mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
parent
d1a11cca31
commit
c534b3e0ea
1 changed files with 26 additions and 0 deletions
26
patches/server/General-ItemMeta-fixes.patch
Normal file
26
patches/server/General-ItemMeta-fixes.patch
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||||
|
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java
|
||||||
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java
|
||||||
|
@@ -0,0 +0,0 @@ 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));
|
||||||
|
}
|
Loading…
Reference in a new issue