Don't resend pack in 1.20->1.20.2 for 1.20.3 clients

This commit is contained in:
Nassim Jahnke 2023-11-20 20:01:06 +01:00
parent a0f8ab7bbb
commit 151ecdcd72
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
2 changed files with 3 additions and 1 deletions

View File

@ -30,6 +30,7 @@ import com.viaversion.viaversion.api.protocol.packet.Direction;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.protocol.packet.State;
import com.viaversion.viaversion.api.protocol.remapper.PacketHandler;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viaversion.api.rewriter.EntityRewriter;
import com.viaversion.viaversion.api.rewriter.ItemRewriter;
import com.viaversion.viaversion.api.type.Type;
@ -304,7 +305,7 @@ public final class Protocol1_20_2To1_20 extends AbstractProtocol<ClientboundPack
lastTags.sendLastTags(connection);
}
if (lastResourcePack != null) {
if (lastResourcePack != null && connection.getProtocolInfo().getProtocolVersion() == ProtocolVersion.v1_20_2.getVersion()) {
// The client for some reason drops the resource pack when reentering the configuration state
final PacketWrapper resourcePackPacket = PacketWrapper.create(ClientboundConfigurationPackets1_20_2.RESOURCE_PACK, connection);
resourcePackPacket.write(Type.STRING, lastResourcePack.url());

View File

@ -327,6 +327,7 @@ public final class Protocol1_20_3To1_20_2 extends AbstractProtocol<ClientboundPa
registerClientbound(State.CONFIGURATION, ClientboundConfigurationPackets1_20_2.UPDATE_TAGS.getId(), ClientboundConfigurationPackets1_20_3.UPDATE_TAGS.getId());
}
// TODO Drop old resource packs
private PacketHandler resourcePackHandler() {
return wrapper -> {
wrapper.write(Type.UUID, UUID.randomUUID());