diff options
author | snowleo <schneeleo@gmail.com> | 2011-09-29 23:56:02 +0200 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2011-09-29 23:59:24 +0200 |
commit | f8450e39e31e9c90e28d96ee4de4275554537059 (patch) | |
tree | 8f94c7b4ca3ade245f322bd30d0ea06d66e2a1fa | |
parent | c6e68f72ea2b14ebbc69d25e492c6cf5c4a4d7f7 (diff) | |
download | Essentials-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.java | 16 |
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); |