diff --git a/src/main/java/dev/waterdog/waterdogpe/network/protocol/ProtocolVersion.java b/src/main/java/dev/waterdog/waterdogpe/network/protocol/ProtocolVersion.java index 2783985e..10b07ee4 100644 --- a/src/main/java/dev/waterdog/waterdogpe/network/protocol/ProtocolVersion.java +++ b/src/main/java/dev/waterdog/waterdogpe/network/protocol/ProtocolVersion.java @@ -64,6 +64,7 @@ import org.cloudburstmc.protocol.bedrock.codec.v712.Bedrock_v712; import org.cloudburstmc.protocol.bedrock.codec.v729.Bedrock_v729; import org.cloudburstmc.protocol.bedrock.codec.v748.Bedrock_v748; +import org.cloudburstmc.protocol.bedrock.codec.v766.Bedrock_v766; @ToString(exclude = {"defaultCodec", "bedrockCodec"}) public enum ProtocolVersion { @@ -113,7 +114,8 @@ public enum ProtocolVersion { MINECRAFT_PE_1_21_2(686, Bedrock_v686.CODEC), MINECRAFT_PE_1_21_20(712, Bedrock_v712.CODEC), MINECRAFT_PE_1_21_30(729, Bedrock_v729.CODEC), - MINECRAFT_PE_1_21_40(748, Bedrock_v748.CODEC); + MINECRAFT_PE_1_21_40(748, Bedrock_v748.CODEC), + MINECRAFT_PE_1_21_50(766, Bedrock_v766.CODEC); private static final ProtocolVersion[] VALUES = values(); private static final Int2ObjectMap VERSIONS = new Int2ObjectOpenHashMap<>(); diff --git a/src/main/java/dev/waterdog/waterdogpe/packs/PackManager.java b/src/main/java/dev/waterdog/waterdogpe/packs/PackManager.java index ea8e63f6..303be198 100644 --- a/src/main/java/dev/waterdog/waterdogpe/packs/PackManager.java +++ b/src/main/java/dev/waterdog/waterdogpe/packs/PackManager.java @@ -47,6 +47,8 @@ public class PackManager { private final ResourcePacksInfoPacket packsInfoPacket = new ResourcePacksInfoPacket(); private final ResourcePackStackPacket stackPacket = new ResourcePackStackPacket(); + private static final UUID ZERO_UUID = new UUID(0, 0); + public PackManager(ProxyServer proxy) { this.proxy = proxy; } @@ -148,6 +150,9 @@ public boolean unregisterPack(UUID packId) { } public void rebuildPackets() { + this.packsInfoPacket.setWorldTemplateId(ZERO_UUID); + this.packsInfoPacket.setWorldTemplateVersion("0.0.0"); + this.packsInfoPacket.setForcedToAccept(this.proxy.getConfiguration().isForceServerPacks()); this.stackPacket.setForcedToAccept(this.proxy.getConfiguration().isOverwriteClientPacks()); @@ -157,10 +162,10 @@ public void rebuildPackets() { this.stackPacket.getBehaviorPacks().clear(); this.stackPacket.getResourcePacks().clear(); - this.stackPacket.setGameVersion(""); + this.stackPacket.setGameVersion("*"); for (ResourcePack pack : this.packs.values()) { - ResourcePacksInfoPacket.Entry infoEntry = new ResourcePacksInfoPacket.Entry(pack.getPackId().toString(), pack.getVersion().toString(), + ResourcePacksInfoPacket.Entry infoEntry = new ResourcePacksInfoPacket.Entry(pack.getPackId(), pack.getVersion().toString(), pack.getPackSize(), pack.getContentKey(), "", pack.getContentKey().equals("") ? "" : pack.getPackId().toString(), false, false, false, null); ResourcePackStackPacket.Entry stackEntry = new ResourcePackStackPacket.Entry(pack.getPackId().toString(), pack.getVersion().toString(), ""); if (pack.getType().equals(ResourcePack.TYPE_RESOURCES)) {