Class InputButton
java.lang.Object
me.hsgamer.hscore.bukkit.gui.button.InputButton
- All Implemented Interfaces:
Function<@NotNull InventoryContext,,@Nullable ActionItem> GUIElement
public class InputButton
extends Object
implements GUIElement, Function<@NotNull InventoryContext,@Nullable ActionItem>
The button that stores the input item
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable ActionItemapply(@NotNull InventoryContext context) @Nullable org.bukkit.inventory.ItemStackgetInputItem(@NotNull UUID uuid) Get the input item for the unique idsetDisplayItemFunction(@NotNull BiFunction<UUID, org.bukkit.inventory.ItemStack, org.bukkit.inventory.ItemStack> displayItemFunction) Set the function to display the item on the GUIvoidsetInputItem(@NotNull UUID uuid, @Nullable org.bukkit.inventory.ItemStack itemStack) Set the input item for the unique idvoidstop()Stop the element.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.hsgamer.hscore.minecraft.gui.common.GUIElement
init
-
Constructor Details
-
InputButton
public InputButton()
-
-
Method Details
-
apply
- Specified by:
applyin interfaceFunction<@NotNull InventoryContext,@Nullable ActionItem>
-
stop
public void stop()Description copied from interface:GUIElementStop the element. Should be called after removing from the GUI.- Specified by:
stopin interfaceGUIElement
-
setInputItem
public void setInputItem(@NotNull @NotNull UUID uuid, @Nullable @Nullable org.bukkit.inventory.ItemStack itemStack) Set the input item for the unique id- Parameters:
uuid- the unique iditemStack- the item, or null to remove the input item
-
getInputItem
Get the input item for the unique id- Parameters:
uuid- the unique id- Returns:
- the item
-
setDisplayItemFunction
@Contract("_ -> this") public InputButton setDisplayItemFunction(@NotNull @NotNull BiFunction<UUID, org.bukkit.inventory.ItemStack, org.bukkit.inventory.ItemStack> displayItemFunction) Set the function to display the item on the GUI- Parameters:
displayItemFunction- the function- Returns:
- this instance
-