Removed Stream usage from Creature.

This commit is contained in:
MobiusDevelopment
2021-03-16 08:01:40 +00:00
parent 6c86d1d864
commit e0e47e55c9
19 changed files with 266 additions and 57 deletions

View File

@ -2886,7 +2886,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public boolean isCastingNow(Predicate<SkillCaster> filter)
{
return _skillCasters.values().stream().anyMatch(filter);
for (SkillCaster skillCaster : _skillCasters.values())
{
if (filter.test(skillCaster))
{
return true;
}
}
return false;
}
/**
@ -3897,9 +3904,13 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
private void onAttackFinish(Attack attack)
{
// Recharge any active auto-soulshot tasks for current creature after the attack has successfully hit.
if (attack.getHits().stream().anyMatch(h -> !h.isMiss()))
for (Hit hit : attack.getHits())
{
rechargeShots(true, false, false);
if (!hit.isMiss())
{
rechargeShots(true, false, false);
break;
}
}
// Notify that this character is ready to act for the next attack