Added horses to SpawnMob /spawnmob horse:<color><variant><style><chest>

This commit is contained in:
okamosy 2013-07-16 23:29:53 +01:00 committed by KHobbits
parent ba6fd95247
commit bf675b230e

View File

@ -403,6 +403,75 @@ public class SpawnMob
}
}
if (type == EntityType.HORSE)
{
if (data.contains("donkey"))
{
((Horse)spawned).setVariant(Horse.Variant.DONKEY);
}
else if (data.contains("mule"))
{
((Horse)spawned).setVariant(Horse.Variant.MULE);
}
else if (data.contains("skeleton"))
{
((Horse)spawned).setVariant(Horse.Variant.SKELETON_HORSE);
}
else if (data.contains("undead"))
{
((Horse)spawned).setVariant(Horse.Variant.UNDEAD_HORSE);
}
if (data.contains("polka") || data.contains("sooty"))
{
((Horse)spawned).setStyle(Horse.Style.BLACK_DOTS);
}
else if (data.contains("socks") || data.contains("blaze"))
{
((Horse)spawned).setStyle(Horse.Style.WHITE);
}
else if (data.contains("leopard") || data.contains("appaloosa"))
{
((Horse)spawned).setStyle(Horse.Style.WHITE_DOTS);
}
else if (data.contains("splotchy") || data.contains("milky") || data.contains("paint"))
{
((Horse)spawned).setStyle(Horse.Style.WHITEFIELD);
}
if (data.contains("black"))
{
((Horse)spawned).setColor(Horse.Color.BLACK);
}
else if (data.contains("chestnut") || data.contains("liver"))
{
((Horse)spawned).setColor(Horse.Color.CHESTNUT);
data = data.replace("chestnut", "");
}
else if (data.contains("creamy") || data.contains("flaxen"))
{
((Horse)spawned).setColor(Horse.Color.CREAMY);
}
else if (data.contains("gray") || data.contains("dapple"))
{
((Horse)spawned).setColor(Horse.Color.GRAY);
}
else if (data.contains("dark") || data.contains("darkbrown") || data.contains("dbrown") || data.contains("buckskin"))
{
((Horse)spawned).setColor(Horse.Color.DARK_BROWN);
}
else if (data.contains("brown") || data.contains("bay"))
{
((Horse)spawned).setColor(Horse.Color.BROWN);
}
if (data.contains("chest"))
{
((Horse)spawned).setTamed(true);
((Horse)spawned).setCarryingChest(true);
}
}
}
private static void defaultMobData(final EntityType type, final Entity spawned)