Skip to content

Commit

Permalink
Dungeon: do not throw exceptions in stream operations (refactoring, S…
Browse files Browse the repository at this point in the history
…pikeSystem)

see #1564 (comment)
  • Loading branch information
cagix committed Jul 1, 2024
1 parent 2e694e3 commit 152b372
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dungeon/src/contrib/systems/SpikeSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public SpikeSystem() {
@Override
public void execute() {
filteredEntityStream(SpikyComponent.class)
.forEach(e -> e.fetch(SpikyComponent.class).orElseThrow().reduceCoolDown());
.flatMap((e -> e.fetch(SpikyComponent.class).stream()))
.forEach(sc -> sc.reduceCoolDown());
}
}

0 comments on commit 152b372

Please sign in to comment.