public class MenuIcon extends Object
ItemStack in an InventoryPanel's inventory that
will execute code when clicked.| Modifier and Type | Field and Description |
|---|---|
protected ItemStack |
item
The
ItemStack that this instance uses |
protected Execution |
onExec
The
Execution function to run when clicked |
protected Map<String,Object> |
options
A mapping of metadata options
|
protected List<String> |
perms
Permissions required to see this icon
|
protected long |
seed
A seed representing this
object |
| Modifier and Type | Method and Description |
|---|---|
Object |
addOption(String key,
Object value)
Adds a metadata option
|
void |
addPermission(String permission)
Adds a permission node that a player will need in order to see this icon.
|
boolean |
equals(Object obj) |
ItemStack |
getItem()
Returns the
ItemStack that is displayed when a user opens the
InventoryInterface |
Object |
getOption(String key)
Returns a metadata option
|
Map<String,Object> |
getOptions()
Returns a
Map of all the metadata options |
int |
hashCode() |
boolean |
hasPermission(Player p)
Returns whether or not a
Player has permission to view this icon |
boolean |
requiresPerms()
Returns
true if any permissions are required to see this icon |
void |
setExecutable(Execution onExec)
Sets the
Execution function that is called when this icon is
clicked. |
protected final long seed
objectpublic ItemStack getItem()
ItemStack that is displayed when a user opens the
InventoryInterfaceItemStack to displaypublic void setExecutable(Execution onExec)
Execution function that is called when this icon is
clicked. Can be set to null to not execute anythingonExec - The Execution to be usedpublic Map<String,Object> getOptions()
Map of all the metadata optionsMap of metadata valuespublic Object addOption(String key, Object value)
key - The String key to retrieve the optionvalue - The value of the optionnull if
there was no previous mapping using the keypublic Object getOption(String key)
key - The key that maps to the valuenull if none is setpublic boolean equals(Object obj)
public void addPermission(String permission)
permission - A string representing a permission nodepublic boolean requiresPerms()
true if any permissions are required to see this icontrue if a permission is needed to see the iconCopyright © 2017. All rights reserved.