From 1934aa4bf9da1bdd7976d0fa49cc01388499b83a Mon Sep 17 00:00:00 2001 From: Shansen Date: Mon, 24 Jun 2013 14:47:09 +0100 Subject: [PATCH] Caught pigs with saddles will now drop their saddle. --- .../EggCatcher/listeners/EggCatcherEntityListener.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/me/shansen/EggCatcher/listeners/EggCatcherEntityListener.java b/src/main/java/me/shansen/EggCatcher/listeners/EggCatcherEntityListener.java index 6aa4ae9..95da32c 100644 --- a/src/main/java/me/shansen/EggCatcher/listeners/EggCatcherEntityListener.java +++ b/src/main/java/me/shansen/EggCatcher/listeners/EggCatcherEntityListener.java @@ -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) {