3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-09-08 22:02:50 +02:00

Fix accidental casting

Might have forgotten to actually commit this, whoopsie
Dieser Commit ist enthalten in:
KennyTV 2020-06-28 20:44:45 +02:00
Ursprung ed0db721dd
Commit 26b90b6d71
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B

Datei anzeigen

@ -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();