From da1ee9d882e630d577139879b8d48c11f4917bf8 Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Sun, 24 Sep 2023 16:17:09 +0200 Subject: [PATCH] Trying to fix ItemStack Gson adapter --- .../java/fr/pandacube/lib/paper/json/ItemStackAdapter.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandalib-paper/src/main/java/fr/pandacube/lib/paper/json/ItemStackAdapter.java b/pandalib-paper/src/main/java/fr/pandacube/lib/paper/json/ItemStackAdapter.java index a8f7a06..3341b9e 100644 --- a/pandalib-paper/src/main/java/fr/pandacube/lib/paper/json/ItemStackAdapter.java +++ b/pandalib-paper/src/main/java/fr/pandacube/lib/paper/json/ItemStackAdapter.java @@ -17,8 +17,7 @@ import java.util.Map; /* package */ class ItemStackAdapter implements JsonSerializer, JsonDeserializer { - private static final TypeToken ITEMSTACK_TYPE = TypeToken.get(ItemStack.class); - public static final TypeAdapterFactory FACTORY = TreeTypeAdapter.newFactoryWithMatchRawType(ITEMSTACK_TYPE, new ItemStackAdapter()); + public static final TypeAdapterFactory FACTORY = TreeTypeAdapter.newTypeHierarchyFactory(ItemStack.class, new ItemStackAdapter()); private static final TypeToken> MAP_STR_OBJ_TYPE = new TypeToken<>() { };