diff options
author | Feildmaster <admin@feildmaster.com> | 2011-10-17 07:38:03 -0500 |
---|---|---|
committer | Nathan Adams <dinnerbone@dinnerbone.com> | 2012-01-14 17:03:38 +0000 |
commit | 6cc56b8c2ccd6ae3b01aac549ca2a1c694818065 (patch) | |
tree | c5c744ab650f1d09c0eacd54bb34ba213535d913 /src/main/java/net | |
parent | cc05bea457976aed4ec213499ede7677118a8843 (diff) | |
download | craftbukkit-6cc56b8c2ccd6ae3b01aac549ca2a1c694818065.tar craftbukkit-6cc56b8c2ccd6ae3b01aac549ca2a1c694818065.tar.gz craftbukkit-6cc56b8c2ccd6ae3b01aac549ca2a1c694818065.tar.lz craftbukkit-6cc56b8c2ccd6ae3b01aac549ca2a1c694818065.tar.xz craftbukkit-6cc56b8c2ccd6ae3b01aac549ca2a1c694818065.zip |
Added ItemDespawnEvent
Diffstat (limited to 'src/main/java/net')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityItem.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java index d314cef9..40c148ca 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -1,6 +1,9 @@ package net.minecraft.server; -import org.bukkit.event.player.PlayerPickupItemEvent; // CraftBukkit +// CraftBukkit start +import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.event.player.PlayerPickupItemEvent; +// CraftBukkit End public class EntityItem extends Entity { @@ -83,6 +86,12 @@ public class EntityItem extends Entity { ++this.e; ++this.b; if (this.b >= 6000) { + // CraftBukkit start + if(CraftEventFactory.callItemDespawnEvent(this).isCancelled()) { + this.b = 0; + return; + } + // CraftBukkit end this.die(); } } |