From a3903ada2a01d6ee3a33099160ac6cda574c9ceb Mon Sep 17 00:00:00 2001 From: Tim203 Date: Fri, 21 Jun 2024 19:09:15 +0200 Subject: [PATCH] Added support for Bedrock 1.21 --- gradle/libs.versions.toml | 6 +++--- .../geysermc/globallinkserver/bedrock/BedrockPlayer.java | 4 ++++ .../globallinkserver/bedrock/util/BedrockVersionUtils.java | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 066bea3..db8e05e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,8 +1,8 @@ [versions] gson = "2.10.1" -protocol = "3.0.0.Beta2-20240423.201358-2" -raknet = "1.0.0.CR1-20240330.103819-16" -netty = "4.1.80.Final" +protocol = "3.0.0.Beta2-20240616.144648-10" +raknet = "1.0.0.CR3-20240416.144209-1" +netty = "4.1.110.Final" fastutil = "8.5.2" mcprotocollib = "1.20.4-1" adventure-text = "4.15.0-20231207.074016-23" # Match version to MCPL diff --git a/src/main/java/org/geysermc/globallinkserver/bedrock/BedrockPlayer.java b/src/main/java/org/geysermc/globallinkserver/bedrock/BedrockPlayer.java index 6f28764..b2f173a 100644 --- a/src/main/java/org/geysermc/globallinkserver/bedrock/BedrockPlayer.java +++ b/src/main/java/org/geysermc/globallinkserver/bedrock/BedrockPlayer.java @@ -147,6 +147,10 @@ public void sendStartGame() { startGamePacket.setRewindHistorySize(0); startGamePacket.setServerAuthoritativeBlockBreaking(false); + startGamePacket.setServerId(""); + startGamePacket.setWorldId(""); + startGamePacket.setScenarioId(""); + session.sendPacket(startGamePacket); // Send an empty chunk diff --git a/src/main/java/org/geysermc/globallinkserver/bedrock/util/BedrockVersionUtils.java b/src/main/java/org/geysermc/globallinkserver/bedrock/util/BedrockVersionUtils.java index 6c19cd6..b265f12 100644 --- a/src/main/java/org/geysermc/globallinkserver/bedrock/util/BedrockVersionUtils.java +++ b/src/main/java/org/geysermc/globallinkserver/bedrock/util/BedrockVersionUtils.java @@ -35,6 +35,7 @@ import org.cloudburstmc.protocol.bedrock.codec.v649.Bedrock_v649; import org.cloudburstmc.protocol.bedrock.codec.v662.Bedrock_v662; import org.cloudburstmc.protocol.bedrock.codec.v671.Bedrock_v671; +import org.cloudburstmc.protocol.bedrock.codec.v685.Bedrock_v685; /** * Contains information about the supported Bedrock protocols in GlobalLinkServer. @@ -45,7 +46,7 @@ public class BedrockVersionUtils { * Default Bedrock codec that should act as a fallback. Should represent the latest available * release of the game that GlobalLinkServer supports. */ - public static final BedrockCodec LATEST_CODEC = Bedrock_v671.CODEC; + public static final BedrockCodec LATEST_CODEC = Bedrock_v685.CODEC; /** * A list of all supported Bedrock versions that can join GlobalLinkServer @@ -60,6 +61,7 @@ public class BedrockVersionUtils { SUPPORTED_BEDROCK_CODECS.add(Bedrock_v630.CODEC); SUPPORTED_BEDROCK_CODECS.add(Bedrock_v649.CODEC); SUPPORTED_BEDROCK_CODECS.add(Bedrock_v662.CODEC); + SUPPORTED_BEDROCK_CODECS.add(Bedrock_v671.CODEC); SUPPORTED_BEDROCK_CODECS.add(LATEST_CODEC); }