summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-07-07 19:22:57 +0200
committersnowleo <schneeleo@gmail.com>2011-07-07 19:22:57 +0200
commit367fcdd029586a4cd8289977f59d1aa3d6e95c4f (patch)
treed81bb65c926f9f8e1c21db7caf8e6c354f85ac28
parent3b838cc23df917f71a1ca25a1ad57e2087e88716 (diff)
downloadEssentials-367fcdd029586a4cd8289977f59d1aa3d6e95c4f.tar
Essentials-367fcdd029586a4cd8289977f59d1aa3d6e95c4f.tar.gz
Essentials-367fcdd029586a4cd8289977f59d1aa3d6e95c4f.tar.lz
Essentials-367fcdd029586a4cd8289977f59d1aa3d6e95c4f.tar.xz
Essentials-367fcdd029586a4cd8289977f59d1aa3d6e95c4f.zip
/spawnmob command: Show error message if EssentialsProtect will prevent spawning of creature.
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
index 36beaad5d..33eeb7db7 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
@@ -60,6 +60,12 @@ public class Commandspawnmob extends EssentialsCommand
}
}
+ if (ess.getSettings().getProtectPreventSpawn(mobType.toLowerCase())
+ || (mountType != null && ess.getSettings().getProtectPreventSpawn(mountType.toLowerCase())))
+ {
+ user.sendMessage(Util.i18n("unableToSpawnMob"));
+ return;
+ }
Entity spawnedMob = null;
Mob mob = null;
@@ -85,7 +91,7 @@ public class Commandspawnmob extends EssentialsCommand
loc.setY(loc.getY() + 1);
block = user.getWorld().getBlockAt(loc);
}
-
+
try
{
spawnedMob = mob.spawn(user, server, loc);
@@ -224,7 +230,8 @@ public class Commandspawnmob extends EssentialsCommand
{
((CraftWolf)spawned).setAngry(true);
}
- if ("Creeper".equalsIgnoreCase(type) && data.equalsIgnoreCase("powered")) {
+ if ("Creeper".equalsIgnoreCase(type) && data.equalsIgnoreCase("powered"))
+ {
((CraftCreeper)spawned).setPowered(true);
}
}