Skip to content

Instantly share code, notes, and snippets.

Created June 27, 2014 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3173707c7ee8135269e6 to your computer and use it in GitHub Desktop.
Save anonymous/3173707c7ee8135269e6 to your computer and use it in GitHub Desktop.
import org.bukkit.inventory.ItemStack;
public class MenuItem
{
private Menu menu;
private ItemStack icon;
private boolean closeMenuOnSelection;
private IMenuItemClickHandler clickHandler;
public MenuItem(ItemStack icon, boolean closeMenuOnSelection)
{
this.icon = icon;
this.closeMenuOnSelection = closeMenuOnSelection;
}
public MenuItem(ItemStack icon)
{
this(icon, false);
}
public Menu getMenu()
{
return menu;
}
public ItemStack getIcon()
{
return icon;
}
public IMenuItemClickHandler getClickHandler()
{
return clickHandler;
}
public void setMenu(Menu menu)
{
this.menu = menu;
}
public void setIcon(ItemStack icon)
{
this.icon = icon;
}
public void setClickHandler(IMenuItemClickHandler handler)
{
this.clickHandler = handler;
}
public void setCloseOnSelection(boolean bool)
{
this.closeMenuOnSelection = bool;
}
public boolean shouldCloseMenuOnSelection()
{
return closeMenuOnSelection;
}
public boolean hasClickHandler()
{
return clickHandler != null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment