Package de.themoep.inventorygui
Class GuiStateElement.State
java.lang.Object
de.themoep.inventorygui.GuiStateElement.State
- Enclosing class:
GuiStateElement
A state that the
GuiStateElement
can have.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Define what should happen when the state of the element' state changes to this statestatic class
A simple implementation of theGuiStateElement.State.Change
interface that allows for lambda expressions for the state enter and leave methods -
Constructor Summary
ConstructorDescriptionState
(GuiStateElement.State.Change change, String key, org.bukkit.inventory.ItemStack item, String... text) A state that theGuiStateElement
can have. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.inventory.ItemStack
getItem()
Deprecated.org.bukkit.inventory.ItemStack
getItem
(org.bukkit.entity.HumanEntity who) Get theItemStack
that represents this state.getKey()
Get the string key of the state.String[]
getText()
Get the text lines that describe this state.void
Set this element's display text.
-
Constructor Details
-
State
public State(GuiStateElement.State.Change change, String key, org.bukkit.inventory.ItemStack item, String... text) A state that theGuiStateElement
can have.- Parameters:
change
- What to do when the state changeskey
- The state's string keyitem
- TheItemStack
to represent this statetext
- The text to display on this element, placeholders are automatically replaced, seeInventoryGui.replaceVars(org.bukkit.entity.HumanEntity, java.lang.String, java.lang.String...)
for a list of the placeholder variables. Empty text strings are also filter out, use a single space if you want to add an empty line!
If it's not set/empty the item's default name will be used
-
-
Method Details
-
setText
Set this element's display text. If this is an empty array the item's name will be displayed- Parameters:
text
- The text to display on this element, placeholders are automatically replaced, seeInventoryGui.replaceVars(org.bukkit.entity.HumanEntity, java.lang.String, java.lang.String...)
for a list of the placeholder variables. Empty text strings are also filtered out, use a single space if you want to add an empty line!
If it's not set/empty the item's default name will be used
-
getItem
Deprecated.Get theItemStack
that represents this state.- Returns:
- The
ItemStack
that represents this state
-
getItem
public org.bukkit.inventory.ItemStack getItem(org.bukkit.entity.HumanEntity who) Get theItemStack
that represents this state.- Parameters:
who
- The player viewing the GUI- Returns:
- The
ItemStack
that represents this state
-
getKey
Get the string key of the state.- Returns:
- The state's string key
-
getText
Get the text lines that describe this state.- Returns:
- The text lines for this state
-
getItem(HumanEntity)