Class BlockMenuPreset
java.lang.Object
me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu
me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset
-
Nested Class Summary
Nested classes/interfaces inherited from class me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu
ChestMenu.AdvancedMenuClickHandler, ChestMenu.MenuClickHandler, ChestMenu.MenuCloseHandler, ChestMenu.MenuOpeningHandler -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBlockMenuPreset(String id, String title) protectedBlockMenuPreset(String id, String title, boolean universal) -
Method Summary
Modifier and TypeMethodDescriptionAdds an Item to the Inventory in that SlotaddMenuClickHandler(int slot, ChestMenu.MenuClickHandler handler) Executes a certain Action upon clicking an Item in the Menuabstract booleanprotected voidclone(DirtyChestMenu menu) voiddrawBackground(int[] slots) This method will draw unclickable background items into thisBlockMenuPreset.voiddrawBackground(ItemStack item, int[] slots) This method will draw unclickable background items into thisBlockMenuPreset.getID()This returns the id of the associatedSlimefunItem.static BlockMenuPresetintgetSize()This method returns the size of thisBlockMenuPreset.This returns theSlimefunItemassociated with thisBlockMenuPreset.int[]getSlotsAccessedByItemTransport(DirtyChestMenu menu, ItemTransportFlow flow, ItemStack item) abstract int[]getTitle()This returns the title of thisBlockMenuPreset, the title will be visible in everyInventoryViewfor any menu created using thisBlockMenuPreset.abstract voidinit()static booleanisInventory(String id) booleanThis method returns whether thisBlockMenuPresetwill spawn aUniversalBlockMenu.static booleanvoidnewInstance(BlockMenu menu, Block b) voidnewInstance(BlockMenu menu, Location l) protected ItemStackonItemStackChange(DirtyChestMenu menu, int slot, ItemStack previous, ItemStack next) This method is called whenever anItemStackchanges.voidreplaceExistingItem(int slot, ItemStack item) Modifies an ItemStack in an ALREADY OPENED ChestMenusetSize(int size) Methods inherited from class me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu
addItem, addMenuCloseHandler, addMenuOpeningHandler, addPlayerInventoryClickHandler, build, getContents, getItemInSlot, getMenuClickHandler, getMenuCloseHandler, getMenuOpeningHandler, getPlayerInventoryClickHandler, isEmptySlotsClickable, isPlayerInventoryClickable, open, reset, setEmptySlotsClickable, setPlayerInventoryClickable, toInventory
-
Constructor Details
-
BlockMenuPreset
-
BlockMenuPreset
-
-
Method Details
-
init
public abstract void init() -
canOpen
-
getSlotsAccessedByItemTransport
-
onItemStackChange
@Nullable protected ItemStack onItemStackChange(@Nonnull DirtyChestMenu menu, int slot, @Nullable ItemStack previous, @Nullable ItemStack next) This method is called whenever anItemStackchanges. You can override this as necessary if you need to listen to these events -
newInstance
-
getSlotsAccessedByItemTransport
public int[] getSlotsAccessedByItemTransport(DirtyChestMenu menu, ItemTransportFlow flow, ItemStack item) -
replaceExistingItem
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
-
drawBackground
This method will draw unclickable background items into thisBlockMenuPreset.- Parameters:
item- TheItemStackthat should be used as backgroundslots- The slots which should be treated as background
-
drawBackground
public void drawBackground(@Nonnull int[] slots) This method will draw unclickable background items into thisBlockMenuPreset.- Parameters:
slots- The slots which should be treated as background
-
addItem
Description copied from class:ChestMenuAdds an Item to the Inventory in that Slot -
addMenuClickHandler
Description copied from class:ChestMenuExecutes a certain Action upon clicking an Item in the Menu- Overrides:
addMenuClickHandlerin classChestMenu- Parameters:
slot- The Slot in the Inventoryhandler- The MenuClickHandler- Returns:
- The ChestMenu Instance
-
setSize
-
getSize
public int getSize()This method returns the size of thisBlockMenuPreset. If the size has not been determined yet, this will return -1.- Returns:
- The size of this
BlockMenuPreset
-
getTitle
This returns the title of thisBlockMenuPreset, the title will be visible in everyInventoryViewfor any menu created using thisBlockMenuPreset.- Returns:
- The inventory title for this
BlockMenuPreset
-
isUniversal
public boolean isUniversal()This method returns whether thisBlockMenuPresetwill spawn aUniversalBlockMenu.- Returns:
- Whether this
BlockMenuPresetis universal
-
getPresetSlots
-
getInventorySlots
-
clone
-
newInstance
-
getID
This returns the id of the associatedSlimefunItem. It also doubles as the id for thisBlockMenuPreset.- Returns:
- Our identifier
-
getSlimefunItem
This returns theSlimefunItemassociated with thisBlockMenuPreset.- Returns:
- The associated
SlimefunItem
-
getPreset
-
isInventory
-
isUniversalInventory
-