diff options
author | snowleo <schneeleo@gmail.com> | 2011-11-25 05:54:32 +0100 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2011-11-25 05:54:32 +0100 |
commit | 03452bda689940f0144f27351099906b9ad7f422 (patch) | |
tree | a3da36f4659d88ea2c954fe2987098a2747854bc | |
parent | 613cb57fdb6701c61878796c17f2fe06f38241f4 (diff) | |
download | Essentials-03452bda689940f0144f27351099906b9ad7f422.tar Essentials-03452bda689940f0144f27351099906b9ad7f422.tar.gz Essentials-03452bda689940f0144f27351099906b9ad7f422.tar.lz Essentials-03452bda689940f0144f27351099906b9ad7f422.tar.xz Essentials-03452bda689940f0144f27351099906b9ad7f422.zip |
Baby wolfs, awwwwh
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index 43b0b8ffa..e0e08e6fd 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -20,7 +20,7 @@ public class Commandspawnmob extends EssentialsCommand { super("spawnmob"); } - + @Override public void run(Server server, User user, String commandLabel, String[] args) throws Exception { @@ -29,8 +29,8 @@ public class Commandspawnmob extends EssentialsCommand throw new NotEnoughArgumentsException(); //TODO: user.sendMessage("ยง7Mobs: Zombie PigZombie Skeleton Slime Chicken Pig Monster Spider Creeper Ghast Squid Giant Cow Sheep Wolf"); } - - + + String[] mountparts = args[0].split(","); String[] parts = mountparts[0].split(":"); String mobType = parts[0]; @@ -50,24 +50,24 @@ public class Commandspawnmob extends EssentialsCommand mountData = parts[1]; } } - - + + Entity spawnedMob = null; Mob mob = null; Entity spawnedMount = null; Mob mobMount = null; - + mob = Mob.fromName(mobType); if (mob == null) { throw new Exception(_("invalidMob")); } - + if (ess.getSettings().getProtectPreventSpawn(mob.getType().toString().toLowerCase(Locale.ENGLISH))) { throw new Exception(_("unableToSpawnMob")); } - + final Block block = Util.getTarget(user).getBlock(); if (block == null) { @@ -83,7 +83,7 @@ public class Commandspawnmob extends EssentialsCommand { throw new Exception(_("unableToSpawnMob")); } - + if (mountType != null) { mobMount = Mob.fromName(mountType); @@ -92,7 +92,7 @@ public class Commandspawnmob extends EssentialsCommand user.sendMessage(_("invalidMob")); return; } - + if (ess.getSettings().getProtectPreventSpawn(mobMount.getType().toString().toLowerCase(Locale.ENGLISH))) { throw new Exception(_("unableToSpawnMob")); @@ -124,7 +124,7 @@ public class Commandspawnmob extends EssentialsCommand mobCount = serverLimit; user.sendMessage(_("mobSpawnLimit")); } - + try { for (int i = 1; i < mobCount; i++) @@ -171,7 +171,7 @@ public class Commandspawnmob extends EssentialsCommand user.sendMessage(mob.name + " " + _("spawned")); } } - + private void changeMobData(String type, Entity spawned, String data, User user) throws Exception { if ("Slime".equalsIgnoreCase(type)) @@ -188,7 +188,8 @@ public class Commandspawnmob extends EssentialsCommand if (("Sheep".equalsIgnoreCase(type) || "Cow".equalsIgnoreCase(type) || "Chicken".equalsIgnoreCase(type) - || "Pig".equalsIgnoreCase(type)) + || "Pig".equalsIgnoreCase(type) + || "Wolf".equalsIgnoreCase(type)) && data.equalsIgnoreCase("baby")) { ((Animals)spawned).setAge(-24000); |