Use correct type

This commit is contained in:
Nassim Jahnke 2023-12-06 09:44:20 +01:00
parent 7de9bc604a
commit d5326fad95
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
3 changed files with 7 additions and 8 deletions

View File

@ -100,7 +100,6 @@ public final class Protocol1_20_3To1_20_2 extends AbstractProtocol<ClientboundPa
final TagRewriter<ClientboundPackets1_20_2> tagRewriter = new TagRewriter<>(this);
tagRewriter.registerGeneric(ClientboundPackets1_20_2.TAGS);
tagRewriter.registerGeneric(State.CONFIGURATION, ClientboundConfigurationPackets1_20_2.UPDATE_TAGS);
final SoundRewriter<ClientboundPackets1_20_2> soundRewriter = new SoundRewriter<>(this);
soundRewriter.register1_19_3Sound(ClientboundPackets1_20_2.SOUND);
@ -327,7 +326,7 @@ public final class Protocol1_20_3To1_20_2 extends AbstractProtocol<ClientboundPa
registerClientbound(State.CONFIGURATION, ClientboundConfigurationPackets1_20_2.RESOURCE_PACK.getId(), ClientboundConfigurationPackets1_20_3.RESOURCE_PACK_PUSH.getId(), resourcePackHandler(ClientboundConfigurationPackets1_20_3.RESOURCE_PACK_POP));
// TODO Auto map via packet types provider
registerClientbound(State.CONFIGURATION, ClientboundConfigurationPackets1_20_2.UPDATE_ENABLED_FEATURES.getId(), ClientboundConfigurationPackets1_20_3.UPDATE_ENABLED_FEATURES.getId());
registerClientbound(State.CONFIGURATION, ClientboundConfigurationPackets1_20_2.UPDATE_TAGS.getId(), ClientboundConfigurationPackets1_20_3.UPDATE_TAGS.getId());
registerClientbound(State.CONFIGURATION, ClientboundConfigurationPackets1_20_2.UPDATE_TAGS.getId(), ClientboundConfigurationPackets1_20_3.UPDATE_TAGS.getId(), tagRewriter.getGenericHandler());
}
private PacketHandler resourcePackStatusHandler() {

View File

@ -26,9 +26,9 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType;
import com.viaversion.viaversion.api.protocol.packet.State;
import com.viaversion.viaversion.data.entity.EntityTrackerBase;
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ClientboundConfigurationPackets1_20_2;
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ClientboundPackets1_20_2;
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ServerboundConfigurationPackets1_20_2;
import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ClientboundConfigurationPackets1_20_3;
import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ServerboundPackets1_20_3;
import com.viaversion.viaversion.rewriter.SoundRewriter;
import com.viaversion.viaversion.rewriter.StatisticsRewriter;
@ -40,7 +40,7 @@ import com.viaversion.viaversion.template.protocols.rewriter.EntityPacketRewrite
// Protocol1_99To_98, EntityPacketRewriter1_99, BlockItemPacketRewriter1_99
// ClientboundPackets1_20_2
// ServerboundPackets1_20_3
// ClientboundConfigurationPackets1_20_2
// ClientboundConfigurationPackets1_20_3
// ServerboundConfigurationPackets1_20_2
// Entity1_19_4Types (MAPPED type)
// 1.99, 1.98
@ -62,7 +62,7 @@ public final class Protocol1_99To_98 extends AbstractProtocol<ClientboundPackets
// Registers renames etc. as well as registry type id changes
final TagRewriter<ClientboundPackets1_20_2> tagRewriter = new TagRewriter<>(this);
tagRewriter.registerGeneric(ClientboundPackets1_20_2.TAGS);
tagRewriter.registerGeneric(State.CONFIGURATION, ClientboundConfigurationPackets1_20_2.UPDATE_TAGS);
tagRewriter.registerGeneric(State.CONFIGURATION, ClientboundConfigurationPackets1_20_3.UPDATE_TAGS);
// Registers sound id changes
final SoundRewriter<ClientboundPackets1_20_2> soundRewriter = new SoundRewriter<>(this);
@ -130,7 +130,7 @@ public final class Protocol1_99To_98 extends AbstractProtocol<ClientboundPackets
@Override
protected ClientboundPacketType clientboundFinishConfigurationPacket() {
return ClientboundConfigurationPackets1_20_2.FINISH_CONFIGURATION;
return ClientboundConfigurationPackets1_20_3.FINISH_CONFIGURATION;
}
@Override

View File

@ -23,8 +23,8 @@ import com.viaversion.viaversion.api.protocol.packet.State;
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.version.Types1_20_3;
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ClientboundConfigurationPackets1_20_2;
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ClientboundPackets1_20_2;
import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ClientboundConfigurationPackets1_20_3;
import com.viaversion.viaversion.rewriter.EntityRewriter;
import com.viaversion.viaversion.template.protocols.Protocol1_99To_98;
@ -44,7 +44,7 @@ public final class EntityPacketRewriter1_99 extends EntityRewriter<ClientboundPa
registerMetadataRewriter(ClientboundPackets1_20_2.ENTITY_METADATA, /*Types1_OLD.METADATA_LIST, */Types1_20_3.METADATA_LIST); // Specify old and new metadata list if changed
registerRemoveEntities(ClientboundPackets1_20_2.REMOVE_ENTITIES);
protocol.registerClientbound(State.CONFIGURATION, ClientboundConfigurationPackets1_20_2.REGISTRY_DATA, new PacketHandlers() {
protocol.registerClientbound(State.CONFIGURATION, ClientboundConfigurationPackets1_20_3.REGISTRY_DATA, new PacketHandlers() {
@Override
protected void register() {
map(Type.COMPOUND_TAG); // Registry data