可能是真修复is导致的空判断异常

This commit is contained in:
17146 2025-06-30 21:09:43 +08:00 committed by Light_Quanta
parent 1831f900f6
commit afdb50c1d7
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959

View file

@ -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;