Package net.gcnt.additionsplus.api.utils
Interface MenuUtils
public interface MenuUtils
Class that holds some useful utils for custom menus.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close
(org.bukkit.entity.Player player, boolean checkForCancel) Close the current inventory of a player.getPlayerMenu
(org.bukkit.entity.Player player) Get the currentAdditionsMenu
that the player has open.boolean
isMaterialLegacy
(String material) Check if a material is legacy (<1.13)void
restoreInventory
(org.bukkit.entity.Player player) Restore the player's stored inventory.void
setPlayerMenu
(org.bukkit.entity.Player player, AdditionsMenu menu) Set the currentAdditionsMenu
that the player has open.void
storeInventory
(org.bukkit.entity.Player player) Store the player's current inventory.
-
Method Details
-
storeInventory
void storeInventory(org.bukkit.entity.Player player) Store the player's current inventory.- Parameters:
player
- Player to store inventory of.
-
restoreInventory
void restoreInventory(org.bukkit.entity.Player player) Restore the player's stored inventory.- Parameters:
player
- Player to restore inventory of.
-
setPlayerMenu
Set the currentAdditionsMenu
that the player has open.- Parameters:
player
- Player to update.menu
-AdditionsMenu
that is open.
-
getPlayerMenu
Get the currentAdditionsMenu
that the player has open.- Parameters:
player
- Player to check.- Returns:
AdditionsMenu
if open, null otherwise.
-
close
void close(org.bukkit.entity.Player player, boolean checkForCancel) Close the current inventory of a player.- Parameters:
player
- Player to close inventory of.checkForCancel
- Whether to check if this event is cancelled.
-
isMaterialLegacy
Check if a material is legacy (<1.13)- Parameters:
material
- Material to check.- Returns:
- True when legacy, false otherwise.
-