From c7324b1b354052e89ba14df59f13345c06147bef Mon Sep 17 00:00:00 2001 From: FlorianMichael Date: Sat, 19 Oct 2024 01:19:22 +0200 Subject: [PATCH] Use SET_ENTITY_MOTION and EXPLODE for delta movement translation --- .../rewriter/EntityPacketRewriter1_21_2.java | 65 ++++++++++++++----- .../v1_21_2to1_21/storage/PlayerStorage.java | 22 ------- 2 files changed, 47 insertions(+), 40 deletions(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/v1_21_2to1_21/rewriter/EntityPacketRewriter1_21_2.java b/common/src/main/java/com/viaversion/viabackwards/protocol/v1_21_2to1_21/rewriter/EntityPacketRewriter1_21_2.java index 21477e34..4b177ee4 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/v1_21_2to1_21/rewriter/EntityPacketRewriter1_21_2.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/v1_21_2to1_21/rewriter/EntityPacketRewriter1_21_2.java @@ -18,10 +18,14 @@ package com.viaversion.viabackwards.protocol.v1_21_2to1_21.rewriter; import com.viaversion.nbt.tag.Tag; +import com.viaversion.viabackwards.ViaBackwards; import com.viaversion.viabackwards.api.rewriters.EntityRewriter; import com.viaversion.viabackwards.protocol.v1_21_2to1_21.Protocol1_21_2To1_21; import com.viaversion.viabackwards.protocol.v1_21_2to1_21.storage.PlayerStorage; import com.viaversion.viabackwards.protocol.v1_21_2to1_21.storage.SneakingStorage; +import com.viaversion.viaversion.api.minecraft.Holder; +import com.viaversion.viaversion.api.minecraft.Particle; +import com.viaversion.viaversion.api.minecraft.SoundEvent; import com.viaversion.viaversion.api.minecraft.entities.EntityType; import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_21_2; import com.viaversion.viaversion.api.minecraft.entitydata.EntityData; @@ -43,6 +47,8 @@ import java.util.List; public final class EntityPacketRewriter1_21_2 extends EntityRewriter { + private boolean warned = ViaBackwards.getConfig().suppressEmulationWarnings(); + public EntityPacketRewriter1_21_2(final Protocol1_21_2To1_21 protocol) { super(protocol, Types1_21.ENTITY_DATA_TYPES.optionalComponentType, Types1_21.ENTITY_DATA_TYPES.booleanType); } @@ -181,6 +187,10 @@ public final class EntityPacketRewriter1_21_2 extends EntityRewriter