Fixed bossbars disabling self, added support for modded custom entities, disguises now refer to themselves with the right disguise name when possible, cleaned up some code, fixed bossbar error when a server uses a bad bossbar name in their own system

This commit is contained in:
libraryaddict
2020-04-16 00:55:35 +12:00
parent b31fc3a251
commit 8b39450490
33 changed files with 327 additions and 151 deletions

View File

@@ -9,7 +9,8 @@ import java.lang.reflect.Type;
/**
* Created by libraryaddict on 1/06/2017.
*/
public class SerializerDisguise implements JsonDeserializer<Disguise>, JsonSerializer<Disguise>, InstanceCreator<Disguise> {
public class SerializerDisguise implements JsonDeserializer<Disguise>, JsonSerializer<Disguise>,
InstanceCreator<Disguise> {
@Override
public Disguise deserialize(JsonElement json, Type typeOfT,
@@ -53,7 +54,9 @@ public class SerializerDisguise implements JsonDeserializer<Disguise>, JsonSeria
@Override
public JsonElement serialize(Disguise src, Type typeOfSrc, JsonSerializationContext context) {
if (src.isPlayerDisguise())
if (src.isCustomDisguise()) {
return context.serialize(src, CustomDisguise.class);
} else if (src.isPlayerDisguise())
return context.serialize(src, PlayerDisguise.class);
else if (src.isMobDisguise())
return context.serialize(src, MobDisguise.class);