Class PreServerListSetEvent
java.lang.Object
ch.andre601.advancedserverlist.api.velocity.events.PreServerListSetEvent
- All Implemented Interfaces:
GenericServerListEvent
@NullMarked
public abstract class PreServerListSetEvent
extends Object
implements GenericServerListEvent
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.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for creating a new PreServerListSetEvent instance. -
Method Summary
Modifier and TypeMethodDescriptiongetEntry()Gets theProfileEntrycurrently set.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.
-
Constructor Details
-
PreServerListSetEvent
Constructor for creating a new PreServerListSetEvent instance.- Parameters:
entry- The initialProfileEntryto use for this event.
-
-
Method Details
-
getEntry
Gets theProfileEntrycurrently set.- Specified by:
getEntryin interfaceGenericServerListEvent- Returns:
- The currently set
ProfileEntry
-
setEntry
Sets the new
ProfileEntryto use.This may not be
null.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 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 interfaceGenericServerListEvent- Parameters:
cancelled- Boolean to set the event's cancelled state.
-