Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-28 09:00:09 +01:00
Fix accidental casting
Might have forgotten to actually commit this, whoopsie
Dieser Commit ist enthalten in:
Ursprung
ed0db721dd
Commit
26b90b6d71
@ -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();
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren