From e35c7ff5300ae1a0979411d84c024cc690182fc9 Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Wed, 19 Mar 2025 16:50:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E6=97=B6=E5=9B=9E=E6=BB=9Amixin?= =?UTF-8?q?=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ClientboundSetEntityMotionPacketMixin.java | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/mixins/ClientboundSetEntityMotionPacketMixin.java b/src/main/java/com/atsuishio/superbwarfare/mixins/ClientboundSetEntityMotionPacketMixin.java index 8a39b9784..f429856ea 100644 --- a/src/main/java/com/atsuishio/superbwarfare/mixins/ClientboundSetEntityMotionPacketMixin.java +++ b/src/main/java/com/atsuishio/superbwarfare/mixins/ClientboundSetEntityMotionPacketMixin.java @@ -1,11 +1,7 @@ package com.atsuishio.superbwarfare.mixins; -import com.atsuishio.superbwarfare.entity.projectile.FastProjectile; -import net.minecraft.client.Minecraft; -import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.protocol.game.ClientboundSetEntityMotionPacket; -import net.minecraft.world.entity.Entity; import net.minecraft.world.phys.Vec3; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; @@ -47,15 +43,9 @@ public class ClientboundSetEntityMotionPacketMixin { // TODO 实现仅对 FastProjectile 对象的动量修改 @Inject(method = "(ILnet/minecraft/world/phys/Vec3;)V", at = @At(value = "RETURN")) public void init(int entityId, Vec3 motion, CallbackInfo ci) { - ClientLevel level = Minecraft.getInstance().level; - if (level != null) { - Entity entity = level.getEntity(entityId); - if (entity instanceof FastProjectile) { - this.xa = (int) (motion.x * 8000.0D); - this.ya = (int) (motion.y * 8000.0D); - this.za = (int) (motion.z * 8000.0D); - } - } + this.xa = (int) (motion.x * 8000.0D); + this.ya = (int) (motion.y * 8000.0D); + this.za = (int) (motion.z * 8000.0D); } @Redirect(method = "(Lnet/minecraft/network/FriendlyByteBuf;)V",