From 31d4a777c75610092365ccc9c02acc144d711d3c Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 6 Jul 2019 10:08:52 +1000 Subject: [PATCH] SPIGOT-5142: Ignore invalid firework effects --- .../org/bukkit/craftbukkit/inventory/CraftMetaFirework.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java index 4c68273fc4..7a1c4d6199 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java @@ -90,7 +90,11 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { List effects = this.effects = new ArrayList(fireworkEffects.size()); for (int i = 0; i < fireworkEffects.size(); i++) { - effects.add(getEffect((NBTTagCompound) fireworkEffects.get(i))); + try { + effects.add(getEffect((NBTTagCompound) fireworkEffects.get(i))); + } catch (IllegalArgumentException ex) { + // Ignore invalid effects + } } }