mirror of
https://github.com/lucko/LuckPerms.git
synced 2025-09-25 13:28:58 +02:00
Fix parsing second optional argument in editor command
This commit is contained in:
@@ -69,18 +69,22 @@ public class EditorCommand extends SingleCommand {
|
|||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, List<String> args, String label) {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, List<String> args, String label) {
|
||||||
Type type = Type.ALL;
|
Type type = Type.ALL;
|
||||||
|
String filter = null;
|
||||||
|
|
||||||
// parse type
|
// attempt to parse type
|
||||||
String typeString = ArgumentParser.parseStringOrElse(0, args, null);
|
String arg0 = ArgumentParser.parseStringOrElse(0, args, null);
|
||||||
if (typeString != null) {
|
if (arg0 != null) {
|
||||||
try {
|
try {
|
||||||
type = Type.valueOf(typeString.toUpperCase());
|
type = Type.valueOf(arg0.toUpperCase());
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
// ignored
|
// assume they meant it as a filter
|
||||||
}
|
filter = arg0;
|
||||||
}
|
}
|
||||||
|
|
||||||
String filter = ArgumentParser.parseStringOrElse(1, args, null);
|
if (filter == null) {
|
||||||
|
filter = ArgumentParser.parseStringOrElse(1, args, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// run a sync task
|
// run a sync task
|
||||||
plugin.getSyncTaskBuffer().requestDirectly();
|
plugin.getSyncTaskBuffer().requestDirectly();
|
||||||
|
Reference in New Issue
Block a user