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;