public class MaterialPouch extends java.lang.Object implements WauzInventory
Modifier and Type | Field and Description |
---|---|
private static java.util.Map<java.lang.String,org.bukkit.inventory.Inventory> |
inventoryMap
A map of cached inventories.
|
private java.lang.String |
inventoryName
The name of the inventory, representing the section of the pouch to show.
|
Modifier | Constructor and Description |
---|---|
|
MaterialPouch()
Creates a new menu to display the contents of the materials section of the material pouch.
|
private |
MaterialPouch(java.lang.String inventoryName)
Creates a new menu to display the contents of the given section of the material pouch.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
addItem(org.bukkit.entity.Player player,
org.bukkit.inventory.ItemStack itemStack,
java.lang.String inventoryName)
Let's the player add an item to the inventory, if there is enough space.
|
java.util.List<WauzMode> |
getGamemodes() |
static org.bukkit.inventory.Inventory |
getInventory(org.bukkit.entity.Player player,
java.lang.String inventoryName)
Gets or creates / loads the inventory with the given name for the player.
|
java.lang.String |
getInventoryId() |
static void |
open(org.bukkit.entity.Player player)
Opens the menu for the given player.
|
static void |
open(org.bukkit.entity.Player player,
java.lang.String inventoryName)
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 |
unloadInventory(org.bukkit.entity.Player player,
java.lang.String inventoryName)
Unloads the cache of the inventory with the given name for the player.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
destroyInventory
private static final java.util.Map<java.lang.String,org.bukkit.inventory.Inventory> inventoryMap
private java.lang.String inventoryName
public MaterialPouch()
private MaterialPouch(java.lang.String inventoryName)
inventoryName
- The name of the inventory, representing the section of the pouch to show.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.open(Player, String)
public static void open(org.bukkit.entity.Player player, java.lang.String inventoryName)
player
- The player that should view the inventory.inventoryName
- The name of the inventory, representing the section of the pouch to show.MenuUtils.setBorders(Inventory)
public static org.bukkit.inventory.Inventory getInventory(org.bukkit.entity.Player player, java.lang.String inventoryName)
player
- The player who owns the pouch that contains the inventory.inventoryName
- The name of the inventory.public static void unloadInventory(org.bukkit.entity.Player player, java.lang.String inventoryName)
player
- The player who owns the pouch that contains the inventory.inventoryName
- The name of the inventory.public static boolean addItem(org.bukkit.entity.Player player, org.bukkit.inventory.ItemStack itemStack, java.lang.String inventoryName)
player
- The player who owns the pouch that contains the inventory.itemStack
- The item stack to add to the inventory.inventoryName
- The name of the inventory.public void selectMenuPoint(org.bukkit.event.inventory.InventoryClickEvent event)
selectMenuPoint
in interface WauzInventory
event
- The inventory click event.WauzShopActions.sell(Player, ItemStack, boolean)
,
WauzPlayerEventMaterialsSell
,
open(Player, String)