Refactor and cleanup commands

This commit is contained in:
Luck 2017-03-13 20:02:59 +00:00
parent dbc909a317
commit aa2941fcdb
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
115 changed files with 497 additions and 467 deletions

View File

@ -32,8 +32,8 @@ import de.bananaco.bpermissions.api.WorldManager;
import me.lucko.luckperms.api.event.cause.CreationCause; import me.lucko.luckperms.api.event.cause.CreationCause;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.migration.MigrationUtils; import me.lucko.luckperms.common.commands.impl.migration.MigrationUtils;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.NodeFactory;
import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;

View File

@ -27,8 +27,8 @@ import me.lucko.luckperms.api.event.cause.CreationCause;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.migration.MigrationUtils; import me.lucko.luckperms.common.commands.impl.migration.MigrationUtils;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.NodeFactory;

View File

@ -25,8 +25,8 @@ package me.lucko.luckperms.bukkit.migration;
import me.lucko.luckperms.api.event.cause.CreationCause; import me.lucko.luckperms.api.event.cause.CreationCause;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.migration.MigrationUtils; import me.lucko.luckperms.common.commands.impl.migration.MigrationUtils;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.NodeFactory;

View File

@ -35,8 +35,8 @@ import me.lucko.luckperms.api.event.cause.CreationCause;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.migration.MigrationUtils; import me.lucko.luckperms.common.commands.impl.migration.MigrationUtils;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.config.ConfigKeys; import me.lucko.luckperms.common.config.ConfigKeys;
import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.NodeFactory;

View File

@ -25,8 +25,8 @@ package me.lucko.luckperms.bukkit.migration;
import me.lucko.luckperms.api.event.cause.CreationCause; import me.lucko.luckperms.api.event.cause.CreationCause;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.migration.MigrationUtils; import me.lucko.luckperms.common.commands.impl.migration.MigrationUtils;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.NodeFactory;

View File

@ -25,8 +25,8 @@ package me.lucko.luckperms.bungee.migration;
import me.lucko.luckperms.api.event.cause.CreationCause; import me.lucko.luckperms.api.event.cause.CreationCause;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.migration.MigrationUtils; import me.lucko.luckperms.common.commands.impl.migration.MigrationUtils;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.NodeFactory;

View File

@ -1,42 +0,0 @@
/*
* Copyright (c) 2016 Lucko (Luck) <luck@lucko.me>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package me.lucko.luckperms.common.commands;
import me.lucko.luckperms.common.constants.Permission;
import java.util.List;
import java.util.function.Predicate;
public abstract class BaseCommand<T, S> extends Command<T, S> {
public BaseCommand(String name, String description, Permission permission, Predicate<Integer> argumentCheck, List<Arg> args, List<Command<S, ?>> children) {
super(name, description, permission, argumentCheck, args, children);
}
public abstract String getUsage();
public boolean shouldDisplay() {
return true;
}
}

View File

@ -26,29 +26,30 @@ import lombok.Getter;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import me.lucko.luckperms.common.commands.group.CreateGroup; import me.lucko.luckperms.common.commands.abstraction.Command;
import me.lucko.luckperms.common.commands.group.DeleteGroup; import me.lucko.luckperms.common.commands.impl.group.CreateGroup;
import me.lucko.luckperms.common.commands.group.GroupMainCommand; import me.lucko.luckperms.common.commands.impl.group.DeleteGroup;
import me.lucko.luckperms.common.commands.group.ListGroups; import me.lucko.luckperms.common.commands.impl.group.GroupMainCommand;
import me.lucko.luckperms.common.commands.log.LogMainCommand; import me.lucko.luckperms.common.commands.impl.group.ListGroups;
import me.lucko.luckperms.common.commands.migration.MigrationMainCommand; import me.lucko.luckperms.common.commands.impl.log.LogMainCommand;
import me.lucko.luckperms.common.commands.misc.CheckCommand; import me.lucko.luckperms.common.commands.impl.migration.MigrationMainCommand;
import me.lucko.luckperms.common.commands.misc.ExportCommand; import me.lucko.luckperms.common.commands.impl.misc.CheckCommand;
import me.lucko.luckperms.common.commands.misc.ImportCommand; import me.lucko.luckperms.common.commands.impl.misc.ExportCommand;
import me.lucko.luckperms.common.commands.misc.InfoCommand; import me.lucko.luckperms.common.commands.impl.misc.ImportCommand;
import me.lucko.luckperms.common.commands.misc.NetworkSyncCommand; import me.lucko.luckperms.common.commands.impl.misc.InfoCommand;
import me.lucko.luckperms.common.commands.misc.ReloadConfigCommand; import me.lucko.luckperms.common.commands.impl.misc.NetworkSyncCommand;
import me.lucko.luckperms.common.commands.misc.SearchCommand; import me.lucko.luckperms.common.commands.impl.misc.ReloadConfigCommand;
import me.lucko.luckperms.common.commands.misc.SyncCommand; import me.lucko.luckperms.common.commands.impl.misc.SearchCommand;
import me.lucko.luckperms.common.commands.misc.TreeCommand; import me.lucko.luckperms.common.commands.impl.misc.SyncCommand;
import me.lucko.luckperms.common.commands.misc.VerboseCommand; import me.lucko.luckperms.common.commands.impl.misc.TreeCommand;
import me.lucko.luckperms.common.commands.impl.misc.VerboseCommand;
import me.lucko.luckperms.common.commands.impl.track.CreateTrack;
import me.lucko.luckperms.common.commands.impl.track.DeleteTrack;
import me.lucko.luckperms.common.commands.impl.track.ListTracks;
import me.lucko.luckperms.common.commands.impl.track.TrackMainCommand;
import me.lucko.luckperms.common.commands.impl.user.UserMainCommand;
import me.lucko.luckperms.common.commands.impl.usersbulkedit.UsersBulkEditMainCommand;
import me.lucko.luckperms.common.commands.sender.Sender; 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.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
@ -75,14 +76,14 @@ public class CommandManager {
private final ExecutorService executor; private final ExecutorService executor;
@Getter @Getter
private final List<BaseCommand> mainCommands; private final List<Command> mainCommands;
public CommandManager(LuckPermsPlugin plugin) { public CommandManager(LuckPermsPlugin plugin) {
this.plugin = plugin; this.plugin = plugin;
this.executor = Executors.newSingleThreadExecutor(); this.executor = Executors.newSingleThreadExecutor();
ImmutableList.Builder<BaseCommand> l = ImmutableList.builder(); mainCommands = ImmutableList.<Command>builder()
l.add(new UserMainCommand()) .add(new UserMainCommand())
.add(new GroupMainCommand()) .add(new GroupMainCommand())
.add(new TrackMainCommand()) .add(new TrackMainCommand())
.addAll(plugin.getExtraCommands()) .addAll(plugin.getExtraCommands())
@ -104,9 +105,8 @@ public class CommandManager {
.add(new ListGroups()) .add(new ListGroups())
.add(new CreateTrack()) .add(new CreateTrack())
.add(new DeleteTrack()) .add(new DeleteTrack())
.add(new ListTracks()); .add(new ListTracks())
.build();
mainCommands = l.build();
} }
/** /**
@ -129,7 +129,7 @@ public class CommandManager {
} }
// Look for the main command. // Look for the main command.
Optional<BaseCommand> o = mainCommands.stream() Optional<Command> o = mainCommands.stream()
.filter(m -> m.getName().equalsIgnoreCase(args.get(0))) .filter(m -> m.getName().equalsIgnoreCase(args.get(0)))
.limit(1) .limit(1)
.findAny(); .findAny();
@ -226,19 +226,23 @@ public class CommandManager {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
String permission = (String) c.getPermission().map(p -> ((Permission) p).getExample()).orElse("None"); String permission = (String) c.getPermission().map(p -> ((Permission) p).getExample()).orElse("None");
FancyMessage msg = new FancyMessage("> ").color(ChatColor.getByChar('3')).then().text(String.format(c.getUsage(), label)).color(ChatColor.getByChar('a')) FancyMessage msg = new FancyMessage("> ").color(c('3')).then().text(String.format(c.getUsage(), label)).color(c('a'))
.formattedTooltip( .formattedTooltip(
new FancyMessage("Command: ").color(ChatColor.getByChar('b')).then().text(c.getName()).color(ChatColor.getByChar('2')), new FancyMessage("Command: ").color(c('b')).then().text(c.getName()).color(c('2')),
new FancyMessage("Description: ").color(ChatColor.getByChar('b')).then().text(c.getDescription()).color(ChatColor.getByChar('2')), new FancyMessage("Description: ").color(c('b')).then().text(c.getDescription()).color(c('2')),
new FancyMessage("Usage: ").color(ChatColor.getByChar('b')).then().text(String.format(c.getUsage(), label)).color(ChatColor.getByChar('2')), new FancyMessage("Usage: ").color(c('b')).then().text(String.format(c.getUsage(), label)).color(c('2')),
new FancyMessage("Permission: ").color(ChatColor.getByChar('b')).then().text(permission).color(ChatColor.getByChar('2')), new FancyMessage("Permission: ").color(c('b')).then().text(permission).color(c('2')),
new FancyMessage(" "), new FancyMessage(" "),
new FancyMessage("Click to auto-complete.").color(ChatColor.getByChar('7')) new FancyMessage("Click to auto-complete.").color(c('7'))
) )
.suggest(String.format(c.getUsage(), label)); .suggest(String.format(c.getUsage(), label));
sender.sendMessage(msg); sender.sendMessage(msg);
}); });
} }
private static ChatColor c(char c) {
return ChatColor.getByChar(c);
}
public static CommandResult handleException(CommandException e, Sender sender, String label, Command command) { public static CommandResult handleException(CommandException e, Sender sender, String label, Command command) {
if (e instanceof ArgumentUtils.ArgumentException) { if (e instanceof ArgumentUtils.ArgumentException) {
@ -392,9 +396,9 @@ public class CommandManager {
// Provide lazy set rewrite // Provide lazy set rewrite
boolean lazySet = ( boolean lazySet = (
args.size() >= 6 && args.size() >= 6 &&
args.get(2).equalsIgnoreCase("permission") && args.get(2).equalsIgnoreCase("permission") &&
args.get(3).toLowerCase().startsWith("set") && args.get(3).toLowerCase().startsWith("set") &&
(args.get(5).equalsIgnoreCase("none") || args.get(5).equalsIgnoreCase("0")) (args.get(5).equalsIgnoreCase("none") || args.get(5).equalsIgnoreCase("0"))
); );
if (lazySet) { if (lazySet) {

View File

@ -20,12 +20,15 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands; package me.lucko.luckperms.common.commands.abstraction;
import lombok.Getter; import lombok.Getter;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
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.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
@ -35,24 +38,46 @@ import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.function.Predicate; import java.util.function.Predicate;
/**
* An abstract command class
*
* @param <T> the type required by the {@link #execute(LuckPermsPlugin, Sender, Object, List, String)} method of this command
* @param <S> the type of any child commands
*/
public abstract class Command<T, S> { public abstract class Command<T, S> {
/**
* The name of the command. Should be properly capitalised.
*/
@Getter @Getter
private final String name; private final String name;
/**
* A brief description of this command
*/
@Getter @Getter
private final String description; private final String description;
// Could be null /**
* The permission required to use this command. Nullable.
*/
private final Permission permission; private final Permission permission;
/**
* A predicate used for testing the size of the arguments list passed to this command
*/
@Getter @Getter
private final Predicate<Integer> argumentCheck; private final Predicate<Integer> argumentCheck;
// Could be null /**
* A list of arguments required for the command. These are just here for informational purposes, and aren't used
* for argument validation.
*/
private final List<Arg> args; private final List<Arg> args;
// Could be null /**
* Child commands. Nullable.
*/
private final List<Command<S, ?>> children; private final List<Command<S, ?>> children;
public Command(String name, String description, Permission permission, Predicate<Integer> argumentCheck, List<Arg> args, List<Command<S, ?>> children) { public Command(String name, String description, Permission permission, Predicate<Integer> argumentCheck, List<Arg> args, List<Command<S, ?>> children) {
@ -78,14 +103,56 @@ public abstract class Command<T, S> {
return Collections.emptyList(); return Collections.emptyList();
} }
/**
* Sends a brief command usage message to the Sender.
* If this command has child commands, the children are listed. Otherwise, a basic usage message is sent.
*
* @param sender the sender to send the usage to
* @param label the label used when executing the command
*/
public abstract void sendUsage(Sender sender, String label); public abstract void sendUsage(Sender sender, String label);
/**
* Sends a detailed command usage message to the Sender.
* If this command has child commands, nothing is sent. Otherwise, a detailed messaging containing a description
* and argument usage is sent.
*
* @param sender the sender to send the usage to
* @param label the label used when executing the command
*/
public abstract void sendDetailedUsage(Sender sender, String label); public abstract void sendDetailedUsage(Sender sender, String label);
/**
* Returns true if the sender is authorised to use this command
*
* Commands with children are likely to override this method to check for permissions based upon whether
* a sender has access to any sub commands.
*
* @param sender the sender
* @return true if the sender has permission to use this command
*/
public boolean isAuthorized(Sender sender) { public boolean isAuthorized(Sender sender) {
return permission == null || permission.isAuthorized(sender); return permission == null || permission.isAuthorized(sender);
} }
/**
* Returns if this command should be displayed in command listings, or "hidden"
*
* @return if this command should be displayed in command listings, or "hidden"
*/
public boolean shouldDisplay() {
return true;
}
/**
* Returns the usage of this command. Will only return a non empty result for main commands.
*
* @return the usage of this command.
*/
public String getUsage() {
return "";
}
public Optional<Permission> getPermission() { public Optional<Permission> getPermission() {
return Optional.ofNullable(permission); return Optional.ofNullable(permission);
} }

View File

@ -20,10 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands; package me.lucko.luckperms.common.commands.abstraction;
import lombok.Getter; import lombok.Getter;
import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandManager;
import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
@ -36,7 +39,7 @@ import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
public abstract class MainCommand<T> extends BaseCommand<Void, T> { public abstract class MainCommand<T> extends Command<Void, T> {
@Getter @Getter
private final String usage; private final String usage;
@ -55,7 +58,7 @@ public abstract class MainCommand<T> extends BaseCommand<Void, T> {
return CommandResult.INVALID_ARGS; return CommandResult.INVALID_ARGS;
} }
Optional<Command<T, ?>> o = getSubCommands().stream() Optional<Command<T, ?>> o = getChildren().get().stream()
.filter(s -> s.getName().equalsIgnoreCase(args.get(minArgs - 1))) .filter(s -> s.getName().equalsIgnoreCase(args.get(minArgs - 1)))
.limit(1) .limit(1)
.findAny(); .findAny();
@ -112,7 +115,7 @@ public abstract class MainCommand<T> extends BaseCommand<Void, T> {
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
final List<Command<T, ?>> subs = getSubCommands().stream() final List<Command<T, ?>> subs = getChildren().get().stream()
.filter(s -> s.isAuthorized(sender)) .filter(s -> s.isAuthorized(sender))
.collect(Collectors.toList()); .collect(Collectors.toList());
@ -149,7 +152,7 @@ public abstract class MainCommand<T> extends BaseCommand<Void, T> {
@Override @Override
public void sendUsage(Sender sender, String label) { public void sendUsage(Sender sender, String label) {
List<Command> subs = getSubCommands().stream() List<Command> subs = getChildren().get().stream()
.filter(s -> s.isAuthorized(sender)) .filter(s -> s.isAuthorized(sender))
.collect(Collectors.toList()); .collect(Collectors.toList());
@ -172,19 +175,11 @@ public abstract class MainCommand<T> extends BaseCommand<Void, T> {
@Override @Override
public boolean isAuthorized(Sender sender) { public boolean isAuthorized(Sender sender) {
return getSubCommands().stream().filter(sc -> sc.isAuthorized(sender)).count() != 0; return getChildren().get().stream().filter(sc -> sc.isAuthorized(sender)).count() != 0;
} }
@SuppressWarnings("DeprecatedIsStillUsed")
@Deprecated
@Override @Override
public Optional<List<Command<T, ?>>> getChildren() { public Optional<List<Command<T, ?>>> getChildren() {
return super.getChildren(); return super.getChildren();
} }
@SuppressWarnings("deprecation")
public List<Command<T, ?>> getSubCommands() {
return getChildren().get();
}
} }

View File

@ -20,11 +20,10 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic; package me.lucko.luckperms.common.commands.abstraction;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; 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.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
@ -39,46 +38,18 @@ import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/**
* A shared main command. Shared meaning it can apply to both users and groups.
* This extends sub command as they're actually sub commands of the main user/group commands.
* @param <T>
*/
public class SharedMainCommand<T extends PermissionHolder> extends SubCommand<T> { public class SharedMainCommand<T extends PermissionHolder> extends SubCommand<T> {
private static CommandResult handleException(CommandException e, Sender sender, SharedSubCommand command) {
if (e instanceof ArgumentUtils.ArgumentException) {
if (e instanceof ArgumentUtils.DetailedUsageException) {
command.sendDetailedUsage(sender);
return CommandResult.INVALID_ARGS;
}
if (e instanceof ArgumentUtils.UseInheritException) {
Message.USE_INHERIT_COMMAND.send(sender);
return CommandResult.INVALID_ARGS;
}
if (e instanceof ArgumentUtils.InvalidServerException) {
Message.SERVER_INVALID_ENTRY.send(sender);
return CommandResult.INVALID_ARGS;
}
if (e instanceof ArgumentUtils.PastDateException) {
Message.PAST_DATE_ERROR.send(sender);
return CommandResult.INVALID_ARGS;
}
if (e instanceof ArgumentUtils.InvalidDateException) {
Message.ILLEGAL_DATE_ERROR.send(sender, ((ArgumentUtils.InvalidDateException) e).getInvalidDate());
return CommandResult.INVALID_ARGS;
}
if (e instanceof ArgumentUtils.InvalidPriorityException) {
Message.META_INVALID_PRIORITY.send(sender, ((ArgumentUtils.InvalidPriorityException) e).getInvalidPriority());
return CommandResult.INVALID_ARGS;
}
}
// Not something we can catch.
e.printStackTrace();
return CommandResult.FAILURE;
}
private final List<SharedSubCommand> secondaryCommands; private final List<SharedSubCommand> secondaryCommands;
/**
* If this instance of the shared command is targeting a user. Otherwise, it targets a group.
*/
private boolean user; private boolean user;
public SharedMainCommand(String name, String description, boolean user, List<SharedSubCommand> secondaryCommands) { public SharedMainCommand(String name, String description, boolean user, List<SharedSubCommand> secondaryCommands) {
@ -162,12 +133,7 @@ public class SharedMainCommand<T extends PermissionHolder> extends SubCommand<T>
@Override @Override
public boolean isAuthorized(Sender sender) { public boolean isAuthorized(Sender sender) {
for (SharedSubCommand subCommand : secondaryCommands) { return secondaryCommands.stream().filter(sc -> sc.isAuthorized(sender, user)).count() != 0;
if (subCommand.isAuthorized(sender, user)) {
return true;
}
}
return false;
} }
private void sendUsageDetailed(Sender sender, boolean user, String label) { private void sendUsageDetailed(Sender sender, boolean user, String label) {
@ -190,4 +156,42 @@ public class SharedMainCommand<T extends PermissionHolder> extends SubCommand<T>
Message.COMMAND_NO_PERMISSION.send(sender); Message.COMMAND_NO_PERMISSION.send(sender);
} }
} }
private static CommandResult handleException(CommandException e, Sender sender, SharedSubCommand command) {
if (e instanceof ArgumentUtils.ArgumentException) {
if (e instanceof ArgumentUtils.DetailedUsageException) {
command.sendDetailedUsage(sender);
return CommandResult.INVALID_ARGS;
}
if (e instanceof ArgumentUtils.UseInheritException) {
Message.USE_INHERIT_COMMAND.send(sender);
return CommandResult.INVALID_ARGS;
}
if (e instanceof ArgumentUtils.InvalidServerException) {
Message.SERVER_INVALID_ENTRY.send(sender);
return CommandResult.INVALID_ARGS;
}
if (e instanceof ArgumentUtils.PastDateException) {
Message.PAST_DATE_ERROR.send(sender);
return CommandResult.INVALID_ARGS;
}
if (e instanceof ArgumentUtils.InvalidDateException) {
Message.ILLEGAL_DATE_ERROR.send(sender, ((ArgumentUtils.InvalidDateException) e).getInvalidDate());
return CommandResult.INVALID_ARGS;
}
if (e instanceof ArgumentUtils.InvalidPriorityException) {
Message.META_INVALID_PRIORITY.send(sender, ((ArgumentUtils.InvalidPriorityException) e).getInvalidPriority());
return CommandResult.INVALID_ARGS;
}
}
// Not something we can catch.
e.printStackTrace();
return CommandResult.FAILURE;
}
} }

View File

@ -20,7 +20,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic; package me.lucko.luckperms.common.commands.abstraction;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
@ -30,7 +30,6 @@ import com.google.common.collect.ImmutableList;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; 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.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
@ -43,39 +42,30 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.function.Predicate; import java.util.function.Predicate;
/**
* A sub command which can be be applied to both groups and users.
* This doesn't extend the other Command or SubCommand classes to avoid generics hell.
*/
@Getter @Getter
@AllArgsConstructor @AllArgsConstructor
public abstract class SharedSubCommand { public abstract class SharedSubCommand {
protected static void save(PermissionHolder holder, Sender sender, LuckPermsPlugin plugin) {
if (holder instanceof User) {
User user = ((User) holder);
SubCommand.save(user, sender, plugin);
return;
}
if (holder instanceof Group) {
Group group = ((Group) holder);
SubCommand.save(group, sender, plugin);
return;
}
throw new IllegalArgumentException();
}
/** /**
* The name of the sub command * The name of the sub command
*/ */
private final String name; private final String name;
/** /**
* A brief description of what the sub command does * A brief description of what the sub command does
*/ */
private final String description; private final String description;
/** /**
* The permission needed to use this command * The permission needed to use this command
*/ */
private final Permission userPermission; private final Permission userPermission;
private final Permission groupPermission; private final Permission groupPermission;
/** /**
* Predicate to test if the argument length given is invalid * Predicate to test if the argument length given is invalid
*/ */
@ -115,4 +105,20 @@ public abstract class SharedSubCommand {
return user ? userPermission.isAuthorized(sender) : groupPermission.isAuthorized(sender); return user ? userPermission.isAuthorized(sender) : groupPermission.isAuthorized(sender);
} }
protected static void save(PermissionHolder holder, Sender sender, LuckPermsPlugin plugin) {
if (holder instanceof User) {
User user = ((User) holder);
SubCommand.save(user, sender, plugin);
return;
}
if (holder instanceof Group) {
Group group = ((Group) holder);
SubCommand.save(group, sender, plugin);
return;
}
throw new IllegalArgumentException();
}
} }

View File

@ -20,10 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands; package me.lucko.luckperms.common.commands.abstraction;
import lombok.Getter; import lombok.Getter;
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.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
@ -32,7 +35,10 @@ import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
import java.util.List; import java.util.List;
import java.util.function.Predicate; import java.util.function.Predicate;
public abstract class SingleCommand extends BaseCommand<Void, Void> { /**
* Represents a single "main" command (one without any children)
*/
public abstract class SingleCommand extends Command<Void, Void> {
@Getter @Getter
private final String usage; private final String usage;

View File

@ -20,12 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands; package me.lucko.luckperms.common.commands.abstraction;
import lombok.Getter; import lombok.Getter;
import com.google.common.base.Splitter; import com.google.common.base.Splitter;
import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
@ -51,6 +52,42 @@ import java.util.stream.Collectors;
@Getter @Getter
public abstract class SubCommand<T> extends Command<T, Void> { public abstract class SubCommand<T> extends Command<T, Void> {
public SubCommand(String name, String description, Permission permission, Predicate<Integer> argumentCheck, List<Arg> args) {
super(name, description, permission, argumentCheck, args);
}
/**
* Send the command usage to a sender
*
* @param sender the sender to send the usage to
*/
@Override
public void sendUsage(Sender sender, String label) {
StringBuilder sb = new StringBuilder();
if (getArgs().isPresent()) {
sb.append("&3 - &7");
for (Arg arg : getArgs().get()) {
sb.append(arg.asPrettyString()).append(" ");
}
}
Util.sendPluginMessage(sender, "&3> &a" + getName().toLowerCase() + sb.toString());
}
@Override
public void sendDetailedUsage(Sender sender, String label) {
Util.sendPluginMessage(sender, "&3&lCommand Usage &3- &b" + getName());
Util.sendPluginMessage(sender, "&b> &7" + getDescription());
if (getArgs().isPresent()) {
Util.sendPluginMessage(sender, "&3Arguments:");
for (Arg arg : getArgs().get()) {
Util.sendPluginMessage(sender, "&b- " + arg.asPrettyString() + "&3 -> &7" + arg.getDescription());
}
}
}
/* Utility methods used by #tabComplete and #execute implementations in sub classes */
public static List<String> getGroupTabComplete(List<String> args, LuckPermsPlugin plugin) { public static List<String> getGroupTabComplete(List<String> args, LuckPermsPlugin plugin) {
return getTabComplete(new ArrayList<>(plugin.getGroupManager().getAll().keySet()), args); return getTabComplete(new ArrayList<>(plugin.getGroupManager().getAll().keySet()), args);
} }
@ -67,13 +104,6 @@ public abstract class SubCommand<T> extends Command<T, Void> {
} }
} }
/*
* ----------------------------------------------------------------------------------
* Utility methods used by #tabComplete and #execute implementations in sub classes
* ----------------------------------------------------------------------------------
*/
public static List<String> getPermissionTabComplete(List<String> args, PermissionVault cache) { public static List<String> getPermissionTabComplete(List<String> args, PermissionVault cache) {
if (args.size() <= 1) { if (args.size() <= 1) {
if (args.isEmpty() || args.get(0).equals("")) { if (args.isEmpty() || args.get(0).equals("")) {
@ -167,38 +197,4 @@ public abstract class SubCommand<T> extends Command<T, Void> {
Message.TRACK_SAVE_ERROR.send(sender); Message.TRACK_SAVE_ERROR.send(sender);
} }
} }
public SubCommand(String name, String description, Permission permission, Predicate<Integer> argumentCheck, List<Arg> args) {
super(name, description, permission, argumentCheck, args);
}
/**
* Send the command usage to a sender
*
* @param sender the sender to send the usage to
*/
@Override
public void sendUsage(Sender sender, String label) {
StringBuilder sb = new StringBuilder();
if (getArgs().isPresent()) {
sb.append("&3 - &7");
for (Arg arg : getArgs().get()) {
sb.append(arg.asPrettyString()).append(" ");
}
}
Util.sendPluginMessage(sender, "&3> &a" + getName().toLowerCase() + sb.toString());
}
@Override
public void sendDetailedUsage(Sender sender, String label) {
Util.sendPluginMessage(sender, "&3&lCommand Usage &3- &b" + getName());
Util.sendPluginMessage(sender, "&b> &7" + getDescription());
if (getArgs().isPresent()) {
Util.sendPluginMessage(sender, "&3Arguments:");
for (Arg arg : getArgs().get()) {
Util.sendPluginMessage(sender, "&b- " + arg.asPrettyString() + "&3 -> &7" + arg.getDescription());
}
}
}
} }

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.meta; package me.lucko.luckperms.common.commands.impl.generic.meta;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import me.lucko.luckperms.common.commands.generic.SharedMainCommand; import me.lucko.luckperms.common.commands.abstraction.SharedMainCommand;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
public class CommandMeta<T extends PermissionHolder> extends SharedMainCommand<T> { public class CommandMeta<T extends PermissionHolder> extends SharedMainCommand<T> {

View File

@ -20,13 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.meta; package me.lucko.luckperms.common.commands.impl.generic.meta;
import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.api.MetaUtils;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;

View File

@ -20,13 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.meta; package me.lucko.luckperms.common.commands.impl.generic.meta;
import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.api.MetaUtils;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;

View File

@ -20,13 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.meta; package me.lucko.luckperms.common.commands.impl.generic.meta;
import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.api.MetaUtils;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;

View File

@ -20,13 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.meta; package me.lucko.luckperms.common.commands.impl.generic.meta;
import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.api.MetaUtils;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.meta; package me.lucko.luckperms.common.commands.impl.generic.meta;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;

View File

@ -20,13 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.meta; package me.lucko.luckperms.common.commands.impl.generic.meta;
import me.lucko.luckperms.api.Contexts; import me.lucko.luckperms.api.Contexts;
import me.lucko.luckperms.api.LocalizedNode; import me.lucko.luckperms.api.LocalizedNode;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;

View File

@ -20,14 +20,14 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.meta; package me.lucko.luckperms.common.commands.impl.generic.meta;
import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.api.MetaUtils;
import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Node;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;

View File

@ -20,14 +20,14 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.meta; package me.lucko.luckperms.common.commands.impl.generic.meta;
import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.api.MetaUtils;
import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Node;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;

View File

@ -20,14 +20,14 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.meta; package me.lucko.luckperms.common.commands.impl.generic.meta;
import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.api.MetaUtils;
import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Node;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;

View File

@ -20,14 +20,14 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.meta; package me.lucko.luckperms.common.commands.impl.generic.meta;
import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.api.MetaUtils;
import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Node;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;

View File

@ -20,13 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.meta; package me.lucko.luckperms.common.commands.impl.generic.meta;
import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Node;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;

View File

@ -20,13 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.meta; package me.lucko.luckperms.common.commands.impl.generic.meta;
import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Node;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.meta; package me.lucko.luckperms.common.commands.impl.generic.meta;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.meta; package me.lucko.luckperms.common.commands.impl.generic.meta;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.other; package me.lucko.luckperms.common.commands.impl.generic.other;
import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Node;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.parent; package me.lucko.luckperms.common.commands.impl.generic.parent;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import me.lucko.luckperms.common.commands.generic.SharedMainCommand; import me.lucko.luckperms.common.commands.abstraction.SharedMainCommand;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
public class CommandParent<T extends PermissionHolder> extends SharedMainCommand<T> { public class CommandParent<T extends PermissionHolder> extends SharedMainCommand<T> {

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.parent; package me.lucko.luckperms.common.commands.impl.generic.parent;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
@ -41,7 +41,7 @@ import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static me.lucko.luckperms.common.commands.SubCommand.getGroupTabComplete; import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getGroupTabComplete;
public class ParentAdd extends SharedSubCommand { public class ParentAdd extends SharedSubCommand {
public ParentAdd() { public ParentAdd() {

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.parent; package me.lucko.luckperms.common.commands.impl.generic.parent;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
@ -45,7 +45,7 @@ import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static me.lucko.luckperms.common.commands.SubCommand.getGroupTabComplete; import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getGroupTabComplete;
public class ParentAddTemp extends SharedSubCommand { public class ParentAddTemp extends SharedSubCommand {
public ParentAddTemp() { public ParentAddTemp() {

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.parent; package me.lucko.luckperms.common.commands.impl.generic.parent;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;

View File

@ -20,11 +20,11 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.parent; package me.lucko.luckperms.common.commands.impl.generic.parent;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.parent; package me.lucko.luckperms.common.commands.impl.generic.parent;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
@ -41,7 +41,7 @@ import me.lucko.luckperms.exceptions.ObjectLacksException;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static me.lucko.luckperms.common.commands.SubCommand.getGroupTabComplete; import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getGroupTabComplete;
public class ParentRemove extends SharedSubCommand { public class ParentRemove extends SharedSubCommand {
public ParentRemove() { public ParentRemove() {

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.parent; package me.lucko.luckperms.common.commands.impl.generic.parent;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
@ -40,7 +40,7 @@ import me.lucko.luckperms.exceptions.ObjectLacksException;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static me.lucko.luckperms.common.commands.SubCommand.getGroupTabComplete; import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getGroupTabComplete;
public class ParentRemoveTemp extends SharedSubCommand { public class ParentRemoveTemp extends SharedSubCommand {
public ParentRemoveTemp() { public ParentRemoveTemp() {

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.parent; package me.lucko.luckperms.common.commands.impl.generic.parent;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
@ -42,7 +42,7 @@ import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static me.lucko.luckperms.common.commands.SubCommand.getGroupTabComplete; import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getGroupTabComplete;
public class ParentSet extends SharedSubCommand { public class ParentSet extends SharedSubCommand {
public ParentSet() { public ParentSet() {

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.permission; package me.lucko.luckperms.common.commands.impl.generic.permission;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import me.lucko.luckperms.common.commands.generic.SharedMainCommand; import me.lucko.luckperms.common.commands.abstraction.SharedMainCommand;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
public class CommandPermission<T extends PermissionHolder> extends SharedMainCommand<T> { public class CommandPermission<T extends PermissionHolder> extends SharedMainCommand<T> {

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.permission; package me.lucko.luckperms.common.commands.impl.generic.permission;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
@ -38,7 +38,7 @@ import me.lucko.luckperms.common.utils.Predicates;
import java.util.List; import java.util.List;
import static me.lucko.luckperms.common.commands.SubCommand.getPermissionTabComplete; import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getPermissionTabComplete;
public class PermissionCheck extends SharedSubCommand { public class PermissionCheck extends SharedSubCommand {
public PermissionCheck() { public PermissionCheck() {

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.permission; package me.lucko.luckperms.common.commands.impl.generic.permission;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
@ -39,7 +39,7 @@ import me.lucko.luckperms.common.utils.Predicates;
import java.util.List; import java.util.List;
import static me.lucko.luckperms.common.commands.SubCommand.getPermissionTabComplete; import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getPermissionTabComplete;
public class PermissionCheckInherits extends SharedSubCommand { public class PermissionCheckInherits extends SharedSubCommand {
public PermissionCheckInherits() { public PermissionCheckInherits() {

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.permission; package me.lucko.luckperms.common.commands.impl.generic.permission;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.permission; package me.lucko.luckperms.common.commands.impl.generic.permission;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
@ -40,8 +40,8 @@ import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static me.lucko.luckperms.common.commands.SubCommand.getBoolTabComplete; import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getBoolTabComplete;
import static me.lucko.luckperms.common.commands.SubCommand.getPermissionTabComplete; import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getPermissionTabComplete;
public class PermissionSet extends SharedSubCommand { public class PermissionSet extends SharedSubCommand {
public PermissionSet() { public PermissionSet() {

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.permission; package me.lucko.luckperms.common.commands.impl.generic.permission;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
@ -44,8 +44,8 @@ import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static me.lucko.luckperms.common.commands.SubCommand.getBoolTabComplete; import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getBoolTabComplete;
import static me.lucko.luckperms.common.commands.SubCommand.getPermissionTabComplete; import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getPermissionTabComplete;
public class PermissionSetTemp extends SharedSubCommand { public class PermissionSetTemp extends SharedSubCommand {
public PermissionSetTemp() { public PermissionSetTemp() {

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.permission; package me.lucko.luckperms.common.commands.impl.generic.permission;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.generic.permission; package me.lucko.luckperms.common.commands.impl.generic.permission;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.group; package me.lucko.luckperms.common.commands.impl.group;
import me.lucko.luckperms.api.event.cause.CreationCause; import me.lucko.luckperms.api.event.cause.CreationCause;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SingleCommand; import me.lucko.luckperms.common.commands.abstraction.SingleCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.group; package me.lucko.luckperms.common.commands.impl.group;
import me.lucko.luckperms.api.event.cause.DeletionCause; import me.lucko.luckperms.api.event.cause.DeletionCause;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SingleCommand; import me.lucko.luckperms.common.commands.abstraction.SingleCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.config.ConfigKeys; import me.lucko.luckperms.common.config.ConfigKeys;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;

View File

@ -20,13 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.group; package me.lucko.luckperms.common.commands.impl.group;
import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Node;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.group; package me.lucko.luckperms.common.commands.impl.group;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;

View File

@ -20,13 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.group; package me.lucko.luckperms.common.commands.impl.group;
import me.lucko.luckperms.api.event.cause.CreationCause; import me.lucko.luckperms.api.event.cause.CreationCause;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.group; package me.lucko.luckperms.common.commands.impl.group;
import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Node;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;

View File

@ -20,16 +20,16 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.group; package me.lucko.luckperms.common.commands.impl.group;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import me.lucko.luckperms.common.commands.Command; import me.lucko.luckperms.common.commands.abstraction.Command;
import me.lucko.luckperms.common.commands.MainCommand; import me.lucko.luckperms.common.commands.abstraction.MainCommand;
import me.lucko.luckperms.common.commands.generic.meta.CommandMeta; import me.lucko.luckperms.common.commands.impl.generic.meta.CommandMeta;
import me.lucko.luckperms.common.commands.generic.other.HolderShowTracks; import me.lucko.luckperms.common.commands.impl.generic.other.HolderShowTracks;
import me.lucko.luckperms.common.commands.generic.parent.CommandParent; import me.lucko.luckperms.common.commands.impl.generic.parent.CommandParent;
import me.lucko.luckperms.common.commands.generic.permission.CommandPermission; import me.lucko.luckperms.common.commands.impl.generic.permission.CommandPermission;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.core.model.Group; import me.lucko.luckperms.common.core.model.Group;

View File

@ -20,14 +20,14 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.group; package me.lucko.luckperms.common.commands.impl.group;
import me.lucko.luckperms.api.event.cause.CreationCause; import me.lucko.luckperms.api.event.cause.CreationCause;
import me.lucko.luckperms.api.event.cause.DeletionCause; import me.lucko.luckperms.api.event.cause.DeletionCause;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,13 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.group; package me.lucko.luckperms.common.commands.impl.group;
import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Node;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;

View File

@ -20,10 +20,10 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.group; package me.lucko.luckperms.common.commands.impl.group;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SingleCommand; import me.lucko.luckperms.common.commands.abstraction.SingleCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;

View File

@ -20,19 +20,19 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.log; package me.lucko.luckperms.common.commands.impl.log;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import me.lucko.luckperms.common.commands.Command; import me.lucko.luckperms.common.commands.abstraction.Command;
import me.lucko.luckperms.common.commands.MainCommand; import me.lucko.luckperms.common.commands.abstraction.MainCommand;
import me.lucko.luckperms.common.commands.log.subcommands.LogExport; import me.lucko.luckperms.common.commands.impl.log.subcommands.LogExport;
import me.lucko.luckperms.common.commands.log.subcommands.LogGroupHistory; import me.lucko.luckperms.common.commands.impl.log.subcommands.LogGroupHistory;
import me.lucko.luckperms.common.commands.log.subcommands.LogNotify; import me.lucko.luckperms.common.commands.impl.log.subcommands.LogNotify;
import me.lucko.luckperms.common.commands.log.subcommands.LogRecent; import me.lucko.luckperms.common.commands.impl.log.subcommands.LogRecent;
import me.lucko.luckperms.common.commands.log.subcommands.LogSearch; import me.lucko.luckperms.common.commands.impl.log.subcommands.LogSearch;
import me.lucko.luckperms.common.commands.log.subcommands.LogTrackHistory; import me.lucko.luckperms.common.commands.impl.log.subcommands.LogTrackHistory;
import me.lucko.luckperms.common.commands.log.subcommands.LogUserHistory; import me.lucko.luckperms.common.commands.impl.log.subcommands.LogUserHistory;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.data.Log; import me.lucko.luckperms.common.data.Log;
@ -80,7 +80,7 @@ public class LogMainCommand extends MainCommand<Log> {
@Override @Override
public List<String> tabComplete(LuckPermsPlugin plugin, Sender sender, List<String> args) { public List<String> tabComplete(LuckPermsPlugin plugin, Sender sender, List<String> args) {
final List<Command<Log, ?>> subs = getSubCommands().stream() final List<Command<Log, ?>> subs = getChildren().get().stream()
.filter(s -> s.isAuthorized(sender)) .filter(s -> s.isAuthorized(sender))
.collect(Collectors.toList()); .collect(Collectors.toList());

View File

@ -20,13 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.log.subcommands; package me.lucko.luckperms.common.commands.impl.log.subcommands;
import me.lucko.luckperms.api.LogEntry; import me.lucko.luckperms.api.LogEntry;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,13 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.log.subcommands; package me.lucko.luckperms.common.commands.impl.log.subcommands;
import me.lucko.luckperms.api.LogEntry; import me.lucko.luckperms.api.LogEntry;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.log.subcommands; package me.lucko.luckperms.common.commands.impl.log.subcommands;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,13 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.log.subcommands; package me.lucko.luckperms.common.commands.impl.log.subcommands;
import me.lucko.luckperms.api.LogEntry; import me.lucko.luckperms.api.LogEntry;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;

View File

@ -20,13 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.log.subcommands; package me.lucko.luckperms.common.commands.impl.log.subcommands;
import me.lucko.luckperms.api.LogEntry; import me.lucko.luckperms.api.LogEntry;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,13 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.log.subcommands; package me.lucko.luckperms.common.commands.impl.log.subcommands;
import me.lucko.luckperms.api.LogEntry; import me.lucko.luckperms.api.LogEntry;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,13 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.log.subcommands; package me.lucko.luckperms.common.commands.impl.log.subcommands;
import me.lucko.luckperms.api.LogEntry; import me.lucko.luckperms.api.LogEntry;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;

View File

@ -20,15 +20,15 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.migration; package me.lucko.luckperms.common.commands.impl.migration;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import me.lucko.luckperms.common.commands.Command;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.MainCommand; import me.lucko.luckperms.common.commands.abstraction.Command;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.MainCommand;
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
@ -53,20 +53,6 @@ public class MigrationMainCommand extends MainCommand<Object> {
.put("io.github.djxy.permissionmanager.PermissionManager", "me.lucko.luckperms.sponge.migration.MigrationPermissionManager") .put("io.github.djxy.permissionmanager.PermissionManager", "me.lucko.luckperms.sponge.migration.MigrationPermissionManager")
.build(); .build();
@SuppressWarnings("unchecked")
private static List<Command<Object, ?>> getAvailableCommands() {
List<SubCommand<Object>> l = new ArrayList<>();
for (Map.Entry<String, String> plugin : PLUGINS.entrySet()) {
try {
Class.forName(plugin.getKey());
l.add((SubCommand<Object>) Class.forName(plugin.getValue()).newInstance());
} catch (Throwable ignored) {}
}
return l.stream().collect(Collectors.toList());
}
private List<Command<Object, ?>> commands = null; private List<Command<Object, ?>> commands = null;
private boolean display = true; private boolean display = true;
@ -74,8 +60,6 @@ public class MigrationMainCommand extends MainCommand<Object> {
super("Migration", "Migration commands", "/%s migration", 1, null); super("Migration", "Migration commands", "/%s migration", 1, null);
} }
@SuppressWarnings({"deprecation", "DeprecatedIsStillUsed"})
@Deprecated
@Override @Override
public synchronized Optional<List<Command<Object, ?>>> getChildren() { public synchronized Optional<List<Command<Object, ?>>> getChildren() {
if (commands == null) { if (commands == null) {
@ -96,11 +80,6 @@ public class MigrationMainCommand extends MainCommand<Object> {
return Optional.of(commands); return Optional.of(commands);
} }
@SuppressWarnings("deprecation")
public List<Command<Object, ?>> getSubCommands() {
return getChildren().orElse(null);
}
@Override @Override
public boolean isAuthorized(Sender sender) { public boolean isAuthorized(Sender sender) {
return sender.hasPermission(Permission.MIGRATION); return sender.hasPermission(Permission.MIGRATION);
@ -108,10 +87,26 @@ public class MigrationMainCommand extends MainCommand<Object> {
@Override @Override
public boolean shouldDisplay() { public boolean shouldDisplay() {
getSubCommands(); getChildren();
return display; return display;
} }
@SuppressWarnings("unchecked")
private static List<Command<Object, ?>> getAvailableCommands() {
List<SubCommand<Object>> l = new ArrayList<>();
for (Map.Entry<String, String> plugin : PLUGINS.entrySet()) {
try {
Class.forName(plugin.getKey());
l.add((SubCommand<Object>) Class.forName(plugin.getValue()).newInstance());
} catch (Throwable ignored) {}
}
return l.stream().collect(Collectors.toList());
}
/* Dummy */
@Override @Override
protected List<String> getTargets(LuckPermsPlugin plugin) { protected List<String> getTargets(LuckPermsPlugin plugin) {
return Collections.emptyList(); return Collections.emptyList();

View File

@ -20,7 +20,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.migration; package me.lucko.luckperms.common.commands.impl.migration;
import lombok.experimental.UtilityClass; import lombok.experimental.UtilityClass;

View File

@ -20,14 +20,14 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.misc; package me.lucko.luckperms.common.commands.impl.misc;
import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.api.Tristate;
import me.lucko.luckperms.common.caching.UserCache; import me.lucko.luckperms.common.caching.UserCache;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SingleCommand; import me.lucko.luckperms.common.commands.abstraction.SingleCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;

View File

@ -20,11 +20,11 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.misc; package me.lucko.luckperms.common.commands.impl.misc;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SingleCommand; import me.lucko.luckperms.common.commands.abstraction.SingleCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,11 +20,11 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.misc; package me.lucko.luckperms.common.commands.impl.misc;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SingleCommand; import me.lucko.luckperms.common.commands.abstraction.SingleCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,10 +20,10 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.misc; package me.lucko.luckperms.common.commands.impl.misc;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SingleCommand; import me.lucko.luckperms.common.commands.abstraction.SingleCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.config.ConfigKeys; import me.lucko.luckperms.common.config.ConfigKeys;

View File

@ -20,10 +20,10 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.misc; package me.lucko.luckperms.common.commands.impl.misc;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SingleCommand; import me.lucko.luckperms.common.commands.abstraction.SingleCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,11 +20,11 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.misc; package me.lucko.luckperms.common.commands.impl.misc;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SingleCommand; import me.lucko.luckperms.common.commands.abstraction.SingleCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,13 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.misc; package me.lucko.luckperms.common.commands.impl.misc;
import me.lucko.luckperms.api.HeldPermission; import me.lucko.luckperms.api.HeldPermission;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SingleCommand; import me.lucko.luckperms.common.commands.abstraction.SingleCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;

View File

@ -20,10 +20,10 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.misc; package me.lucko.luckperms.common.commands.impl.misc;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SingleCommand; import me.lucko.luckperms.common.commands.abstraction.SingleCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,14 +20,14 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.misc; package me.lucko.luckperms.common.commands.impl.misc;
import me.lucko.luckperms.api.caching.PermissionData; import me.lucko.luckperms.api.caching.PermissionData;
import me.lucko.luckperms.common.caching.UserCache; import me.lucko.luckperms.common.caching.UserCache;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SingleCommand; import me.lucko.luckperms.common.commands.abstraction.SingleCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;

View File

@ -20,11 +20,11 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.misc; package me.lucko.luckperms.common.commands.impl.misc;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SingleCommand; import me.lucko.luckperms.common.commands.abstraction.SingleCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.track; package me.lucko.luckperms.common.commands.impl.track;
import me.lucko.luckperms.api.event.cause.CreationCause; import me.lucko.luckperms.api.event.cause.CreationCause;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SingleCommand; import me.lucko.luckperms.common.commands.abstraction.SingleCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.track; package me.lucko.luckperms.common.commands.impl.track;
import me.lucko.luckperms.api.event.cause.DeletionCause; import me.lucko.luckperms.api.event.cause.DeletionCause;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SingleCommand; import me.lucko.luckperms.common.commands.abstraction.SingleCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,10 +20,10 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.track; package me.lucko.luckperms.common.commands.impl.track;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SingleCommand; import me.lucko.luckperms.common.commands.abstraction.SingleCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.track; package me.lucko.luckperms.common.commands.impl.track;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;

View File

@ -20,11 +20,11 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.track; package me.lucko.luckperms.common.commands.impl.track;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,13 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.track; package me.lucko.luckperms.common.commands.impl.track;
import me.lucko.luckperms.api.event.cause.CreationCause; import me.lucko.luckperms.api.event.cause.CreationCause;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,11 +20,11 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.track; package me.lucko.luckperms.common.commands.impl.track;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.track; package me.lucko.luckperms.common.commands.impl.track;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.track; package me.lucko.luckperms.common.commands.impl.track;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import me.lucko.luckperms.common.commands.Command; import me.lucko.luckperms.common.commands.abstraction.Command;
import me.lucko.luckperms.common.commands.MainCommand; import me.lucko.luckperms.common.commands.abstraction.MainCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.core.model.Track; import me.lucko.luckperms.common.core.model.Track;

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.track; package me.lucko.luckperms.common.commands.impl.track;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;

View File

@ -20,14 +20,14 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.track; package me.lucko.luckperms.common.commands.impl.track;
import me.lucko.luckperms.api.event.cause.CreationCause; import me.lucko.luckperms.api.event.cause.CreationCause;
import me.lucko.luckperms.api.event.cause.DeletionCause; import me.lucko.luckperms.api.event.cause.DeletionCause;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,13 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.user; package me.lucko.luckperms.common.commands.impl.user;
import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Node;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.user; package me.lucko.luckperms.common.commands.impl.user;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;

View File

@ -20,7 +20,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.user; package me.lucko.luckperms.common.commands.impl.user;
import com.google.common.base.Objects; import com.google.common.base.Objects;
@ -28,7 +28,7 @@ import me.lucko.luckperms.api.Node;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;

View File

@ -20,11 +20,11 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.user; package me.lucko.luckperms.common.commands.impl.user;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,7 +20,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.user; package me.lucko.luckperms.common.commands.impl.user;
import me.lucko.luckperms.api.Contexts; import me.lucko.luckperms.api.Contexts;
import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Node;
@ -28,7 +28,7 @@ import me.lucko.luckperms.api.caching.MetaData;
import me.lucko.luckperms.api.caching.UserData; import me.lucko.luckperms.api.caching.UserData;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;

View File

@ -20,16 +20,16 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.user; package me.lucko.luckperms.common.commands.impl.user;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import me.lucko.luckperms.common.commands.Command; import me.lucko.luckperms.common.commands.abstraction.Command;
import me.lucko.luckperms.common.commands.MainCommand; import me.lucko.luckperms.common.commands.abstraction.MainCommand;
import me.lucko.luckperms.common.commands.generic.meta.CommandMeta; import me.lucko.luckperms.common.commands.impl.generic.meta.CommandMeta;
import me.lucko.luckperms.common.commands.generic.other.HolderShowTracks; import me.lucko.luckperms.common.commands.impl.generic.other.HolderShowTracks;
import me.lucko.luckperms.common.commands.generic.parent.CommandParent; import me.lucko.luckperms.common.commands.impl.generic.parent.CommandParent;
import me.lucko.luckperms.common.commands.generic.permission.CommandPermission; import me.lucko.luckperms.common.commands.impl.generic.permission.CommandPermission;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;

View File

@ -20,7 +20,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.user; package me.lucko.luckperms.common.commands.impl.user;
import com.google.common.base.Objects; import com.google.common.base.Objects;
@ -28,7 +28,7 @@ import me.lucko.luckperms.api.Node;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.user; package me.lucko.luckperms.common.commands.impl.user;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,13 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.usersbulkedit; package me.lucko.luckperms.common.commands.impl.usersbulkedit;
import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Node;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,13 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.usersbulkedit; package me.lucko.luckperms.common.commands.impl.usersbulkedit;
import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Node;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandException;
import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;

View File

@ -20,12 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.commands.usersbulkedit; package me.lucko.luckperms.common.commands.impl.usersbulkedit;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import me.lucko.luckperms.common.commands.Command; import me.lucko.luckperms.common.commands.abstraction.Command;
import me.lucko.luckperms.common.commands.MainCommand; import me.lucko.luckperms.common.commands.abstraction.MainCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
import me.lucko.luckperms.common.storage.Storage; import me.lucko.luckperms.common.storage.Storage;
@ -62,7 +62,7 @@ public class UsersBulkEditMainCommand extends MainCommand<Storage> {
@Override @Override
public List<String> tabComplete(LuckPermsPlugin plugin, Sender sender, List<String> args) { public List<String> tabComplete(LuckPermsPlugin plugin, Sender sender, List<String> args) {
final List<Command<Storage, ?>> subs = getSubCommands().stream() final List<Command<Storage, ?>> subs = getChildren().get().stream()
.filter(s -> s.isAuthorized(sender)) .filter(s -> s.isAuthorized(sender))
.collect(Collectors.toList()); .collect(Collectors.toList());

View File

@ -28,8 +28,8 @@ import me.lucko.luckperms.api.PlatformType;
import me.lucko.luckperms.common.api.ApiProvider; import me.lucko.luckperms.common.api.ApiProvider;
import me.lucko.luckperms.common.caching.handlers.CachedStateManager; import me.lucko.luckperms.common.caching.handlers.CachedStateManager;
import me.lucko.luckperms.common.calculators.CalculatorFactory; import me.lucko.luckperms.common.calculators.CalculatorFactory;
import me.lucko.luckperms.common.commands.BaseCommand;
import me.lucko.luckperms.common.commands.CommandManager; import me.lucko.luckperms.common.commands.CommandManager;
import me.lucko.luckperms.common.commands.abstraction.Command;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.config.LuckPermsConfiguration; import me.lucko.luckperms.common.config.LuckPermsConfiguration;
@ -341,7 +341,7 @@ public interface LuckPermsPlugin {
*/ */
Set<Contexts> getPreProcessContexts(boolean op); Set<Contexts> getPreProcessContexts(boolean op);
default List<BaseCommand> getExtraCommands() { default List<Command> getExtraCommands() {
return Collections.emptyList(); return Collections.emptyList();
} }

View File

@ -33,7 +33,7 @@ import me.lucko.luckperms.common.api.ApiHandler;
import me.lucko.luckperms.common.api.ApiProvider; import me.lucko.luckperms.common.api.ApiProvider;
import me.lucko.luckperms.common.caching.handlers.CachedStateManager; import me.lucko.luckperms.common.caching.handlers.CachedStateManager;
import me.lucko.luckperms.common.calculators.CalculatorFactory; import me.lucko.luckperms.common.calculators.CalculatorFactory;
import me.lucko.luckperms.common.commands.BaseCommand; import me.lucko.luckperms.common.commands.abstraction.Command;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.config.ConfigKeys; import me.lucko.luckperms.common.config.ConfigKeys;
import me.lucko.luckperms.common.config.LuckPermsConfiguration; import me.lucko.luckperms.common.config.LuckPermsConfiguration;
@ -456,7 +456,7 @@ public class LPSpongePlugin implements LuckPermsPlugin {
} }
@Override @Override
public List<BaseCommand> getExtraCommands() { public List<Command> getExtraCommands() {
return Collections.singletonList(new SpongeMainCommand(this)); return Collections.singletonList(new SpongeMainCommand(this));
} }

Some files were not shown because too many files have changed in this diff Show More