3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-20 06:50:08 +01:00

Handle 1.20->1.20.2 tags

Dieser Commit ist enthalten in:
Nassim Jahnke 2024-01-09 17:18:32 +01:00
Ursprung a561bad004
Commit b6ba7dcc44
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F

Datei anzeigen

@ -51,6 +51,7 @@ import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.storage.Configur
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.storage.LastResourcePack; import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.storage.LastResourcePack;
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.storage.LastTags; import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.storage.LastTags;
import com.viaversion.viaversion.rewriter.SoundRewriter; import com.viaversion.viaversion.rewriter.SoundRewriter;
import com.viaversion.viaversion.rewriter.TagRewriter;
import com.viaversion.viaversion.util.Key; import com.viaversion.viaversion.util.Key;
import java.util.UUID; import java.util.UUID;
import org.checkerframework.checker.nullness.qual.Nullable; import org.checkerframework.checker.nullness.qual.Nullable;
@ -85,9 +86,15 @@ public final class Protocol1_20_2To1_20 extends AbstractProtocol<ClientboundPack
wrapper.user().put(new LastResourcePack(url, hash, required, prompt)); wrapper.user().put(new LastResourcePack(url, hash, required, prompt));
}); });
registerClientbound(ClientboundPackets1_19_4.TAGS, wrapper -> wrapper.user().put(new LastTags(wrapper))); final TagRewriter<ClientboundPackets1_19_4> tagRewriter = new TagRewriter<>(this);
registerClientbound(State.CONFIGURATION, ClientboundConfigurationPackets1_20_2.UPDATE_TAGS.getId(), ClientboundConfigurationPackets1_20_2.UPDATE_TAGS.getId(), registerClientbound(ClientboundPackets1_19_4.TAGS, wrapper -> {
wrapper -> wrapper.user().put(new LastTags(wrapper))); tagRewriter.getGenericHandler().handle(wrapper);
wrapper.user().put(new LastTags(wrapper));
});
registerClientbound(State.CONFIGURATION, ClientboundConfigurationPackets1_20_2.UPDATE_TAGS.getId(), ClientboundConfigurationPackets1_20_2.UPDATE_TAGS.getId(), wrapper -> {
tagRewriter.getGenericHandler().handle(wrapper);
wrapper.user().put(new LastTags(wrapper));
});
registerClientbound(ClientboundPackets1_19_4.DISPLAY_SCOREBOARD, wrapper -> { registerClientbound(ClientboundPackets1_19_4.DISPLAY_SCOREBOARD, wrapper -> {
final byte slot = wrapper.read(Type.BYTE); final byte slot = wrapper.read(Type.BYTE);