Class AnvilGUI
java.lang.Object
de.marcely.bedwars.tools.gui.type.AnvilGUI
- All Implemented Interfaces:
GUI
Represents a GUI that allows the player to rename an item
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddCloseListener(Consumer<Player> callback) Adds a close listener to the gui.booleanaddListener(WriteListener listener) Adds a listener to this GUIbooleanReturns if this type allows its items to get moved around and to be droppedvoidclear()Resets its contentvoidcloseAll()Closes this GUI for any playerReturns the default/initial message that will be shown inside the text fieldReturns all listeners that were added to this GUIReturns the player for whom the GUI is currently opengetTitle()Returns the set titlebooleanGet whether the given player has the inventory currently openvoidEvent method that's getting called whenever a player closes the inventoryvoidOpens the GUI for the playerbooleanremoveCloseListener(Consumer<Player> callback) Removes a close listener from the gui.booleanremoveListener(WriteListener listener) Removes an already added listener from this GUIvoidSet the title of the GUI.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.marcely.bedwars.tools.gui.GUI
getCloseListeners, ignoresCancelEvent
-
Constructor Details
-
AnvilGUI
public AnvilGUI()Creates a new instance with an empty message -
AnvilGUI
Creates a new instance with a default message- Parameters:
defaultMessage- The initial text inside the editor
-
-
Method Details
-
open
Description copied from interface:GUIOpens the GUI for the player -
closeAll
public void closeAll()Description copied from interface:GUICloses this GUI for any player -
setTitle
Set the title of the GUI.Only supported for 1.14 or higher
-
getTitle
Description copied from interface:GUIReturns the set title -
areItemsMoveable
public boolean areItemsMoveable()Description copied from interface:GUIReturns if this type allows its items to get moved around and to be dropped- Specified by:
areItemsMoveablein interfaceGUI- Returns:
- If the items are moveable/dragable
-
getPlayers
Description copied from interface:GUIReturns the player for whom the GUI is currently open- Specified by:
getPlayersin interfaceGUI- Returns:
- The players for who the GUI has been opened
-
hasOpen
Description copied from interface:GUIGet whether the given player has the inventory currently open -
addCloseListener
Description copied from interface:GUIAdds a close listener to the gui. This listener will be called when a player closes the gui- Specified by:
addCloseListenerin interfaceGUI- Parameters:
callback- the listener that is being added- Returns:
- if the listener was added successfully
-
removeCloseListener
Description copied from interface:GUIRemoves a close listener from the gui.- Specified by:
removeCloseListenerin interfaceGUI- Parameters:
callback- the listener that is being removed- Returns:
- if the listener was removed successfully
-
clear
public void clear()Description copied from interface:GUIResets its content -
onClose
Description copied from interface:GUIEvent method that's getting called whenever a player closes the inventory -
getDefaultMessage
Returns the default/initial message that will be shown inside the text field- Returns:
- The text the player has to rename
-
getListeners
Returns all listeners that were added to this GUI- Returns:
- All listeners listeners whenever someone writes something in this GUI
-
addListener
Adds a listener to this GUI- Parameters:
listener- The listener that shall be added- Returns:
falseif it was already added
-
removeListener
Removes an already added listener from this GUI- Parameters:
listener- The listener that shall be removed- Returns:
trueif it has been removed
-