public abstract class CustomComponent extends Component
Modifier and Type | Field and Description |
---|---|
protected Component |
component
The Component.
|
clickAction, hidden, id, interaction
Constructor and Description |
---|
CustomComponent(Interaction interaction)
Instantiates a new CustomComponent.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(Graphics graphic,
org.bukkit.entity.Player player,
GuiPoint cursor)
Render the component on the provided graphic context.
|
Component |
clone(Interaction interaction)
Clone the component with the new interaction.
|
String |
getState(org.bukkit.entity.Player player,
GuiPoint cursor)
Gets the current state of the component for the given parameters.
|
boolean |
isInBounds(org.bukkit.entity.Player player,
GuiPoint cursor)
Checks whether the cursor is in bounds of the component.
|
void |
onClick(org.bukkit.entity.Player player,
GuiPoint cursor,
boolean isPrimary)
Called when a player clicks on the component.
|
dispose, getClickAction, getId, getInteraction, isHidden, locate, locate, locateOn, setClickAction, setHidden
protected Component component
public CustomComponent(Interaction interaction)
interaction
- the interactionpublic void apply(Graphics graphic, org.bukkit.entity.Player player, GuiPoint cursor)
Component
public boolean isInBounds(org.bukkit.entity.Player player, GuiPoint cursor)
Component
isInBounds
in class Component
player
- the playercursor
- the cursorpublic String getState(org.bukkit.entity.Player player, GuiPoint cursor)
Component
Component.apply(Graphics, Player, GuiPoint)
renders different content, then the this method should
return different strings. If it renders the same the return value should be the same.
RectComponent
returns
x+"*"+y+"*"+width+"*"+height+"*"+color.getRGB()
)public void onClick(org.bukkit.entity.Player player, GuiPoint cursor, boolean isPrimary)
Component
public Component clone(Interaction interaction)
Component
Copyright © 2021. All rights reserved.