AllyDesignationSystem update

Added isOnSameTeam check to  isValidTarget and isAllied
This commit is contained in:
ipdnaeip
2026-04-03 12:09:23 +02:00
committed by WinDanesz
parent 600a321f49
commit 64168d103d
@@ -117,6 +117,9 @@ public final class AllyDesignationSystem {
// Always return true if the attacker is null - this must be after the target null check!
if(attacker == null) return true;
// Teammates are allies
if(attacker.isOnSameTeam(target)) return false;
// Tests whether the target is the attacker
if(target == attacker) return false;
@@ -220,6 +223,10 @@ public final class AllyDesignationSystem {
if(allyOf instanceof EntityPlayer && isOwnerAlly((EntityPlayer)allyOf, pet)) return true;
}
if(possibleAlly.isOnSameTeam(allyOf)) {
return true;
}
// Check if the possibleAlly is mind controlled by the allyOf entity
if(possibleAlly instanceof EntityLiving && possibleAlly.isPotionActive(WizardryPotions.mind_control)){
NBTTagCompound entityNBT = possibleAlly.getEntityData();