Also process hovered text

This commit is contained in:
KennyTV 2020-04-23 12:37:29 +02:00
parent b1ca8cc2a0
commit 49daeb33c0
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B

View File

@ -68,14 +68,12 @@ public class TranslatableRewriter1_16 extends TranslatableRewriter {
String action = hoverEvent.getAsJsonPrimitive("action").getAsString();
if (contentsElement != null) {
if (action.equals("show_text")) {
// text as chat component
// show_text as chat component
processTranslate(contentsElement);
hoverEvent.add("value", contentsElement);
} else {
// show_entity and show_item as plain strings in a text field
final JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("text", contentsElement.toString());
hoverEvent.add("value", jsonObject);
//hoverEvent.addProperty("value", contentsElement.toString());
hoverEvent.addProperty("value", contentsElement.toString());
}
}
}