public class PercentageBar extends VariableBar
Pane.PriorityOrientable.OrientationbackgroundPane, fillPane, flipHorizontally, flipVertically, orientation, value| Constructor and Description |
|---|
PercentageBar(int length,
int height) |
PercentageBar(int x,
int y,
int length,
int height) |
PercentageBar(int x,
int y,
int length,
int height,
Pane.Priority priority) |
| Modifier and Type | Method and Description |
|---|---|
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
|
float |
getPercentage()
Gets the percentage as a float in between (0,1) this bar is currently set at.
|
static PercentageBar |
load(Object instance,
Element element)
Loads a percentage bar from a given element
|
void |
setPercentage(float percentage)
Sets the percentage of this bar.
|
clear, display, flipHorizontally, flipVertically, getItems, getOrientation, getPanes, isFlippedHorizontally, isFlippedVertically, setBackgroundItem, setFillItem, setHeight, setLength, setOrientation, setX, setYgetHeight, getLength, getPriority, getPropertyMappings, getX, getY, isVisible, load, loadItem, setOnClick, setOnLocalClick, setPriority, setVisibleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitloadpublic PercentageBar(int x,
int y,
int length,
int height,
@NotNull
Pane.Priority priority)
public PercentageBar(int x,
int y,
int length,
int height)
public PercentageBar(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 setPercentage(float percentage)
IllegalArgumentException.percentage - the new percentage.IllegalArgumentException - when the percentage is out of rangepublic float getPercentage()
@NotNull
@Contract(value="_, null -> fail",
pure=true)
public static PercentageBar load(@NotNull
Object instance,
@NotNull
Element element)
instance - the instance classelement - the elementCopyright © 2019. All rights reserved.