mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-17 05:03:55 -07:00
Refactored a bunch of death code into the event factory
This commit is contained in:
@@ -62,14 +62,7 @@ public class EntityCow extends EntityAnimal {
|
||||
loot.add(new org.bukkit.inventory.ItemStack(this.fireTicks > 0 ? Item.COOKED_BEEF.id : Item.RAW_BEEF.id, count));
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user