mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 20:00:46 +00:00
Allow spawning zombies without the trademark gold boots.
Also limit armor to zombies and skeletons.
This commit is contained in:
parent
0457705850
commit
34daa5691c
1 changed files with 23 additions and 19 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue