Caught pigs with saddles will now drop their saddle.

This commit is contained in:
Shansen 2013-06-24 14:47:09 +01:00
parent 1e2170db6a
commit 1934aa4bf9

View File

@ -248,6 +248,7 @@ public class EggCatcherEntityListener implements Listener {
}
ItemStack eggStack = new ItemStack(383, 1, eggType.getCreatureId());
String customName = ((LivingEntity) entity).getCustomName();
if (customName != null) {
@ -257,6 +258,12 @@ public class EggCatcherEntityListener implements Listener {
eggStack.setItemMeta(meta);
}
if(entity instanceof Pig) {
if(((Pig)entity).hasSaddle()) {
entity.getWorld().dropItem(entity.getLocation(), new ItemStack(329, 1));
}
}
entity.getWorld().dropItem(entity.getLocation(), eggStack);
if (!this.spawnChickenOnSuccess) {