From c9f9df648e8e8d0d551a0ff621fee65a8b58f9d3 Mon Sep 17 00:00:00 2001 From: Konicai <71294714+Konicai@users.noreply.github.com> Date: Thu, 26 Oct 2023 04:55:34 -0400 Subject: [PATCH] Java 1.20.2 and Bedrock 1.20.40 (#20) * Support 23w31a changes * 1.20.2-pre2 * MCPL 1.20.2 is now on our maven repo * Bedrock 1.20.40 --------- Co-authored-by: basaigh <53559772+basaigh@users.noreply.github.com> --- gradle/libs.versions.toml | 6 +-- .../bedrock/util/BedrockVersionUtils.java | 4 +- .../globallinkserver/java/JavaServer.java | 39 +++++------------- src/main/resources/registry_codec.nbt | Bin 4600 -> 0 bytes 4 files changed, 17 insertions(+), 32 deletions(-) delete mode 100644 src/main/resources/registry_codec.nbt diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 42b22a3..5a20ed9 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,10 +1,10 @@ [versions] gson = "2.10.1" -protocol = "3.0.0.Beta1-20230908.171156-106" -protocol-connection = "3.0.0.Beta1-20230908.171156-105" +protocol = "3.0.0.Beta1-20231016.115644-107" +protocol-connection = "3.0.0.Beta1-20231016.115644-106" netty = "4.1.80.Final" fastutil = "8.5.2" -mcprotocollib = "1.20-1-20230607.135651-6" # Temporary hack - needs to be updated to release once publishing is fixed +mcprotocollib = "1.20.2-1-20231003.141424-6" adventure-text = "4.9.3" # Match version to MCPL mariadb-client = "2.7.3" checker-qual = "3.21.1" 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 ac93d72..98db215 100644 --- a/src/main/java/org/geysermc/globallinkserver/bedrock/util/BedrockVersionUtils.java +++ b/src/main/java/org/geysermc/globallinkserver/bedrock/util/BedrockVersionUtils.java @@ -30,6 +30,7 @@ import org.cloudburstmc.protocol.bedrock.codec.v589.Bedrock_v589; import org.cloudburstmc.protocol.bedrock.codec.v594.Bedrock_v594; import org.cloudburstmc.protocol.bedrock.codec.v618.Bedrock_v618; +import org.cloudburstmc.protocol.bedrock.codec.v622.Bedrock_v622; /** * Contains information about the supported Bedrock protocols in GlobalLinkServer. @@ -40,7 +41,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_v618.CODEC; + public static final BedrockCodec LATEST_CODEC = Bedrock_v622.CODEC; /** * A list of all supported Bedrock versions that can join GlobalLinkServer @@ -50,6 +51,7 @@ public class BedrockVersionUtils { static { SUPPORTED_BEDROCK_CODECS.add(Bedrock_v589.CODEC); SUPPORTED_BEDROCK_CODECS.add(Bedrock_v594.CODEC); + SUPPORTED_BEDROCK_CODECS.add(Bedrock_v618.CODEC); SUPPORTED_BEDROCK_CODECS.add(LATEST_CODEC); } diff --git a/src/main/java/org/geysermc/globallinkserver/java/JavaServer.java b/src/main/java/org/geysermc/globallinkserver/java/JavaServer.java index c672e55..67a59bb 100644 --- a/src/main/java/org/geysermc/globallinkserver/java/JavaServer.java +++ b/src/main/java/org/geysermc/globallinkserver/java/JavaServer.java @@ -35,6 +35,7 @@ import com.github.steveice10.mc.protocol.data.game.command.CommandType; import com.github.steveice10.mc.protocol.data.game.command.properties.IntegerProperties; import com.github.steveice10.mc.protocol.data.game.entity.player.GameMode; +import com.github.steveice10.mc.protocol.data.game.entity.player.PlayerSpawnInfo; import com.github.steveice10.mc.protocol.data.status.PlayerInfo; import com.github.steveice10.mc.protocol.data.status.ServerStatusInfo; import com.github.steveice10.mc.protocol.data.status.VersionInfo; @@ -44,21 +45,14 @@ import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.player.ClientboundPlayerAbilitiesPacket; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.player.ClientboundSetHealthPacket; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundSetDefaultSpawnPositionPacket; -import com.github.steveice10.opennbt.NBTIO; -import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.github.steveice10.packetlib.Server; import com.github.steveice10.packetlib.event.server.ServerAdapter; import com.github.steveice10.packetlib.event.server.ServerClosedEvent; import com.github.steveice10.packetlib.event.server.SessionAddedEvent; import com.github.steveice10.packetlib.event.session.ConnectedEvent; import com.github.steveice10.packetlib.tcp.TcpServer; -import java.io.DataInput; -import java.io.DataInputStream; -import java.io.IOException; -import java.io.InputStream; import java.util.Collections; import java.util.OptionalInt; -import java.util.zip.GZIPInputStream; import net.kyori.adventure.text.Component; import org.cloudburstmc.math.vector.Vector3i; import org.geysermc.globallinkserver.config.Config; @@ -66,8 +60,6 @@ import org.geysermc.globallinkserver.player.PlayerManager; public class JavaServer implements org.geysermc.globallinkserver.Server { - private static final CompoundTag REGISTRY_CODEC = loadRegistryCodec(); - private final PlayerManager playerManager; private final LinkManager linkManager; @@ -134,22 +126,23 @@ public boolean startServer(Config config) { session.send(new ClientboundLoginPacket( 0, false, - GameMode.SPECTATOR, - GameMode.SPECTATOR, new String[] {"minecraft:the_end"}, - REGISTRY_CODEC, - "minecraft:the_end", - "minecraft:the_end", - 100, 1, 0, 0, false, false, false, - false, - null, - 100)); + new PlayerSpawnInfo( + "minecraft:the_end", + "minecraft:the_end", + 100, + GameMode.SPECTATOR, + GameMode.SPECTATOR, + false, + false, + null, + 100))); session.send(new ClientboundPlayerAbilitiesPacket(false, false, true, false, 0f, 0f)); @@ -188,14 +181,4 @@ public void shutdown() { server.close(); server = null; } - - public static CompoundTag loadRegistryCodec() { - try (InputStream inputStream = JavaServer.class.getClassLoader().getResourceAsStream("registry_codec.nbt"); - DataInputStream stream = new DataInputStream(new GZIPInputStream(inputStream))) { - return (CompoundTag) NBTIO.readTag((DataInput) stream); - } catch (IOException e) { - e.printStackTrace(); - throw new AssertionError("Unable to load login registry."); - } - } } diff --git a/src/main/resources/registry_codec.nbt b/src/main/resources/registry_codec.nbt deleted file mode 100644 index 317752bb7acbb276b56b4bb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