Better Barrier Tracking

This commit is contained in:
Kam committed 2026-02-20 02:17:00 -05:00
1 parent 077fc3cb1d
commit 747918c4dc
3 files changed
+23

No files matched your search

@@ -1,5 +1,6 @@
package kamkeel.npcs.entity;
import kamkeel.npcs.controllers.data.ability.AbilityTargetHelper;
import kamkeel.npcs.controllers.data.ability.data.EnergyBarrierData;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -236,6 +237,16 @@ public abstract class EntityEnergyBarrier extends EntityEnergyAbility {
}
}
/**
* Check if an entity is an ally of this barrier's owner.
* Allies should not be knocked back by barriers.
*/
protected boolean isAllyOfOwner(EntityLivingBase entity) {
Entity owner = getOwnerEntity();
if (owner == null || !(owner instanceof EntityLivingBase)) return false;
return AbilityTargetHelper.isAlly((EntityLivingBase) owner, entity);
}
// ==================== GETTERS ====================
public EnergyBarrierData getBarrierData() {