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
commita43cbe061a97469ec43113ae9b2391acbbdbe1f4 (patch)
treea4b4e208395e718339427c2096f6140a203e3b9f
parent9d2358ed4d1f6eeb116100e438c53dd9c9aab269 (diff)
downloadEssentials-a43cbe061a97469ec43113ae9b2391acbbdbe1f4.tar
Essentials-a43cbe061a97469ec43113ae9b2391acbbdbe1f4.tar.gz
Essentials-a43cbe061a97469ec43113ae9b2391acbbdbe1f4.tar.lz
Essentials-a43cbe061a97469ec43113ae9b2391acbbdbe1f4.tar.xz
Essentials-a43cbe061a97469ec43113ae9b2391acbbdbe1f4.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);
}