From 15913b98e96f6e773a1371511ab417f20d5c6df2 Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Sun, 5 Nov 2023 15:35:44 +0100 Subject: [PATCH] Fixed NPE in ItemTranslator --- .../viafabricplus/protocolhack/util/ItemTranslator.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/florianmichael/viafabricplus/protocolhack/util/ItemTranslator.java b/src/main/java/de/florianmichael/viafabricplus/protocolhack/util/ItemTranslator.java index 5e955c13..e44b336d 100644 --- a/src/main/java/de/florianmichael/viafabricplus/protocolhack/util/ItemTranslator.java +++ b/src/main/java/de/florianmichael/viafabricplus/protocolhack/util/ItemTranslator.java @@ -65,7 +65,11 @@ public class ItemTranslator { if (targetVersion.isOlderThanOrEqualTo(VersionEnum.b1_8tob1_8_1)) { return wrapper.read(Typesb1_8_0_1.CREATIVE_ITEM); } else { - return wrapper.read(Type.ITEM1_8); + if (wrapper.is(Type.ITEM1_13_2, 0)) { + return wrapper.read(Type.ITEM1_13_2); + } else { + return wrapper.read(Type.ITEM1_8); + } } } catch (Exception e) { ViaFabricPlus.LOGGER.error("Failed to translate item", e);