Skip to content

Commit

Permalink
change login from PlayerSpawnEvent from AsyncPlayerConfigurationEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
DasBabyPixel committed Dec 14, 2024
1 parent f577403 commit 6f06c91
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import net.minestom.server.event.EventFilter;
import net.minestom.server.event.EventNode;
import net.minestom.server.event.GlobalEventHandler;
import net.minestom.server.event.player.AsyncPlayerConfigurationEvent;
import net.minestom.server.event.player.PlayerDisconnectEvent;
import net.minestom.server.event.player.PlayerSpawnEvent;

Expand All @@ -48,13 +49,13 @@ public MinestomPlayerManagementListener(
// listen on these events and redirect them into the methods
var node = EventNode.type("cloudnet-bridge", EventFilter.PLAYER);
eventHandler.addChild(node
.addListener(PlayerSpawnEvent.class, this::handleLogin)
.addListener(AsyncPlayerConfigurationEvent.class, this::handleLogin)
.addListener(PlayerSpawnEvent.class, this::handleJoin)
.addListener(PlayerDisconnectEvent.class, this::handleDisconnect));
}

private void handleLogin(@NonNull PlayerSpawnEvent event) {
if (!event.isFirstSpawn()) {
private void handleLogin(@NonNull AsyncPlayerConfigurationEvent event) {
if (!event.isFirstConfig()) {
return;
}

Expand Down

0 comments on commit 6f06c91

Please sign in to comment.