diff options
author | KHobbits <rob@khobbits.co.uk> | 2013-06-05 03:15:12 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2013-06-05 03:15:12 +0100 |
commit | 34daa5691c561e28b41ed34deab9a3c0261841a0 (patch) | |
tree | 48a23498ac24ef7b01bfd0135ea79e9d26b56977 | |
parent | 045770585015079bf823f592af6e7080ee5f094d (diff) | |
download | Essentials-34daa5691c561e28b41ed34deab9a3c0261841a0.tar Essentials-34daa5691c561e28b41ed34deab9a3c0261841a0.tar.gz Essentials-34daa5691c561e28b41ed34deab9a3c0261841a0.tar.lz Essentials-34daa5691c561e28b41ed34deab9a3c0261841a0.tar.xz Essentials-34daa5691c561e28b41ed34deab9a3c0261841a0.zip |
Allow spawning zombies without the trademark gold boots.
Also limit armor to zombies and skeletons.
-rw-r--r-- | Essentials/src/com/earth2me/essentials/SpawnMob.java | 42 |
1 files 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) { |