Package fr.maxlego08.menu.api
Interface Inventory
public interface Inventory
The `Inventory` interface defines the structure and behavior of inventory-related operations.
Documentation: Inventory documentation
This class encapsulates information about an inventory, including its size, buttons, patterns, and associated requirements.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines whether the player's inventory should be cleared upon closing the inventory.voidcloseInventory(org.bukkit.entity.Player player, fr.maxlego08.menu.inventory.inventories.InventoryDefault inventoryDefault) Closes the inventory for a player.Returns a collection of buttons present in the inventory.getButtons(Class<T> type) Returns a list of buttons of a specific type.getFile()Returns the configuration file associated with the inventory.Returns the name of the file associated with the inventory.fr.maxlego08.menu.MenuItemStackReturns the item stack used to fill empty slots in the inventory.intgetMaxPage(Collection<Pattern> patterns, org.bukkit.entity.Player player, Object... objects) Returns the maximum number of pages for the inventory.intgetMaxPage(org.bukkit.entity.Player player, Object... objects) Deprecated.getName()Returns the name of the inventory.fr.maxlego08.menu.api.requirement.RequirementReturns the requirement for opening the inventory.Returns the item that can be used to open the inventory.Returns a collection of patterns associated with the inventory.org.bukkit.plugin.PluginReturns the plugin from which the inventory originates.intReturns the interval for updating buttons in the inventory.fr.maxlego08.menu.zcore.utils.inventory.InventoryResultopenInventory(org.bukkit.entity.Player player, fr.maxlego08.menu.inventory.inventories.InventoryDefault inventoryDefault) Opens the inventory for a player and returns the result of the operation.voidpostOpenInventory(org.bukkit.entity.Player player, fr.maxlego08.menu.inventory.inventories.InventoryDefault inventoryDefault) Performs post-opening actions for the inventory.intsize()Returns the size of the inventory.sortButtons(int page, Object... objects) Sorts the buttons based on the current page and additional elements.sortPatterns(Pattern pattern, int page, Object... objects) Sorts the pattern buttons based on the current page and additional elements.
-
Method Details
-
size
int size()Returns the size of the inventory.- Returns:
- The size of the inventory.
-
getName
String getName()Returns the name of the inventory.- Returns:
- The name of the inventory.
-
getFileName
String getFileName()Returns the name of the file associated with the inventory.- Returns:
- The file name.
-
getButtons
Collection<Button> getButtons()Returns a collection of buttons present in the inventory.- Returns:
- A collection of buttons.
-
getPatterns
Collection<Pattern> getPatterns()Returns a collection of patterns associated with the inventory.- Returns:
- A collection of patterns.
-
getButtons
Returns a list of buttons of a specific type.- Type Parameters:
T- The button type.- Parameters:
type- The class type of the button.- Returns:
- A list of buttons with the specified type.
-
getPlugin
org.bukkit.plugin.Plugin getPlugin()Returns the plugin from which the inventory originates.- Returns:
- The plugin.
-
getMaxPage
Deprecated.Returns the maximum number of pages for the inventory.- Parameters:
player- The player for whom the page count is determined.objects- Additional elements.- Returns:
- The maximum number of pages.
-
getMaxPage
Returns the maximum number of pages for the inventory.- Parameters:
patterns- Pattern listplayer- The player for whom the page count is determined.objects- Additional elements.- Returns:
- The maximum number of pages.
-
sortButtons
Sorts the buttons based on the current page and additional elements.- Parameters:
page- The current page.objects- Additional elements.- Returns:
- A list of sorted buttons.
-
getFillItemStack
fr.maxlego08.menu.MenuItemStack getFillItemStack()Returns the item stack used to fill empty slots in the inventory.- Returns:
- The fill item stack.
-
getUpdateInterval
int getUpdateInterval()Returns the interval for updating buttons in the inventory.- Returns:
- The update interval.
-
getFile
File getFile()Returns the configuration file associated with the inventory.- Returns:
- The configuration file.
-
cleanInventory
boolean cleanInventory()Determines whether the player's inventory should be cleared upon closing the inventory.- Returns:
- True if the player's inventory should be cleaned, false otherwise.
-
getOpenRequirement
fr.maxlego08.menu.api.requirement.Requirement getOpenRequirement()Returns the requirement for opening the inventory.- Returns:
- The opening requirement.
-
getOpenWithItem
OpenWithItem getOpenWithItem()Returns the item that can be used to open the inventory. (Left or rick click)- Returns:
- The OpenWithItem
-