diff options
author | KHobbits <rob@khobbits.co.uk> | 2013-04-30 01:37:39 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2013-04-30 01:37:39 +0100 |
commit | 047ef63e55a9eebe2ddae863b2e3bbed307beff8 (patch) | |
tree | 78d5e69185edb5b87f16926e2894841e4770e004 | |
parent | 31d9b1fab4a3f3773df0f8a1219dcf745ac628f6 (diff) | |
download | Essentials-047ef63e55a9eebe2ddae863b2e3bbed307beff8.tar Essentials-047ef63e55a9eebe2ddae863b2e3bbed307beff8.tar.gz Essentials-047ef63e55a9eebe2ddae863b2e3bbed307beff8.tar.lz Essentials-047ef63e55a9eebe2ddae863b2e3bbed307beff8.tar.xz Essentials-047ef63e55a9eebe2ddae863b2e3bbed307beff8.zip |
Move spawnmob.stack perm check to the right place.
-rw-r--r-- | Essentials/src/com/earth2me/essentials/SpawnMob.java | 4 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java | 17 |
2 files changed, 11 insertions, 10 deletions
diff --git a/Essentials/src/com/earth2me/essentials/SpawnMob.java b/Essentials/src/com/earth2me/essentials/SpawnMob.java index 393ef8693..5305f6539 100644 --- a/Essentials/src/com/earth2me/essentials/SpawnMob.java +++ b/Essentials/src/com/earth2me/essentials/SpawnMob.java @@ -82,10 +82,6 @@ public class SpawnMob { throw new Exception(_("unableToSpawnMob")); } - if (parts.size() > 1 && !user.isAuthorized("essentials.spawnmob.stack")) - { - throw new Exception(_("cannotStackMob")); - } spawnmob(ess, server, user, user, block.getLocation(), parts, data, mobCount); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index ed91cf805..706a3f84b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -16,7 +16,7 @@ public class Commandspawnmob extends EssentialsCommand { super("spawnmob"); } - + @Override public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { @@ -34,17 +34,22 @@ public class Commandspawnmob extends EssentialsCommand { mobCount = Integer.parseInt(args[1]); } - + + if (mobParts.size() > 1 && !user.isAuthorized("essentials.spawnmob.stack")) + { + throw new Exception(_("cannotStackMob")); + } + if (args.length >= 3) { final User target = getPlayer(ess.getServer(), user, args, 2); SpawnMob.spawnmob(ess, server, user, target, mobParts, mobData, mobCount); return; } - + SpawnMob.spawnmob(ess, server, user, mobParts, mobData, mobCount); } - + @Override public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception { @@ -53,11 +58,11 @@ public class Commandspawnmob extends EssentialsCommand final String mobList = Util.joinList(Mob.getMobList()); throw new NotEnoughArgumentsException(_("mobsAvailable", mobList)); } - + List<String> mobParts = SpawnMob.mobParts(args[0]); List<String> mobData = SpawnMob.mobData(args[0]); int mobCount = Integer.parseInt(args[1]); - + final User target = getPlayer(ess.getServer(), args, 2, true, false); SpawnMob.spawnmob(ess, server, sender, target, mobParts, mobData, mobCount); } |