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 317752b..0000000 Binary files a/src/main/resources/registry_codec.nbt and /dev/null differ