
org.bukkit.event.inventory.InventoryEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of walk-server Show documentation
Show all versions of walk-server Show documentation
A spigot fork to kotlin structure and news.
package org.bukkit.event.inventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import java.util.List;
/**
* Represents a player related inventory event
*/
public class InventoryEvent extends Event {
private static final HandlerList handlers = new HandlerList();
protected InventoryView transaction;
public InventoryEvent(InventoryView transaction) {
this.transaction = transaction;
}
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Gets the primary Inventory involved in this transaction
*
* @return The upper inventory.
*/
public Inventory getInventory() {
return transaction.getTopInventory();
}
/**
* Gets the list of players viewing the primary (upper) inventory involved
* in this event
*
* @return A list of people viewing.
*/
public List getViewers() {
return transaction.getTopInventory().getViewers();
}
/**
* Gets the view object itself
*
* @return InventoryView
*/
public InventoryView getView() {
return transaction;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy