diff options
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandspawner.java | 9 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java | 8 |
2 files changed, 17 insertions, 0 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java index bdbcc4a8c..e3b1ef366 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java @@ -4,6 +4,7 @@ import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.Mob; import com.earth2me.essentials.User; import com.earth2me.essentials.Util; +import java.util.Locale; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Server; @@ -43,6 +44,14 @@ public class Commandspawner extends EssentialsCommand user.sendMessage(_("invalidMob")); return; } + if (ess.getSettings().getProtectPreventSpawn(mob.getType().toString().toLowerCase(Locale.ENGLISH))) + { + throw new Exception(_("unableToSpawnMob")); + } + if (!user.isAuthorized("essentials.spawner." + mob.name.toLowerCase())) + { + throw new Exception(_("unableToSpawnMob")); + } ((CreatureSpawner)target.getBlock().getState()).setCreatureType(mob.getType()); user.sendMessage(_("setSpawner", mob.name)); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index 66c6b4414..863821973 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -66,6 +66,10 @@ public class Commandspawnmob extends EssentialsCommand { throw new Exception(_("unableToSpawnMob")); } + if (!user.isAuthorized("essentials.spawnmob." + mob.name.toLowerCase())) + { + throw new Exception(_("unableToSpawnMob")); + } final Block block = Util.getTarget(user).getBlock(); if (block == null) @@ -96,6 +100,10 @@ public class Commandspawnmob extends EssentialsCommand { throw new Exception(_("unableToSpawnMob")); } + if (!user.isAuthorized("essentials.spawnmob." + mobMount.name.toLowerCase())) + { + throw new Exception(_("unableToSpawnMob")); + } try { spawnedMount = mobMount.spawn(user, server, loc); |