From 167b8dfabded7f6f180c1d97d32ad6cb33612b23 Mon Sep 17 00:00:00 2001 From: Intelli Date: Mon, 21 Feb 2022 18:12:43 -0700 Subject: [PATCH] Display correct error message if a user isn't specified on an inventory rollback --- .../command/RollbackRestoreCommand.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/coreprotect/command/RollbackRestoreCommand.java b/src/main/java/net/coreprotect/command/RollbackRestoreCommand.java index 39b8890..86ccb43 100755 --- a/src/main/java/net/coreprotect/command/RollbackRestoreCommand.java +++ b/src/main/java/net/coreprotect/command/RollbackRestoreCommand.java @@ -178,6 +178,16 @@ public class RollbackRestoreCommand { return; } + if (argAction.contains(4) && argAction.contains(11)) { // a:inventory + if (argUsers.size() == 0) { + Chat.sendMessage(player, Color.DARK_AQUA + "CoreProtect " + Color.WHITE + "- " + Phrase.build(Phrase.MISSING_ACTION_USER)); + return; + } + if (!argExcludeUsers.contains("#hopper")) { + argExcludeUsers.add("#hopper"); + } + } + if (g == 1 && (argUsers.size() > 0 || (argUsers.size() == 0 && argRadius != null))) { Integer MAX_RADIUS = Config.getGlobal().MAX_RADIUS; if (argRadius != null) { @@ -210,13 +220,10 @@ public class RollbackRestoreCommand { } } - if (argAction.contains(4) && argAction.contains(11) && !argExcludeUsers.contains("#hopper")) { // a:inventory - argExcludeUsers.add("#hopper"); - } - if (argUsers.size() == 0) { argUsers.add("#global"); } + List rollbackusers = argUsers; int c = 0; for (String ruser : rollbackusers) {