From cb9ed3b61fe0d449fb4f934878772629da033b43 Mon Sep 17 00:00:00 2001 From: Stijn Bannink Date: Sat, 19 Aug 2023 20:11:24 +0200 Subject: [PATCH] Fixed incomplete selection message and tab complete for setoffline / build --- .../v10lift/commands/V10LiftTabCompleter.java | 8 ++++---- .../tech/sbdevelopment/v10lift/utils/WorldEditUtil.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/tech/sbdevelopment/v10lift/commands/V10LiftTabCompleter.java b/src/main/java/tech/sbdevelopment/v10lift/commands/V10LiftTabCompleter.java index 361e0ed..baec7ad 100644 --- a/src/main/java/tech/sbdevelopment/v10lift/commands/V10LiftTabCompleter.java +++ b/src/main/java/tech/sbdevelopment/v10lift/commands/V10LiftTabCompleter.java @@ -45,6 +45,10 @@ public class V10LiftTabCompleter implements TabCompleter { || args[0].equalsIgnoreCase("whitelist") || args[0].equalsIgnoreCase("rope")) { 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) { //Command based arguments @@ -74,10 +78,6 @@ public class V10LiftTabCompleter implements TabCompleter { playerOrGroupNames.addAll(VaultManager.getGroups()); } 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) { //Command based arguments diff --git a/src/main/java/tech/sbdevelopment/v10lift/utils/WorldEditUtil.java b/src/main/java/tech/sbdevelopment/v10lift/utils/WorldEditUtil.java index 8fe62f8..b6b94f3 100644 --- a/src/main/java/tech/sbdevelopment/v10lift/utils/WorldEditUtil.java +++ b/src/main/java/tech/sbdevelopment/v10lift/utils/WorldEditUtil.java @@ -21,7 +21,7 @@ public class WorldEditUtil { try { region = ls.getSelection(BukkitAdapter.adapt(p.getWorld())); } catch (IncompleteRegionException e) { - throw new RuntimeException(e); + return -1; } if (region == null) { return -1;