Added INVENTORY_OPEN as a player event

By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
Bukkit/Spigot
2011-01-30 22:05:36 +00:00
parent 301b48abea
commit 63181e1c59
3 changed files with 40 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
package org.bukkit.event.player;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
/**
* Represents a player related inventory event
*/
public class PlayerInventoryEvent extends PlayerEvent {
protected Inventory inventory;
public PlayerInventoryEvent(final Type type, final Player player, final Inventory inventory) {
super(type, player);
this.inventory = inventory;
}
/**
* Gets the Inventory involved in this event
*
* @return Inventory
*/
public Inventory getInventory() {
return inventory;
}
}

View File

@@ -89,4 +89,12 @@ public class PlayerListener implements Listener {
*/
public void onPlayerAnimation(PlayerAnimationEvent event) {
}
/**
* Called when a player opens an inventory
*
* @param event Relevant event details
*/
public void onInventoryOpen(PlayerInventoryEvent event) {
}
}