Skip to content

Commit

Permalink
Fix apoli:attacker damage condition null
Browse files Browse the repository at this point in the history
  • Loading branch information
Dueris committed Jul 20, 2024
1 parent 45e492b commit 4500323
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public void registerConditions() {
return false;
}));
register(new ConditionFactory(OriginsPaper.apoliIdentifier("attacker"), (data, damageEvent) -> {
if (damageEvent.getDamageSource() == null || damageEvent.getDamageSource().getDirectEntity() == null) return false;
Entity attacker = new DamageSource(nmsDamageSource(damageEvent).typeHolder(), ((CraftEntity) damageEvent.getDamageSource().getDirectEntity()).getHandle()).getEntity();
if (attacker instanceof LivingEntity) {
return !data.isPresent("entity_condition") || ConditionExecutor.testEntity(data.getJsonObject("entity_condition"), attacker.getBukkitEntity());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ public ResourceLocation key() {
return this.key;
}

public Map<String, String> getLangMap() {
return langMap;
}
}

0 comments on commit 4500323

Please sign in to comment.