Pane.Priority
Constructor and Description |
---|
PatternPane(int x,
int y,
int length,
int height,
@NotNull Pane.Priority priority,
@NotNull Pattern pattern)
Constructs a new pattern pane.
|
PatternPane(int x,
int y,
int length,
int height,
@NotNull Pattern pattern)
Constructs a new pattern pane.
|
PatternPane(int length,
int height,
@NotNull Pattern pattern)
Constructs a new pattern pane, with no position.
|
Modifier and Type | Method and Description |
---|---|
void |
bindItem(char character,
@NotNull GuiItem item)
Binds a character to a specific item or if the character was already bound, this overwrites the previously
binding with the provided one.
|
void |
bindItem(int character,
@NotNull GuiItem item)
Binds a character to a specific item or if the character was already bound, this overwrites the previously
binding with the provided one.
|
void |
clear()
Clears the entire pane of any items/panes.
|
boolean |
click(@NotNull Gui gui,
@NotNull InventoryComponent inventoryComponent,
@NotNull org.bukkit.event.inventory.InventoryClickEvent event,
int slot,
int paneOffsetX,
int paneOffsetY,
int maxLength,
int maxHeight)
Called whenever there is being clicked on this pane
|
@NotNull PatternPane |
copy()
Makes a copy of this pane and returns it.
|
void |
display(@NotNull InventoryComponent inventoryComponent,
int paneOffsetX,
int paneOffsetY,
int maxLength,
int maxHeight)
Has to set all the items in the right spot inside the inventory
|
void |
flipHorizontally(boolean flipHorizontally)
Sets whether this pane should flip its items horizontally
|
void |
flipVertically(boolean flipVertically)
Sets whether this pane should flip its items vertically
|
@NotNull Collection<GuiItem> |
getItems()
Gets all the items in this pane and all underlying panes.
|
@NotNull Collection<Pane> |
getPanes()
Gets all the panes in this panes, including any child panes from other panes.
|
@NotNull Pattern |
getPattern()
Gets the pattern.
|
int |
getRotation()
Gets the rotation specified to this pane.
|
boolean |
isFlippedHorizontally()
Gets whether this pane's items are flipped horizontally
|
boolean |
isFlippedVertically()
Gets whether this pane's items are flipped vertically
|
static @NotNull PatternPane |
load(@NotNull Object instance,
@NotNull Element element)
Loads a pattern pane from a given element
|
void |
setHeight(int height)
Set the height of this pane
|
void |
setLength(int length)
Set the length of this pane
|
void |
setPattern(@NotNull Pattern pattern)
Overrides the pattern set on this pane.
|
void |
setRotation(int rotation)
Sets the rotation of this pane.
|
callOnClick, findMatchingItem, getHeight, getLength, getPriority, getUUID, getX, getY, isVisible, load, loadItem, registerProperty, setOnClick, setPriority, setVisible, setX, setY
public PatternPane(int x, int y, int length, int height, @NotNull @NotNull Pane.Priority priority, @NotNull @NotNull Pattern pattern)
x
- the upper left x coordinate of the paney
- the upper left y coordinate of the panelength
- the length of the paneheight
- the height of the panepriority
- the priority of the panepattern
- the pattern of the paneIllegalArgumentException
- when the pane and pattern dimensions don't matchpublic PatternPane(int length, int height, @NotNull @NotNull Pattern pattern)
length
- the length of the paneheight
- the height of the panepattern
- the pattern of the paneIllegalArgumentException
- when the pane and pattern dimensions don't matchpublic PatternPane(int x, int y, int length, int height, @NotNull @NotNull Pattern pattern)
x
- the upper left x coordinate of the paney
- the upper left y coordinate of the panelength
- the length of the paneheight
- the height of the panepattern
- the pattern of the paneIllegalArgumentException
- when the pane and pattern dimensions don't matchpublic void display(@NotNull @NotNull InventoryComponent inventoryComponent, int paneOffsetX, int paneOffsetY, int maxLength, int maxHeight)
Pane
display
in class Pane
inventoryComponent
- the inventory component in which the items should be displayedpaneOffsetX
- 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 boolean click(@NotNull @NotNull Gui gui, @NotNull @NotNull InventoryComponent inventoryComponent, @NotNull @NotNull org.bukkit.event.inventory.InventoryClickEvent event, int slot, int paneOffsetX, int paneOffsetY, int maxLength, int maxHeight)
Pane
click
in class Pane
gui
- the gui in which was clickedinventoryComponent
- the inventory component in which this pane residesevent
- the event that occurred while clicking on this itemslot
- the slot that was clicked inpaneOffsetX
- 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 @Contract(pure=true) public @NotNull PatternPane copy()
Pane
public void setRotation(int rotation)
Rotatable
setRotation
in interface Rotatable
rotation
- the rotation of this pane, must be divisible by 90.@NotNull public @NotNull Collection<GuiItem> getItems()
public void setPattern(@NotNull @NotNull Pattern pattern)
pattern
- the new pattern to setIllegalArgumentException
- when the pane and pattern dimensions don't matchpublic void setHeight(int height)
Pane
public void setLength(int length)
Pane
public void bindItem(char character, @NotNull @NotNull GuiItem item)
bindItem(int, GuiItem)
.character
- the characteritem
- the item this representspublic void bindItem(int character, @NotNull @NotNull GuiItem item)
character
- the characteritem
- the item this representsbindItem(char, GuiItem)
public void clear()
Pane
public void flipHorizontally(boolean flipHorizontally)
Flippable
flipHorizontally
in interface Flippable
flipHorizontally
- whether the pane should flip items horizontallypublic void flipVertically(boolean flipVertically)
Flippable
flipVertically
in interface Flippable
flipVertically
- whether the pane should flip items vertically@NotNull public @NotNull Collection<Pane> getPanes()
Pane
@NotNull @Contract(pure=true) public @NotNull Pattern getPattern()
public boolean isFlippedHorizontally()
Flippable
isFlippedHorizontally
in interface Flippable
public boolean isFlippedVertically()
Flippable
isFlippedVertically
in interface Flippable
public int getRotation()
Rotatable
getRotation
in interface Rotatable
@NotNull public static @NotNull PatternPane load(@NotNull @NotNull Object instance, @NotNull @NotNull Element element)
instance
- the instance classelement
- the elementCopyright © 2021. All rights reserved.