From f817f06dbe3a0414acdf2bc021b028390fecd774 Mon Sep 17 00:00:00 2001 From: WinDanesz <31292708+WinDanesz@users.noreply.github.com> Date: Sun, 31 Aug 2025 14:56:41 +0200 Subject: [PATCH] feat: Mind controlled creatures are considered allies by AoE spells. Fixes #890 --- .../wizardry/util/AllyDesignationSystem.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/electroblob/wizardry/util/AllyDesignationSystem.java b/src/main/java/electroblob/wizardry/util/AllyDesignationSystem.java index 77e8b9f8..b8395deb 100644 --- a/src/main/java/electroblob/wizardry/util/AllyDesignationSystem.java +++ b/src/main/java/electroblob/wizardry/util/AllyDesignationSystem.java @@ -220,6 +220,16 @@ public final class AllyDesignationSystem { if(allyOf instanceof EntityPlayer && isOwnerAlly((EntityPlayer)allyOf, pet)) 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(); + + if(entityNBT != null && entityNBT.hasUniqueId(MindControl.NBT_KEY)){ + Entity controller = EntityUtils.getEntityByUUID(possibleAlly.world, entityNBT.getUniqueId(MindControl.NBT_KEY)); + return controller == allyOf; + } + } + return false; }