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 TypeMethodDescriptionvoid
open()
Calling directly can result inGUI
not setting the current Window correctly! UseGUI.openWindow(Kyu.GuiAPI_Redone.Window.Openable)
insteadvoid
setDisableClickEvent
(boolean disableClickEvent) Disabled for this windowvoid
setInitalLines
(String... lines) Set the inital content displayed when the sign opensvoid
setOnClose
(Consumer<org.bukkit.event.inventory.InventoryCloseEvent> onClose) Disabled for this window, Closing the sign just callsgetOnSubmit()
void
setOnSubmit
(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 inGUI
not 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:
setDisableClickEvent
in classOpenable
- Parameters:
disableClickEvent
- Whether or not to cancel InventoryClickEvent
-
setOnClose
Disabled for this window, Closing the sign just callsgetOnSubmit()
- Overrides:
setOnClose
in 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
-