SPIGOT-7789: Fix NPE in CraftMetaFirework applyToItem

By: blablubbabc <lukas@wirsindwir.de>
This commit is contained in:
CraftBukkit/Spigot 2024-06-20 07:04:11 +10:00
parent be0055d2a0
commit 2f1800fa2e

View file

@ -185,8 +185,10 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta {
}
List<FireworkExplosion> effects = new ArrayList<>();
for (FireworkEffect effect : this.effects) {
effects.add(getExplosion(effect));
if (hasEffects()) {
for (FireworkEffect effect : this.effects) {
effects.add(getExplosion(effect));
}
}
itemTag.put(FIREWORKS, new Fireworks(power, effects));