--- a/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java
@@ -30,22 +30,24 @@
 import net.minecraft.server.network.config.ServerResourcePackConfigurationTask;
 import net.minecraft.server.players.PlayerList;
 import net.minecraft.tags.TagNetworkSerialization;
+import net.minecraft.util.thread.BlockableEventLoop;
 import net.minecraft.world.flag.FeatureFlags;
 import org.slf4j.Logger;
 
 public class ServerConfigurationPacketListenerImpl extends ServerCommonPacketListenerImpl implements TickablePacketListener, ServerConfigurationPacketListener {
+
     private static final Logger LOGGER = LogUtils.getLogger();
     private static final Component DISCONNECT_REASON_INVALID_DATA = Component.translatable("multiplayer.disconnect.invalid_player_data");
     private final GameProfile gameProfile;
-    private final Queue<ConfigurationTask> configurationTasks = new ConcurrentLinkedQueue<>();
+    private final Queue<ConfigurationTask> configurationTasks = new ConcurrentLinkedQueue();
     @Nullable
     private ConfigurationTask currentTask;
     private ClientInformation clientInformation;
 
-    public ServerConfigurationPacketListenerImpl(MinecraftServer server, Connection connection, CommonListenerCookie clientData) {
-        super(server, connection, clientData);
-        this.gameProfile = clientData.gameProfile();
-        this.clientInformation = clientData.clientInformation();
+    public ServerConfigurationPacketListenerImpl(MinecraftServer minecraftserver, Connection networkmanager, CommonListenerCookie commonlistenercookie, ServerPlayer player) { // CraftBukkit
+        super(minecraftserver, networkmanager, commonlistenercookie, player); // CraftBukkit
+        this.gameProfile = commonlistenercookie.gameProfile();
+        this.clientInformation = commonlistenercookie.clientInformation();
     }
 
     @Override
@@ -55,7 +57,7 @@
 
     @Override
     public void onDisconnect(Component reason) {
-        LOGGER.info("{} lost connection: {}", this.gameProfile, reason.getString());
+        ServerConfigurationPacketListenerImpl.LOGGER.info("{} lost connection: {}", this.gameProfile, reason.getString());
         super.onDisconnect(reason);
     }
 
@@ -66,10 +68,11 @@
 
     public void startConfiguration() {
         this.send(new ClientboundCustomPayloadPacket(new BrandPayload(this.server.getServerModName())));
-        LayeredRegistryAccess<RegistryLayer> layeredRegistryAccess = this.server.registries();
+        LayeredRegistryAccess<RegistryLayer> layeredregistryaccess = this.server.registries();
+
         this.send(new ClientboundUpdateEnabledFeaturesPacket(FeatureFlags.REGISTRY.toNames(this.server.getWorldData().enabledFeatures())));
-        this.send(new ClientboundRegistryDataPacket((new RegistryAccess.ImmutableRegistryAccess(RegistrySynchronization.networkedRegistries(layeredRegistryAccess))).freeze()));
-        this.send(new ClientboundUpdateTagsPacket(TagNetworkSerialization.serializeTagsToNetwork(layeredRegistryAccess)));
+        this.send(new ClientboundRegistryDataPacket((new RegistryAccess.ImmutableRegistryAccess(RegistrySynchronization.networkedRegistries(layeredregistryaccess))).freeze()));
+        this.send(new ClientboundUpdateTagsPacket(TagNetworkSerialization.serializeTagsToNetwork(layeredregistryaccess)));
         this.addOptionalTasks();
         this.configurationTasks.add(new JoinWorldTask());
         this.startNextTask();
@@ -81,14 +84,15 @@
     }
 
     private void addOptionalTasks() {
-        this.server.getServerResourcePack().ifPresent((properties) -> {
-            this.configurationTasks.add(new ServerResourcePackConfigurationTask(properties));
+        this.server.getServerResourcePack().ifPresent((minecraftserver_serverresourcepackinfo) -> {
+            this.configurationTasks.add(new ServerResourcePackConfigurationTask(minecraftserver_serverresourcepackinfo));
         });
     }
 
     @Override
     public void handleClientInformation(ServerboundClientInformationPacket packet) {
         this.clientInformation = packet.information();
+        this.connection.channel.attr(io.papermc.paper.adventure.PaperAdventure.LOCALE_ATTRIBUTE).set(net.kyori.adventure.translation.Translator.parseLocale(packet.information().language())); // Paper
     }
 
     @Override
@@ -103,29 +107,37 @@
     @Override
     public void handleConfigurationFinished(ServerboundFinishConfigurationPacket packet) {
         this.connection.suspendInboundAfterProtocolChange();
-        PacketUtils.ensureRunningOnSameThread(packet, this, this.server);
+        PacketUtils.ensureRunningOnSameThread(packet, this, (BlockableEventLoop) this.server);
         this.finishCurrentTask(JoinWorldTask.TYPE);
 
         try {
-            PlayerList playerList = this.server.getPlayerList();
-            if (playerList.getPlayer(this.gameProfile.getId()) != null) {
+            PlayerList playerlist = this.server.getPlayerList();
+
+            if (playerlist.getPlayer(this.gameProfile.getId()) != null) {
                 this.disconnect(PlayerList.DUPLICATE_LOGIN_DISCONNECT_MESSAGE);
                 return;
             }
 
-            Component component = playerList.canPlayerLogin(this.connection.getRemoteAddress(), this.gameProfile);
-            if (component != null) {
-                this.disconnect(component);
+            Component ichatbasecomponent = null; // CraftBukkit - login checks already completed
+
+            if (ichatbasecomponent != null) {
+                this.disconnect(ichatbasecomponent);
                 return;
             }
 
-            ServerPlayer serverPlayer = playerList.getPlayerForLogin(this.gameProfile, this.clientInformation);
-            playerList.placeNewPlayer(this.connection, serverPlayer, this.createCookie(this.clientInformation));
+            ServerPlayer entityplayer = playerlist.getPlayerForLogin(this.gameProfile, this.clientInformation, this.player); // CraftBukkit
+
+            playerlist.placeNewPlayer(this.connection, entityplayer, this.createCookie(this.clientInformation));
             this.connection.resumeInboundAfterProtocolChange();
-        } catch (Exception var5) {
-            LOGGER.error("Couldn't place player in world", (Throwable)var5);
-            this.connection.send(new ClientboundDisconnectPacket(DISCONNECT_REASON_INVALID_DATA));
-            this.connection.disconnect(DISCONNECT_REASON_INVALID_DATA);
+        } catch (Exception exception) {
+            ServerConfigurationPacketListenerImpl.LOGGER.error("Couldn't place player in world", exception);
+            // Paper start
+            if (MinecraftServer.getServer().isDebugging()) {
+                io.papermc.paper.util.TraceUtil.printStackTrace(exception);
+            }
+            // Paper end
+            this.connection.send(new ClientboundDisconnectPacket(ServerConfigurationPacketListenerImpl.DISCONNECT_REASON_INVALID_DATA));
+            this.connection.disconnect(ServerConfigurationPacketListenerImpl.DISCONNECT_REASON_INVALID_DATA);
         }
 
     }
@@ -139,19 +151,21 @@
         if (this.currentTask != null) {
             throw new IllegalStateException("Task " + this.currentTask.type().id() + " has not finished yet");
         } else if (this.isAcceptingMessages()) {
-            ConfigurationTask configurationTask = this.configurationTasks.poll();
-            if (configurationTask != null) {
-                this.currentTask = configurationTask;
-                configurationTask.start(this::send);
+            ConfigurationTask configurationtask = (ConfigurationTask) this.configurationTasks.poll();
+
+            if (configurationtask != null) {
+                this.currentTask = configurationtask;
+                configurationtask.start(this::send);
             }
 
         }
     }
 
     private void finishCurrentTask(ConfigurationTask.Type key) {
-        ConfigurationTask.Type type = this.currentTask != null ? this.currentTask.type() : null;
-        if (!key.equals(type)) {
-            throw new IllegalStateException("Unexpected request for task finish, current task: " + type + ", requested: " + key);
+        ConfigurationTask.Type configurationtask_a1 = this.currentTask != null ? this.currentTask.type() : null;
+
+        if (!key.equals(configurationtask_a1)) {
+            throw new IllegalStateException("Unexpected request for task finish, current task: " + configurationtask_a1 + ", requested: " + key);
         } else {
             this.currentTask = null;
             this.startNextTask();
