More mind control fixes
This commit is contained in:
@@ -141,6 +141,7 @@ public class MindControl extends SpellRay {
|
|||||||
target.posX, target.posY, target.posZ, world);
|
target.posX, target.posY, target.posZ, world);
|
||||||
|
|
||||||
possibleTargets.remove(target);
|
possibleTargets.remove(target);
|
||||||
|
possibleTargets.remove(target.getRidingEntity());
|
||||||
possibleTargets.removeIf(e -> e instanceof EntityArmorStand);
|
possibleTargets.removeIf(e -> e instanceof EntityArmorStand);
|
||||||
|
|
||||||
EntityLivingBase newAITarget = null;
|
EntityLivingBase newAITarget = null;
|
||||||
@@ -153,10 +154,7 @@ public class MindControl extends SpellRay {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(newAITarget != null){
|
if(newAITarget != null){
|
||||||
// From 1.7.10 - this seems not to work quite right; the entity appears to continue attacking this target
|
|
||||||
// after it gets killed (not noticeable in survival since it will target the player again immediately.)
|
|
||||||
target.setAttackTarget(newAITarget);
|
target.setAttackTarget(newAITarget);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,7 +204,7 @@ public class MindControl extends SpellRay {
|
|||||||
if(((EntityLiving)event.getEntityLiving()).getAttackTarget() == null
|
if(((EntityLiving)event.getEntityLiving()).getAttackTarget() == null
|
||||||
|| !((EntityLiving)event.getEntityLiving()).getAttackTarget().isEntityAlive()){
|
|| !((EntityLiving)event.getEntityLiving()).getAttackTarget().isEntityAlive()){
|
||||||
|
|
||||||
processTargeting(entity.world, entity, entity.getAttackTarget());
|
processTargeting(entity.world, entity, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -231,6 +229,7 @@ public class MindControl extends SpellRay {
|
|||||||
private static void onEffectEnd(PotionEffect effect, Entity entity){
|
private static void onEffectEnd(PotionEffect effect, Entity entity){
|
||||||
if(effect != null && effect.getPotion() == WizardryPotions.mind_control && entity instanceof EntityLiving){
|
if(effect != null && effect.getPotion() == WizardryPotions.mind_control && entity instanceof EntityLiving){
|
||||||
((EntityLiving)entity).setAttackTarget(null); // End effect
|
((EntityLiving)entity).setAttackTarget(null); // End effect
|
||||||
|
((EntityLiving)entity).setRevengeTarget(null); // End effect
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user