From 5d4bc57e2aefd5f5a7d9b06de5a568f3e0ac2ad7 Mon Sep 17 00:00:00 2001 From: Pug <81167232+MerchantPug@users.noreply.github.com> Date: Sun, 19 May 2024 08:02:49 +1000 Subject: [PATCH] Fix MerchantPug/toomanyorigins#87. --- CHANGELOG.md | 3 +-- .../apugli/power/factory/DamageNearbyPowerFactory.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff407fb4..af911279 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,2 @@ ## Bugfixes -- Fixed `modify_scale` sometimes not syncing when scales are applied. (#70) -- Fixed a `modify_enchantment_level` related NullPointerException crash. (#73) \ No newline at end of file +- Fixed `damage_nearby_x_hit` power type running attacker, target bientity conditions without an attacker. ([toomanyorigins#87](https://github.com/MerchantPug/toomanyorigins/issues/87)) \ No newline at end of file diff --git a/Common/src/main/java/net/merchantpug/apugli/power/factory/DamageNearbyPowerFactory.java b/Common/src/main/java/net/merchantpug/apugli/power/factory/DamageNearbyPowerFactory.java index b784ae0a..4e0969df 100644 --- a/Common/src/main/java/net/merchantpug/apugli/power/factory/DamageNearbyPowerFactory.java +++ b/Common/src/main/java/net/merchantpug/apugli/power/factory/DamageNearbyPowerFactory.java @@ -27,7 +27,7 @@ static SerializableData getSerializableData() { default void execute(P power, LivingEntity powerHolder, DamageSource damageSource, float damageAmount, @Nullable Entity attacker, LivingEntity target, String attackerName, String targetName, boolean damagerIsAttacker) { SerializableData.Instance data = getDataFromPower(power); - if (canUse(power, powerHolder) && (!data.isPresent("damage_condition") || Services.CONDITION.checkDamage(data, "damage_condition", damageSource, damageAmount)) && (attacker == null && !data.isPresent(attackerName + "_" + targetName + "_bientity_condition") || Services.CONDITION.checkBiEntity(data, attackerName + "_" + targetName + "_bientity_condition", attacker, target))) { + if (canUse(power, powerHolder) && (!data.isPresent("damage_condition") || Services.CONDITION.checkDamage(data, "damage_condition", damageSource, damageAmount)) && (!data.isPresent(attackerName + "_" + targetName + "_bientity_condition") || attacker != null && Services.CONDITION.checkBiEntity(data, attackerName + "_" + targetName + "_bientity_condition", attacker, target))) { float radius = data.getFloat("radius"); List modifiers = new ArrayList<>(); if (data.isPresent("modifiers"))