mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-28 03:15:42 +00:00
Better Barrier Tracking
This commit is contained in:
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() {
|
||||
|
||||
Reference in new issue
Block a user