Use getPlainDisplayName to get name for hover messages (#1663)

This commit is contained in:
Luck 2019-12-02 21:03:45 +00:00
parent 6325e25630
commit 2eb0c1e67e
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
3 changed files with 7 additions and 7 deletions

View File

@ -174,7 +174,7 @@ public class MetaInfo extends SharedSubCommand {
HoverEvent hoverEvent = HoverEvent.showText(TextUtils.fromLegacy(TextUtils.joinNewline(
"¥3> ¥a" + node.getPriority() + " ¥7- ¥r" + node.getMetaValue(),
" ",
"¥7Click to remove this " + node.getMetaType().name().toLowerCase() + " from " + holder.getFormattedDisplayName()
"¥7Click to remove this " + node.getMetaType().name().toLowerCase() + " from " + holder.getPlainDisplayName()
), '¥'));
String id = holder.getType() == HolderType.GROUP ? holder.getObjectName() : holder.getFormattedDisplayName();
@ -201,10 +201,10 @@ public class MetaInfo extends SharedSubCommand {
HoverEvent hoverEvent = HoverEvent.showText(TextUtils.fromLegacy(TextUtils.joinNewline(
"¥3> ¥r" + node.getMetaKey() + " ¥7- ¥r" + node.getMetaValue(),
" ",
"¥7Click to remove this meta pair from " + holder.getFormattedDisplayName()
"¥7Click to remove this meta pair from " + holder.getPlainDisplayName()
), '¥'));
String id = holder.getType() == HolderType.GROUP ? holder.getObjectName() : holder.getFormattedDisplayName();
String id = holder.getType() == HolderType.GROUP ? holder.getObjectName() : holder.getPlainDisplayName();
boolean explicitGlobalContext = !holder.getPlugin().getConfiguration().getContextsFile().getDefaultContexts().isEmpty();
String command = "/" + label + " " + NodeCommandFactory.generateCommand(node, id, holder.getType(), false, explicitGlobalContext);
ClickEvent clickEvent = ClickEvent.suggestCommand(command);

View File

@ -139,10 +139,10 @@ public class ParentInfo extends SharedSubCommand {
HoverEvent hoverEvent = HoverEvent.showText(TextUtils.fromLegacy(TextUtils.joinNewline(
"&3> &f" + node.getGroupName(),
" ",
"&7Click to remove this parent from " + holder.getFormattedDisplayName()
"&7Click to remove this parent from " + holder.getPlainDisplayName()
), TextUtils.AMPERSAND_CHAR));
String id = holder.getType() == HolderType.GROUP ? holder.getObjectName() : holder.getFormattedDisplayName();
String id = holder.getType() == HolderType.GROUP ? holder.getObjectName() : holder.getPlainDisplayName();
boolean explicitGlobalContext = !holder.getPlugin().getConfiguration().getContextsFile().getDefaultContexts().isEmpty();
String command = "/" + label + " " + NodeCommandFactory.generateCommand(node, id, holder.getType(), false, explicitGlobalContext);
ClickEvent clickEvent = ClickEvent.suggestCommand(command);

View File

@ -139,10 +139,10 @@ public class PermissionInfo extends SharedSubCommand {
HoverEvent hoverEvent = HoverEvent.showText(TextUtils.fromLegacy(TextUtils.joinNewline(
"¥3> " + (node.getValue() ? "¥a" : "¥c") + node.getKey(),
" ",
"¥7Click to remove this node from " + holder.getFormattedDisplayName()
"¥7Click to remove this node from " + holder.getPlainDisplayName()
), '¥'));
String id = holder.getType() == HolderType.GROUP ? holder.getObjectName() : holder.getFormattedDisplayName();
String id = holder.getType() == HolderType.GROUP ? holder.getObjectName() : holder.getPlainDisplayName();
boolean explicitGlobalContext = !holder.getPlugin().getConfiguration().getContextsFile().getDefaultContexts().isEmpty();
String command = "/" + label + " " + NodeCommandFactory.generateCommand(node, id, holder.getType(), false, explicitGlobalContext);
ClickEvent clickEvent = ClickEvent.suggestCommand(command);