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/EntityPlayer.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/EntityPlayer.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityPlayer.java | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java index b5c90270..799aae64 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -9,8 +9,8 @@ import java.util.Set; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.ChunkCompressionThread; import org.bukkit.craftbukkit.CraftWorld; +import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; // CraftBukkit end @@ -60,6 +60,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public String displayName; public org.bukkit.Location compassTarget; + public int newExp = 0; // CraftBukkit end public void a(NBTTagCompound nbttagcompound) { @@ -154,11 +155,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } } - org.bukkit.entity.Entity bukkitEntity = this.getBukkitEntity(); - CraftWorld bworld = this.world.getWorld(); - - EntityDeathEvent event = new EntityDeathEvent(bukkitEntity, loot); - this.world.getServer().getPluginManager().callEvent(event); + CraftEventFactory.callPlayerDeathEvent(this, loot); // CraftBukkit - we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory. for (int i = 0; i < this.inventory.items.length; ++i) { @@ -169,10 +166,6 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.inventory.armor[i] = null; } - for (org.bukkit.inventory.ItemStack stack: event.getDrops()) { - bworld.dropItemNaturally(bukkitEntity.getLocation(), stack); - } - this.x(); // CraftBukkit end } |