From 0e41fbfe8384f25da8e286ba6aabb75f634bd986 Mon Sep 17 00:00:00 2001 From: Atsuihsio <842960157@qq.com> Date: Fri, 8 Nov 2024 19:19:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BC=A4=E5=AE=B3=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E4=B8=BA=E8=B4=9F=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/net/mcreator/superbwarfare/entity/Mk42Entity.java | 5 +---- .../net/mcreator/superbwarfare/entity/Mle1934Entity.java | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/mcreator/superbwarfare/entity/Mk42Entity.java b/src/main/java/net/mcreator/superbwarfare/entity/Mk42Entity.java index b5b069e64..ba5d917bd 100644 --- a/src/main/java/net/mcreator/superbwarfare/entity/Mk42Entity.java +++ b/src/main/java/net/mcreator/superbwarfare/entity/Mk42Entity.java @@ -140,12 +140,9 @@ public class Mk42Entity extends Entity implements GeoEntity, ICannonEntity { if (source.is(ModDamageTypes.GUN_FIRE_ABSOLUTE)) { amount *= 1.6f; } - if (amount < 3) { - return false; - } this.level().playSound(null, this.getOnPos(), ModSounds.HIT.get(), SoundSource.PLAYERS, 1, 1); - this.entityData.set(HEALTH, this.entityData.get(HEALTH) - 0.5f * (amount - 5)); + this.entityData.set(HEALTH, this.entityData.get(HEALTH) - 0.5f * Math.max(amount - 5, 0)); return true; } diff --git a/src/main/java/net/mcreator/superbwarfare/entity/Mle1934Entity.java b/src/main/java/net/mcreator/superbwarfare/entity/Mle1934Entity.java index 381b44be2..0b0b8c2c6 100644 --- a/src/main/java/net/mcreator/superbwarfare/entity/Mle1934Entity.java +++ b/src/main/java/net/mcreator/superbwarfare/entity/Mle1934Entity.java @@ -146,12 +146,9 @@ public class Mle1934Entity extends Entity implements GeoEntity, ICannonEntity { if (source.is(ModDamageTypes.GUN_FIRE_ABSOLUTE)) { amount *= 1.6f; } - if (amount < 3) { - return false; - } this.level().playSound(null, this.getOnPos(), ModSounds.HIT.get(), SoundSource.PLAYERS, 1, 1); - this.entityData.set(HEALTH, this.entityData.get(HEALTH) - 0.5f * (amount - 5)); + this.entityData.set(HEALTH, this.entityData.get(HEALTH) - 0.5f * Math.max(amount - 5, 0)); return true; }