From 02b466ccc7efa8cb39f3cf417981d96b397b8a72 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 16 May 2019 21:10:05 +1000 Subject: [PATCH] SPIGOT-4940: Fletcher villager gifts sometimes crash server --- nms-patches/LootTable.patch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 nms-patches/LootTable.patch diff --git a/nms-patches/LootTable.patch b/nms-patches/LootTable.patch new file mode 100644 index 0000000000..06298ad61b --- /dev/null +++ b/nms-patches/LootTable.patch @@ -0,0 +1,14 @@ +--- a/net/minecraft/server/LootTable.java ++++ b/net/minecraft/server/LootTable.java +@@ -40,6 +40,11 @@ + + public static Consumer a(Consumer consumer) { + return (itemstack) -> { ++ // CraftBukkit start - SPIGOT-4940: no empty loot ++ if (itemstack.isEmpty()) { ++ return; ++ } ++ // CraftBukkit end + if (itemstack.getCount() < itemstack.getMaxStackSize()) { + consumer.accept(itemstack); + } else {