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
commit42498a141788d4bcfe19db4c1b81d13763f5ebb5 (patch)
treef3d9767adc67d0a81e114d847109c65b2f5db0fa
parent1011475bf04ba245758d068172890bd792fcf5cd (diff)
downloadEssentials-42498a141788d4bcfe19db4c1b81d13763f5ebb5.tar
Essentials-42498a141788d4bcfe19db4c1b81d13763f5ebb5.tar.gz
Essentials-42498a141788d4bcfe19db4c1b81d13763f5ebb5.tar.lz
Essentials-42498a141788d4bcfe19db4c1b81d13763f5ebb5.tar.xz
Essentials-42498a141788d4bcfe19db4c1b81d13763f5ebb5.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);