From 34daa5691c561e28b41ed34deab9a3c0261841a0 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 5 Jun 2013 03:15:12 +0100 Subject: [PATCH] Allow spawning zombies without the trademark gold boots. Also limit armor to zombies and skeletons. --- .../src/com/earth2me/essentials/SpawnMob.java | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/SpawnMob.java b/Essentials/src/com/earth2me/essentials/SpawnMob.java index 09faef05c..8fa7c3ac7 100644 --- a/Essentials/src/com/earth2me/essentials/SpawnMob.java +++ b/Essentials/src/com/earth2me/essentials/SpawnMob.java @@ -213,25 +213,7 @@ public class SpawnMob { data = data.toLowerCase(Locale.ENGLISH); - if (spawned instanceof Slime) - { - try - { - ((Slime)spawned).setSize(Integer.parseInt(data)); - } - catch (Exception e) - { - throw new Exception(_("slimeMalformedSize"), e); - } - } - - if ((spawned instanceof Ageable) && data.contains("baby")) - { - ((Ageable)spawned).setBaby(); - data = data.replace("baby", ""); - } - - if (spawned instanceof LivingEntity) + if (spawned instanceof Zombie || type == EntityType.SKELETON) { //This should match all Living Entities but most mobs will just ignore the equipment. if (data.contains("armor") || data.contains("armour")) @@ -258,6 +240,10 @@ public class SpawnMob invent.setChestplate(new ItemStack(Material.LEATHER_BOOTS, 1)); invent.setHelmet(new ItemStack(Material.LEATHER_BOOTS, 1)); } + else if (data.contains("no")) + { + invent.clear(); + } else { invent.setBoots(new ItemStack(Material.IRON_BOOTS, 1)); @@ -272,6 +258,24 @@ public class SpawnMob } } + + if (spawned instanceof Slime) + { + try + { + ((Slime)spawned).setSize(Integer.parseInt(data)); + } + catch (Exception e) + { + throw new Exception(_("slimeMalformedSize"), e); + } + } + + if ((spawned instanceof Ageable) && data.contains("baby")) + { + ((Ageable)spawned).setBaby(); + data = data.replace("baby", ""); + } if (spawned instanceof Colorable) {