mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-12 09:51:12 +01:00
SPIGOT-4940: Fletcher villager gifts sometimes crash server
This commit is contained in:
parent
f690957311
commit
02b466ccc7
1 changed files with 14 additions and 0 deletions
14
nms-patches/LootTable.patch
Normal file
14
nms-patches/LootTable.patch
Normal file
|
@ -0,0 +1,14 @@
|
|||
--- a/net/minecraft/server/LootTable.java
|
||||
+++ b/net/minecraft/server/LootTable.java
|
||||
@@ -40,6 +40,11 @@
|
||||
|
||||
public static Consumer<ItemStack> a(Consumer<ItemStack> 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 {
|
Loading…
Reference in a new issue