Class PlayerOpenArenaEditorInSetupGUI
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
de.marcely.bedwars.api.event.player.PlayerOpenArenaEditorInSetupGUI
- All Implemented Interfaces:
ArenaEvent
,Cancellable
public abstract class PlayerOpenArenaEditorInSetupGUI
extends PlayerEvent
implements ArenaEvent, Cancellable
Gets called when player opens an arena editor inside the setup GUI (/bw arena setupgui)
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
static enum
static enum
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Field Summary
Fields inherited from class org.bukkit.event.player.PlayerEvent
player
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a button to the end of its set category.protected abstract boolean
construct
(Plugin plugin, PlayerOpenArenaEditorInSetupGUI.ButtonCategory category, PlayerOpenArenaEditorInSetupGUI.ButtonType type, ItemStack icon, ClickListener listener) Constructs a new button on which players will be able to click on.constructSpliterator
(Plugin plugin, PlayerOpenArenaEditorInSetupGUI.ButtonCategory category) Constructs a spliterator.@Nullable Arena
getArena()
Returns the localArena
that is involved in this event.Returns all buttons that were added to a specific category.static HandlerList
Returns the arena that is involved in this event.protected abstract void
setButtonIcon
(PlayerOpenArenaEditorInSetupGUI.Button button, ItemStack icon) protected abstract void
setButtonVisibility
(PlayerOpenArenaEditorInSetupGUI.Button button, boolean visible) Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayer
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.bukkit.event.Cancellable
isCancelled, setCancelled
-
Constructor Details
-
PlayerOpenArenaEditorInSetupGUI
-
-
Method Details
-
setButtonIcon
protected abstract void setButtonIcon(PlayerOpenArenaEditorInSetupGUI.Button button, ItemStack icon) -
setButtonVisibility
protected abstract void setButtonVisibility(PlayerOpenArenaEditorInSetupGUI.Button button, boolean visible) -
buttonExists
-
getArena
Returns the localArena
that is involved in this event.May be
null
if the arena isn't local.- Specified by:
getArena
in interfaceArenaEvent
- Returns:
- The arena that is involved. May be
null
-
getRemoteArena
Returns the arena that is involved in this event.- Returns:
- The involved arena
-
getButtons
public List<PlayerOpenArenaEditorInSetupGUI.Button> getButtons(PlayerOpenArenaEditorInSetupGUI.ButtonCategory category) Returns all buttons that were added to a specific category.It's safe to remove, add and iterate the entries of this list. Those changes are also getting applied to the real world.
- Parameters:
category
- The category to which the buttons were added- Returns:
- All existing buttons of a category
-
addButton
Adds a button to the end of its set category.Use
construct(Plugin, ButtonCategory, ButtonType, ItemStack, ClickListener)
to create a Button instance.- Parameters:
button
- The button that shall be added
-
construct
public PlayerOpenArenaEditorInSetupGUI.Button construct(Plugin plugin, PlayerOpenArenaEditorInSetupGUI.ButtonCategory category, PlayerOpenArenaEditorInSetupGUI.ButtonType type, ItemStack icon, ClickListener listener) Constructs a new button on which players will be able to click on.Keep in mind that this does not automatically adds it, it's only constructing the object. To add it use
addButton(Button)
or add it to the list ingetButtons(ButtonCategory)
.- Parameters:
plugin
- The plugin that created the listener (or this button). This is important so that the button automatically gets removed when the plugin unloadcategory
- The category/row to which the item shall be added totype
- The type of the button. Plugins should usePlayerOpenArenaEditorInSetupGUI.ButtonType.CUSTOM
, but this is not a must. Does effectivelly nothing, but helps plugins to orientateicon
- The icon of the button which players will seelistener
- The listener that handles what will happen when the player clicks on it- Returns:
- The constructed button
-
constructSpliterator
public PlayerOpenArenaEditorInSetupGUI.Button constructSpliterator(Plugin plugin, PlayerOpenArenaEditorInSetupGUI.ButtonCategory category) Constructs a spliterator.Keep in mind that this does not automatically adds it, it's only constructing the object. To add it use
addButton(Button)
or add it to the list ingetButtons(ButtonCategory)
.- Parameters:
plugin
- The plugin that created the listener (or this button). This is important so that the button automatically gets removed when the plugin unloadcategory
- The category/row to which the item shall be added to- Returns:
- The constructed button
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-