Class DirtyChestMenu

java.lang.Object
me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu
me.mrCookieSlime.Slimefun.api.inventory.DirtyChestMenu
Direct Known Subclasses:
BlockMenu, UniversalBlockMenu

public class DirtyChestMenu extends ChestMenu
  • Field Details

    • preset

      protected final BlockMenuPreset preset
    • changes

      protected int changes
  • Constructor Details

  • Method Details

    • hasViewer

      public boolean hasViewer()
      This method checks whether this DirtyChestMenu is currently viewed by a Player.
      Returns:
      Whether anyone is currently viewing this Inventory
    • markDirty

      public void markDirty()
    • isDirty

      public boolean isDirty()
    • getUnsavedChanges

      public int getUnsavedChanges()
    • getPreset

      @Nonnull public BlockMenuPreset getPreset()
    • canOpen

      public boolean canOpen(Block b, Player p)
    • open

      public void open(Player... players)
      Description copied from class: ChestMenu
      Opens this Menu for the specified Player/s
      Overrides:
      open in class ChestMenu
      Parameters:
      players - The Players who will see this Menu
    • close

      public void close()
    • fits

      public boolean fits(@Nonnull ItemStack item, int... slots)
    • pushItem

      @Nullable public ItemStack pushItem(ItemStack item, int... slots)
      Adds given ItemStack 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 inventory
      slots - Numbers of slots to add the ItemStack 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, ItemStack item)
      Description copied from class: ChestMenu
      Modifies an ItemStack in an ALREADY OPENED ChestMenu
      Overrides:
      replaceExistingItem in class ChestMenu
      Parameters:
      slot - The Slot of the Item which will be replaced
      item - The new Item
    • replaceExistingItem

      public void replaceExistingItem(int slot, ItemStack item, boolean event)