Package net.minestom.server.event.player
Class AsyncPlayerConfigurationEvent
java.lang.Object
net.minestom.server.event.player.AsyncPlayerConfigurationEvent
- All Implemented Interfaces:
Event
,EntityEvent
,PlayerEvent
Called when a player enters the configuration state (either on first connection, or if they are
sent back to configuration later). The player is moved to the play state as soon as all event
handles finish processing this event.
The spawning instance must be set for the player to join.
The event is called off the tick threads, so it is safe to block here
-
Constructor Summary
ConstructorDescriptionAsyncPlayerConfigurationEvent
(@NotNull Player player, boolean isFirstConfig, @NotNull Set<FeatureFlag> enabledFeatures) -
Method Summary
Modifier and TypeMethodDescription@NotNull Player
Gets the player.@Nullable Instance
boolean
Returns true if this is the first time the player is in the configuration phase (they are joining), false otherwise.boolean
void
setEnabledFeatures
(Set<FeatureFlag> enabledFeatures) void
setHardcore
(boolean hardcore) void
setSendRegistryData
(boolean sendRegistryData) void
setSpawningInstance
(@Nullable Instance spawningInstance) boolean
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minestom.server.event.trait.PlayerEvent
getEntity
-
Constructor Details
-
AsyncPlayerConfigurationEvent
public AsyncPlayerConfigurationEvent(@NotNull @NotNull Player player, boolean isFirstConfig, @NotNull @NotNull Set<FeatureFlag> enabledFeatures)
-
-
Method Details
-
getPlayer
Description copied from interface:PlayerEvent
Gets the player.- Specified by:
getPlayer
in interfacePlayerEvent
- Returns:
- the player
-
isFirstConfig
public boolean isFirstConfig()Returns true if this is the first time the player is in the configuration phase (they are joining), false otherwise. -
isHardcore
public boolean isHardcore() -
setHardcore
public void setHardcore(boolean hardcore) -
willSendRegistryData
public boolean willSendRegistryData() -
setSendRegistryData
public void setSendRegistryData(boolean sendRegistryData) -
getSpawningInstance
-
setSpawningInstance
-
setEnabledFeatures
-
getEnabledFeatures
-