Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
import org.bukkit.event.server.PluginDisableEvent;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.spigotmc.event.player.PlayerSpawnLocationEvent;

final class CloudBukkitListener<C> implements Listener {

Expand All @@ -39,11 +39,11 @@ final class CloudBukkitListener<C> implements Listener {
}

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
void onPlayerLogin(final @NonNull PlayerSpawnLocationEvent event) {
void onPlayerLogin(final @NonNull AsyncPlayerPreLoginEvent event) {
/* If the server is brigadier-capable, any registration after players
have joined (and been sent a command tree) is unsafe.
Bukkit's PlayerJoinEvent is called just after the command tree is sent,
so we have to perform this state change at PlayerSpawnLocationEvent to lock before that happens. */
so we have to perform this state change at AsyncPlayerPreLoginEvent to lock before that happens. */
this.bukkitCommandManager.lockIfBrigadierCapable();
}

Expand Down