summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-11-16 04:26:24 +0100
committersnowleo <schneeleo@gmail.com>2011-11-16 04:26:24 +0100
commitb9daf6aaa5c2b659599f6ebea0ce6e36c515201c (patch)
tree9dd5927ae5090ef689aee30a9d73fba80fa9b69b
parent4be1797592cded0d123c9378ca5afb393195f469 (diff)
downloadEssentials-b9daf6aaa5c2b659599f6ebea0ce6e36c515201c.tar
Essentials-b9daf6aaa5c2b659599f6ebea0ce6e36c515201c.tar.gz
Essentials-b9daf6aaa5c2b659599f6ebea0ce6e36c515201c.tar.lz
Essentials-b9daf6aaa5c2b659599f6ebea0ce6e36c515201c.tar.xz
Essentials-b9daf6aaa5c2b659599f6ebea0ce6e36c515201c.zip
Sudo: This would break horrible for offline players and the original player object has to be used.
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsudo.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java
index 19b1fd084..a7976e8a6 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java
@@ -21,10 +21,12 @@ public class Commandsudo extends EssentialsCommand
throw new NotEnoughArgumentsException();
}
- final User user = getPlayer(server, args, 0, true);
+ final User user = getPlayer(server, args, 0, false);
final String command = args[1];
- String[] arguments = new String[args.length - 2];
- System.arraycopy(args, 2, arguments, 0, args.length - 2);
+ final String[] arguments = new String[args.length - 2];
+ if (arguments.length > 0) {
+ System.arraycopy(args, 2, arguments, 0, args.length - 2);
+ }
//TODO: Translate this.
sender.sendMessage("Running the command as " + user.getDisplayName());
@@ -32,7 +34,7 @@ public class Commandsudo extends EssentialsCommand
final PluginCommand pc = ess.getServer().getPluginCommand(command);
if (pc != null)
{
- pc.execute(user, command, arguments);
+ pc.execute(user.getBase(), command, arguments);
}
}