Catch CraftItemStack when de/serializing, fixes #414
This commit is contained in:
parent
f130d55170
commit
3b3de8d0ee
@ -811,14 +811,16 @@ public class DisguiseUtilities {
|
||||
}
|
||||
|
||||
GsonBuilder gsonBuilder = new GsonBuilder();
|
||||
|
||||
gsonBuilder.registerTypeAdapter(MetaIndex.class, new SerializerMetaIndex());
|
||||
gsonBuilder.registerTypeAdapter(WrappedGameProfile.class, new SerializerGameProfile());
|
||||
gsonBuilder.registerTypeAdapter(WrappedBlockData.class, new SerializerWrappedBlockData());
|
||||
gsonBuilder.registerTypeAdapter(Disguise.class, new SerializerDisguise());
|
||||
gsonBuilder.registerTypeAdapter(FlagWatcher.class, new SerializerFlagWatcher());
|
||||
gsonBuilder.registerTypeAdapter(WrappedChatComponent.class, new SerializerChatComponent());
|
||||
gsonBuilder.registerTypeAdapter(PropertyMap.class, new PropertyMap.Serializer());
|
||||
gsonBuilder.registerTypeAdapter(ItemStack.class, new SerializerItemStack());
|
||||
gsonBuilder.registerTypeHierarchyAdapter(ItemStack.class, new SerializerItemStack());
|
||||
|
||||
gsonBuilder.registerTypeAdapter(FlagWatcher.class, new SerializerFlagWatcher(gsonBuilder.create()));
|
||||
gsonBuilder.registerTypeAdapter(Disguise.class, new SerializerDisguise());
|
||||
|
||||
gson = gsonBuilder.create();
|
||||
|
||||
|
@ -27,16 +27,8 @@ public class SerializerFlagWatcher implements JsonDeserializer<FlagWatcher>, Jso
|
||||
InstanceCreator<FlagWatcher> {
|
||||
private Gson gson;
|
||||
|
||||
public SerializerFlagWatcher() {
|
||||
GsonBuilder gsonBuilder = new GsonBuilder();
|
||||
gsonBuilder.registerTypeAdapter(MetaIndex.class, new SerializerMetaIndex());
|
||||
gsonBuilder.registerTypeAdapter(WrappedGameProfile.class, new SerializerGameProfile());
|
||||
gsonBuilder.registerTypeAdapter(WrappedBlockData.class, new SerializerWrappedBlockData());
|
||||
gsonBuilder.registerTypeAdapter(WrappedChatComponent.class, new SerializerChatComponent());
|
||||
gsonBuilder.registerTypeAdapter(PropertyMap.class, new PropertyMap.Serializer());
|
||||
gsonBuilder.registerTypeAdapter(ItemStack.class, new SerializerItemStack());
|
||||
|
||||
gson = gsonBuilder.create();
|
||||
public SerializerFlagWatcher(Gson gson) {
|
||||
this.gson = gson;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user