Trying to fix ItemStack Gson adapter

This commit is contained in:
Marc Baloup 2023-09-24 16:17:09 +02:00
parent 455226b762
commit da1ee9d882

View File

@ -17,8 +17,7 @@ import java.util.Map;
/* package */ class ItemStackAdapter implements JsonSerializer<ItemStack>, JsonDeserializer<ItemStack> { /* package */ class ItemStackAdapter implements JsonSerializer<ItemStack>, JsonDeserializer<ItemStack> {
private static final TypeToken<ItemStack> ITEMSTACK_TYPE = TypeToken.get(ItemStack.class); public static final TypeAdapterFactory FACTORY = TreeTypeAdapter.newTypeHierarchyFactory(ItemStack.class, new ItemStackAdapter());
public static final TypeAdapterFactory FACTORY = TreeTypeAdapter.newFactoryWithMatchRawType(ITEMSTACK_TYPE, new ItemStackAdapter());
private static final TypeToken<Map<String, Object>> MAP_STR_OBJ_TYPE = new TypeToken<>() { }; private static final TypeToken<Map<String, Object>> MAP_STR_OBJ_TYPE = new TypeToken<>() { };