3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-12-27 08:30:10 +01:00

Fix show_item count tag

Dieser Commit ist enthalten in:
KennyTV 2020-04-27 14:24:52 +02:00
Ursprung 29908523b0
Commit 8409f6fb2a
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B

Datei anzeigen

@ -71,8 +71,15 @@ public class TranslatableRewriter1_16 extends TranslatableRewriter {
// show_text as chat component // show_text as chat component
processTranslate(contentsElement); processTranslate(contentsElement);
hoverEvent.add("value", contentsElement); hoverEvent.add("value", contentsElement);
} else if (action.equals("show_item")) {
JsonObject item = contentsElement.getAsJsonObject();
JsonElement count = item.remove("count");
if (count != null) {
item.addProperty("Count", count.getAsByte());
}
hoverEvent.addProperty("value", contentsElement.toString());
} else { } else {
// show_entity and show_item as plain strings in a text field
hoverEvent.addProperty("value", contentsElement.toString()); hoverEvent.addProperty("value", contentsElement.toString());
} }
} }