mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-15 11:04:29 +02:00
Better matching of zombie and skeleton mobdata to avoid confusion.
This commit is contained in:
@@ -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)
|
||||||
|
Reference in New Issue
Block a user