public class Backpack extends java.lang.Object implements WauzInventory
Modifier and Type | Field and Description |
---|---|
private static java.util.Map<org.bukkit.entity.Player,org.bukkit.inventory.Inventory> |
backpackMap
A map of cached backpacks, indexed by player.
|
static int |
BASE_SIZE
The base amount of slots available in the backpack.
|
Constructor and Description |
---|
Backpack() |
Modifier and Type | Method and Description |
---|---|
static org.bukkit.inventory.Inventory |
getBackpack(org.bukkit.entity.Player player)
Gets or creates / loads the backpack of the given player.
|
java.util.List<WauzMode> |
getGamemodes() |
java.lang.String |
getInventoryId() |
static void |
open(org.bukkit.entity.Player player)
Opens the menu for the given player.
|
void |
openInstance(org.bukkit.entity.Player player)
Opens a new inventory of this type for the given player.
|
void |
selectMenuPoint(org.bukkit.event.inventory.InventoryClickEvent event)
Checks if an event in this inventory was triggered by a player click.
|
static void |
unloadBackpack(org.bukkit.entity.Player player)
Unloads the cache of the backpack of the given player.
|
static void |
updateLockedSlots(org.bukkit.entity.Player player)
Updates the slots that are locked in the backpack of the given player.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
destroyInventory
public static final int BASE_SIZE
private static final java.util.Map<org.bukkit.entity.Player,org.bukkit.inventory.Inventory> backpackMap
public java.lang.String getInventoryId()
getInventoryId
in interface WauzInventory
public java.util.List<WauzMode> getGamemodes()
getGamemodes
in interface WauzInventory
public void openInstance(org.bukkit.entity.Player player)
openInstance
in interface WauzInventory
player
- The player that should view the inventory.public static void open(org.bukkit.entity.Player player)
player
- The player that should view the inventory.public static org.bukkit.inventory.Inventory getBackpack(org.bukkit.entity.Player player)
player
- The player who owns the backpack.public static void updateLockedSlots(org.bukkit.entity.Player player)
player
- The player who owns the backpack.public static void unloadBackpack(org.bukkit.entity.Player player)
player
- The player who owns the backpack.public void selectMenuPoint(org.bukkit.event.inventory.InventoryClickEvent event)
selectMenuPoint
in interface WauzInventory
event
- The inventory click event.