diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-09-21 15:41:24 +0100 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-09-21 15:41:24 +0100 |
commit | 20ddc944bb38b96ac5deb742126c53b9989b5c31 (patch) | |
tree | cf8cef5a55f609417a756d34a7b09034d48b69e9 /src/main/java/net/minecraft/server/EntityChicken.java | |
parent | 751ab82be07aec65151d7a0a76b90d8fc12974f6 (diff) | |
download | craftbukkit-20ddc944bb38b96ac5deb742126c53b9989b5c31.tar craftbukkit-20ddc944bb38b96ac5deb742126c53b9989b5c31.tar.gz craftbukkit-20ddc944bb38b96ac5deb742126c53b9989b5c31.tar.lz craftbukkit-20ddc944bb38b96ac5deb742126c53b9989b5c31.tar.xz craftbukkit-20ddc944bb38b96ac5deb742126c53b9989b5c31.zip |
Refactored a bunch of death code into the event factory
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityChicken.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityChicken.java | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/main/java/net/minecraft/server/EntityChicken.java b/src/main/java/net/minecraft/server/EntityChicken.java index e8797157..2cd58802 100644 --- a/src/main/java/net/minecraft/server/EntityChicken.java +++ b/src/main/java/net/minecraft/server/EntityChicken.java @@ -2,10 +2,7 @@ package net.minecraft.server; // CraftBukkit start import java.util.List; - -import org.bukkit.Location; -import org.bukkit.craftbukkit.entity.CraftEntity; -import org.bukkit.event.entity.EntityDeathEvent; +import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit end public class EntityChicken extends EntityAnimal { @@ -92,14 +89,7 @@ public class EntityChicken extends EntityAnimal { loot.add(new org.bukkit.inventory.ItemStack(this.fireTicks > 0 ? Item.COOKED_CHICKEN.id : Item.RAW_CHICKEN.id, 1)); } - CraftEntity entity = (CraftEntity) this.getBukkitEntity(); - EntityDeathEvent event = new EntityDeathEvent(entity, loot); - org.bukkit.World bworld = this.world.getWorld(); - this.world.getServer().getPluginManager().callEvent(event); - - for (org.bukkit.inventory.ItemStack stack: event.getDrops()) { - bworld.dropItemNaturally(entity.getLocation(), stack); - } + CraftEventFactory.callEntityDeathEvent(this, loot); // CraftBukkit end } } |