From b3304405ec6f6878b1c588b1e6edf847a904ece0 Mon Sep 17 00:00:00 2001 From: FlorianMichael Date: Mon, 28 Oct 2024 11:34:44 +0100 Subject: [PATCH] Use new ParticleRewriter --- .../src/main/groovy/vaf.base-conventions.gradle | 4 ++-- .../Protocol20w14infiniteTo1_16.java | 10 ++++++++++ .../rewriter/BlockItemPacketRewriter20w14infinite.java | 1 - .../Protocol3D_SharewareTo1_14.java | 10 ++++++++++ .../rewriter/BlockItemPacketRewriter3D_Shareware.java | 1 - fabric/src/main/resources/fabric.mod.json | 2 +- 6 files changed, 23 insertions(+), 5 deletions(-) diff --git a/build-logic/src/main/groovy/vaf.base-conventions.gradle b/build-logic/src/main/groovy/vaf.base-conventions.gradle index 1deb86f..049dd00 100644 --- a/build-logic/src/main/groovy/vaf.base-conventions.gradle +++ b/build-logic/src/main/groovy/vaf.base-conventions.gradle @@ -22,8 +22,8 @@ base { } dependencies { - compileOnly "com.viaversion:viaversion-common:5.1.0" - compileOnly "com.viaversion:viabackwards-common:5.1.0" + compileOnly "com.viaversion:viaversion-common:5.1.1-SNAPSHOT" + compileOnly "com.viaversion:viabackwards-common:5.1.1-SNAPSHOT" } publishing { diff --git a/common/src/main/java/net/raphimc/viaaprilfools/protocol/s20w14infinitetov1_16/Protocol20w14infiniteTo1_16.java b/common/src/main/java/net/raphimc/viaaprilfools/protocol/s20w14infinitetov1_16/Protocol20w14infiniteTo1_16.java index 7eac12a..b284006 100644 --- a/common/src/main/java/net/raphimc/viaaprilfools/protocol/s20w14infinitetov1_16/Protocol20w14infiniteTo1_16.java +++ b/common/src/main/java/net/raphimc/viaaprilfools/protocol/s20w14infinitetov1_16/Protocol20w14infiniteTo1_16.java @@ -31,6 +31,7 @@ import com.viaversion.viaversion.protocols.v1_15_2to1_16.Protocol1_15_2To1_16; import com.viaversion.viaversion.protocols.v1_15_2to1_16.packet.ClientboundPackets1_16; import com.viaversion.viaversion.protocols.v1_15_2to1_16.packet.ServerboundPackets1_16; import com.viaversion.viaversion.protocols.v1_15_2to1_16.provider.PlayerAbilitiesProvider; +import com.viaversion.viaversion.rewriter.ParticleRewriter; import com.viaversion.viaversion.rewriter.RecipeRewriter; import com.viaversion.viaversion.rewriter.StatisticsRewriter; import com.viaversion.viaversion.rewriter.TagRewriter; @@ -39,6 +40,7 @@ import net.raphimc.viaaprilfools.protocol.s20w14infinitetov1_16.rewriter.EntityP import net.raphimc.viaaprilfools.protocol.s20w14infinitetov1_16.packet.ClientboundPackets20w14infinite; import net.raphimc.viaaprilfools.protocol.s20w14infinitetov1_16.packet.ServerboundPackets20w14infinite; import net.raphimc.viaaprilfools.protocol.s20w14infinitetov1_16.rewriter.BlockItemPacketRewriter20w14infinite; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.UUID; @@ -48,6 +50,7 @@ public class Protocol20w14infiniteTo1_16 extends BackwardsProtocol particleRewriter = new ParticleRewriter<>(this); private final EntityPacketRewriter20w14infinite entityRewriter = new EntityPacketRewriter20w14infinite(this); private final TagRewriter tagRewriter = new TagRewriter<>(this); @@ -59,6 +62,8 @@ public class Protocol20w14infiniteTo1_16 extends BackwardsProtocol(this).register(ClientboundPackets20w14infinite.AWARD_STATS); final SoundRewriter soundRewriter = new SoundRewriter<>(this); @@ -172,6 +177,11 @@ public class Protocol20w14infiniteTo1_16 extends BackwardsProtocol getParticleRewriter() { + return particleRewriter; + } + @Override public EntityPacketRewriter20w14infinite getEntityRewriter() { return this.entityRewriter; diff --git a/common/src/main/java/net/raphimc/viaaprilfools/protocol/s20w14infinitetov1_16/rewriter/BlockItemPacketRewriter20w14infinite.java b/common/src/main/java/net/raphimc/viaaprilfools/protocol/s20w14infinitetov1_16/rewriter/BlockItemPacketRewriter20w14infinite.java index f10815e..debf6f3 100644 --- a/common/src/main/java/net/raphimc/viaaprilfools/protocol/s20w14infinitetov1_16/rewriter/BlockItemPacketRewriter20w14infinite.java +++ b/common/src/main/java/net/raphimc/viaaprilfools/protocol/s20w14infinitetov1_16/rewriter/BlockItemPacketRewriter20w14infinite.java @@ -51,7 +51,6 @@ public class BlockItemPacketRewriter20w14infinite extends ItemRewriter blockRewriter = BlockRewriter.for1_14(this.protocol); diff --git a/common/src/main/java/net/raphimc/viaaprilfools/protocol/s3d_sharewaretov1_14/Protocol3D_SharewareTo1_14.java b/common/src/main/java/net/raphimc/viaaprilfools/protocol/s3d_sharewaretov1_14/Protocol3D_SharewareTo1_14.java index 0f95a5a..85bcc69 100644 --- a/common/src/main/java/net/raphimc/viaaprilfools/protocol/s3d_sharewaretov1_14/Protocol3D_SharewareTo1_14.java +++ b/common/src/main/java/net/raphimc/viaaprilfools/protocol/s3d_sharewaretov1_14/Protocol3D_SharewareTo1_14.java @@ -28,12 +28,14 @@ import com.viaversion.viaversion.api.type.types.chunk.ChunkType1_14; import com.viaversion.viaversion.protocols.v1_13_2to1_14.Protocol1_13_2To1_14; import com.viaversion.viaversion.protocols.v1_13_2to1_14.packet.ClientboundPackets1_14; import com.viaversion.viaversion.protocols.v1_13_2to1_14.packet.ServerboundPackets1_14; +import com.viaversion.viaversion.rewriter.ParticleRewriter; import net.raphimc.viaaprilfools.api.data.AprilFoolsMappingData; import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.packet.ClientboundPackets3D_Shareware; import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.packet.ServerboundPackets3D_Shareware; import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.rewriter.BlockItemPacketRewriter3D_Shareware; import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.rewriter.EntityPacketRewriter3D_Shareware; import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.storage.ChunkCenterTracker3D_Shareware; +import org.checkerframework.checker.nullness.qual.Nullable; public class Protocol3D_SharewareTo1_14 extends BackwardsProtocol { @@ -41,6 +43,7 @@ public class Protocol3D_SharewareTo1_14 extends BackwardsProtocol particleRewriter = new ParticleRewriter<>(this); public Protocol3D_SharewareTo1_14() { super(ClientboundPackets3D_Shareware.class, ClientboundPackets1_14.class, ServerboundPackets3D_Shareware.class, ServerboundPackets1_14.class); @@ -50,6 +53,8 @@ public class Protocol3D_SharewareTo1_14 extends BackwardsProtocol soundRewriter = new SoundRewriter<>(this); soundRewriter.registerSound(ClientboundPackets3D_Shareware.SOUND); @@ -94,4 +99,9 @@ public class Protocol3D_SharewareTo1_14 extends BackwardsProtocol getParticleRewriter() { + return particleRewriter; + } + } diff --git a/common/src/main/java/net/raphimc/viaaprilfools/protocol/s3d_sharewaretov1_14/rewriter/BlockItemPacketRewriter3D_Shareware.java b/common/src/main/java/net/raphimc/viaaprilfools/protocol/s3d_sharewaretov1_14/rewriter/BlockItemPacketRewriter3D_Shareware.java index f3e80c7..4ae9205 100644 --- a/common/src/main/java/net/raphimc/viaaprilfools/protocol/s3d_sharewaretov1_14/rewriter/BlockItemPacketRewriter3D_Shareware.java +++ b/common/src/main/java/net/raphimc/viaaprilfools/protocol/s3d_sharewaretov1_14/rewriter/BlockItemPacketRewriter3D_Shareware.java @@ -39,7 +39,6 @@ public class BlockItemPacketRewriter3D_Shareware extends ItemRewriter=0.4.14", - "viabackwards": ">=5.1.0" + "viabackwards": ">=5.1.1-SNAPSHOT" }, "custom": { "modmenu:api": true,