summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-11-27 19:59:06 +0100
committersnowleo <schneeleo@gmail.com>2011-11-27 19:59:06 +0100
commit67be976d908e5d6dc1337f053b3421bd19668600 (patch)
tree7e4075ccbb39bf695e19f1edee211e5722dfea24
parentec6baa3621bb9d0a40f032f6669c11fa731be2c5 (diff)
downloadEssentials-67be976d908e5d6dc1337f053b3421bd19668600.tar
Essentials-67be976d908e5d6dc1337f053b3421bd19668600.tar.gz
Essentials-67be976d908e5d6dc1337f053b3421bd19668600.tar.lz
Essentials-67be976d908e5d6dc1337f053b3421bd19668600.tar.xz
Essentials-67be976d908e5d6dc1337f053b3421bd19668600.zip
New permissions:
essentials.spawnmob.[mobname] and essentials.spawner.[mobname]
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandspawner.java9
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java8
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);