Replace event cancellation with setting target to null, fixes #236
This commit is contained in:
@@ -624,7 +624,7 @@ public class Possession extends SpellRay {
|
|||||||
EntityLiving possessee = getPossessee((EntityPlayer)event.getTarget());
|
EntityLiving possessee = getPossessee((EntityPlayer)event.getTarget());
|
||||||
EntityLiving attacker = (EntityLiving)event.getEntityLiving();
|
EntityLiving attacker = (EntityLiving)event.getEntityLiving();
|
||||||
if(possessee != null && !attacker.canAttackClass(possessee.getClass())){
|
if(possessee != null && !attacker.canAttackClass(possessee.getClass())){
|
||||||
event.setCanceled(true); // Mobs can't target a player possessing an entity they don't normally attack
|
((EntityLiving)event.getEntityLiving()).setAttackTarget(null); // Mobs can't target a player possessing an entity they don't normally attack
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user