diff --git a/src/main/java/net/coreprotect/spigot/SpigotAdapter.java b/src/main/java/net/coreprotect/spigot/SpigotAdapter.java index 8365f97..175f7da 100644 --- a/src/main/java/net/coreprotect/spigot/SpigotAdapter.java +++ b/src/main/java/net/coreprotect/spigot/SpigotAdapter.java @@ -82,4 +82,8 @@ public class SpigotAdapter implements SpigotInterface { Chat.sendMessage(sender, message.toString()); } + + public String processComponent(String component) { + return component.replace(Chat.COMPONENT_PIPE, "|"); + } } diff --git a/src/main/java/net/coreprotect/spigot/Spigot_v1_16.java b/src/main/java/net/coreprotect/spigot/Spigot_v1_16.java index 600997e..29395d2 100644 --- a/src/main/java/net/coreprotect/spigot/Spigot_v1_16.java +++ b/src/main/java/net/coreprotect/spigot/Spigot_v1_16.java @@ -19,7 +19,7 @@ public class Spigot_v1_16 extends SpigotHandler implements SpigotInterface { try { if (Config.getGlobal().HOVER_EVENTS) { TextComponent component = new TextComponent(TextComponent.fromLegacyText(data[2])); - component.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text(TextComponent.fromLegacyText(data[1])))); + component.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text(TextComponent.fromLegacyText(processComponent(data[1]))))); ((TextComponent) message).addExtra(component); } else { diff --git a/src/main/java/net/coreprotect/utility/Chat.java b/src/main/java/net/coreprotect/utility/Chat.java index 870996e..df50fbd 100644 --- a/src/main/java/net/coreprotect/utility/Chat.java +++ b/src/main/java/net/coreprotect/utility/Chat.java @@ -17,6 +17,7 @@ public final class Chat { public static final String COMPONENT_TAG_CLOSE = ""; public static final String COMPONENT_COMMAND = "COMMAND"; public static final String COMPONENT_POPUP = "POPUP"; + public static final String COMPONENT_PIPE = ""; private Chat() { throw new IllegalStateException("Utility class"); diff --git a/src/main/java/net/coreprotect/utility/Util.java b/src/main/java/net/coreprotect/utility/Util.java index fb4329f..6c233e0 100755 --- a/src/main/java/net/coreprotect/utility/Util.java +++ b/src/main/java/net/coreprotect/utility/Util.java @@ -304,7 +304,7 @@ public class Util extends Queue { StringBuilder message = new StringBuilder(Chat.COMPONENT_TAG_OPEN + Chat.COMPONENT_POPUP); // tooltip - message.append("|" + tooltip + "|"); + message.append("|" + tooltip.replace("|", Chat.COMPONENT_PIPE) + "|"); // chat output message.append(phrase);