Remove defunct serializers
This commit is contained in:
parent
407d00af1c
commit
84f32a70fa
@ -12,7 +12,7 @@ import java.lang.reflect.Type;
|
|||||||
/**
|
/**
|
||||||
* Created by libraryaddict on 1/06/2017.
|
* Created by libraryaddict on 1/06/2017.
|
||||||
*/
|
*/
|
||||||
public class SerializerDisguise implements JsonDeserializer<Disguise>, JsonSerializer<Disguise>, InstanceCreator<Disguise> {
|
public class SerializerDisguise implements JsonDeserializer<Disguise>, InstanceCreator<Disguise> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Disguise deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
|
public Disguise deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
|
||||||
@ -47,19 +47,4 @@ public class SerializerDisguise implements JsonDeserializer<Disguise>, JsonSeria
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public JsonElement serialize(Disguise src, Type typeOfSrc, JsonSerializationContext context) {
|
|
||||||
if (src.isCustomDisguise()) {
|
|
||||||
return context.serialize(src, ModdedDisguise.class);
|
|
||||||
} else if (src.isPlayerDisguise()) {
|
|
||||||
return context.serialize(src, PlayerDisguise.class);
|
|
||||||
} else if (src.isMobDisguise()) {
|
|
||||||
return context.serialize(src, MobDisguise.class);
|
|
||||||
} else if (src.isMiscDisguise()) {
|
|
||||||
return context.serialize(src, MiscDisguise.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ import java.util.Optional;
|
|||||||
/**
|
/**
|
||||||
* Created by libraryaddict on 1/06/2017.
|
* Created by libraryaddict on 1/06/2017.
|
||||||
*/
|
*/
|
||||||
public class SerializerFlagWatcher implements JsonDeserializer<FlagWatcher>, JsonSerializer<FlagWatcher>, InstanceCreator<FlagWatcher> {
|
public class SerializerFlagWatcher implements JsonDeserializer<FlagWatcher>, InstanceCreator<FlagWatcher> {
|
||||||
private Gson gson;
|
private Gson gson;
|
||||||
|
|
||||||
public SerializerFlagWatcher(Gson gson) {
|
public SerializerFlagWatcher(Gson gson) {
|
||||||
@ -138,14 +138,4 @@ public class SerializerFlagWatcher implements JsonDeserializer<FlagWatcher>, Jso
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public JsonElement serialize(FlagWatcher src, Type typeOfSrc, JsonSerializationContext context) {
|
|
||||||
JsonObject obj = (JsonObject) gson.toJsonTree(src);
|
|
||||||
|
|
||||||
obj.addProperty("flagType", src.getClass().getName());
|
|
||||||
obj.addProperty("entityType", src.getDisguise().getType().name());
|
|
||||||
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user