Skip to content

Commit 3b67abb

Browse files
committed
Small code adjustment, dont update for modern player
1 parent d36471e commit 3b67abb

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

paper-server/patches/sources/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java.patch

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
private static final Logger LOGGER = LogUtils.getLogger();
66
private static final Component DISCONNECT_REASON_INVALID_DATA = Component.translatable("multiplayer.disconnect.invalid_player_data");
77
- private final GameProfile gameProfile;
8-
- private final Queue<ConfigurationTask> configurationTasks = new ConcurrentLinkedQueue<>();
98
+ public final GameProfile gameProfile; // Paper
10-
+ public final Queue<ConfigurationTask> configurationTasks = new ConcurrentLinkedQueue<>(); // Paper
9+
private final Queue<ConfigurationTask> configurationTasks = new ConcurrentLinkedQueue<>();
1110
@Nullable
1211
private ConfigurationTask currentTask;
1312
- private ClientInformation clientInformation;
@@ -61,7 +60,7 @@
6160
}
6261

6362
@Override
64-
@@ -139,16 +_,30 @@
63+
@@ -139,16 +_,36 @@
6564
return;
6665
}
6766

@@ -80,9 +79,15 @@
8079
+ this.disconnect(component);
8180
+ return;
8281
+ }
82+
+ ServerPlayer playerForLogin;
83+
+ if (this.connection.savedPlayerForLoginEventLegacy != null) {
84+
+ playerForLogin = this.connection.savedPlayerForLoginEventLegacy;
85+
+ // WE have to do this because the player isnt updated properly
86+
+ playerForLogin.updateOptions(this.clientInformation);
87+
+ } else {
88+
+ playerForLogin = playerList.getPlayerForLogin(this.gameProfile, this.clientInformation);
89+
+ }
8390
+ // Paper end
84-
+ ServerPlayer playerForLogin = java.util.Objects.requireNonNullElseGet(this.connection.savedPlayerForLoginEventLegacy, () -> playerList.getPlayerForLogin(this.gameProfile, this.clientInformation)); // Paper - legacy serverlogin
85-
+ playerForLogin.updateOptions(this.clientInformation); // Paper - update options for legacy player
8691
playerList.placeNewPlayer(this.connection, playerForLogin, this.createCookie(this.clientInformation));
8792
} catch (Exception var5) {
8893
LOGGER.error("Couldn't place player in world", (Throwable)var5);

0 commit comments

Comments
 (0)