diff options
author | Jake Potrebic <[email protected]> | 2024-04-27 20:57:42 -0700 |
---|---|---|
committer | Jake Potrebic <[email protected]> | 2024-04-27 20:57:42 -0700 |
commit | e16263c39fce51f4ea5a3081c24103fd6dabbaf4 (patch) | |
tree | d169f0acaf36b146ff8075a3549ceb671fceddc1 | |
parent | a3c4dc95e3b6ac1e0069988d4abce33b642fecf5 (diff) | |
download | Paper-e16263c39fce51f4ea5a3081c24103fd6dabbaf4.tar.gz Paper-e16263c39fce51f4ea5a3081c24103fd6dabbaf4.zip |
Fix firework meta NPE
Fixes #10466
-rw-r--r-- | patches/server/1045-General-ItemMeta-fixes.patch | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/patches/server/1045-General-ItemMeta-fixes.patch b/patches/server/1045-General-ItemMeta-fixes.patch new file mode 100644 index 0000000000..474135ffd3 --- /dev/null +++ b/patches/server/1045-General-ItemMeta-fixes.patch @@ -0,0 +1,26 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic <[email protected]> +Date: Sat, 27 Apr 2024 20:56:17 -0700 +Subject: [PATCH] General ItemMeta fixes + + +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java +index 8e0dd4b7a7a25a8beb27b507047bc48d8227627c..88245d8704f4df3075d592a68a4715565e9eed8c 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java +@@ -186,9 +186,13 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { + } + + List<FireworkExplosion> effects = new ArrayList<>(); +- for (FireworkEffect effect : this.effects) { +- effects.add(CraftMetaFirework.getExplosion(effect)); ++ // Paper start - fix NPE with effects list being null ++ if (this.effects != null) { ++ for (FireworkEffect effect : this.effects) { ++ effects.add(CraftMetaFirework.getExplosion(effect)); ++ } + } ++ // Paper end + + itemTag.put(CraftMetaFirework.FIREWORKS, new Fireworks(this.power, effects)); + } |