3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-08 17:20:24 +01:00

Ensure it's a string

Dieser Commit ist enthalten in:
Myles 2017-08-03 17:36:48 +01:00
Ursprung 757d22da23
Commit f70059b4b6

Datei anzeigen

@ -20,12 +20,16 @@ public class ChatItemRewriter {
if (hoverEvent.has("action") && hoverEvent.has("value")) { if (hoverEvent.has("action") && hoverEvent.has("value")) {
String type = hoverEvent.get("action").getAsString(); String type = hoverEvent.get("action").getAsString();
if (type.equals("show_item") || type.equals("show_entity")) { if (type.equals("show_item") || type.equals("show_entity")) {
if (hoverEvent.get("value").isJsonPrimitive()) {
if (hoverEvent.get("value").getAsJsonPrimitive().isString()) {
String value = hoverEvent.get("value").getAsString(); String value = hoverEvent.get("value").getAsString();
value = indexRemoval.matcher(value).replaceAll(""); value = indexRemoval.matcher(value).replaceAll("");
hoverEvent.addProperty("value", value); hoverEvent.addProperty("value", value);
} }
} }
} }
}
}
} else { } else {
if (obj.has("extra")) { if (obj.has("extra")) {
toClient(obj.get("extra"), user); toClient(obj.get("extra"), user);