From d007beaeec4f1bdd20d6fa02e49d293989467de5 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sat, 8 Jun 2024 21:07:24 +0200 Subject: [PATCH] 1.21-pre4 --- .../api/protocol/version/ProtocolVersion.java | 2 +- .../rewriter/EntityPacketRewriter1_20_5.java | 7 +++---- .../rewriter/BlockItemPacketRewriter1_21.java | 13 ++++++------- .../rewriter/EntityPacketRewriter1_21.java | 4 +++- .../viaversion/rewriter/EntityRewriter.java | 16 ++++++++++++++-- gradle.properties | 2 +- .../rewriter/EntityPacketRewriter1_99.java | 4 +++- 7 files changed, 31 insertions(+), 17 deletions(-) diff --git a/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java b/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java index 2342e13e4..cc67dc54a 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java +++ b/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java @@ -84,7 +84,7 @@ public class ProtocolVersion implements Comparable { public static final ProtocolVersion v1_20_2 = register(764, "1.20.2"); public static final ProtocolVersion v1_20_3 = register(765, "1.20.3-1.20.4", new SubVersionRange("1.20", 3, 4)); public static final ProtocolVersion v1_20_5 = register(766, "1.20.5-1.20.6", new SubVersionRange("1.20", 5, 6)); - public static final ProtocolVersion v1_21 = register(767, 201, "1.21"); + public static final ProtocolVersion v1_21 = register(767, 202, "1.21"); public static final ProtocolVersion unknown = new ProtocolVersion(VersionType.SPECIAL, -1, -1, "UNKNOWN", null); public static ProtocolVersion register(int version, String name) { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/rewriter/EntityPacketRewriter1_20_5.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/rewriter/EntityPacketRewriter1_20_5.java index 5bb12877c..1dd9e1ddd 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/rewriter/EntityPacketRewriter1_20_5.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/rewriter/EntityPacketRewriter1_20_5.java @@ -412,13 +412,12 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter protocol.getComponentRewriter().processTag(event.user(), meta.value())); - filter().dataType(Types1_20_5.ENTITY_DATA_TYPES.optionalComponentType).handler((event, meta) -> protocol.getComponentRewriter().processTag(event.user(), meta.value())); - filter().type(EntityTypes1_20_5.LIVING_ENTITY).index(10).handler((event, meta) -> { final int effectColor = meta.value(); if (effectColor == 0) { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_5to1_21/rewriter/BlockItemPacketRewriter1_21.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_5to1_21/rewriter/BlockItemPacketRewriter1_21.java index e141e6df2..53bed0e3b 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_5to1_21/rewriter/BlockItemPacketRewriter1_21.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_5to1_21/rewriter/BlockItemPacketRewriter1_21.java @@ -38,7 +38,6 @@ import com.viaversion.viaversion.rewriter.BlockRewriter; import com.viaversion.viaversion.rewriter.StructuredItemRewriter; import java.util.Arrays; import java.util.List; -import org.checkerframework.checker.nullness.qual.Nullable; public final class BlockItemPacketRewriter1_21 extends StructuredItemRewriter { @@ -108,9 +107,9 @@ public final class BlockItemPacketRewriter1_21 extends StructuredItemRewriter { diff --git a/common/src/main/java/com/viaversion/viaversion/rewriter/EntityRewriter.java b/common/src/main/java/com/viaversion/viaversion/rewriter/EntityRewriter.java index 7b4b0fd2d..0ce1a9f07 100644 --- a/common/src/main/java/com/viaversion/viaversion/rewriter/EntityRewriter.java +++ b/common/src/main/java/com/viaversion/viaversion/rewriter/EntityRewriter.java @@ -21,6 +21,7 @@ import com.google.common.base.Preconditions; import com.viaversion.nbt.tag.CompoundTag; import com.viaversion.nbt.tag.ListTag; import com.viaversion.nbt.tag.NumberTag; +import com.viaversion.nbt.tag.Tag; import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.data.Int2IntMapMappings; @@ -32,9 +33,9 @@ import com.viaversion.viaversion.api.data.entity.TrackedEntity; import com.viaversion.viaversion.api.minecraft.Particle; import com.viaversion.viaversion.api.minecraft.RegistryEntry; import com.viaversion.viaversion.api.minecraft.entities.EntityType; -import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.minecraft.entitydata.EntityData; import com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType; +import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.protocol.Protocol; import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType; import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; @@ -191,6 +192,10 @@ public abstract class EntityRewriter { final EntityDataType type = data.dataType(); if (type == itemType) { @@ -220,6 +229,9 @@ public abstract class EntityRewriter