From 6ca9f4d478eca3f7f6093a29fa65094775af9df0 Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Sat, 31 May 2025 15:32:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BD=BD=E5=85=B7=E5=87=8F?= =?UTF-8?q?=E4=BC=A4=E8=AE=A1=E7=AE=97=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../superbwarfare/entity/vehicle/base/VehicleEntity.java | 7 +------ .../superbwarfare/entity/vehicle/damage/DamageModify.java | 2 ++ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/VehicleEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/VehicleEntity.java index 1bbe5a332..b5b6394d2 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/VehicleEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/VehicleEntity.java @@ -406,12 +406,7 @@ public abstract class VehicleEntity extends Entity { if (source.is(DamageTypes.CACTUS) || source.is(DamageTypes.SWEET_BERRY_BUSH) || source.is(DamageTypes.IN_WALL)) return false; // 计算减伤后的伤害 - float computedAmount; - if (this.level().isClientSide) { - computedAmount = amount; - } else { - computedAmount = getDamageModifier().compute(source, amount); - } + float computedAmount = getDamageModifier().compute(source, amount); this.crash = source.is(ModDamageTypes.VEHICLE_STRIKE); if (source.getEntity() != null) { diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/damage/DamageModify.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/damage/DamageModify.java index c605f3cf9..b93beffef 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/damage/DamageModify.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/damage/DamageModify.java @@ -110,6 +110,8 @@ public class DamageModify { * @return 伤害来源是否符合条件 */ public boolean match(DamageSource source) { + if (source == null) return false; + if (sourceType == null) { generateSourceType(); }