From 26b90b6d71c9e8656f3f3c977d054e009ce214d6 Mon Sep 17 00:00:00 2001 From: KennyTV Date: Sun, 28 Jun 2020 20:44:45 +0200 Subject: [PATCH] Fix accidental casting Might have forgotten to actually commit this, whoopsie --- .../protocols/protocol1_13to1_12_2/ChatRewriter.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/ChatRewriter.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/ChatRewriter.java index e3679254b..dc5401508 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/ChatRewriter.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/ChatRewriter.java @@ -35,14 +35,13 @@ public class ChatRewriter { String action = hoverEvent.getAsJsonPrimitive("action").getAsString(); if (!action.equals("show_item")) return; - JsonElement value = hoverEvent.getAsJsonObject("value"); + JsonElement value = hoverEvent.get("value"); if (value == null) return; String text = findItemNBT(value); - System.out.println(text); + if (text == null) return; try { CompoundTag tag = BinaryTagIO.readString(text); - System.out.println(tag); CompoundTag itemTag = tag.get("tag"); ShortTag damageTag = tag.get("Damage"); @@ -67,8 +66,6 @@ public class ChatRewriter { String serializedNBT = BinaryTagIO.writeString(tag); object.addProperty("text", serializedNBT); hoverEvent.add("value", array); - - System.out.println(serializedNBT); } catch (IOException e) { Via.getPlatform().getLogger().warning("Invalid NBT in show_item:"); e.printStackTrace();