Class DirtyChestMenu
java.lang.Object
city.norain.slimefun4.holder.SlimefunInventoryHolder
me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu
me.mrCookieSlime.Slimefun.api.inventory.DirtyChestMenu
- All Implemented Interfaces:
org.bukkit.inventory.InventoryHolder
- Direct Known Subclasses:
BlockMenu,UniversalMenu
-
Nested Class Summary
Nested classes/interfaces inherited from class me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu
ChestMenu.AdvancedMenuClickHandler, ChestMenu.MenuClickHandler, ChestMenu.MenuCloseHandler, ChestMenu.MenuOpeningHandler -
Field Summary
FieldsFields inherited from class city.norain.slimefun4.holder.SlimefunInventoryHolder
inventory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanOpen(org.bukkit.block.Block b, org.bukkit.entity.Player p) voidclose()voidconsumeItem(int slot) voidconsumeItem(int slot, int amount) voidconsumeItem(int slot, int amount, boolean replaceConsumables) booleanfits(org.bukkit.inventory.ItemStack item, int... slots) intbooleanThis method checks whether thisDirtyChestMenuis currently viewed by aPlayer.booleanisDirty()voidvoidopen(org.bukkit.entity.Player... players) Opens this Menu for the specified Player/sorg.bukkit.inventory.ItemStackpushItem(org.bukkit.inventory.ItemStack item, int... slots) Adds givenItemStackto any of the given inventory slots.voidreplaceExistingItem(int slot, org.bukkit.inventory.ItemStack item) Modifies an ItemStack in an ALREADY OPENED ChestMenuvoidreplaceExistingItem(int slot, org.bukkit.inventory.ItemStack item, boolean event) Methods inherited from class me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu
addItem, addItem, addMenuClickHandler, addMenuCloseHandler, addMenuOpeningHandler, addPlayerInventoryClickHandler, addViewer, build, contains, getContents, getItemInSlot, getMenuClickHandler, getMenuCloseHandler, getMenuOpeningHandler, getPlayerInventoryClickHandler, getSize, isEmptySlotsClickable, isPlayerInventoryClickable, isSizeAutomaticallyInferred, lock, locked, removeViewer, reset, setEmptySlotsClickable, setPlayerInventoryClickable, setSize, toInventory, unlockMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bukkit.inventory.InventoryHolder
getInventory
-
Field Details
-
preset
-
changes
protected int changes
-
-
Constructor Details
-
DirtyChestMenu
-
-
Method Details
-
hasViewer
public boolean hasViewer()This method checks whether thisDirtyChestMenuis currently viewed by aPlayer.- Returns:
- Whether anyone is currently viewing this
Inventory
-
markDirty
public void markDirty() -
isDirty
public boolean isDirty() -
getUnsavedChanges
public int getUnsavedChanges() -
getPreset
-
canOpen
public boolean canOpen(org.bukkit.block.Block b, org.bukkit.entity.Player p) -
open
public void open(org.bukkit.entity.Player... players) Description copied from class:ChestMenuOpens this Menu for the specified Player/s -
close
public void close() -
fits
public boolean fits(@Nonnull org.bukkit.inventory.ItemStack item, int... slots) -
pushItem
@Nullable public org.bukkit.inventory.ItemStack pushItem(org.bukkit.inventory.ItemStack item, int... slots) Adds givenItemStackto any of the given inventory slots. Items will be added to the inventory slots based on their order in the function argument. Items will be added either to any empty inventory slots or any partially filled slots, in which case as many items as can fit will be added to that specific spot.- Parameters:
item-ItemStackto be added to the inventoryslots- Numbers of slots to add theItemStackto- Returns:
ItemStackwith any items that did not fit into the inventory or null when everything had fit
-
consumeItem
public void consumeItem(int slot) -
consumeItem
public void consumeItem(int slot, int amount) -
consumeItem
public void consumeItem(int slot, int amount, boolean replaceConsumables) -
replaceExistingItem
public void replaceExistingItem(int slot, org.bukkit.inventory.ItemStack item) Description copied from class:ChestMenuModifies an ItemStack in an ALREADY OPENED ChestMenu- Overrides:
replaceExistingItemin classChestMenu- Parameters:
slot- The Slot of the Item which will be replaceditem- The new Item
-
replaceExistingItem
public void replaceExistingItem(int slot, org.bukkit.inventory.ItemStack item, boolean event)
-