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
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDefine what should happen when the state of the element' state changes to this statestatic classA simple implementation of theGuiStateElement.State.Changeinterface that allows for lambda expressions for the state enter and leave methods -
Constructor Summary
ConstructorsConstructorDescriptionState(GuiStateElement.State.Change change, String key, org.bukkit.inventory.ItemStack item, String... text) A state that theGuiStateElementcan have. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.inventory.ItemStackgetItem()Deprecated.org.bukkit.inventory.ItemStackgetItem(org.bukkit.entity.HumanEntity who) Get theItemStackthat represents this state.getKey()Get the string key of the state.String[]getText()Get the text lines that describe this state.voidSet 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 theGuiStateElementcan have.- Parameters:
change- What to do when the state changeskey- The state's string keyitem- TheItemStackto 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 theItemStackthat represents this state.- Returns:
- The
ItemStackthat represents this state
-
getItem
public org.bukkit.inventory.ItemStack getItem(org.bukkit.entity.HumanEntity who) Get theItemStackthat represents this state.- Parameters:
who- The player viewing the GUI- Returns:
- The
ItemStackthat 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)