可能是真修复is导致的空判断异常
This commit is contained in:
parent
1831f900f6
commit
afdb50c1d7
1 changed files with 9 additions and 3 deletions
|
@ -122,8 +122,14 @@ public class DamageModify {
|
||||||
}
|
}
|
||||||
|
|
||||||
return switch (sourceType) {
|
return switch (sourceType) {
|
||||||
case TAG_KEY -> source.is(sourceTagKey);
|
case TAG_KEY -> {
|
||||||
case RESOURCE_KEY -> source.is(sourceKey);
|
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 FUNCTION -> condition.apply(source);
|
||||||
case ENTITY_ID -> {
|
case ENTITY_ID -> {
|
||||||
var directEntity = source.getDirectEntity();
|
var directEntity = source.getDirectEntity();
|
||||||
|
@ -141,7 +147,7 @@ public class DamageModify {
|
||||||
case ENTITY_TAG -> {
|
case ENTITY_TAG -> {
|
||||||
var directEntity = source.getDirectEntity();
|
var directEntity = source.getDirectEntity();
|
||||||
if (directEntity == null) yield false;
|
if (directEntity == null) yield false;
|
||||||
|
if (entityTag == null) yield false;
|
||||||
yield directEntity.getType().is(entityTag);
|
yield directEntity.getType().is(entityTag);
|
||||||
}
|
}
|
||||||
case ALL -> true;
|
case ALL -> true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue