summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-04-30 01:37:39 +0100
committerKHobbits <rob@khobbits.co.uk>2013-04-30 01:37:39 +0100
commita72c0b406c920e22ab73adb28729c368c3df01a1 (patch)
treee09bac8304cc5c54acd51ab0bc2cd7d56295950d
parent24f26f3d08204c1a14ce2cd760c85ac2531a26a0 (diff)
downloadEssentials-a72c0b406c920e22ab73adb28729c368c3df01a1.tar
Essentials-a72c0b406c920e22ab73adb28729c368c3df01a1.tar.gz
Essentials-a72c0b406c920e22ab73adb28729c368c3df01a1.tar.lz
Essentials-a72c0b406c920e22ab73adb28729c368c3df01a1.tar.xz
Essentials-a72c0b406c920e22ab73adb28729c368c3df01a1.zip
Move spawnmob.stack perm check to the right place.
-rw-r--r--Essentials/src/com/earth2me/essentials/SpawnMob.java4
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java17
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);
}