Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.