Class PreServerListSetEvent
java.lang.Object
org.bukkit.event.Event
ch.andre601.advancedserverlist.api.bukkit.events.PreServerListSetEvent
- All Implemented Interfaces:
GenericServerListEvent
,Cancellable
public abstract class PreServerListSetEvent
extends Event
implements GenericServerListEvent, Cancellable
Called before AdvancedServerList modifies the server list.
The provided ProfileEntry will be the one used for the server list.
The provided ProfileEntry will be the one used for the server list.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Constructor Summary
ConstructorDescriptionConstructor for creating a new PreServerListSetEvent instance. -
Method Summary
Modifier and TypeMethodDescriptiongetEntry()
Gets theProfileEntry
currently set.static HandlerList
StaticHandlerList
getter.@NotNull HandlerList
boolean
Returns whether this event has been cancelled or not.void
setCancelled
(boolean cancelled) Sets the event's cancel state.void
setEntry
(ProfileEntry entry) Sets the newProfileEntry
to use.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PreServerListSetEvent
Constructor for creating a new PreServerListSetEvent instance.- Parameters:
entry
- The initialProfileEntry
to use for this event.
-
-
Method Details
-
getHandlerList
StaticHandlerList
getter. Required by Paper.- Returns:
- The static HandlerList instance of this event.
-
getEntry
Gets theProfileEntry
currently set.- Specified by:
getEntry
in interfaceGenericServerListEvent
- Returns:
- The currently set
ProfileEntry
-
setEntry
Sets the new
ProfileEntry
to use.
This may not benull
.Note that a new copy of the entry will be made using
ProfileEntry.copy()
.- Specified by:
setEntry
in interfaceGenericServerListEvent
- Parameters:
entry
- The newProfileEntry
to use.- Throws:
IllegalArgumentException
- When the provided ProfileEntry is null.
-
isCancelled
public boolean isCancelled()Returns whether this event has been cancelled or not.- Specified by:
isCancelled
in interfaceCancellable
- Specified by:
isCancelled
in interfaceGenericServerListEvent
- Returns:
- Whether the event has been cancelled or not.
-
setCancelled
public void setCancelled(boolean cancelled) Sets the event's cancel state.- Specified by:
setCancelled
in interfaceCancellable
- Specified by:
setCancelled
in interfaceGenericServerListEvent
- Parameters:
cancelled
- Boolean to set the event's cancelled state.
-
getHandlers
- Specified by:
getHandlers
in classEvent
-