Class PreServerListSetEvent
java.lang.Object
ch.andre601.advancedserverlist.api.velocity.events.PreServerListSetEvent
- All Implemented Interfaces:
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
ConstructorDescriptionConstructor for creating a new PreServerListSetEvent instance. -
Method Summary
Modifier and TypeMethodDescriptiongetEntry()
Gets theProfileEntry
currently set.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.
-
Constructor Details
-
PreServerListSetEvent
Constructor for creating a new PreServerListSetEvent instance.- Parameters:
entry
- The initialProfileEntry
to use for this event.
-
-
Method Details
-
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 be
null
.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 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 interfaceGenericServerListEvent
- Parameters:
cancelled
- Boolean to set the event's cancelled state.
-