diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2012-08-05 22:35:54 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2012-08-05 23:57:22 -0500 |
commit | 304cb019e45972ebf7f5e4ad33428cd4f17712d8 (patch) | |
tree | 951bf685cd60d9d6195c4816b07ec51fc5e53925 /src | |
parent | 9cccb1c89e45edbba80e2ccb5e048f194129f2a7 (diff) | |
download | craftbukkit-304cb019e45972ebf7f5e4ad33428cd4f17712d8.tar craftbukkit-304cb019e45972ebf7f5e4ad33428cd4f17712d8.tar.gz craftbukkit-304cb019e45972ebf7f5e4ad33428cd4f17712d8.tar.lz craftbukkit-304cb019e45972ebf7f5e4ad33428cd4f17712d8.tar.xz craftbukkit-304cb019e45972ebf7f5e4ad33428cd4f17712d8.zip |
Fire EntityDeathEvent for pigs. Fixes BUKKIT-2100
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityPig.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java index e809ba5f..ce169176 100644 --- a/src/main/java/net/minecraft/server/EntityPig.java +++ b/src/main/java/net/minecraft/server/EntityPig.java @@ -70,15 +70,20 @@ public class EntityPig extends EntityAnimal { } protected void dropDeathLoot(boolean flag, int i) { + // CraftBukkit start + java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(); int j = this.random.nextInt(3) + 1 + this.random.nextInt(1 + i); - for (int k = 0; k < j; ++k) { + if (j > 0) { if (this.isBurning()) { - this.b(Item.GRILLED_PORK.id, 1); + loot.add(new org.bukkit.inventory.ItemStack(Item.GRILLED_PORK.id, j)); } else { - this.b(Item.PORK.id, 1); + loot.add(new org.bukkit.inventory.ItemStack(Item.PORK.id, j)); } } + + org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot); + // CraftBukkit end } public boolean hasSaddle() { |