From 7b1e9cf42dd37fadae8b3aa1c275b3df4fbaf3c3 Mon Sep 17 00:00:00 2001 From: DelayedGaming <72163224+DelayedGaming@users.noreply.github.com> Date: Wed, 26 Oct 2022 12:21:00 +0800 Subject: [PATCH] Resolves EffFireworkLaunch's IAE from out-of-range power number input (#5173) --- src/main/java/ch/njol/skript/effects/EffFireworkLaunch.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/ch/njol/skript/effects/EffFireworkLaunch.java b/src/main/java/ch/njol/skript/effects/EffFireworkLaunch.java index 721be87af15..85b1643012d 100644 --- a/src/main/java/ch/njol/skript/effects/EffFireworkLaunch.java +++ b/src/main/java/ch/njol/skript/effects/EffFireworkLaunch.java @@ -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)