Fixed incomplete selection message and tab complete for setoffline / build

This commit is contained in:
Stijn Bannink 2023-08-19 20:11:24 +02:00
parent 52bcbe231e
commit cb9ed3b61f
2 changed files with 5 additions and 5 deletions

View file

@ -45,6 +45,10 @@ public class V10LiftTabCompleter implements TabCompleter {
|| args[0].equalsIgnoreCase("whitelist") || args[0].equalsIgnoreCase("whitelist")
|| args[0].equalsIgnoreCase("rope")) { || args[0].equalsIgnoreCase("rope")) {
return StringUtil.copyPartialMatches(args[1], SUB, new ArrayList<>()); return StringUtil.copyPartialMatches(args[1], SUB, new ArrayList<>());
} else if (args[0].equalsIgnoreCase("setoffline")) {
return StringUtil.copyPartialMatches(args[1], BOOL, new ArrayList<>());
} else if (args[0].equalsIgnoreCase("build") && V10LiftPlugin.isWorldEditEnabled()) {
return StringUtil.copyPartialMatches(args[1], List.of("worldedit"), new ArrayList<>());
} }
} else if (args.length == 3) { } else if (args.length == 3) {
//Command based arguments //Command based arguments
@ -74,10 +78,6 @@ public class V10LiftTabCompleter implements TabCompleter {
playerOrGroupNames.addAll(VaultManager.getGroups()); playerOrGroupNames.addAll(VaultManager.getGroups());
} }
return StringUtil.copyPartialMatches(args[2], playerOrGroupNames, new ArrayList<>()); return StringUtil.copyPartialMatches(args[2], playerOrGroupNames, new ArrayList<>());
} else if (args[0].equalsIgnoreCase("setoffline")) {
return StringUtil.copyPartialMatches(args[2], BOOL, new ArrayList<>());
} else if (args[0].equalsIgnoreCase("build") && V10LiftPlugin.isWorldEditEnabled()) {
return StringUtil.copyPartialMatches(args[2], List.of("worldedit"), new ArrayList<>());
} }
} else if (args.length == 4) { } else if (args.length == 4) {
//Command based arguments //Command based arguments

View file

@ -21,7 +21,7 @@ public class WorldEditUtil {
try { try {
region = ls.getSelection(BukkitAdapter.adapt(p.getWorld())); region = ls.getSelection(BukkitAdapter.adapt(p.getWorld()));
} catch (IncompleteRegionException e) { } catch (IncompleteRegionException e) {
throw new RuntimeException(e); return -1;
} }
if (region == null) { if (region == null) {
return -1; return -1;