Skip to content

Commit

Permalink
Resolves EffFireworkLaunch's IAE from out-of-range power number input (
Browse files Browse the repository at this point in the history
  • Loading branch information
NotSoDelayed authored Oct 26, 2022
1 parent 8d6cf1f commit 7b1e9cf
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelaye
protected void execute(Event event) {
FireworkEffect[] effects = this.effects.getArray(event);
int power = lifetime.getOptionalSingle(event).orElse(1).intValue();
power = Math.min(127, Math.max(0, power));
for (Location location : locations.getArray(event)) {
World world = location.getWorld();
if (world == null)
Expand Down

0 comments on commit 7b1e9cf

Please sign in to comment.