Added ItemDespawnEvent

This commit is contained in:
Feildmaster
2011-10-17 07:38:03 -05:00
committed by Nathan Adams
parent cc05bea457
commit 6cc56b8c2c
2 changed files with 22 additions and 2 deletions

View File

@@ -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();
}
}