mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-04-25 16:09:44 +00:00
Better matching of zombie and skeleton mobdata to avoid confusion.
This commit is contained in:
parent
23d2ffb134
commit
3017d2a7f4
1 changed files with 13 additions and 13 deletions
|
@ -217,20 +217,16 @@ public class SpawnMob
|
||||||
sender.sendMessage(_("mobDataList", StringUtil.joinList(MobData.getValidHelp(spawned))));
|
sender.sendMessage(_("mobDataList", StringUtil.joinList(MobData.getValidHelp(spawned))));
|
||||||
}
|
}
|
||||||
|
|
||||||
MobData newData = MobData.fromData(spawned, data);
|
|
||||||
while (newData != null)
|
|
||||||
{
|
|
||||||
newData.setData(spawned, target.getBase(), data);
|
|
||||||
data = data.replace(newData.getMatched(), "");
|
|
||||||
newData = MobData.fromData(spawned, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (spawned instanceof Zombie || type == EntityType.SKELETON)
|
if (spawned instanceof Zombie || type == EntityType.SKELETON)
|
||||||
{
|
{
|
||||||
if (inputData.contains("armor") || inputData.contains("armour"))
|
if (inputData.contains("armor") || inputData.contains("armour"))
|
||||||
{
|
{
|
||||||
final EntityEquipment invent = ((LivingEntity)spawned).getEquipment();
|
final EntityEquipment invent = ((LivingEntity)spawned).getEquipment();
|
||||||
if (inputData.contains("diamond"))
|
if (inputData.contains("noarmor") || inputData.contains("noarmour"))
|
||||||
|
{
|
||||||
|
invent.clear();
|
||||||
|
}
|
||||||
|
else if (inputData.contains("diamond"))
|
||||||
{
|
{
|
||||||
invent.setBoots(new ItemStack(Material.DIAMOND_BOOTS, 1));
|
invent.setBoots(new ItemStack(Material.DIAMOND_BOOTS, 1));
|
||||||
invent.setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS, 1));
|
invent.setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS, 1));
|
||||||
|
@ -251,10 +247,6 @@ public class SpawnMob
|
||||||
invent.setChestplate(new ItemStack(Material.LEATHER_CHESTPLATE, 1));
|
invent.setChestplate(new ItemStack(Material.LEATHER_CHESTPLATE, 1));
|
||||||
invent.setHelmet(new ItemStack(Material.LEATHER_HELMET, 1));
|
invent.setHelmet(new ItemStack(Material.LEATHER_HELMET, 1));
|
||||||
}
|
}
|
||||||
else if (inputData.contains("no"))
|
|
||||||
{
|
|
||||||
invent.clear();
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
invent.setBoots(new ItemStack(Material.IRON_BOOTS, 1));
|
invent.setBoots(new ItemStack(Material.IRON_BOOTS, 1));
|
||||||
|
@ -269,6 +261,14 @@ public class SpawnMob
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MobData newData = MobData.fromData(spawned, data);
|
||||||
|
while (newData != null)
|
||||||
|
{
|
||||||
|
newData.setData(spawned, target.getBase(), data);
|
||||||
|
data = data.replace(newData.getMatched(), "");
|
||||||
|
newData = MobData.fromData(spawned, data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void defaultMobData(final EntityType type, final Entity spawned)
|
private static void defaultMobData(final EntityType type, final Entity spawned)
|
||||||
|
|
Loading…
Reference in a new issue