mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-12-29 12:37:40 +01:00
Fix parsing second optional argument in editor command
This commit is contained in:
parent
91d75424f4
commit
8754123535
@ -69,19 +69,23 @@ public class EditorCommand extends SingleCommand {
|
||||
@Override
|
||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, List<String> args, String label) {
|
||||
Type type = Type.ALL;
|
||||
String filter = null;
|
||||
|
||||
// parse type
|
||||
String typeString = ArgumentParser.parseStringOrElse(0, args, null);
|
||||
if (typeString != null) {
|
||||
// attempt to parse type
|
||||
String arg0 = ArgumentParser.parseStringOrElse(0, args, null);
|
||||
if (arg0 != null) {
|
||||
try {
|
||||
type = Type.valueOf(typeString.toUpperCase());
|
||||
type = Type.valueOf(arg0.toUpperCase());
|
||||
} catch (IllegalArgumentException e) {
|
||||
// ignored
|
||||
// assume they meant it as a filter
|
||||
filter = arg0;
|
||||
}
|
||||
|
||||
if (filter == null) {
|
||||
filter = ArgumentParser.parseStringOrElse(1, args, null);
|
||||
}
|
||||
}
|
||||
|
||||
String filter = ArgumentParser.parseStringOrElse(1, args, null);
|
||||
|
||||
// run a sync task
|
||||
plugin.getSyncTaskBuffer().requestDirectly();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user