3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-19 14:30:16 +01:00

Add component rewriter for 1.20.3->1.20.5

Dieser Commit ist enthalten in:
FlorianMichael 2024-04-13 20:56:54 +02:00
Ursprung ba4404fad6
Commit 970986bc59
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: C2FB87E71C425126
3 geänderte Dateien mit 1024 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -48,8 +48,10 @@ import com.viaversion.viaversion.protocols.protocol1_20_5to1_20_3.packet.Serverb
import com.viaversion.viaversion.protocols.protocol1_20_5to1_20_3.packet.ServerboundPacket1_20_5; import com.viaversion.viaversion.protocols.protocol1_20_5to1_20_3.packet.ServerboundPacket1_20_5;
import com.viaversion.viaversion.protocols.protocol1_20_5to1_20_3.packet.ServerboundPackets1_20_5; import com.viaversion.viaversion.protocols.protocol1_20_5to1_20_3.packet.ServerboundPackets1_20_5;
import com.viaversion.viaversion.protocols.protocol1_20_5to1_20_3.rewriter.BlockItemPacketRewriter1_20_5; import com.viaversion.viaversion.protocols.protocol1_20_5to1_20_3.rewriter.BlockItemPacketRewriter1_20_5;
import com.viaversion.viaversion.protocols.protocol1_20_5to1_20_3.rewriter.ComponentRewriter1_20_5;
import com.viaversion.viaversion.protocols.protocol1_20_5to1_20_3.rewriter.EntityPacketRewriter1_20_5; import com.viaversion.viaversion.protocols.protocol1_20_5to1_20_3.rewriter.EntityPacketRewriter1_20_5;
import com.viaversion.viaversion.protocols.protocol1_20_5to1_20_3.storage.AcknowledgedMessagesStorage; import com.viaversion.viaversion.protocols.protocol1_20_5to1_20_3.storage.AcknowledgedMessagesStorage;
import com.viaversion.viaversion.rewriter.ComponentRewriter;
import com.viaversion.viaversion.rewriter.SoundRewriter; import com.viaversion.viaversion.rewriter.SoundRewriter;
import com.viaversion.viaversion.rewriter.StatisticsRewriter; import com.viaversion.viaversion.rewriter.StatisticsRewriter;
import com.viaversion.viaversion.rewriter.TagRewriter; import com.viaversion.viaversion.rewriter.TagRewriter;
@ -81,6 +83,10 @@ public final class Protocol1_20_5To1_20_3 extends AbstractProtocol<ClientboundPa
new StatisticsRewriter<>(this).register(ClientboundPackets1_20_3.STATISTICS); new StatisticsRewriter<>(this).register(ClientboundPackets1_20_3.STATISTICS);
final ComponentRewriter<ClientboundPacket1_20_3> componentRewriter = new ComponentRewriter1_20_5(this);
componentRewriter.registerComponentPacket(ClientboundPackets1_20_3.SYSTEM_CHAT);
componentRewriter.registerComponentPacket(ClientboundPackets1_20_3.DISGUISED_CHAT);
registerClientbound(State.LOGIN, ClientboundLoginPackets.HELLO, wrapper -> { registerClientbound(State.LOGIN, ClientboundLoginPackets.HELLO, wrapper -> {
wrapper.passthrough(Type.STRING); // Server ID wrapper.passthrough(Type.STRING); // Server ID
wrapper.passthrough(Type.BYTE_ARRAY_PRIMITIVE); // Public key wrapper.passthrough(Type.BYTE_ARRAY_PRIMITIVE); // Public key

Datei anzeigen

@ -116,6 +116,7 @@ import static com.viaversion.viaversion.util.MathUtil.clamp;
public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter<ClientboundPacket1_20_3, ServerboundPacket1_20_5, Protocol1_20_5To1_20_3> { public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter<ClientboundPacket1_20_3, ServerboundPacket1_20_5, Protocol1_20_5To1_20_3> {
public static final String[] MOB_TAGS = {"NoAI", "Silent", "NoGravity", "Glowing", "Invulnerable", "Health", "Age", "Variant", "HuntingCooldown", "BucketVariantTag"}; public static final String[] MOB_TAGS = {"NoAI", "Silent", "NoGravity", "Glowing", "Invulnerable", "Health", "Age", "Variant", "HuntingCooldown", "BucketVariantTag"};
public static final String[] ATTRIBUTE_OPERATIONS = {"add_value", "add_multiplied_base", "add_multiplied_total"};
private static final StructuredDataConverter DATA_CONVERTER = new StructuredDataConverter(false); private static final StructuredDataConverter DATA_CONVERTER = new StructuredDataConverter(false);
private static final GameProfile.Property[] EMPTY_PROPERTIES = new GameProfile.Property[0]; private static final GameProfile.Property[] EMPTY_PROPERTIES = new GameProfile.Property[0];
private static final StatePropertyMatcher[] EMPTY_PROPERTY_MATCHERS = new StatePropertyMatcher[0]; private static final StatePropertyMatcher[] EMPTY_PROPERTY_MATCHERS = new StatePropertyMatcher[0];