Register tagrewriter in 1.19.3->1.19.4 protocol

This commit is contained in:
Nassim Jahnke 2023-03-04 00:23:02 +01:00
parent 51d4e11b5f
commit b94c71b699
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
2 changed files with 4 additions and 1 deletions

View File

@ -34,6 +34,7 @@ import com.viaversion.viaversion.protocols.protocol1_19_4to1_19_3.packets.Entity
import com.viaversion.viaversion.protocols.protocol1_19_4to1_19_3.packets.InventoryPackets;
import com.viaversion.viaversion.rewriter.CommandRewriter;
import com.viaversion.viaversion.rewriter.SoundRewriter;
import com.viaversion.viaversion.rewriter.TagRewriter;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
@ -51,6 +52,8 @@ public final class Protocol1_19_4To1_19_3 extends AbstractProtocol<ClientboundPa
protected void registerPackets() {
super.registerPackets();
new TagRewriter<>(this).registerGeneric(ClientboundPackets1_19_3.TAGS);
final SoundRewriter<ClientboundPackets1_19_3> soundRewriter = new SoundRewriter<>(this);
soundRewriter.registerSound(ClientboundPackets1_19_3.ENTITY_SOUND);
soundRewriter.register1_19_3Sound(ClientboundPackets1_19_3.SOUND);

View File

@ -45,7 +45,7 @@ public class TagRewriter<C extends ClientboundPacketType> {
private final Map<RegistryType, Map<String, String>> toRename = new EnumMap<>(RegistryType.class);
private final Set<String> toRemove = new HashSet<>();
public TagRewriter(Protocol<C, ?, ?, ?> protocol) {
public TagRewriter(final Protocol<C, ?, ?, ?> protocol) {
this.protocol = protocol;
}