Class ChestMenu
java.lang.Object
me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu
- Direct Known Subclasses:
BlockMenuPreset
,DirtyChestMenu
An old remnant of CS-CoreLib.
This will be removed once we updated everything.
Don't look at the code, it will be gone soon, don't worry.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
static interface
static interface
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds an Item to the Inventory in that SlotaddItem
(int slot, ItemStack item, ChestMenu.MenuClickHandler clickHandler) Adds an Item to the Inventory in that Slot as well as a Click HandleraddMenuClickHandler
(int slot, ChestMenu.MenuClickHandler handler) Executes a certain Action upon clicking an Item in the MenuExecutes a certain Action upon closing this MenuExecutes a certain Action upon opening this MenuAdds a ClickHandler to ALL Slots of the Player's Inventorybuild()
Finishes the Creation of the MenuReturns an Array containing the Contents of this InventorygetItemInSlot
(int slot) Returns the ItemStack in that SlotgetMenuClickHandler
(int slot) Returns the MenuClickHandler which was registered for the specified SlotReturns the registered MenuCloseHandlerReturns the registered MenuOpeningHandlerReturns the registered MenuClickHandler for Player Inventoriesboolean
Returns whether the empty menu slots are clickable while viewing this Menuboolean
Returns whether the Player's Inventory is accessible while viewing this Menuvoid
Opens this Menu for the specified Player/svoid
replaceExistingItem
(int slot, ItemStack item) Modifies an ItemStack in an ALREADY OPENED ChestMenuvoid
reset
(boolean update) setEmptySlotsClickable
(boolean emptyClickable) Toggles whether Players can click the empty menu slots while viewing this MenusetPlayerInventoryClickable
(boolean clickable) Toggles whether Players can access there Inventory while viewing this MenuConverts this ChestMenu Instance into a normal Inventory
-
Constructor Details
-
ChestMenu
Creates a new ChestMenu with the specified Title- Parameters:
title
- The title of the Menu
-
-
Method Details
-
setPlayerInventoryClickable
Toggles whether Players can access there Inventory while viewing this Menu- Parameters:
clickable
- Whether the Player can access his Inventory- Returns:
- The ChestMenu Instance
-
isPlayerInventoryClickable
public boolean isPlayerInventoryClickable()Returns whether the Player's Inventory is accessible while viewing this Menu- Returns:
- Whether the Player Inventory is clickable
-
setEmptySlotsClickable
Toggles whether Players can click the empty menu slots while viewing this Menu- Parameters:
emptyClickable
- Whether the Player can click empty slots- Returns:
- The ChestMenu Instance
-
isEmptySlotsClickable
public boolean isEmptySlotsClickable()Returns whether the empty menu slots are clickable while viewing this Menu- Returns:
- Whether the empty menu slots are clickable
-
addPlayerInventoryClickHandler
Adds a ClickHandler to ALL Slots of the Player's Inventory- Parameters:
handler
- The MenuClickHandler- Returns:
- The ChestMenu Instance
-
addItem
Adds an Item to the Inventory in that Slot- Parameters:
slot
- The Slot in the Inventoryitem
- The Item for that Slot- Returns:
- The ChestMenu Instance
-
addItem
Adds an Item to the Inventory in that Slot as well as a Click Handler- Parameters:
slot
- The Slot in the Inventoryitem
- The Item for that SlotclickHandler
- The MenuClickHandler for that Slot- Returns:
- The ChestMenu Instance
-
getItemInSlot
Returns the ItemStack in that Slot- Parameters:
slot
- The Slot in the Inventory- Returns:
- The ItemStack in that Slot
-
addMenuClickHandler
Executes a certain Action upon clicking an Item in the Menu- Parameters:
slot
- The Slot in the Inventoryhandler
- The MenuClickHandler- Returns:
- The ChestMenu Instance
-
addMenuOpeningHandler
Executes a certain Action upon opening this Menu- Parameters:
handler
- The MenuOpeningHandler- Returns:
- The ChestMenu Instance
-
addMenuCloseHandler
Executes a certain Action upon closing this Menu- Parameters:
handler
- The MenuCloseHandler- Returns:
- The ChestMenu Instance
-
build
Finishes the Creation of the Menu- Returns:
- The ChestMenu Instance
-
getContents
Returns an Array containing the Contents of this Inventory- Returns:
- The Contents of this Inventory
-
reset
public void reset(boolean update) -
replaceExistingItem
Modifies an ItemStack in an ALREADY OPENED ChestMenu- Parameters:
slot
- The Slot of the Item which will be replaceditem
- The new Item
-
open
Opens this Menu for the specified Player/s- Parameters:
players
- The Players who will see this Menu
-
getMenuClickHandler
Returns the MenuClickHandler which was registered for the specified Slot- Parameters:
slot
- The Slot in the Inventory- Returns:
- The MenuClickHandler registered for the specified Slot
-
getMenuCloseHandler
Returns the registered MenuCloseHandler- Returns:
- The registered MenuCloseHandler
-
getMenuOpeningHandler
Returns the registered MenuOpeningHandler- Returns:
- The registered MenuOpeningHandler
-
getPlayerInventoryClickHandler
Returns the registered MenuClickHandler for Player Inventories- Returns:
- The registered MenuClickHandler
-
toInventory
Converts this ChestMenu Instance into a normal Inventory- Returns:
- The converted Inventory
-