diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitCommand.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitCommand.java index 28d24f24..22b844cb 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitCommand.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitCommand.java @@ -26,7 +26,7 @@ import com.google.common.base.Joiner; import com.google.common.base.Splitter; import me.lucko.luckperms.api.data.Callback; import me.lucko.luckperms.common.commands.CommandManager; -import me.lucko.luckperms.common.commands.Util; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Patterns; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitSenderFactory.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitSenderFactory.java index 013dc41a..952f7d8c 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitSenderFactory.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitSenderFactory.java @@ -23,7 +23,7 @@ package me.lucko.luckperms.bukkit; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.SenderFactory; +import me.lucko.luckperms.common.commands.sender.SenderFactory; import me.lucko.luckperms.common.constants.Constants; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java index 05d269be..e6419b08 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java @@ -38,7 +38,7 @@ import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.api.ApiProvider; import me.lucko.luckperms.common.calculators.CalculatorFactory; import me.lucko.luckperms.common.commands.ConsecutiveExecutor; -import me.lucko.luckperms.common.commands.Sender; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.config.LPConfiguration; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.contexts.ContextManager; diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationBPermissions.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationBPermissions.java index c5591179..c0ac3bcc 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationBPermissions.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationBPermissions.java @@ -28,8 +28,8 @@ import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Constants; import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.data.LogEntry; diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationGroupManager.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationGroupManager.java index 9de0b1ea..76d48345 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationGroupManager.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationGroupManager.java @@ -24,7 +24,11 @@ package me.lucko.luckperms.bukkit.migration; import me.lucko.luckperms.api.Logger; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Constants; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.NodeFactory; diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPermissionsEx.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPermissionsEx.java index ade21dfe..6c416a78 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPermissionsEx.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPermissionsEx.java @@ -26,7 +26,11 @@ import me.lucko.luckperms.api.Logger; import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.api.PlatformType; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Constants; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.LogEntry; diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPowerfulPerms.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPowerfulPerms.java index b6b2c07e..af9bd9f9 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPowerfulPerms.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPowerfulPerms.java @@ -30,7 +30,11 @@ import me.lucko.luckperms.api.Logger; import me.lucko.luckperms.api.data.Callback; import me.lucko.luckperms.bukkit.migration.utils.LPResultRunnable; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Constants; import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.data.LogEntry; diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationZPermissions.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationZPermissions.java index c9e3805d..58e111b9 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationZPermissions.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationZPermissions.java @@ -25,7 +25,11 @@ package me.lucko.luckperms.bukkit.migration; import me.lucko.luckperms.api.Logger; import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Constants; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.LogEntry; diff --git a/bungee/src/main/java/me/lucko/luckperms/bungee/BungeeCommand.java b/bungee/src/main/java/me/lucko/luckperms/bungee/BungeeCommand.java index 564a62a2..70b8f7ae 100644 --- a/bungee/src/main/java/me/lucko/luckperms/bungee/BungeeCommand.java +++ b/bungee/src/main/java/me/lucko/luckperms/bungee/BungeeCommand.java @@ -26,7 +26,7 @@ import com.google.common.base.Joiner; import com.google.common.base.Splitter; import me.lucko.luckperms.api.data.Callback; import me.lucko.luckperms.common.commands.CommandManager; -import me.lucko.luckperms.common.commands.Util; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Patterns; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.plugin.Command; diff --git a/bungee/src/main/java/me/lucko/luckperms/bungee/BungeeSenderFactory.java b/bungee/src/main/java/me/lucko/luckperms/bungee/BungeeSenderFactory.java index 41da02dd..f3c1858d 100644 --- a/bungee/src/main/java/me/lucko/luckperms/bungee/BungeeSenderFactory.java +++ b/bungee/src/main/java/me/lucko/luckperms/bungee/BungeeSenderFactory.java @@ -23,7 +23,7 @@ package me.lucko.luckperms.bungee; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.SenderFactory; +import me.lucko.luckperms.common.commands.sender.SenderFactory; import me.lucko.luckperms.common.constants.Constants; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.chat.TextComponent; diff --git a/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java b/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java index 4bbe2da7..90d7c779 100644 --- a/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java +++ b/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java @@ -34,7 +34,7 @@ import me.lucko.luckperms.common.api.ApiProvider; import me.lucko.luckperms.common.calculators.CalculatorFactory; import me.lucko.luckperms.common.commands.CommandManager; import me.lucko.luckperms.common.commands.ConsecutiveExecutor; -import me.lucko.luckperms.common.commands.Sender; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.config.LPConfiguration; import me.lucko.luckperms.common.contexts.ContextManager; import me.lucko.luckperms.common.contexts.ServerCalculator; diff --git a/bungee/src/main/java/me/lucko/luckperms/bungee/migration/MigrationBungeePerms.java b/bungee/src/main/java/me/lucko/luckperms/bungee/migration/MigrationBungeePerms.java index 445baf68..e1d356cd 100644 --- a/bungee/src/main/java/me/lucko/luckperms/bungee/migration/MigrationBungeePerms.java +++ b/bungee/src/main/java/me/lucko/luckperms/bungee/migration/MigrationBungeePerms.java @@ -27,8 +27,8 @@ import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Constants; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/LuckPermsPlugin.java b/common/src/main/java/me/lucko/luckperms/common/LuckPermsPlugin.java index d3acccfc..65cbef01 100644 --- a/common/src/main/java/me/lucko/luckperms/common/LuckPermsPlugin.java +++ b/common/src/main/java/me/lucko/luckperms/common/LuckPermsPlugin.java @@ -28,7 +28,7 @@ import me.lucko.luckperms.api.PlatformType; import me.lucko.luckperms.common.api.ApiProvider; import me.lucko.luckperms.common.calculators.CalculatorFactory; import me.lucko.luckperms.common.commands.ConsecutiveExecutor; -import me.lucko.luckperms.common.commands.Sender; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.config.LPConfiguration; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.contexts.ContextManager; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/Command.java b/common/src/main/java/me/lucko/luckperms/common/commands/Command.java index 20f82e9f..600eb86f 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/Command.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/Command.java @@ -25,6 +25,7 @@ package me.lucko.luckperms.common.commands; import com.google.common.collect.ImmutableList; import lombok.Getter; import me.lucko.luckperms.common.LuckPermsPlugin; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Permission; import java.util.Collections; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/CommandManager.java b/common/src/main/java/me/lucko/luckperms/common/commands/CommandManager.java index a8e517d3..c3a2a513 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/CommandManager.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/CommandManager.java @@ -34,12 +34,15 @@ import me.lucko.luckperms.common.commands.group.ListGroups; import me.lucko.luckperms.common.commands.log.LogMainCommand; import me.lucko.luckperms.common.commands.migration.MigrationMainCommand; import me.lucko.luckperms.common.commands.misc.*; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.track.CreateTrack; import me.lucko.luckperms.common.commands.track.DeleteTrack; import me.lucko.luckperms.common.commands.track.ListTracks; import me.lucko.luckperms.common.commands.track.TrackMainCommand; import me.lucko.luckperms.common.commands.user.UserMainCommand; import me.lucko.luckperms.common.commands.usersbulkedit.UsersBulkEditMainCommand; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import java.util.ArrayList; @@ -101,21 +104,25 @@ public class CommandManager { */ @SuppressWarnings("unchecked") public CommandResult onCommand(Sender sender, String label, List args) { + // Handle no arguments if (args.size() == 0) { sendCommandUsage(sender, label); return CommandResult.INVALID_ARGS; } + // Look for the main command. Optional o = mainCommands.stream() .filter(m -> m.getName().equalsIgnoreCase(args.get(0))) .limit(1) .findAny(); + // Main command not found if (!o.isPresent()) { sendCommandUsage(sender, label); return CommandResult.INVALID_ARGS; } + // Check the Sender has permission to use the main command. final Command main = o.get(); if (!main.isAuthorized(sender)) { sendCommandUsage(sender, label); @@ -124,13 +131,15 @@ public class CommandManager { List arguments = new ArrayList<>(args); handleRewrites(arguments); - arguments.remove(0); // remove the first command part. + arguments.remove(0); // remove the main command arg. + // Check the correct number of args were given for the main command if (main.getArgumentCheck().test(arguments.size())) { main.sendUsage(sender, label); return CommandResult.INVALID_ARGS; } + // Try to execute the command. CommandResult result; try { result = main.execute(plugin, sender, null, arguments, label); @@ -194,19 +203,24 @@ public class CommandManager { .filter(m -> m.isAuthorized(sender)) .collect(Collectors.toList()); + // Not yet past the point of entering a main command if (args.size() <= 1) { + + // Nothing yet entered if (args.isEmpty() || args.get(0).equalsIgnoreCase("")) { return mains.stream() .map(m -> m.getName().toLowerCase()) .collect(Collectors.toList()); } + // Started typing a main command return mains.stream() .map(m -> m.getName().toLowerCase()) .filter(s -> s.startsWith(args.get(0).toLowerCase())) .collect(Collectors.toList()); } + // Find a main command matching the first arg Optional o = mains.stream() .filter(m -> m.getName().equalsIgnoreCase(args.get(0))) .limit(1) @@ -216,6 +230,7 @@ public class CommandManager { return Collections.emptyList(); } + // Pass the processing onto the main command return o.get().tabComplete(plugin, sender, args.subList(1, args.size())); } diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/ConsecutiveExecutor.java b/common/src/main/java/me/lucko/luckperms/common/commands/ConsecutiveExecutor.java index 47d667ad..ae6a3502 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/ConsecutiveExecutor.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/ConsecutiveExecutor.java @@ -25,6 +25,7 @@ package me.lucko.luckperms.common.commands; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.RequiredArgsConstructor; +import me.lucko.luckperms.common.commands.sender.Sender; import java.util.ArrayList; import java.util.List; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/MainCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/MainCommand.java index 0ecb4ec1..3685877d 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/MainCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/MainCommand.java @@ -25,6 +25,8 @@ package me.lucko.luckperms.common.commands; import lombok.Getter; import lombok.NonNull; import me.lucko.luckperms.common.LuckPermsPlugin; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.utils.Predicates; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/SingleCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/SingleCommand.java index 3d542dd4..8c606910 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/SingleCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/SingleCommand.java @@ -24,6 +24,8 @@ package me.lucko.luckperms.common.commands; import lombok.Getter; import me.lucko.luckperms.common.LuckPermsPlugin; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Permission; import java.util.List; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/SubCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/SubCommand.java index d61e5967..79a801d7 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/SubCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/SubCommand.java @@ -24,6 +24,8 @@ package me.lucko.luckperms.common.commands; import lombok.Getter; import me.lucko.luckperms.common.LuckPermsPlugin; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.groups.Group; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/SharedMainCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/SharedMainCommand.java index 994c9529..4c5d2722 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/SharedMainCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/SharedMainCommand.java @@ -23,7 +23,12 @@ package me.lucko.luckperms.common.commands.generic; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.utils.Predicates; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/SharedSubCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/SharedSubCommand.java index 325b64b0..4e109acf 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/SharedSubCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/SharedSubCommand.java @@ -26,7 +26,12 @@ import com.google.common.collect.ImmutableList; import lombok.AllArgsConstructor; import lombok.Getter; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.groups.Group; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaAddPrefix.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaAddPrefix.java index 61651d6f..6a0b5e95 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaAddPrefix.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaAddPrefix.java @@ -24,8 +24,13 @@ package me.lucko.luckperms.common.commands.generic.meta; import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaAddSuffix.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaAddSuffix.java index b860e1e6..b8270c44 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaAddSuffix.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaAddSuffix.java @@ -24,8 +24,13 @@ package me.lucko.luckperms.common.commands.generic.meta; import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaAddTempPrefix.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaAddTempPrefix.java index b93fe16e..197bd3b6 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaAddTempPrefix.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaAddTempPrefix.java @@ -24,8 +24,13 @@ package me.lucko.luckperms.common.commands.generic.meta; import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaAddTempSuffix.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaAddTempSuffix.java index d6594e6f..f231d01a 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaAddTempSuffix.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaAddTempSuffix.java @@ -24,8 +24,13 @@ package me.lucko.luckperms.common.commands.generic.meta; import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaClear.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaClear.java index 58c97209..68fac33d 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaClear.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaClear.java @@ -23,8 +23,13 @@ package me.lucko.luckperms.common.commands.generic.meta; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; 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 ed6dfa56..012faab4 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 @@ -27,9 +27,9 @@ import me.lucko.luckperms.api.Node; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; -import me.lucko.luckperms.common.commands.Util; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; @@ -44,8 +44,8 @@ public class MetaInfo extends SharedSubCommand { @Override public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args) throws CommandException { - SortedSet> prefixes = new TreeSet<>(Util.getMetaComparator().reversed()); - SortedSet> suffixes = new TreeSet<>(Util.getMetaComparator().reversed()); + SortedSet> prefixes = new TreeSet<>(Util.META_COMPARATOR.reversed()); + SortedSet> suffixes = new TreeSet<>(Util.META_COMPARATOR.reversed()); Set meta = new HashSet<>(); // Collect data @@ -68,16 +68,9 @@ public class MetaInfo extends SharedSubCommand { } else { Message.CHAT_META_PREFIX_HEADER.send(sender, holder.getFriendlyName()); for (Map.Entry e : prefixes) { - if (e.getValue().isServerSpecific() || e.getValue().isWorldSpecific()) { - StringBuilder sb = new StringBuilder(); - if (e.getValue().isServerSpecific()) { - sb.append(" &8(&7server=&f").append(e.getValue().getServer().get()).append("&8)"); - } - if (e.getValue().isWorldSpecific()) { - sb.append(" &8(&7world=&f").append(e.getValue().getWorld().get()).append("&8)"); - } - - Message.CHAT_META_ENTRY_WITH_CONTEXT.send(sender, e.getKey(), e.getValue().getPrefix().getValue(), sb.toString()); + if (e.getValue().isServerSpecific() || e.getValue().isWorldSpecific() || !e.getValue().getContexts().isEmpty()) { + String context = Util.getNodeContextDescription(e.getValue()); + Message.CHAT_META_ENTRY_WITH_CONTEXT.send(sender, e.getKey(), e.getValue().getPrefix().getValue(), context); } else { Message.CHAT_META_ENTRY.send(sender, e.getKey(), e.getValue().getPrefix().getValue()); } @@ -89,16 +82,9 @@ public class MetaInfo extends SharedSubCommand { } else { Message.CHAT_META_SUFFIX_HEADER.send(sender, holder.getFriendlyName()); for (Map.Entry e : suffixes) { - if (e.getValue().isServerSpecific() || e.getValue().isWorldSpecific()) { - StringBuilder sb = new StringBuilder(); - if (e.getValue().isServerSpecific()) { - sb.append(" &8(&7server=&f").append(e.getValue().getServer().get()).append("&8)"); - } - if (e.getValue().isWorldSpecific()) { - sb.append(" &8(&7world=&f").append(e.getValue().getWorld().get()).append("&8)"); - } - - Message.CHAT_META_ENTRY_WITH_CONTEXT.send(sender, e.getKey(), e.getValue().getSuffix().getValue(), sb.toString()); + if (e.getValue().isServerSpecific() || e.getValue().isWorldSpecific() || !e.getValue().getContexts().isEmpty()) { + String context = Util.getNodeContextDescription(e.getValue()); + Message.CHAT_META_ENTRY_WITH_CONTEXT.send(sender, e.getKey(), e.getValue().getSuffix().getValue(), context); } else { Message.CHAT_META_ENTRY.send(sender, e.getKey(), e.getValue().getSuffix().getValue()); } @@ -110,16 +96,9 @@ public class MetaInfo extends SharedSubCommand { } else { Message.META_HEADER.send(sender, holder.getFriendlyName()); for (Node m : meta) { - if (m.isServerSpecific() || m.isWorldSpecific()) { - StringBuilder sb = new StringBuilder(); - if (m.isServerSpecific()) { - sb.append(" &8(&7server=&f").append(m.getServer().get()).append("&8)"); - } - if (m.isWorldSpecific()) { - sb.append(" &8(&7world=&f").append(m.getWorld().get()).append("&8)"); - } - - Message.META_ENTRY_WITH_CONTEXT.send(sender, m.getMeta().getKey(), m.getMeta().getValue(), sb.toString()); + if (m.isServerSpecific() || m.isWorldSpecific() || !m.getContexts().isEmpty()) { + String context = Util.getNodeContextDescription(m); + Message.META_ENTRY_WITH_CONTEXT.send(sender, m.getMeta().getKey(), m.getMeta().getValue(), context); } else { Message.META_ENTRY.send(sender, m.getMeta().getKey(), m.getMeta().getValue()); } diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaRemovePrefix.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaRemovePrefix.java index 3b2f9b08..2b500756 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaRemovePrefix.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaRemovePrefix.java @@ -25,8 +25,13 @@ package me.lucko.luckperms.common.commands.generic.meta; import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaRemoveSuffix.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaRemoveSuffix.java index 06f72db6..0d4ac744 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaRemoveSuffix.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaRemoveSuffix.java @@ -25,8 +25,13 @@ package me.lucko.luckperms.common.commands.generic.meta; import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaRemoveTempPrefix.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaRemoveTempPrefix.java index 9be508c2..da02d893 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaRemoveTempPrefix.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaRemoveTempPrefix.java @@ -25,8 +25,13 @@ package me.lucko.luckperms.common.commands.generic.meta; import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaRemoveTempSuffix.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaRemoveTempSuffix.java index a90f467b..2d11ebca 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaRemoveTempSuffix.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaRemoveTempSuffix.java @@ -25,8 +25,13 @@ package me.lucko.luckperms.common.commands.generic.meta; import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaSet.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaSet.java index 598900fe..2aa71d74 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaSet.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaSet.java @@ -25,8 +25,13 @@ package me.lucko.luckperms.common.commands.generic.meta; import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.NodeBuilder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaSetTemp.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaSetTemp.java index 0eb2d67e..f52c5a9d 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaSetTemp.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaSetTemp.java @@ -25,8 +25,13 @@ package me.lucko.luckperms.common.commands.generic.meta; import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.NodeBuilder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaUnset.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaUnset.java index 71c92977..e78cdb57 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaUnset.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaUnset.java @@ -24,8 +24,13 @@ package me.lucko.luckperms.common.commands.generic.meta; import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaUnsetTemp.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaUnsetTemp.java index 7f20ccff..1eaa002b 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaUnsetTemp.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/meta/MetaUnsetTemp.java @@ -24,8 +24,13 @@ package me.lucko.luckperms.common.commands.generic.meta; import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/other/HolderShowTracks.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/other/HolderShowTracks.java index 86f4fc7a..277b7033 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/other/HolderShowTracks.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/other/HolderShowTracks.java @@ -24,7 +24,11 @@ package me.lucko.luckperms.common.commands.generic.other; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; @@ -59,16 +63,13 @@ public class HolderShowTracks extends SubCommand plugin.getTrackManager().getAll().values().stream() .filter(t -> t.containsGroup(name)) - .forEach(t -> { - sb.append("&a").append(t.getName()).append(": ").append(Util.listToArrowSep(t.getGroups(), name)); - if (node.isServerSpecific()) { - sb.append(" &8(&7server=&f").append(node.getServer().get()).append("&8)"); - } - if (node.isWorldSpecific()) { - sb.append(" &8(&7world=&f").append(node.getWorld().get()).append("&8)"); - } - sb.append("\n"); - }); + .forEach(t -> sb.append("&a") + .append(t.getName()) + .append(": ") + .append(Util.listToArrowSep(t.getGroups(), name)) + .append(Util.getNodeContextDescription(node)) + .append("\n") + ); } if (sb.length() == 0) { diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentAdd.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentAdd.java index 60e51381..1990dbf5 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentAdd.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentAdd.java @@ -23,8 +23,13 @@ package me.lucko.luckperms.common.commands.generic.parent; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentAddTemp.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentAddTemp.java index 5719b116..af33e12f 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentAddTemp.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentAddTemp.java @@ -23,8 +23,13 @@ package me.lucko.luckperms.common.commands.generic.parent; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; 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 b3222d15..545a4237 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 @@ -25,9 +25,9 @@ package me.lucko.luckperms.common.commands.generic.parent; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; -import me.lucko.luckperms.common.commands.Util; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentRemove.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentRemove.java index 466df1b4..b7581f30 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentRemove.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentRemove.java @@ -23,8 +23,13 @@ package me.lucko.luckperms.common.commands.generic.parent; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentRemoveTemp.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentRemoveTemp.java index 01c8fe98..967be40f 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentRemoveTemp.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentRemoveTemp.java @@ -23,8 +23,13 @@ package me.lucko.luckperms.common.commands.generic.parent; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentSet.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentSet.java index 60fbf197..84a4b707 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentSet.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/parent/ParentSet.java @@ -23,8 +23,13 @@ package me.lucko.luckperms.common.commands.generic.parent; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionCheck.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionCheck.java index 9908b3c7..25c3dc78 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionCheck.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionCheck.java @@ -23,8 +23,14 @@ package me.lucko.luckperms.common.commands.generic.permission; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.NodeBuilder; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionCheckInherits.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionCheckInherits.java index 52aecb00..018540f0 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionCheckInherits.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionCheckInherits.java @@ -23,8 +23,14 @@ package me.lucko.luckperms.common.commands.generic.permission; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.InheritanceInfo; import me.lucko.luckperms.common.core.NodeBuilder; 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 1f43d68f..f5b1db80 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 @@ -25,9 +25,9 @@ package me.lucko.luckperms.common.commands.generic.permission; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; -import me.lucko.luckperms.common.commands.Util; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionSet.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionSet.java index 6b341beb..08be3f64 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionSet.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionSet.java @@ -23,8 +23,13 @@ package me.lucko.luckperms.common.commands.generic.permission; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionSetTemp.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionSetTemp.java index f02d50cd..a08729d0 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionSetTemp.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionSetTemp.java @@ -23,8 +23,13 @@ package me.lucko.luckperms.common.commands.generic.permission; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionUnset.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionUnset.java index a00d53cf..2fc453fc 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionUnset.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionUnset.java @@ -23,8 +23,13 @@ package me.lucko.luckperms.common.commands.generic.permission; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionUnsetTemp.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionUnsetTemp.java index 8e23311a..51200adf 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionUnsetTemp.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionUnsetTemp.java @@ -23,8 +23,13 @@ package me.lucko.luckperms.common.commands.generic.permission; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.generic.SharedSubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/group/CreateGroup.java b/common/src/main/java/me/lucko/luckperms/common/commands/group/CreateGroup.java index 47675ad6..42c5afa0 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/group/CreateGroup.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/group/CreateGroup.java @@ -25,8 +25,8 @@ package me.lucko.luckperms.common.commands.group; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; import me.lucko.luckperms.common.commands.SingleCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/group/DeleteGroup.java b/common/src/main/java/me/lucko/luckperms/common/commands/group/DeleteGroup.java index d6d27497..069fb25d 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/group/DeleteGroup.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/group/DeleteGroup.java @@ -25,8 +25,8 @@ package me.lucko.luckperms.common.commands.group; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; import me.lucko.luckperms.common.commands.SingleCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/group/subcommands/GroupBulkChange.java b/common/src/main/java/me/lucko/luckperms/common/commands/group/GroupBulkChange.java similarity index 93% rename from common/src/main/java/me/lucko/luckperms/common/commands/group/subcommands/GroupBulkChange.java rename to common/src/main/java/me/lucko/luckperms/common/commands/group/GroupBulkChange.java index 025903da..7930b088 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/group/subcommands/GroupBulkChange.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/group/GroupBulkChange.java @@ -20,11 +20,15 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands.group.subcommands; +package me.lucko.luckperms.common.commands.group; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.NodeFactory; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/group/subcommands/GroupClear.java b/common/src/main/java/me/lucko/luckperms/common/commands/group/GroupClear.java similarity index 87% rename from common/src/main/java/me/lucko/luckperms/common/commands/group/subcommands/GroupClear.java rename to common/src/main/java/me/lucko/luckperms/common/commands/group/GroupClear.java index 66ddbe93..bc7166aa 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/group/subcommands/GroupClear.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/group/GroupClear.java @@ -20,10 +20,16 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands.group.subcommands; +package me.lucko.luckperms.common.commands.group; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/group/subcommands/GroupClone.java b/common/src/main/java/me/lucko/luckperms/common/commands/group/GroupClone.java similarity index 90% rename from common/src/main/java/me/lucko/luckperms/common/commands/group/subcommands/GroupClone.java rename to common/src/main/java/me/lucko/luckperms/common/commands/group/GroupClone.java index 1f998170..8e9ab616 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/group/subcommands/GroupClone.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/group/GroupClone.java @@ -20,10 +20,14 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands.group.subcommands; +package me.lucko.luckperms.common.commands.group; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/group/subcommands/GroupInfo.java b/common/src/main/java/me/lucko/luckperms/common/commands/group/GroupInfo.java similarity index 95% rename from common/src/main/java/me/lucko/luckperms/common/commands/group/subcommands/GroupInfo.java rename to common/src/main/java/me/lucko/luckperms/common/commands/group/GroupInfo.java index 74240243..ad7725a0 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/group/subcommands/GroupInfo.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/group/GroupInfo.java @@ -20,13 +20,13 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands.group.subcommands; +package me.lucko.luckperms.common.commands.group; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.groups.Group; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/group/GroupMainCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/group/GroupMainCommand.java index d723e8b8..d5275515 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/group/GroupMainCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/group/GroupMainCommand.java @@ -26,12 +26,11 @@ import com.google.common.collect.ImmutableList; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.Command; import me.lucko.luckperms.common.commands.MainCommand; -import me.lucko.luckperms.common.commands.Sender; import me.lucko.luckperms.common.commands.generic.meta.CommandMeta; import me.lucko.luckperms.common.commands.generic.other.HolderShowTracks; import me.lucko.luckperms.common.commands.generic.parent.CommandParent; import me.lucko.luckperms.common.commands.generic.permission.CommandPermission; -import me.lucko.luckperms.common.commands.group.subcommands.*; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.groups.Group; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/group/subcommands/GroupRename.java b/common/src/main/java/me/lucko/luckperms/common/commands/group/GroupRename.java similarity index 90% rename from common/src/main/java/me/lucko/luckperms/common/commands/group/subcommands/GroupRename.java rename to common/src/main/java/me/lucko/luckperms/common/commands/group/GroupRename.java index 98027cc6..00b77a45 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/group/subcommands/GroupRename.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/group/GroupRename.java @@ -20,10 +20,14 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands.group.subcommands; +package me.lucko.luckperms.common.commands.group; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/group/ListGroups.java b/common/src/main/java/me/lucko/luckperms/common/commands/group/ListGroups.java index 6c460328..23ac7080 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/group/ListGroups.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/group/ListGroups.java @@ -24,9 +24,9 @@ package me.lucko.luckperms.common.commands.group; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; import me.lucko.luckperms.common.commands.SingleCommand; -import me.lucko.luckperms.common.commands.Util; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.groups.Group; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/log/LogMainCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/log/LogMainCommand.java index 46dd8c19..e7eb5fa5 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/log/LogMainCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/log/LogMainCommand.java @@ -26,8 +26,8 @@ import com.google.common.collect.ImmutableList; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.Command; import me.lucko.luckperms.common.commands.MainCommand; -import me.lucko.luckperms.common.commands.Sender; import me.lucko.luckperms.common.commands.log.subcommands.*; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.data.Log; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogExport.java b/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogExport.java index 575ab3cf..d23799c1 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogExport.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogExport.java @@ -24,7 +24,11 @@ package me.lucko.luckperms.common.commands.log.subcommands; import me.lucko.luckperms.api.LogEntry; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.Log; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogGroupHistory.java b/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogGroupHistory.java index 0c936ba0..f7fcb606 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogGroupHistory.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogGroupHistory.java @@ -24,7 +24,11 @@ package me.lucko.luckperms.common.commands.log.subcommands; import me.lucko.luckperms.api.LogEntry; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.Log; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogNotify.java b/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogNotify.java index e7eea3a0..bf1d75c0 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogNotify.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogNotify.java @@ -23,7 +23,11 @@ package me.lucko.luckperms.common.commands.log.subcommands; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.Log; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogRecent.java b/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogRecent.java index bc64191c..677f2262 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogRecent.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogRecent.java @@ -24,7 +24,12 @@ package me.lucko.luckperms.common.commands.log.subcommands; import me.lucko.luckperms.api.LogEntry; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Patterns; import me.lucko.luckperms.common.constants.Permission; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogSearch.java b/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogSearch.java index cee629a7..f33bfc00 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogSearch.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogSearch.java @@ -24,7 +24,11 @@ package me.lucko.luckperms.common.commands.log.subcommands; import me.lucko.luckperms.api.LogEntry; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.Log; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogTrackHistory.java b/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogTrackHistory.java index a57c0f43..348792b1 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogTrackHistory.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogTrackHistory.java @@ -24,7 +24,11 @@ package me.lucko.luckperms.common.commands.log.subcommands; import me.lucko.luckperms.api.LogEntry; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.Log; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogUserHistory.java b/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogUserHistory.java index 4035e409..5be8eab4 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogUserHistory.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/log/subcommands/LogUserHistory.java @@ -24,7 +24,12 @@ package me.lucko.luckperms.common.commands.log.subcommands; import me.lucko.luckperms.api.LogEntry; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Patterns; import me.lucko.luckperms.common.constants.Permission; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/migration/MigrationMainCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/migration/MigrationMainCommand.java index bd3aea4b..b1fad2b4 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/migration/MigrationMainCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/migration/MigrationMainCommand.java @@ -25,6 +25,7 @@ package me.lucko.luckperms.common.commands.migration; import com.google.common.collect.ImmutableList; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Constants; import me.lucko.luckperms.common.constants.Message; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/misc/DebugCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/misc/DebugCommand.java index 2a8d39f2..12de6819 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/misc/DebugCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/misc/DebugCommand.java @@ -24,8 +24,8 @@ package me.lucko.luckperms.common.commands.misc; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; import me.lucko.luckperms.common.commands.SingleCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.utils.Predicates; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/misc/ExportCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/misc/ExportCommand.java index 5e991477..e705e4fa 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/misc/ExportCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/misc/ExportCommand.java @@ -27,8 +27,8 @@ import me.lucko.luckperms.api.Node; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; import me.lucko.luckperms.common.commands.SingleCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Constants; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/misc/ImportCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/misc/ImportCommand.java index 17c50638..209f605e 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/misc/ImportCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/misc/ImportCommand.java @@ -25,8 +25,8 @@ package me.lucko.luckperms.common.commands.misc; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; import me.lucko.luckperms.common.commands.SingleCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.Importer; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/misc/InfoCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/misc/InfoCommand.java index 3723ecde..fa04bb44 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/misc/InfoCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/misc/InfoCommand.java @@ -24,8 +24,8 @@ package me.lucko.luckperms.common.commands.misc; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; import me.lucko.luckperms.common.commands.SingleCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.config.LPConfiguration; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; @@ -33,7 +33,7 @@ import me.lucko.luckperms.common.utils.Predicates; import java.util.List; -import static me.lucko.luckperms.common.commands.Util.formatBoolean; +import static me.lucko.luckperms.common.commands.utils.Util.formatBoolean; public class InfoCommand extends SingleCommand { public InfoCommand() { diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/misc/NetworkSyncCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/misc/NetworkSyncCommand.java index 4840f097..e5f5e516 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/misc/NetworkSyncCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/misc/NetworkSyncCommand.java @@ -24,8 +24,8 @@ package me.lucko.luckperms.common.commands.misc; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; import me.lucko.luckperms.common.commands.SingleCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.utils.Predicates; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/misc/QueueCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/misc/QueueCommand.java index 931c649c..23c36952 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/misc/QueueCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/misc/QueueCommand.java @@ -23,7 +23,11 @@ package me.lucko.luckperms.common.commands.misc; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.ConsecutiveExecutor; +import me.lucko.luckperms.common.commands.SingleCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Constants; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.utils.Predicates; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/misc/SyncCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/misc/SyncCommand.java index 8d3ad284..496f3c97 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/misc/SyncCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/misc/SyncCommand.java @@ -24,8 +24,8 @@ package me.lucko.luckperms.common.commands.misc; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; import me.lucko.luckperms.common.commands.SingleCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.utils.Predicates; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/misc/VerboseCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/misc/VerboseCommand.java index a2193763..d3916f6d 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/misc/VerboseCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/misc/VerboseCommand.java @@ -25,8 +25,8 @@ package me.lucko.luckperms.common.commands.misc; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; import me.lucko.luckperms.common.commands.SingleCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.utils.Predicates; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/AbstractSender.java b/common/src/main/java/me/lucko/luckperms/common/commands/sender/AbstractSender.java similarity index 98% rename from common/src/main/java/me/lucko/luckperms/common/commands/AbstractSender.java rename to common/src/main/java/me/lucko/luckperms/common/commands/sender/AbstractSender.java index 25ceac57..10cae502 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/AbstractSender.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/sender/AbstractSender.java @@ -20,7 +20,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands; +package me.lucko.luckperms.common.commands.sender; import lombok.Getter; import me.lucko.luckperms.common.LuckPermsPlugin; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/Sender.java b/common/src/main/java/me/lucko/luckperms/common/commands/sender/Sender.java similarity index 65% rename from common/src/main/java/me/lucko/luckperms/common/commands/Sender.java rename to common/src/main/java/me/lucko/luckperms/common/commands/sender/Sender.java index 4c6072c3..9ae242a3 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/Sender.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/sender/Sender.java @@ -20,22 +20,48 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands; +package me.lucko.luckperms.common.commands.sender; import me.lucko.luckperms.common.LuckPermsPlugin; +import me.lucko.luckperms.common.constants.Constants; import me.lucko.luckperms.common.constants.Permission; import java.util.UUID; /** - * Wrapper interface to represent a CommandSender/CommandSource within the luckperms-common command implementations. + * Wrapper interface to represent a CommandSender/CommandSource within the common command implementations. */ public interface Sender { + /** + * Gets the platform where the sender is from. + * @return the plugin + */ LuckPermsPlugin getPlatform(); + + /** + * Gets the sender's username + * @return a friendly username for the sender + */ String getName(); + + /** + * Gets the sender's unique id. See {@link Constants#getConsoleUUID()} for the console's UUID representation. + * @return the sender's uuid + */ UUID getUuid(); + + /** + * Send a message back to the Sender + * @param s the message to send. Supports 'ยง' for message formatting. + */ void sendMessage(String s); + + /** + * Check if the Sender has a permission. + * @param permission the permission to check for + * @return true if the sender has the permission + */ boolean hasPermission(Permission permission); } diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/SenderFactory.java b/common/src/main/java/me/lucko/luckperms/common/commands/sender/SenderFactory.java similarity index 97% rename from common/src/main/java/me/lucko/luckperms/common/commands/SenderFactory.java rename to common/src/main/java/me/lucko/luckperms/common/commands/sender/SenderFactory.java index 15a5ef7a..da7ee648 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/SenderFactory.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/sender/SenderFactory.java @@ -20,7 +20,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands; +package me.lucko.luckperms.common.commands.sender; import lombok.RequiredArgsConstructor; import me.lucko.luckperms.common.LuckPermsPlugin; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/track/CreateTrack.java b/common/src/main/java/me/lucko/luckperms/common/commands/track/CreateTrack.java index 347c0b51..8f6cdf72 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/track/CreateTrack.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/track/CreateTrack.java @@ -25,8 +25,8 @@ package me.lucko.luckperms.common.commands.track; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; import me.lucko.luckperms.common.commands.SingleCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/track/DeleteTrack.java b/common/src/main/java/me/lucko/luckperms/common/commands/track/DeleteTrack.java index a494bb73..52d4ed20 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/track/DeleteTrack.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/track/DeleteTrack.java @@ -25,8 +25,8 @@ package me.lucko.luckperms.common.commands.track; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; import me.lucko.luckperms.common.commands.SingleCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/track/ListTracks.java b/common/src/main/java/me/lucko/luckperms/common/commands/track/ListTracks.java index 064273ed..97c0a798 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/track/ListTracks.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/track/ListTracks.java @@ -24,9 +24,9 @@ package me.lucko.luckperms.common.commands.track; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; import me.lucko.luckperms.common.commands.SingleCommand; -import me.lucko.luckperms.common.commands.Util; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.utils.Predicates; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/track/subcommands/TrackAppend.java b/common/src/main/java/me/lucko/luckperms/common/commands/track/TrackAppend.java similarity index 90% rename from common/src/main/java/me/lucko/luckperms/common/commands/track/subcommands/TrackAppend.java rename to common/src/main/java/me/lucko/luckperms/common/commands/track/TrackAppend.java index ec84504c..a45ddbb1 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/track/subcommands/TrackAppend.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/track/TrackAppend.java @@ -20,10 +20,15 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands.track.subcommands; +package me.lucko.luckperms.common.commands.track; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/track/subcommands/TrackClear.java b/common/src/main/java/me/lucko/luckperms/common/commands/track/TrackClear.java similarity index 95% rename from common/src/main/java/me/lucko/luckperms/common/commands/track/subcommands/TrackClear.java rename to common/src/main/java/me/lucko/luckperms/common/commands/track/TrackClear.java index 682e97c8..300793d3 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/track/subcommands/TrackClear.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/track/TrackClear.java @@ -20,13 +20,13 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands.track.subcommands; +package me.lucko.luckperms.common.commands.track; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/track/subcommands/TrackClone.java b/common/src/main/java/me/lucko/luckperms/common/commands/track/TrackClone.java similarity index 90% rename from common/src/main/java/me/lucko/luckperms/common/commands/track/subcommands/TrackClone.java rename to common/src/main/java/me/lucko/luckperms/common/commands/track/TrackClone.java index 3898c981..43f087e0 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/track/subcommands/TrackClone.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/track/TrackClone.java @@ -20,10 +20,14 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands.track.subcommands; +package me.lucko.luckperms.common.commands.track; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/track/subcommands/TrackInfo.java b/common/src/main/java/me/lucko/luckperms/common/commands/track/TrackInfo.java similarity index 85% rename from common/src/main/java/me/lucko/luckperms/common/commands/track/subcommands/TrackInfo.java rename to common/src/main/java/me/lucko/luckperms/common/commands/track/TrackInfo.java index 5cee9944..368259fb 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/track/subcommands/TrackInfo.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/track/TrackInfo.java @@ -20,10 +20,14 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands.track.subcommands; +package me.lucko.luckperms.common.commands.track; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.tracks.Track; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/track/subcommands/TrackInsert.java b/common/src/main/java/me/lucko/luckperms/common/commands/track/TrackInsert.java similarity index 91% rename from common/src/main/java/me/lucko/luckperms/common/commands/track/subcommands/TrackInsert.java rename to common/src/main/java/me/lucko/luckperms/common/commands/track/TrackInsert.java index b22bd3cf..05d2e8c8 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/track/subcommands/TrackInsert.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/track/TrackInsert.java @@ -20,10 +20,15 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands.track.subcommands; +package me.lucko.luckperms.common.commands.track; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/track/TrackMainCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/track/TrackMainCommand.java index 75632049..5f6b6a95 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/track/TrackMainCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/track/TrackMainCommand.java @@ -26,8 +26,7 @@ import com.google.common.collect.ImmutableList; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.Command; import me.lucko.luckperms.common.commands.MainCommand; -import me.lucko.luckperms.common.commands.Sender; -import me.lucko.luckperms.common.commands.track.subcommands.*; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.tracks.Track; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/track/subcommands/TrackRemove.java b/common/src/main/java/me/lucko/luckperms/common/commands/track/TrackRemove.java similarity index 89% rename from common/src/main/java/me/lucko/luckperms/common/commands/track/subcommands/TrackRemove.java rename to common/src/main/java/me/lucko/luckperms/common/commands/track/TrackRemove.java index 23561c01..db0739d2 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/track/subcommands/TrackRemove.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/track/TrackRemove.java @@ -20,10 +20,15 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands.track.subcommands; +package me.lucko.luckperms.common.commands.track; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/track/subcommands/TrackRename.java b/common/src/main/java/me/lucko/luckperms/common/commands/track/TrackRename.java similarity index 90% rename from common/src/main/java/me/lucko/luckperms/common/commands/track/subcommands/TrackRename.java rename to common/src/main/java/me/lucko/luckperms/common/commands/track/TrackRename.java index a818d783..4e326e58 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/track/subcommands/TrackRename.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/track/TrackRename.java @@ -20,10 +20,14 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands.track.subcommands; +package me.lucko.luckperms.common.commands.track; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/user/subcommands/UserBulkChange.java b/common/src/main/java/me/lucko/luckperms/common/commands/user/UserBulkChange.java similarity index 93% rename from common/src/main/java/me/lucko/luckperms/common/commands/user/subcommands/UserBulkChange.java rename to common/src/main/java/me/lucko/luckperms/common/commands/user/UserBulkChange.java index cbb608c0..a3edd858 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/user/subcommands/UserBulkChange.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/user/UserBulkChange.java @@ -20,11 +20,15 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands.user.subcommands; +package me.lucko.luckperms.common.commands.user; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.NodeFactory; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/user/subcommands/UserClear.java b/common/src/main/java/me/lucko/luckperms/common/commands/user/UserClear.java similarity index 87% rename from common/src/main/java/me/lucko/luckperms/common/commands/user/subcommands/UserClear.java rename to common/src/main/java/me/lucko/luckperms/common/commands/user/UserClear.java index 47dd5347..2dae4035 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/user/subcommands/UserClear.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/user/UserClear.java @@ -20,10 +20,16 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands.user.subcommands; +package me.lucko.luckperms.common.commands.user; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/user/subcommands/UserDemote.java b/common/src/main/java/me/lucko/luckperms/common/commands/user/UserDemote.java similarity index 94% rename from common/src/main/java/me/lucko/luckperms/common/commands/user/subcommands/UserDemote.java rename to common/src/main/java/me/lucko/luckperms/common/commands/user/UserDemote.java index e92a7734..89f4ac03 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/user/subcommands/UserDemote.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/user/UserDemote.java @@ -20,7 +20,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands.user.subcommands; +package me.lucko.luckperms.common.commands.user; import com.google.common.base.Objects; import me.lucko.luckperms.api.Node; @@ -28,7 +28,13 @@ import me.lucko.luckperms.api.event.events.UserDemoteEvent; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.api.internal.TrackLink; import me.lucko.luckperms.common.api.internal.UserLink; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.NodeFactory; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/user/subcommands/UserGetUUID.java b/common/src/main/java/me/lucko/luckperms/common/commands/user/UserGetUUID.java similarity index 94% rename from common/src/main/java/me/lucko/luckperms/common/commands/user/subcommands/UserGetUUID.java rename to common/src/main/java/me/lucko/luckperms/common/commands/user/UserGetUUID.java index 00c95090..46a9b6a2 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/user/subcommands/UserGetUUID.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/user/UserGetUUID.java @@ -20,13 +20,13 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands.user.subcommands; +package me.lucko.luckperms.common.commands.user; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.users.User; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/user/subcommands/UserInfo.java b/common/src/main/java/me/lucko/luckperms/common/commands/user/UserInfo.java similarity index 95% rename from common/src/main/java/me/lucko/luckperms/common/commands/user/subcommands/UserInfo.java rename to common/src/main/java/me/lucko/luckperms/common/commands/user/UserInfo.java index f2cb40d9..c3ce8b9d 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/user/subcommands/UserInfo.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/user/UserInfo.java @@ -20,13 +20,13 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands.user.subcommands; +package me.lucko.luckperms.common.commands.user; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.users.User; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/user/UserMainCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/user/UserMainCommand.java index e50d4739..65fcebeb 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/user/UserMainCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/user/UserMainCommand.java @@ -26,13 +26,12 @@ import com.google.common.collect.ImmutableList; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.Command; import me.lucko.luckperms.common.commands.MainCommand; -import me.lucko.luckperms.common.commands.Sender; -import me.lucko.luckperms.common.commands.Util; import me.lucko.luckperms.common.commands.generic.meta.CommandMeta; import me.lucko.luckperms.common.commands.generic.other.HolderShowTracks; import me.lucko.luckperms.common.commands.generic.parent.CommandParent; import me.lucko.luckperms.common.commands.generic.permission.CommandPermission; -import me.lucko.luckperms.common.commands.user.subcommands.*; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Patterns; import me.lucko.luckperms.common.users.User; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/user/subcommands/UserPromote.java b/common/src/main/java/me/lucko/luckperms/common/commands/user/UserPromote.java similarity index 94% rename from common/src/main/java/me/lucko/luckperms/common/commands/user/subcommands/UserPromote.java rename to common/src/main/java/me/lucko/luckperms/common/commands/user/UserPromote.java index b9c35153..544ea862 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/user/subcommands/UserPromote.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/user/UserPromote.java @@ -20,7 +20,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands.user.subcommands; +package me.lucko.luckperms.common.commands.user; import com.google.common.base.Objects; import me.lucko.luckperms.api.Node; @@ -28,7 +28,13 @@ import me.lucko.luckperms.api.event.events.UserPromoteEvent; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.api.internal.TrackLink; import me.lucko.luckperms.common.api.internal.UserLink; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.ArgumentUtils; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.NodeFactory; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/user/subcommands/UserSetPrimaryGroup.java b/common/src/main/java/me/lucko/luckperms/common/commands/user/UserSetPrimaryGroup.java similarity index 91% rename from common/src/main/java/me/lucko/luckperms/common/commands/user/subcommands/UserSetPrimaryGroup.java rename to common/src/main/java/me/lucko/luckperms/common/commands/user/UserSetPrimaryGroup.java index f04b439c..939dfaa0 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/user/subcommands/UserSetPrimaryGroup.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/user/UserSetPrimaryGroup.java @@ -20,10 +20,14 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands.user.subcommands; +package me.lucko.luckperms.common.commands.user; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/usersbulkedit/subcommands/BulkEditGroup.java b/common/src/main/java/me/lucko/luckperms/common/commands/usersbulkedit/BulkEditGroup.java similarity index 94% rename from common/src/main/java/me/lucko/luckperms/common/commands/usersbulkedit/subcommands/BulkEditGroup.java rename to common/src/main/java/me/lucko/luckperms/common/commands/usersbulkedit/BulkEditGroup.java index b0aed941..4880de79 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/usersbulkedit/subcommands/BulkEditGroup.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/usersbulkedit/BulkEditGroup.java @@ -20,11 +20,15 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands.usersbulkedit.subcommands; +package me.lucko.luckperms.common.commands.usersbulkedit; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.NodeFactory; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/usersbulkedit/subcommands/BulkEditPermission.java b/common/src/main/java/me/lucko/luckperms/common/commands/usersbulkedit/BulkEditPermission.java similarity index 94% rename from common/src/main/java/me/lucko/luckperms/common/commands/usersbulkedit/subcommands/BulkEditPermission.java rename to common/src/main/java/me/lucko/luckperms/common/commands/usersbulkedit/BulkEditPermission.java index d741bc72..d39288b5 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/usersbulkedit/subcommands/BulkEditPermission.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/usersbulkedit/BulkEditPermission.java @@ -20,11 +20,15 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands.usersbulkedit.subcommands; +package me.lucko.luckperms.common.commands.usersbulkedit; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.Arg; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.NodeFactory; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/usersbulkedit/UsersBulkEditMainCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/usersbulkedit/UsersBulkEditMainCommand.java index eb30959d..050cea3e 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/usersbulkedit/UsersBulkEditMainCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/usersbulkedit/UsersBulkEditMainCommand.java @@ -26,9 +26,7 @@ import com.google.common.collect.ImmutableList; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.Command; import me.lucko.luckperms.common.commands.MainCommand; -import me.lucko.luckperms.common.commands.Sender; -import me.lucko.luckperms.common.commands.usersbulkedit.subcommands.BulkEditGroup; -import me.lucko.luckperms.common.commands.usersbulkedit.subcommands.BulkEditPermission; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.storage.Datastore; import java.util.Collections; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/ArgumentUtils.java b/common/src/main/java/me/lucko/luckperms/common/commands/utils/ArgumentUtils.java similarity index 97% rename from common/src/main/java/me/lucko/luckperms/common/commands/ArgumentUtils.java rename to common/src/main/java/me/lucko/luckperms/common/commands/utils/ArgumentUtils.java index 4e072dc6..775b0110 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/ArgumentUtils.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/utils/ArgumentUtils.java @@ -20,10 +20,11 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands; +package me.lucko.luckperms.common.commands.utils; import lombok.AllArgsConstructor; import lombok.Getter; +import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.utils.ArgumentChecker; import me.lucko.luckperms.common.utils.DateUtil; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/ContextHelper.java b/common/src/main/java/me/lucko/luckperms/common/commands/utils/ContextHelper.java similarity index 96% rename from common/src/main/java/me/lucko/luckperms/common/commands/ContextHelper.java rename to common/src/main/java/me/lucko/luckperms/common/commands/utils/ContextHelper.java index 8b93b4a9..241eb882 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/ContextHelper.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/utils/ContextHelper.java @@ -20,7 +20,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands; +package me.lucko.luckperms.common.commands.utils; /** * Utility used to help in commands that take arguments for different contexts diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/Util.java b/common/src/main/java/me/lucko/luckperms/common/commands/utils/Util.java similarity index 70% rename from common/src/main/java/me/lucko/luckperms/common/commands/Util.java rename to common/src/main/java/me/lucko/luckperms/common/commands/utils/Util.java index ad5ff60b..f593edcd 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/Util.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/utils/Util.java @@ -20,12 +20,13 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.commands; +package me.lucko.luckperms.common.commands.utils; import lombok.experimental.UtilityClass; import me.lucko.luckperms.api.LocalizedNode; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Tristate; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Patterns; import me.lucko.luckperms.common.utils.DateUtil; @@ -64,7 +65,6 @@ public class Util { } public static String translateAlternateColorCodes(char altColorChar, String textToTranslate) { - // Stolen from Bukkit :> char[] b = textToTranslate.toCharArray(); for (int i = 0; i < b.length - 1; ++i) { @@ -100,6 +100,99 @@ public class Util { sender.sendMessage(Util.color("&b" + node + ": " + formatTristate(t))); } + public static String getNodeContextDescription(Node node) { + StringBuilder sb = new StringBuilder(); + if (node.isServerSpecific()) { + sb.append(" ").append(contextToString("server", node.getServer().get())); + } + if (node.isWorldSpecific()) { + sb.append(" ").append(contextToString("world", node.getWorld().get())); + } + for (Map.Entry c : node.getContexts().toSet()) { + sb.append(" ").append(contextToString(c.getKey(), c.getValue())); + } + + return sb.toString(); + } + + public static String contextToString(String key, String value) { + return "&8(&7" + key + "=&f" + value + "&8)"; + } + + public static String permNodesToString(SortedSet nodes) { + StringBuilder sb = new StringBuilder(); + for (Node node : nodes) { + if (node.isTemporary()) continue; + + sb.append("&3> ") + .append(node.getValue() ? "&a" : "&c") + .append(node.getPermission()) + .append(getNodeContextDescription(node)) + .append("\n"); + } + return sb.length() == 0 ? "&3None" : sb.toString(); + } + + public static String tempNodesToString(SortedSet nodes) { + StringBuilder sb = new StringBuilder(); + for (Node node : nodes) { + if (!node.isTemporary()) continue; + + sb.append("&3> ") + .append(node.getValue() ? "&a" : "&c") + .append(node.getPermission()) + .append(getNodeContextDescription(node)) + .append("\n&2- expires in ") + .append(DateUtil.formatDateDiff(node.getExpiryUnixTime())) + .append("\n"); + } + return sb.length() == 0 ? "&3None" : sb.toString(); + } + + public static String permGroupsToString(SortedSet nodes) { + StringBuilder sb = new StringBuilder(); + for (Node node : nodes) { + if (!node.isGroupNode()) continue; + if (node.isTemporary()) continue; + + sb.append("&3> &f") + .append(node.getGroupName()) + .append(getNodeContextDescription(node)) + .append("\n"); + } + return sb.length() == 0 ? "&3None" : sb.toString(); + } + + public static String tempGroupsToString(SortedSet nodes) { + StringBuilder sb = new StringBuilder(); + for (Node node : nodes) { + if (!node.isGroupNode()) continue; + if (!node.isTemporary()) continue; + + sb.append("&3> &f") + .append(node.getGroupName()) + .append(getNodeContextDescription(node)) + .append("\n&2- expires in ") + .append(DateUtil.formatDateDiff(node.getExpiryUnixTime())) + .append("\n"); + } + return sb.length() == 0 ? "&3None" : sb.toString(); + } + + public static UUID parseUuid(String s) { + try { + return UUID.fromString(s); + } catch (IllegalArgumentException e) { + try { + return UUID.fromString(s.replaceAll( + "(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", + "$1-$2-$3-$4-$5")); + } catch (IllegalArgumentException e1) { + return null; + } + } + } + public static String listToCommaSep(List strings) { if (strings.isEmpty()) return "&bNone"; @@ -146,139 +239,7 @@ public class Util { return sb.delete(sb.length() - 6, sb.length()).toString(); } - public static String permNodesToString(SortedSet nodes) { - StringBuilder sb = new StringBuilder(); - for (Node node : nodes) { - if (node.isTemporary()) { - continue; - } - - sb.append("&3> ").append(node.getValue() ? "&a" : "&c"); - sb.append(node.getPermission()); - if (node.isServerSpecific()) { - sb.append(" &8(&7server=&f").append(node.getServer().get()).append("&8)"); - } - if (node.isWorldSpecific()) { - sb.append(" &8(&7world=&f").append(node.getWorld().get()).append("&8)"); - } - sb.append("\n"); - } - - if (sb.length() == 0) { - return "&3None"; - } - - return sb.toString(); - } - - public static String tempNodesToString(SortedSet nodes) { - StringBuilder sb = new StringBuilder(); - - for (Node node : nodes) { - if (!node.isTemporary()) { - continue; - } - - sb.append("&3> ").append(node.getValue() ? "&a" : "&c"); - sb.append(node.getPermission()); - if (node.isServerSpecific()) { - sb.append(" &8(&7server=&f").append(node.getServer().get()).append("&8)"); - } - if (node.isWorldSpecific()) { - sb.append(" &8(&7world=&f").append(node.getWorld().get()).append("&8)"); - } - - sb.append("\n&2- expires in ").append(DateUtil.formatDateDiff(node.getExpiryUnixTime())).append("\n"); - } - - if (sb.length() == 0) { - return "&3None"; - } - - return sb.toString(); - } - - public static String permGroupsToString(SortedSet nodes) { - StringBuilder sb = new StringBuilder(); - for (Node node : nodes) { - if (!node.isGroupNode()) { - continue; - } - - if (node.isTemporary()) { - continue; - } - - sb.append("&3> &f").append(node.getGroupName()); - if (node.isServerSpecific()) { - sb.append(" &8(&7server=&f").append(node.getServer().get()).append("&8)"); - } - if (node.isWorldSpecific()) { - sb.append(" &8(&7world=&f").append(node.getWorld().get()).append("&8)"); - } - sb.append("\n"); - } - - if (sb.length() == 0) { - return "&3None"; - } - - return sb.toString(); - } - - public static String tempGroupsToString(SortedSet nodes) { - StringBuilder sb = new StringBuilder(); - - for (Node node : nodes) { - if (!node.isGroupNode()) { - continue; - } - - if (!node.isTemporary()) { - continue; - } - - sb.append("&3> &f").append(node.getGroupName()); - if (node.isServerSpecific()) { - sb.append(" &8(&7server=&f").append(node.getServer().get()).append("&8)"); - } - if (node.isWorldSpecific()) { - sb.append(" &8(&7world=&f").append(node.getWorld().get()).append("&8)"); - } - - sb.append("\n&2- expires in ").append(DateUtil.formatDateDiff(node.getExpiryUnixTime())).append("\n"); - } - - if (sb.length() == 0) { - return "&3None"; - } - - return sb.toString(); - } - - public static UUID parseUuid(String s) { - try { - return UUID.fromString(s); - } catch (IllegalArgumentException e) { - try { - return UUID.fromString(s.replaceAll( - "(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", - "$1-$2-$3-$4-$5")); - } catch (IllegalArgumentException e1) { - return null; - } - } - } - - public static synchronized MetaComparator getMetaComparator() { - if (metaComparator == null) { - metaComparator = new MetaComparator(); - } - return metaComparator; - } - - - private static MetaComparator metaComparator = null; + public static final MetaComparator META_COMPARATOR = new MetaComparator(); public class MetaComparator implements Comparator> { @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/constants/Message.java b/common/src/main/java/me/lucko/luckperms/common/constants/Message.java index 15336113..d9c8465b 100644 --- a/common/src/main/java/me/lucko/luckperms/common/constants/Message.java +++ b/common/src/main/java/me/lucko/luckperms/common/constants/Message.java @@ -24,8 +24,8 @@ package me.lucko.luckperms.common.constants; import lombok.AllArgsConstructor; import lombok.Getter; -import me.lucko.luckperms.common.commands.Sender; -import me.lucko.luckperms.common.commands.Util; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.Util; @SuppressWarnings("SpellCheckingInspection") @AllArgsConstructor diff --git a/common/src/main/java/me/lucko/luckperms/common/constants/Permission.java b/common/src/main/java/me/lucko/luckperms/common/constants/Permission.java index a8769493..82a99a8e 100644 --- a/common/src/main/java/me/lucko/luckperms/common/constants/Permission.java +++ b/common/src/main/java/me/lucko/luckperms/common/constants/Permission.java @@ -25,7 +25,7 @@ package me.lucko.luckperms.common.constants; import com.google.common.collect.Sets; import lombok.AllArgsConstructor; import lombok.Getter; -import me.lucko.luckperms.common.commands.Sender; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.utils.ImmutableCollectors; import java.util.Set; diff --git a/common/src/main/java/me/lucko/luckperms/common/core/PermissionHolder.java b/common/src/main/java/me/lucko/luckperms/common/core/PermissionHolder.java index 9ee24653..3422be3d 100644 --- a/common/src/main/java/me/lucko/luckperms/common/core/PermissionHolder.java +++ b/common/src/main/java/me/lucko/luckperms/common/core/PermissionHolder.java @@ -39,7 +39,7 @@ import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.api.internal.GroupLink; import me.lucko.luckperms.common.api.internal.PermissionHolderLink; import me.lucko.luckperms.common.caching.MetaHolder; -import me.lucko.luckperms.common.commands.Util; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.groups.Group; import me.lucko.luckperms.common.utils.Cache; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; @@ -271,7 +271,7 @@ public abstract class PermissionHolder { !node.shouldApplyWithContext(contexts, false) ); - TreeSet> sortedParents = new TreeSet<>(Util.getMetaComparator().reversed()); + TreeSet> sortedParents = new TreeSet<>(Util.META_COMPARATOR.reversed()); Map weights = plugin.getConfiguration().getGroupWeights(); for (Node node : parents) { if (weights.containsKey(node.getGroupName().toLowerCase())) { @@ -349,7 +349,7 @@ public abstract class PermissionHolder { !node.shouldApplyWithContext(contexts, false) ); - TreeSet> sortedParents = new TreeSet<>(Util.getMetaComparator().reversed()); + TreeSet> sortedParents = new TreeSet<>(Util.META_COMPARATOR.reversed()); Map weights = plugin.getConfiguration().getGroupWeights(); for (Node node : parents) { if (weights.containsKey(node.getGroupName().toLowerCase())) { diff --git a/common/src/main/java/me/lucko/luckperms/common/data/Importer.java b/common/src/main/java/me/lucko/luckperms/common/data/Importer.java index 7087b82d..82653f66 100644 --- a/common/src/main/java/me/lucko/luckperms/common/data/Importer.java +++ b/common/src/main/java/me/lucko/luckperms/common/data/Importer.java @@ -29,8 +29,8 @@ import lombok.Setter; import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.commands.CommandManager; import me.lucko.luckperms.common.commands.CommandResult; -import me.lucko.luckperms.common.commands.Sender; -import me.lucko.luckperms.common.commands.Util; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Constants; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; diff --git a/common/src/main/java/me/lucko/luckperms/common/data/LogEntry.java b/common/src/main/java/me/lucko/luckperms/common/data/LogEntry.java index eec49cec..fec7786a 100644 --- a/common/src/main/java/me/lucko/luckperms/common/data/LogEntry.java +++ b/common/src/main/java/me/lucko/luckperms/common/data/LogEntry.java @@ -24,7 +24,7 @@ package me.lucko.luckperms.common.data; import me.lucko.luckperms.api.event.events.LogNotifyEvent; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.Sender; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/utils/DebugHandler.java b/common/src/main/java/me/lucko/luckperms/common/utils/DebugHandler.java index 12a8f018..6ea5d1fd 100644 --- a/common/src/main/java/me/lucko/luckperms/common/utils/DebugHandler.java +++ b/common/src/main/java/me/lucko/luckperms/common/utils/DebugHandler.java @@ -27,7 +27,7 @@ import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; import me.lucko.luckperms.api.Tristate; -import me.lucko.luckperms.common.commands.Sender; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.constants.Message; import java.util.List; diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java b/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java index 45a372bf..08edd3b0 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java @@ -32,7 +32,7 @@ import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.api.ApiProvider; import me.lucko.luckperms.common.calculators.CalculatorFactory; import me.lucko.luckperms.common.commands.ConsecutiveExecutor; -import me.lucko.luckperms.common.commands.Sender; +import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.config.LPConfiguration; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.contexts.ContextManager; diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeCommand.java b/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeCommand.java index 9d0fe436..d9aa60da 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeCommand.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeCommand.java @@ -26,7 +26,7 @@ import co.aikar.timings.Timing; import com.google.common.base.Splitter; import me.lucko.luckperms.api.data.Callback; import me.lucko.luckperms.common.commands.CommandManager; -import me.lucko.luckperms.common.commands.Util; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Patterns; import me.lucko.luckperms.sponge.timings.LPTiming; import org.spongepowered.api.command.CommandCallable; diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeSenderFactory.java b/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeSenderFactory.java index fd8d13f1..760bf14d 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeSenderFactory.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeSenderFactory.java @@ -23,7 +23,7 @@ package me.lucko.luckperms.sponge; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.SenderFactory; +import me.lucko.luckperms.common.commands.sender.SenderFactory; import me.lucko.luckperms.common.constants.Constants; import org.spongepowered.api.command.CommandSource; import org.spongepowered.api.entity.living.player.Player; diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/contexts/WorldCalculator.java b/sponge/src/main/java/me/lucko/luckperms/sponge/contexts/WorldCalculator.java index 88f9d928..f30f3aa6 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/contexts/WorldCalculator.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/contexts/WorldCalculator.java @@ -25,7 +25,7 @@ package me.lucko.luckperms.sponge.contexts; import lombok.RequiredArgsConstructor; import me.lucko.luckperms.api.context.ContextCalculator; import me.lucko.luckperms.api.context.MutableContextSet; -import me.lucko.luckperms.common.commands.Util; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.sponge.LPSpongePlugin; import org.spongepowered.api.entity.living.player.Player; import org.spongepowered.api.service.context.Context; diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/migration/MigrationPermissionsEx.java b/sponge/src/main/java/me/lucko/luckperms/sponge/migration/MigrationPermissionsEx.java index 2199d276..6b3985b9 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/migration/MigrationPermissionsEx.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/migration/MigrationPermissionsEx.java @@ -26,7 +26,11 @@ import me.lucko.luckperms.api.Logger; import me.lucko.luckperms.api.context.ContextSet; import me.lucko.luckperms.api.context.MutableContextSet; import me.lucko.luckperms.common.LuckPermsPlugin; -import me.lucko.luckperms.common.commands.*; +import me.lucko.luckperms.common.commands.CommandException; +import me.lucko.luckperms.common.commands.CommandResult; +import me.lucko.luckperms.common.commands.SubCommand; +import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.core.NodeBuilder; import me.lucko.luckperms.common.core.PermissionHolder; diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/service/collections/UserCollection.java b/sponge/src/main/java/me/lucko/luckperms/sponge/service/collections/UserCollection.java index 68d88e6c..cbb3a73b 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/service/collections/UserCollection.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/service/collections/UserCollection.java @@ -31,7 +31,7 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.UncheckedExecutionException; import lombok.NonNull; import me.lucko.luckperms.api.context.ContextSet; -import me.lucko.luckperms.common.commands.Util; +import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.users.User; import me.lucko.luckperms.common.users.UserManager; import me.lucko.luckperms.common.utils.ImmutableCollectors;