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 TypeMethodDescriptionboolean
canOpen
(org.bukkit.block.Block b, org.bukkit.entity.Player p) void
close()
void
consumeItem
(int slot) void
consumeItem
(int slot, int amount) void
consumeItem
(int slot, int amount, boolean replaceConsumables) boolean
fits
(org.bukkit.inventory.ItemStack item, int... slots) int
boolean
This method checks whether thisDirtyChestMenu
is currently viewed by aPlayer
.boolean
isDirty()
void
void
open
(org.bukkit.entity.Player... players) Opens this Menu for the specified Player/sorg.bukkit.inventory.ItemStack
pushItem
(org.bukkit.inventory.ItemStack item, int... slots) Adds givenItemStack
to any of the given inventory slots.void
replaceExistingItem
(int slot, org.bukkit.inventory.ItemStack item) Modifies an ItemStack in an ALREADY OPENED ChestMenuvoid
replaceExistingItem
(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, unlock
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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 thisDirtyChestMenu
is 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:ChestMenu
Opens 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 givenItemStack
to 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
-ItemStack
to be added to the inventoryslots
- Numbers of slots to add theItemStack
to- Returns:
ItemStack
with 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:ChestMenu
Modifies an ItemStack in an ALREADY OPENED ChestMenu- Overrides:
replaceExistingItem
in 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)
-