mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2024-11-28 12:55:34 +01:00
Fixed item names containing vertical bars displaying incorrectly (fixes #450)
This commit is contained in:
parent
d944c2bd89
commit
e49913bc09
@ -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, "|");
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -17,6 +17,7 @@ public final class Chat {
|
||||
public static final String COMPONENT_TAG_CLOSE = "</COMPONENT>";
|
||||
public static final String COMPONENT_COMMAND = "COMMAND";
|
||||
public static final String COMPONENT_POPUP = "POPUP";
|
||||
public static final String COMPONENT_PIPE = "<PIPE/>";
|
||||
|
||||
private Chat() {
|
||||
throw new IllegalStateException("Utility class");
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user