Use World forEach methods when possible.

This commit is contained in:
MobiusDevelopment
2020-09-02 21:32:31 +00:00
parent 0790f3d43b
commit e47e7d2759
50 changed files with 237 additions and 192 deletions

View File

@@ -66,14 +66,14 @@ public class GetAgro extends AbstractEffect
final Set<Integer> clans = template.getClans();
if (clans != null)
{
for (Attackable nearby : World.getInstance().getVisibleObjectsInRange(effected, Attackable.class, template.getClanHelpRange()))
World.getInstance().forEachVisibleObjectInRange(effected, Attackable.class, template.getClanHelpRange(), nearby ->
{
if (!nearby.isMovementDisabled() && nearby.getTemplate().isClan(clans))
{
nearby.addDamageHate(effector, 1, 200);
nearby.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector);
}
}
});
}
}
}