From 7fae51f18d5f2c60ede0a20d3ab30d2f3a1842b2 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Fri, 26 Jul 2024 07:25:02 +1000 Subject: [PATCH] SPIGOT-7849: Fix FoodComponent serialize with "using-converts-to" using null By: Doc --- .../inventory/components/CraftFoodComponent.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftFoodComponent.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftFoodComponent.java index 514dab2d4b..21fee6cd21 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftFoodComponent.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftFoodComponent.java @@ -62,7 +62,12 @@ public final class CraftFoodComponent implements FoodComponent { result.put("saturation", getSaturation()); result.put("can-always-eat", canAlwaysEat()); result.put("eat-seconds", getEatSeconds()); - result.put("using-converts-to", getUsingConvertsTo()); + + ItemStack usingConvertsTo = getUsingConvertsTo(); + if (usingConvertsTo != null) { + result.put("using-converts-to", usingConvertsTo); + } + result.put("effects", getEffects()); return result; }