Tweak summoned creature targeting so that non-evil wizards' minions no longer attack players unless the player in question has angered the wizard
This commit is contained in:
@@ -181,8 +181,18 @@ public interface ISummonedCreature extends IEntityAdditionalSpawnData {
|
|||||||
if(!entity.isInvisible() && isValidTarget(entity)){
|
if(!entity.isInvisible() && isValidTarget(entity)){
|
||||||
|
|
||||||
// ... and is a player, they can be attacked, since players can't be in the whitelist or the
|
// ... and is a player, they can be attacked, since players can't be in the whitelist or the
|
||||||
// blacklist.
|
// blacklist ...
|
||||||
if(entity instanceof EntityPlayer) return true;
|
if(entity instanceof EntityPlayer){
|
||||||
|
// ... unless the creature was summoned by a good wizard who the player has not angered.
|
||||||
|
if(getCaster() instanceof EntityWizard){
|
||||||
|
if(((EntityWizard)getCaster()).getRevengeTarget() != entity
|
||||||
|
&& ((EntityWizard)getCaster()).getAttackTarget() != entity) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// ... and is a mob, a summoned creature, a wizard ...
|
// ... and is a mob, a summoned creature, a wizard ...
|
||||||
if((entity instanceof IMob || entity instanceof ISummonedCreature
|
if((entity instanceof IMob || entity instanceof ISummonedCreature
|
||||||
|
|||||||
Reference in New Issue
Block a user