Package net.gcnt.additionsplus.api.utils
Interface MenuUtils
public interface MenuUtils
Class that holds some useful utils for custom menus.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose(org.bukkit.entity.Player player, boolean checkForCancel) Close the current inventory of a player.getPlayerMenu(org.bukkit.entity.Player player) Get the currentAdditionsMenuthat the player has open.booleanisMaterialLegacy(String material) Check if a material is legacy (<1.13)voidrestoreInventory(org.bukkit.entity.Player player) Restore the player's stored inventory.voidsetPlayerMenu(org.bukkit.entity.Player player, AdditionsMenu menu) Set the currentAdditionsMenuthat the player has open.voidstoreInventory(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 currentAdditionsMenuthat the player has open.- Parameters:
player- Player to update.menu-AdditionsMenuthat is open.
-
getPlayerMenu
Get the currentAdditionsMenuthat the player has open.- Parameters:
player- Player to check.- Returns:
AdditionsMenuif 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.
-