use of org.bukkit.entity.Llama in project Prism-Bukkit by prism.
the class AbstractHorseSerializer method serializer.
@Override
protected void serializer(Entity entity) {
final AbstractHorse h = (AbstractHorse) entity;
// TODO: Cleanup
if (entity.getType() == EntityType.HORSE) {
Horse horse = (Horse) h;
horseColor = horse.getColor().name();
style = horse.getStyle().name();
saddle = ItemUtils.smallString(horse.getInventory().getSaddle());
armor = ItemUtils.smallString(horse.getInventory().getArmor());
} else if (entity.getType() == EntityType.LLAMA) {
Llama llama = (Llama) h;
horseColor = llama.getColor().name();
saddle = ItemUtils.smallString(llama.getInventory().getDecor());
} else if (entity.getType() == EntityType.MULE || entity.getType() == EntityType.DONKEY || entity.getType() == EntityType.ZOMBIE_HORSE || entity.getType() == EntityType.SKELETON_HORSE) {
// Actually a saddle
saddle = ItemUtils.smallString(h.getInventory().getItem(0));
}
if (entity instanceof ChestedHorse) {
chest = ((ChestedHorse) entity).isCarryingChest();
}
dom = h.getDomestication();
maxDom = h.getMaxDomestication();
jump = h.getJumpStrength();
maxHealth = h.getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue();
AttributeInstance attributeInstance = h.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED);
if (attributeInstance != null) {
movementSpeed = attributeInstance.getBaseValue();
}
}
Aggregations