diff --git a/common/src/main/java/me/lucko/luckperms/common/backup/Exporter.java b/common/src/main/java/me/lucko/luckperms/common/backup/Exporter.java index 92ef2c5d..5e19f501 100644 --- a/common/src/main/java/me/lucko/luckperms/common/backup/Exporter.java +++ b/common/src/main/java/me/lucko/luckperms/common/backup/Exporter.java @@ -130,7 +130,7 @@ public class Exporter implements Runnable { write(writer, "# Export group: " + group.getName()); for (Node node : group.enduringData().immutable().values()) { - write(writer, "/lp " + NodeFactory.nodeAsCommand(node, group.getName(), HolderType.GROUP, true)); + write(writer, "/lp " + NodeFactory.nodeAsCommand(node, group.getName(), HolderType.GROUP, true, false)); } write(writer, ""); this.log.logAllProgress("Exported {} groups so far.", groupCount.incrementAndGet()); @@ -225,7 +225,7 @@ public class Exporter implements Runnable { continue; } - output.add("/lp " + NodeFactory.nodeAsCommand(node, user.getUuid().toString(), HolderType.USER, true)); + output.add("/lp " + NodeFactory.nodeAsCommand(node, user.getUuid().toString(), HolderType.USER, true, false)); } if (!user.getPrimaryGroup().getStoredValue().orElse(NodeFactory.DEFAULT_GROUP_NAME).equalsIgnoreCase(NodeFactory.DEFAULT_GROUP_NAME)) { diff --git a/common/src/main/java/me/lucko/luckperms/common/command/abstraction/SharedSubCommand.java b/common/src/main/java/me/lucko/luckperms/common/command/abstraction/SharedSubCommand.java index 99acd096..4e67e4b0 100644 --- a/common/src/main/java/me/lucko/luckperms/common/command/abstraction/SharedSubCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/command/abstraction/SharedSubCommand.java @@ -99,9 +99,9 @@ public abstract class SharedSubCommand { public void sendUsage(Sender sender) { StringBuilder sb = new StringBuilder(); if (getArgs() != null) { - sb.append(Message.COMMAND_USAGE_ARGUMENT_JOIN.asString(sender.getPlatform().getLocaleManager())); + sb.append(Message.COMMAND_USAGE_ARGUMENT_JOIN.asString(sender.getPlugin().getLocaleManager())); for (Argument arg : getArgs()) { - sb.append(arg.asPrettyString(sender.getPlatform().getLocaleManager())).append(" "); + sb.append(arg.asPrettyString(sender.getPlugin().getLocaleManager())).append(" "); } } @@ -114,7 +114,7 @@ public abstract class SharedSubCommand { if (getArgs() != null) { Message.COMMAND_USAGE_DETAILED_ARGS_HEADER.send(sender); for (Argument arg : getArgs()) { - Message.COMMAND_USAGE_DETAILED_ARG.send(sender, arg.asPrettyString(sender.getPlatform().getLocaleManager()), arg.getDescription()); + Message.COMMAND_USAGE_DETAILED_ARG.send(sender, arg.asPrettyString(sender.getPlugin().getLocaleManager()), arg.getDescription()); } } } diff --git a/common/src/main/java/me/lucko/luckperms/common/command/abstraction/SingleCommand.java b/common/src/main/java/me/lucko/luckperms/common/command/abstraction/SingleCommand.java index a6b68a43..ddfb4229 100644 --- a/common/src/main/java/me/lucko/luckperms/common/command/abstraction/SingleCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/command/abstraction/SingleCommand.java @@ -56,9 +56,9 @@ public abstract class SingleCommand extends Command { public void sendUsage(Sender sender, String label) { StringBuilder sb = new StringBuilder(); if (getArgs().isPresent()) { - sb.append(Message.COMMAND_USAGE_ARGUMENT_JOIN.asString(sender.getPlatform().getLocaleManager())); + sb.append(Message.COMMAND_USAGE_ARGUMENT_JOIN.asString(sender.getPlugin().getLocaleManager())); for (Argument arg : getArgs().get()) { - sb.append(arg.asPrettyString(sender.getPlatform().getLocaleManager())).append(" "); + sb.append(arg.asPrettyString(sender.getPlugin().getLocaleManager())).append(" "); } } @@ -72,7 +72,7 @@ public abstract class SingleCommand extends Command { if (getArgs().isPresent()) { Message.COMMAND_USAGE_DETAILED_ARGS_HEADER.send(sender); for (Argument arg : getArgs().get()) { - Message.COMMAND_USAGE_DETAILED_ARG.send(sender, arg.asPrettyString(sender.getPlatform().getLocaleManager()), arg.getDescription()); + Message.COMMAND_USAGE_DETAILED_ARG.send(sender, arg.asPrettyString(sender.getPlugin().getLocaleManager()), arg.getDescription()); } } } diff --git a/common/src/main/java/me/lucko/luckperms/common/command/abstraction/SubCommand.java b/common/src/main/java/me/lucko/luckperms/common/command/abstraction/SubCommand.java index d3094849..557c0e7c 100644 --- a/common/src/main/java/me/lucko/luckperms/common/command/abstraction/SubCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/command/abstraction/SubCommand.java @@ -51,9 +51,9 @@ public abstract class SubCommand extends Command { public void sendUsage(Sender sender, String label) { StringBuilder sb = new StringBuilder(); if (getArgs().isPresent()) { - sb.append(Message.COMMAND_USAGE_ARGUMENT_JOIN.asString(sender.getPlatform().getLocaleManager())); + sb.append(Message.COMMAND_USAGE_ARGUMENT_JOIN.asString(sender.getPlugin().getLocaleManager())); for (Argument arg : getArgs().get()) { - sb.append(arg.asPrettyString(sender.getPlatform().getLocaleManager())).append(" "); + sb.append(arg.asPrettyString(sender.getPlugin().getLocaleManager())).append(" "); } } @@ -67,7 +67,7 @@ public abstract class SubCommand extends Command { if (getArgs().isPresent()) { Message.COMMAND_USAGE_DETAILED_ARGS_HEADER.send(sender); for (Argument arg : getArgs().get()) { - Message.COMMAND_USAGE_DETAILED_ARG.send(sender, arg.asPrettyString(sender.getPlatform().getLocaleManager()), arg.getDescription()); + Message.COMMAND_USAGE_DETAILED_ARG.send(sender, arg.asPrettyString(sender.getPlugin().getLocaleManager()), arg.getDescription()); } } } diff --git a/common/src/main/java/me/lucko/luckperms/common/command/utils/MessageUtils.java b/common/src/main/java/me/lucko/luckperms/common/command/utils/MessageUtils.java index 0cdd931e..970932d3 100644 --- a/common/src/main/java/me/lucko/luckperms/common/command/utils/MessageUtils.java +++ b/common/src/main/java/me/lucko/luckperms/common/command/utils/MessageUtils.java @@ -46,7 +46,7 @@ public final class MessageUtils { * @param message the message content */ public static void sendPluginMessage(Sender sender, String message) { - String prefix = Message.PREFIX.asString(sender.getPlatform().getLocaleManager()); + String prefix = Message.PREFIX.asString(sender.getPlugin().getLocaleManager()); sender.sendMessage(Message.colorize(prefix + message)); } diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaInfo.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaInfo.java index 604774d1..8d7993b5 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaInfo.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaInfo.java @@ -123,12 +123,12 @@ public class MetaInfo extends SharedSubCommand { for (LocalizedNode m : meta) { String location = processLocation(m, holder); if (m.hasSpecificContext()) { - String context = MessageUtils.getAppendableNodeContextString(sender.getPlatform().getLocaleManager(), m); - TextComponent.Builder builder = Message.META_ENTRY_WITH_CONTEXT.asComponent(sender.getPlatform().getLocaleManager(), m.getMeta().getKey(), m.getMeta().getValue(), location, context).toBuilder(); + String context = MessageUtils.getAppendableNodeContextString(sender.getPlugin().getLocaleManager(), m); + TextComponent.Builder builder = Message.META_ENTRY_WITH_CONTEXT.asComponent(sender.getPlugin().getLocaleManager(), m.getMeta().getKey(), m.getMeta().getValue(), location, context).toBuilder(); builder.applyDeep(makeFancy(holder, label, m)); sender.sendMessage(builder.build()); } else { - TextComponent.Builder builder = Message.META_ENTRY.asComponent(sender.getPlatform().getLocaleManager(), m.getMeta().getKey(), m.getMeta().getValue(), location).toBuilder(); + TextComponent.Builder builder = Message.META_ENTRY.asComponent(sender.getPlugin().getLocaleManager(), m.getMeta().getKey(), m.getMeta().getValue(), location).toBuilder(); builder.applyDeep(makeFancy(holder, label, m)); sender.sendMessage(builder.build()); } @@ -139,12 +139,12 @@ public class MetaInfo extends SharedSubCommand { for (Map.Entry e : meta) { String location = processLocation(e.getValue(), holder); if (e.getValue().hasSpecificContext()) { - String context = MessageUtils.getAppendableNodeContextString(sender.getPlatform().getLocaleManager(), e.getValue()); - TextComponent.Builder builder = Message.CHAT_META_ENTRY_WITH_CONTEXT.asComponent(sender.getPlatform().getLocaleManager(), e.getKey(), type.getEntry(e.getValue()).getValue(), location, context).toBuilder(); + String context = MessageUtils.getAppendableNodeContextString(sender.getPlugin().getLocaleManager(), e.getValue()); + TextComponent.Builder builder = Message.CHAT_META_ENTRY_WITH_CONTEXT.asComponent(sender.getPlugin().getLocaleManager(), e.getKey(), type.getEntry(e.getValue()).getValue(), location, context).toBuilder(); builder.applyDeep(makeFancy(type, holder, label, e.getValue())); sender.sendMessage(builder.build()); } else { - TextComponent.Builder builder = Message.CHAT_META_ENTRY.asComponent(sender.getPlatform().getLocaleManager(), e.getKey(), type.getEntry(e.getValue()).getValue(), location).toBuilder(); + TextComponent.Builder builder = Message.CHAT_META_ENTRY.asComponent(sender.getPlugin().getLocaleManager(), e.getKey(), type.getEntry(e.getValue()).getValue(), location).toBuilder(); builder.applyDeep(makeFancy(type, holder, label, e.getValue())); sender.sendMessage(builder.build()); } @@ -166,7 +166,7 @@ public class MetaInfo extends SharedSubCommand { "¥7Click to remove this " + type.name().toLowerCase() + " from " + holder.getFriendlyName() ), '¥')); - String command = "/" + label + " " + NodeFactory.nodeAsCommand(node, holder.getType().isGroup() ? holder.getObjectName() : holder.getFriendlyName(), holder.getType(), false); + String command = "/" + label + " " + NodeFactory.nodeAsCommand(node, holder.getType().isGroup() ? holder.getObjectName() : holder.getFriendlyName(), holder.getType(), false, !holder.getPlugin().getConfiguration().getContextsFile().getDefaultContexts().isEmpty()); ClickEvent clickEvent = new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, command); return component -> { @@ -190,7 +190,7 @@ public class MetaInfo extends SharedSubCommand { "¥7Click to remove this meta pair from " + holder.getFriendlyName() ), '¥')); - String command = "/" + label + " " + NodeFactory.nodeAsCommand(node, holder.getType().isGroup() ? holder.getObjectName() : holder.getFriendlyName(), holder.getType(), false); + String command = "/" + label + " " + NodeFactory.nodeAsCommand(node, holder.getType().isGroup() ? holder.getObjectName() : holder.getFriendlyName(), holder.getType(), false, !holder.getPlugin().getConfiguration().getContextsFile().getDefaultContexts().isEmpty()); ClickEvent clickEvent = new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, command); return component -> { diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentInfo.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentInfo.java index 401eb6c4..4bda2403 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentInfo.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentInfo.java @@ -141,7 +141,7 @@ public class ParentInfo extends SharedSubCommand { "&7Click to remove this parent from " + holder.getFriendlyName() ), CommandManager.AMPERSAND_CHAR)); - String command = "/" + label + " " + NodeFactory.nodeAsCommand(node, holder.getType().isGroup() ? holder.getObjectName() : holder.getFriendlyName(), holder.getType(), false); + String command = "/" + label + " " + NodeFactory.nodeAsCommand(node, holder.getType().isGroup() ? holder.getObjectName() : holder.getFriendlyName(), holder.getType(), false, !holder.getPlugin().getConfiguration().getContextsFile().getDefaultContexts().isEmpty()); ClickEvent clickEvent = new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, command); return component -> { diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionInfo.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionInfo.java index 44f89b63..4efa2a28 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionInfo.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionInfo.java @@ -143,7 +143,7 @@ public class PermissionInfo extends SharedSubCommand { "¥7Click to remove this node from " + holder.getFriendlyName() ), '¥')); - String command = "/" + label + " " + NodeFactory.nodeAsCommand(node, holder.getType().isGroup() ? holder.getObjectName() : holder.getFriendlyName(), holder.getType(), false); + String command = "/" + label + " " + NodeFactory.nodeAsCommand(node, holder.getType().isGroup() ? holder.getObjectName() : holder.getFriendlyName(), holder.getType(), false, !holder.getPlugin().getConfiguration().getContextsFile().getDefaultContexts().isEmpty()); ClickEvent clickEvent = new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, command); return component -> { diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/group/GroupListMembers.java b/common/src/main/java/me/lucko/luckperms/common/commands/group/GroupListMembers.java index 3bb31934..cf3365d7 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/group/GroupListMembers.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/group/GroupListMembers.java @@ -142,8 +142,8 @@ public class GroupListMembers extends SubCommand { headerMessage.send(sender, page, pages.size(), results.size()); for (Map.Entry> ent : mappedContent) { - String s = "&3> &b" + ent.getKey() + " " + getNodeExpiryString(ent.getValue().asNode()) + MessageUtils.getAppendableNodeContextString(sender.getPlatform().getLocaleManager(), ent.getValue().asNode()); - TextComponent message = TextUtils.fromLegacy(s, CommandManager.AMPERSAND_CHAR).toBuilder().applyDeep(makeFancy(ent.getKey(), holderType, label, ent.getValue())).build(); + String s = "&3> &b" + ent.getKey() + " " + getNodeExpiryString(ent.getValue().asNode()) + MessageUtils.getAppendableNodeContextString(sender.getPlugin().getLocaleManager(), ent.getValue().asNode()); + TextComponent message = TextUtils.fromLegacy(s, CommandManager.AMPERSAND_CHAR).toBuilder().applyDeep(makeFancy(ent.getKey(), holderType, label, ent.getValue(), sender.getPlugin())).build(); sender.sendMessage(message); } } @@ -156,14 +156,14 @@ public class GroupListMembers extends SubCommand { return " &8(&7expires in " + DurationFormatter.LONG.formatDateDiff(node.getExpiryUnixTime()) + "&8)"; } - private static Consumer> makeFancy(String holderName, HolderType holderType, String label, HeldPermission perm) { + private static Consumer> makeFancy(String holderName, HolderType holderType, String label, HeldPermission perm, LuckPermsPlugin plugin) { HoverEvent hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextUtils.fromLegacy(TextUtils.joinNewline( "&3> &b" + perm.asNode().getGroupName(), " ", "&7Click to remove this parent from " + holderName ), CommandManager.AMPERSAND_CHAR)); - String command = "/" + label + " " + NodeFactory.nodeAsCommand(perm.asNode(), holderName, holderType, false); + String command = "/" + label + " " + NodeFactory.nodeAsCommand(perm.asNode(), holderName, holderType, false, !plugin.getConfiguration().getContextsFile().getDefaultContexts().isEmpty()); ClickEvent clickEvent = new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, command); return component -> { diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/misc/SearchCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/misc/SearchCommand.java index 3f3fbaa9..1d0eca5e 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/misc/SearchCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/misc/SearchCommand.java @@ -157,8 +157,8 @@ public class SearchCommand extends SingleCommand { permission = "&7 - (" + ent.getValue().getPermission() + ")"; } - String s = "&3> &b" + ent.getKey() + permission + "&7 - " + (ent.getValue().getValue() ? "&a" : "&c") + ent.getValue().getValue() + getNodeExpiryString(ent.getValue().asNode()) + MessageUtils.getAppendableNodeContextString(sender.getPlatform().getLocaleManager(), ent.getValue().asNode()); - TextComponent message = TextUtils.fromLegacy(s, CommandManager.AMPERSAND_CHAR).toBuilder().applyDeep(makeFancy(ent.getKey(), holderType, label, ent.getValue())).build(); + String s = "&3> &b" + ent.getKey() + permission + "&7 - " + (ent.getValue().getValue() ? "&a" : "&c") + ent.getValue().getValue() + getNodeExpiryString(ent.getValue().asNode()) + MessageUtils.getAppendableNodeContextString(sender.getPlugin().getLocaleManager(), ent.getValue().asNode()); + TextComponent message = TextUtils.fromLegacy(s, CommandManager.AMPERSAND_CHAR).toBuilder().applyDeep(makeFancy(ent.getKey(), holderType, label, ent.getValue(), sender.getPlugin())).build(); sender.sendMessage(message); } } @@ -171,14 +171,14 @@ public class SearchCommand extends SingleCommand { return " &8(&7expires in " + DurationFormatter.LONG.formatDateDiff(node.getExpiryUnixTime()) + "&8)"; } - private static Consumer> makeFancy(String holderName, HolderType holderType, String label, HeldPermission perm) { + private static Consumer> makeFancy(String holderName, HolderType holderType, String label, HeldPermission perm, LuckPermsPlugin plugin) { HoverEvent hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextUtils.fromLegacy(TextUtils.joinNewline( "&3> " + (perm.asNode().getValue() ? "&a" : "&c") + perm.asNode().getPermission(), " ", "&7Click to remove this node from " + holderName ), CommandManager.AMPERSAND_CHAR)); - String command = "/" + label + " " + NodeFactory.nodeAsCommand(perm.asNode(), holderName, holderType, false); + String command = "/" + label + " " + NodeFactory.nodeAsCommand(perm.asNode(), holderName, holderType, false, !plugin.getConfiguration().getContextsFile().getDefaultContexts().isEmpty()); ClickEvent clickEvent = new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, command); return component -> { diff --git a/common/src/main/java/me/lucko/luckperms/common/locale/message/Message.java b/common/src/main/java/me/lucko/luckperms/common/locale/message/Message.java index 53f165a1..4a98d74e 100644 --- a/common/src/main/java/me/lucko/luckperms/common/locale/message/Message.java +++ b/common/src/main/java/me/lucko/luckperms/common/locale/message/Message.java @@ -503,7 +503,7 @@ public enum Message { } public void send(Sender sender, Object... objects) { - sender.sendMessage(asString(sender.getPlatform().getLocaleManager(), objects)); + sender.sendMessage(asString(sender.getPlugin().getLocaleManager(), objects)); } private static String format(String s, Object... objects) { diff --git a/common/src/main/java/me/lucko/luckperms/common/node/factory/NodeFactory.java b/common/src/main/java/me/lucko/luckperms/common/node/factory/NodeFactory.java index 005dea32..9b948e3a 100644 --- a/common/src/main/java/me/lucko/luckperms/common/node/factory/NodeFactory.java +++ b/common/src/main/java/me/lucko/luckperms/common/node/factory/NodeFactory.java @@ -188,7 +188,7 @@ public final class NodeFactory { return make(groupNode(group.getName()), server, world, temporary); } - public static String nodeAsCommand(Node node, String id, HolderType type, boolean set) { + public static String nodeAsCommand(Node node, String id, HolderType type, boolean set, boolean explicitGlobalContext) { StringBuilder sb = new StringBuilder(32); sb.append(type.toString()).append(" ").append(id).append(" "); @@ -211,7 +211,7 @@ public final class NodeFactory { sb.append(" ").append(node.getExpiryUnixTime()); } - return appendContextToCommand(sb, node).toString(); + return appendContextToCommand(sb, node, explicitGlobalContext).toString(); } if (node.getValue() && (node.isPrefix() || node.isSuffix())) { @@ -246,7 +246,7 @@ public final class NodeFactory { sb.append(" ").append(node.getExpiryUnixTime()); } - return appendContextToCommand(sb, node).toString(); + return appendContextToCommand(sb, node, explicitGlobalContext).toString(); } if (node.getValue() && node.isMeta()) { @@ -287,7 +287,7 @@ public final class NodeFactory { } } - return appendContextToCommand(sb, node).toString(); + return appendContextToCommand(sb, node, explicitGlobalContext).toString(); } sb.append("permission "); @@ -318,10 +318,17 @@ public final class NodeFactory { } } - return appendContextToCommand(sb, node).toString(); + return appendContextToCommand(sb, node, explicitGlobalContext).toString(); } - private static StringBuilder appendContextToCommand(StringBuilder sb, Node node) { + private static StringBuilder appendContextToCommand(StringBuilder sb, Node node, boolean explicitGlobalContext) { + if (node.getFullContexts().isEmpty()) { + if (explicitGlobalContext) { + sb.append(" global"); + } + return sb; + } + if (node.getServer().isPresent()) { sb.append(" server=").append(node.getServer().get()); } diff --git a/common/src/main/java/me/lucko/luckperms/common/sender/AbstractSender.java b/common/src/main/java/me/lucko/luckperms/common/sender/AbstractSender.java index 72b06fd6..f9990af0 100644 --- a/common/src/main/java/me/lucko/luckperms/common/sender/AbstractSender.java +++ b/common/src/main/java/me/lucko/luckperms/common/sender/AbstractSender.java @@ -61,7 +61,7 @@ public final class AbstractSender implements Sender { } @Override - public LuckPermsPlugin getPlatform() { + public LuckPermsPlugin getPlugin() { return this.platform; } diff --git a/common/src/main/java/me/lucko/luckperms/common/sender/DummySender.java b/common/src/main/java/me/lucko/luckperms/common/sender/DummySender.java index e7f21050..bb54cfae 100644 --- a/common/src/main/java/me/lucko/luckperms/common/sender/DummySender.java +++ b/common/src/main/java/me/lucko/luckperms/common/sender/DummySender.java @@ -74,7 +74,7 @@ public abstract class DummySender implements Sender { } @Override - public LuckPermsPlugin getPlatform() { + public LuckPermsPlugin getPlugin() { return this.platform; } diff --git a/common/src/main/java/me/lucko/luckperms/common/sender/Sender.java b/common/src/main/java/me/lucko/luckperms/common/sender/Sender.java index 264877c0..3cc77ce4 100644 --- a/common/src/main/java/me/lucko/luckperms/common/sender/Sender.java +++ b/common/src/main/java/me/lucko/luckperms/common/sender/Sender.java @@ -42,11 +42,11 @@ import java.util.UUID; public interface Sender { /** - * Gets the platform where the sender is from. + * Gets the plugin instance the sender is from. * * @return the plugin */ - LuckPermsPlugin getPlatform(); + LuckPermsPlugin getPlugin(); /** * Gets the sender's username @@ -64,7 +64,7 @@ public interface Sender { default String getNameWithLocation() { String name = getName(); - ContextManager contextManager = getPlatform().getContextManager(); + ContextManager contextManager = getPlugin().getContextManager(); if (contextManager == null) { return name; } diff --git a/common/src/main/java/me/lucko/luckperms/common/verbose/VerboseListener.java b/common/src/main/java/me/lucko/luckperms/common/verbose/VerboseListener.java index b6a13f96..1ba48d27 100644 --- a/common/src/main/java/me/lucko/luckperms/common/verbose/VerboseListener.java +++ b/common/src/main/java/me/lucko/luckperms/common/verbose/VerboseListener.java @@ -148,7 +148,7 @@ public class VerboseListener { } // form a hoverevent from the check trace - TextComponent textComponent = Message.VERBOSE_LOG.asComponent(this.notifiedSender.getPlatform().getLocaleManager(), + TextComponent textComponent = Message.VERBOSE_LOG.asComponent(this.notifiedSender.getPlugin().getLocaleManager(), data.getCheckTarget(), data.getPermission(), getTristateColor(data.getResult()), @@ -158,7 +158,7 @@ public class VerboseListener { // build the text List hover = new ArrayList<>(); hover.add("&bOrigin: &2" + data.getCheckOrigin().name()); - hover.add("&bContext: &r" + MessageUtils.contextSetToString(this.notifiedSender.getPlatform().getLocaleManager(), data.getCheckContext())); + hover.add("&bContext: &r" + MessageUtils.contextSetToString(this.notifiedSender.getPlugin().getLocaleManager(), data.getCheckContext())); hover.add("&bTrace: &r"); Consumer printer = StackTracePrinter.elementToString(str -> hover.add("&7" + str));