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