From 0224bb176629409ca89b4cde35bbba75ca24662e Mon Sep 17 00:00:00 2001 From: Light_Quanta Date: Fri, 10 May 2024 18:50:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9BEAST=E5=AD=90=E5=BC=B9?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=E5=88=A4=E5=AE=9A=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../net/mcreator/target/entity/ProjectileEntity.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/mcreator/target/entity/ProjectileEntity.java b/src/main/java/net/mcreator/target/entity/ProjectileEntity.java index f0ec84610..46d0cd2b0 100644 --- a/src/main/java/net/mcreator/target/entity/ProjectileEntity.java +++ b/src/main/java/net/mcreator/target/entity/ProjectileEntity.java @@ -139,10 +139,6 @@ public class ProjectileEntity extends Entity implements IEntityAdditionalSpawnDa double expandHeight = entity instanceof Player && !entity.isCrouching() ? 0.0625 : 0.0; AABB boundingBox = entity.getBoundingBox(); - if (this.beast) { - boundingBox = boundingBox.inflate(3); - } - // 延迟补偿 if (entity instanceof ServerPlayer && this.shooter != null) { int ping = (int) Math.floor((((ServerPlayer) this.shooter).latency / 1000.0) * 20.0 + 4.0); @@ -150,6 +146,10 @@ public class ProjectileEntity extends Entity implements IEntityAdditionalSpawnDa } boundingBox = boundingBox.expandTowards(0, expandHeight, 0); + if (this.beast) { + boundingBox = boundingBox.inflate(3); + } + Vec3 hitPos = boundingBox.clip(startVec, endVec).orElse(null); Vec3 grownHitPos = boundingBox.inflate(0.35, 0.2, 0.35).clip(startVec, endVec).orElse(null); if (hitPos == null && grownHitPos != null) { @@ -325,7 +325,6 @@ public class ProjectileEntity extends Entity implements IEntityAdditionalSpawnDa living.gameEvent(GameEvent.ENTITY_DIE); } ((ServerLevel) this.level()).sendParticles(ParticleTypes.DAMAGE_INDICATOR, living.getX(), living.getY() + .5, living.getZ(), 1000, .4, .7, .4, 0); - this.discard(); return; }