Class PreServerListSetEvent
java.lang.Object
org.bukkit.event.Event
ch.andre601.advancedserverlist.api.bukkit.events.PreServerListSetEvent
- All Implemented Interfaces:
GenericServerListEvent,Cancellable
@NullMarked
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
ConstructorsConstructorDescriptionConstructor for creating a new PreServerListSetEvent instance. -
Method Summary
Modifier and TypeMethodDescriptiongetEntry()Gets theProfileEntrycurrently set.static HandlerListStaticHandlerListgetter.booleanReturns whether this event has been cancelled or not.voidsetCancelled(boolean cancelled) Sets the event's cancel state.voidsetEntry(ProfileEntry entry) Sets the newProfileEntryto 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 initialProfileEntryto use for this event.
-
-
Method Details
-
getHandlerList
StaticHandlerListgetter. Required by Paper.- Returns:
- The static HandlerList instance of this event.
-
getEntry
Gets theProfileEntrycurrently set.- Specified by:
getEntryin interfaceGenericServerListEvent- Returns:
- The currently set
ProfileEntry
-
setEntry
Sets the new
ProfileEntryto use.
This may not benull.Note that a new copy of the entry will be made using
ProfileEntry.copy().- Specified by:
setEntryin interfaceGenericServerListEvent- Parameters:
entry- The newProfileEntryto use.- Throws:
IllegalArgumentException- When the provided ProfileEntry is null.
-
isCancelled
public boolean isCancelled()Returns whether this event has been cancelled or not.- Specified by:
isCancelledin interfaceCancellable- Specified by:
isCancelledin interfaceGenericServerListEvent- Returns:
- Whether the event has been cancelled or not.
-
setCancelled
public void setCancelled(boolean cancelled) Sets the event's cancel state.- Specified by:
setCancelledin interfaceCancellable- Specified by:
setCancelledin interfaceGenericServerListEvent- Parameters:
cancelled- Boolean to set the event's cancelled state.
-
getHandlers
- Specified by:
getHandlersin classEvent
-