public class CycleButton extends Pane
Pane.Priority| Constructor and Description |
|---|
CycleButton(int length,
int height) |
CycleButton(int x,
int y,
int length,
int height) |
CycleButton(int x,
int y,
int length,
int height,
Pane.Priority priority) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPane(int index,
Pane pane)
Adds a pane to the current list of options
|
void |
addPane(Pane pane)
Adds a pane to the current list of options
|
void |
clear()
Clears the entire pane of any items/panes.
|
boolean |
click(Gui gui,
org.bukkit.event.inventory.InventoryClickEvent event,
int paneOffsetX,
int paneOffsetY,
int maxLength,
int maxHeight)
Called whenever there is being clicked on this pane
|
void |
cycle()
Cycles through one option, making it go to the next one
|
void |
display(Gui gui,
org.bukkit.inventory.Inventory inventory,
org.bukkit.inventory.PlayerInventory playerInventory,
int paneOffsetX,
int paneOffsetY,
int maxLength,
int maxHeight)
Has to set all the items in the right spot inside the inventory
|
Collection<GuiItem> |
getItems()
Gets all the items in this pane and all underlying panes
|
Collection<Pane> |
getPanes()
Gets all the panes in this panes, including any child panes from other panes
|
static CycleButton |
load(Object instance,
Element element)
Loads a cycle button from a given element
|
getHeight, getLength, getPriority, getPropertyMappings, getX, getY, isVisible, load, loadItem, setHeight, setLength, setOnClick, setOnLocalClick, setPriority, setVisible, setX, setYpublic CycleButton(int x,
int y,
int length,
int height,
@NotNull
Pane.Priority priority)
public CycleButton(int x,
int y,
int length,
int height)
public CycleButton(int length,
int height)
public boolean click(@NotNull
Gui gui,
@NotNull
org.bukkit.event.inventory.InventoryClickEvent event,
int paneOffsetX,
int paneOffsetY,
int maxLength,
int maxHeight)
click in class Panegui - the gui this event stems fromevent - the event that occurred while clicking on this itempaneOffsetX - the pane's offset on the x axispaneOffsetY - the pane's offset on the y axismaxLength - the maximum length of the panemaxHeight - the maximum height of the panepublic void display(@NotNull
Gui gui,
@NotNull
org.bukkit.inventory.Inventory inventory,
@NotNull
org.bukkit.inventory.PlayerInventory playerInventory,
int paneOffsetX,
int paneOffsetY,
int maxLength,
int maxHeight)
display in class Panegui - the gui for which we're renderinginventory - the inventory that the items should be displayed inplayerInventory - the player's inventorypaneOffsetX - the pane's offset on the x axispaneOffsetY - the pane's offset on the y axismaxLength - the maximum length of the panemaxHeight - the maximum height of the pane@NotNull public Collection<GuiItem> getItems()
public void addPane(int index,
@NotNull
Pane pane)
index - the index to insert the pane atpane - the pane to addpublic void addPane(@NotNull
Pane pane)
pane - the pane to addpublic void clear()
@NotNull public Collection<Pane> getPanes()
public void cycle()
@NotNull @Contract(value="_, null -> fail") public static CycleButton load(@NotNull Object instance, @NotNull Element element)
instance - the instance classelement - the elementCopyright © 2019. All rights reserved.