mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-22 18:15:39 +01:00
Ensure it's a string
This commit is contained in:
parent
757d22da23
commit
f70059b4b6
@ -20,9 +20,13 @@ 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")) {
|
||||||
String value = hoverEvent.get("value").getAsString();
|
if (hoverEvent.get("value").isJsonPrimitive()) {
|
||||||
value = indexRemoval.matcher(value).replaceAll("");
|
if (hoverEvent.get("value").getAsJsonPrimitive().isString()) {
|
||||||
hoverEvent.addProperty("value", value);
|
String value = hoverEvent.get("value").getAsString();
|
||||||
|
value = indexRemoval.matcher(value).replaceAll("");
|
||||||
|
hoverEvent.addProperty("value", value);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user