mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-27 00:40:52 +01:00
WiredTriggerBotReachedHabbo now saves as json
This commit is contained in:
parent
fd90c23a3a
commit
b781f1d731
@ -62,12 +62,21 @@ public class WiredTriggerBotReachedHabbo extends InteractionWiredTrigger {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getWiredData() {
|
public String getWiredData() {
|
||||||
return this.botName;
|
return WiredHandler.getGsonBuilder().create().toJson(new JsonData(
|
||||||
|
this.botName
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadWiredData(ResultSet set, Room room) throws SQLException {
|
public void loadWiredData(ResultSet set, Room room) throws SQLException {
|
||||||
this.botName = set.getString("wired_data");
|
String wiredData = set.getString("wired_data");
|
||||||
|
|
||||||
|
if (wiredData.startsWith("{")) {
|
||||||
|
JsonData data = WiredHandler.getGsonBuilder().create().fromJson(wiredData, JsonData.class);
|
||||||
|
this.botName = data.botName;
|
||||||
|
} else {
|
||||||
|
this.botName = wiredData;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -79,4 +88,12 @@ public class WiredTriggerBotReachedHabbo extends InteractionWiredTrigger {
|
|||||||
public boolean isTriggeredByRoomUnit() {
|
public boolean isTriggeredByRoomUnit() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static class JsonData {
|
||||||
|
String botName;
|
||||||
|
|
||||||
|
public JsonData(String botName) {
|
||||||
|
this.botName = botName;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user