From afdb50c1d7843054dc7d4d62b96e063cf157a086 Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Mon, 30 Jun 2025 21:09:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AF=E8=83=BD=E6=98=AF=E7=9C=9F=E4=BF=AE?= =?UTF-8?q?=E5=A4=8Dis=E5=AF=BC=E8=87=B4=E7=9A=84=E7=A9=BA=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/vehicle/damage/DamageModify.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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 298e92194..bc18b1464 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 @@ -122,8 +122,14 @@ public class DamageModify { } return switch (sourceType) { - case TAG_KEY -> source.is(sourceTagKey); - case RESOURCE_KEY -> source.is(sourceKey); + case TAG_KEY -> { + if (sourceTagKey == null) yield false; + yield source.is(sourceTagKey); + } + case RESOURCE_KEY -> { + if (sourceKey == null) yield false; + yield source.is(sourceKey); + } case FUNCTION -> condition.apply(source); case ENTITY_ID -> { var directEntity = source.getDirectEntity(); @@ -141,7 +147,7 @@ public class DamageModify { case ENTITY_TAG -> { var directEntity = source.getDirectEntity(); if (directEntity == null) yield false; - + if (entityTag == null) yield false; yield directEntity.getType().is(entityTag); } case ALL -> true;