Send registry data before finish configuration in 1.20.5->1.20.3 (#778)

This commit is contained in:
EnZaXD 2024-06-07 18:19:49 +02:00 committed by GitHub
parent 2f5fbd93ea
commit e93e30c235
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -78,17 +78,17 @@ public final class Protocol1_20_5To1_20_3 extends BackwardsProtocol<ClientboundP
super.registerPackets();
tagRewriter.registerGeneric(ClientboundPackets1_20_5.UPDATE_TAGS);
registerClientbound(ClientboundConfigurationPackets1_20_5.UPDATE_TAGS, wrapper -> {
tagRewriter.registerGeneric(ClientboundConfigurationPackets1_20_5.UPDATE_TAGS);
registerClientbound(ClientboundPackets1_20_5.START_CONFIGURATION, wrapper -> wrapper.user().get(RegistryDataStorage.class).clear());
registerClientbound(ClientboundConfigurationPackets1_20_5.FINISH_CONFIGURATION, wrapper -> {
// Send off registry data first
final PacketWrapper registryDataPacket = wrapper.create(ClientboundConfigurationPackets1_20_3.REGISTRY_DATA);
registryDataPacket.write(Types.COMPOUND_TAG, wrapper.user().get(RegistryDataStorage.class).registryData().copy());
registryDataPacket.send(Protocol1_20_5To1_20_3.class);
tagRewriter.getGenericHandler().handle(wrapper);
});
registerClientbound(ClientboundPackets1_20_5.START_CONFIGURATION, wrapper -> wrapper.user().get(RegistryDataStorage.class).clear());
final SoundRewriter<ClientboundPacket1_20_5> soundRewriter = new SoundRewriter<>(this);
soundRewriter.registerSound1_19_3(ClientboundPackets1_20_5.SOUND);
soundRewriter.registerSound1_19_3(ClientboundPackets1_20_5.SOUND_ENTITY);