From cb958d805b29a9140611135c4d0630f5018bf2fc Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Wed, 19 Mar 2025 20:23:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4fast=20projectile=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/projectile/FastThrowableProjectile.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/FastThrowableProjectile.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/FastThrowableProjectile.java index bb6335d59..ae08f3dbc 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/FastThrowableProjectile.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/FastThrowableProjectile.java @@ -2,7 +2,6 @@ package com.atsuishio.superbwarfare.entity.projectile; import com.atsuishio.superbwarfare.ModUtils; import com.atsuishio.superbwarfare.network.message.ClientMotionSyncMessage; -import net.minecraft.util.Mth; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.projectile.ThrowableItemProjectile; @@ -33,13 +32,7 @@ public abstract class FastThrowableProjectile extends ThrowableItemProjectile im public void syncMotion() { if (this.level().isClientSide) return; - var motion = this.getDeltaMovement(); - double length = motion.length(); - int tickNeeded = 5; - if (length > 0) { - tickNeeded = (int) Mth.clamp(10D / length, 1, 5); - } - if (this.tickCount % tickNeeded == 0) { + if (this.tickCount % this.getType().updateInterval() == 0) { ModUtils.PACKET_HANDLER.send(PacketDistributor.ALL.noArg(), new ClientMotionSyncMessage(this)); } }