Class TextWindow
java.lang.Object
Kyu.GuiAPI_Redone.Window.Openable
Kyu.GuiAPI_Redone.Window.WindowImpl.TextWindow.TextWindow
-
Field Summary
Fields inherited from class Kyu.GuiAPI_Redone.Window.Openable
disableClickEvent, gui, isIgnoreCloseEvent, onClose, preventClose, unregisterOnClose -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidopen()Calling directly can result inGUInot setting the current Window correctly! UseGUI.openWindow(Kyu.GuiAPI_Redone.Window.Openable)insteadvoidsetDisableClickEvent(boolean disableClickEvent) Disabled for this windowvoidsetInitalLines(String... lines) Set the inital content displayed when the sign opensvoidsetOnClose(Consumer<org.bukkit.event.inventory.InventoryCloseEvent> onClose) Disabled for this window, Closing the sign just callsgetOnSubmit()voidsetOnSubmit(Consumer<List<String>> onSubmit) Set the function to execute once the player submits the inputMethods inherited from class Kyu.GuiAPI_Redone.Window.Openable
getGui, getOnClose, isDisableClickEvent, isIgnoreCloseEvent, isPreventClose, isUnregisterOnClose, setIgnoreCloseEvent, setPreventClose, setUnregisterOnClose
-
Constructor Details
-
TextWindow
-
-
Method Details
-
open
public void open()Calling directly can result inGUInot setting the current Window correctly! UseGUI.openWindow(Kyu.GuiAPI_Redone.Window.Openable)instead -
setInitalLines
Set the inital content displayed when the sign opens- Parameters:
lines- Lines of the sign, anything above 4 lines will be cut
-
getOnSubmit
- Returns:
- The function executed once the player submits the input
-
setOnSubmit
Set the function to execute once the player submits the input- Parameters:
onSubmit- Function to execute once input is submitted
-
setDisableClickEvent
public void setDisableClickEvent(boolean disableClickEvent) Disabled for this window- Overrides:
setDisableClickEventin classOpenable- Parameters:
disableClickEvent- Whether or not to cancel InventoryClickEvent
-
setOnClose
Disabled for this window, Closing the sign just callsgetOnSubmit()- Overrides:
setOnClosein classOpenable- Parameters:
onClose- Function to call when the inventory gets closed andOpenable.isIgnoreCloseEvent()as well asOpenable.isPreventClose()are False. Automatically disablesOpenable.isPreventClose()andOpenable.isUnregisterOnClose()so you have to manually callGUI.unregisterListener()when your Windows are closed
-