Added ItemDespawnEvent

By: Feildmaster <admin@feildmaster.com>
This commit is contained in:
CraftBukkit/Spigot 2011-10-17 07:38:03 -05:00
parent f2606b7cbe
commit 30bb54a655

View File

@ -141,7 +141,6 @@ public class CraftEventFactory {
/** /**
* Player Interact event * Player Interact event
*/ */
public static PlayerInteractEvent callPlayerInteractEvent(EntityHuman who, Action action, ItemStack itemstack) { public static PlayerInteractEvent callPlayerInteractEvent(EntityHuman who, Action action, ItemStack itemstack) {
if (action != Action.LEFT_CLICK_AIR && action != Action.RIGHT_CLICK_AIR) { if (action != Action.LEFT_CLICK_AIR && action != Action.RIGHT_CLICK_AIR) {
throw new IllegalArgumentException(); throw new IllegalArgumentException();
@ -286,6 +285,18 @@ public class CraftEventFactory {
return event; return event;
} }
/**
* ItemDespawnEvent
*/
public static ItemDespawnEvent callItemDespawnEvent(EntityItem entityitem) {
org.bukkit.entity.Entity entity = entityitem.getBukkitEntity();
ItemDespawnEvent event = new ItemDespawnEvent(entity, entity.getLocation());
((CraftServer) entity.getServer()).getPluginManager().callEvent(event);
return event;
}
/** /**
* BlockFadeEvent * BlockFadeEvent
*/ */