Scale melee damage dealt to barriers

Barriers are plain entities, so no LivingHurtEvent fires for them and nothing
scaled an incoming melee hit - vanilla handed over the bare attackDamage
attribute and a dome took one point per swing however strong the attacker was.
Attributes now apply, and modifyBarrierMeleeDamage gives addons the same seam
they already have for barrier health.
This commit is contained in:
KAMKEEL committed 2026-08-11 03:43:38 -04:00
1 parent 6477ede022
commit 4341c15cf4
3 files changed
+43 -1

No files matched your search

@@ -46,6 +46,7 @@ import noppes.npcs.controllers.data.AbilityScript;
import noppes.npcs.controllers.data.ChainedAbilityScript;
import net.minecraft.entity.EntityLivingBase;
import kamkeel.npcs.controllers.sync.handlers.PlayerAbilitySyncHelper;
import kamkeel.npcs.entity.EntityEnergyBarrier;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
@@ -1381,6 +1382,17 @@ public class AbilityController implements IAbilityHandler {
return health;
}
/**
* Fire modifyBarrierMeleeDamage on all extenders. Cumulative — each extender's output feeds the next.
*/
public float fireModifyBarrierMeleeDamage(EntityEnergyBarrier barrier, EntityLivingBase attacker, float baseDamage) {
float damage = baseDamage;
for (IAbilityExtender ext : extenders) {
damage = ext.modifyBarrierMeleeDamage(barrier, attacker, damage);
}
return damage;
}
/**
* Fire onAbilityHeal on all extenders. Chain of responsibility — first true wins.
*/