summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-09-29 23:56:02 +0200
committersnowleo <schneeleo@gmail.com>2011-09-29 23:59:24 +0200
commitf8450e39e31e9c90e28d96ee4de4275554537059 (patch)
tree8f94c7b4ca3ade245f322bd30d0ea06d66e2a1fa
parentc6e68f72ea2b14ebbc69d25e492c6cf5c4a4d7f7 (diff)
downloadEssentials-f8450e39e31e9c90e28d96ee4de4275554537059.tar
Essentials-f8450e39e31e9c90e28d96ee4de4275554537059.tar.gz
Essentials-f8450e39e31e9c90e28d96ee4de4275554537059.tar.lz
Essentials-f8450e39e31e9c90e28d96ee4de4275554537059.tar.xz
Essentials-f8450e39e31e9c90e28d96ee4de4275554537059.zip
Correctly throw exceptions if mob spawn protection is on
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
index f46264582..97bcb9c8e 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
@@ -56,11 +56,6 @@ public class Commandspawnmob extends EssentialsCommand
}
}
- if (ess.getSettings().getProtectPreventSpawn(mobType.toLowerCase())
- || (mountType != null && ess.getSettings().getProtectPreventSpawn(mountType.toLowerCase())))
- {
- throw new Exception(Util.i18n("unableToSpawnMob"));
- }
Entity spawnedMob = null;
Mob mob = null;
@@ -72,6 +67,12 @@ public class Commandspawnmob extends EssentialsCommand
{
throw new Exception(Util.i18n("invalidMob"));
}
+
+ if (ess.getSettings().getProtectPreventSpawn(mob.getType().toString().toLowerCase()))
+ {
+ throw new Exception(Util.i18n("unableToSpawnMob"));
+ }
+
int[] ignore =
{
8, 9
@@ -102,6 +103,11 @@ public class Commandspawnmob extends EssentialsCommand
user.sendMessage(Util.i18n("invalidMob"));
return;
}
+
+ if (ess.getSettings().getProtectPreventSpawn(mobMount.getType().toString().toLowerCase()))
+ {
+ throw new Exception(Util.i18n("unableToSpawnMob"));
+ }
try
{
spawnedMount = mobMount.spawn(user, server, loc);