From 93631bd1f21b09409d0e6750cd25a631544bd37f Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Tue, 24 Dec 2019 10:20:39 +1100 Subject: [PATCH] SPIGOT-5476: Fix trading empty items By: md_5 --- paper-server/nms-patches/MerchantRecipe.patch | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/paper-server/nms-patches/MerchantRecipe.patch b/paper-server/nms-patches/MerchantRecipe.patch index 8c880303f1..b0ca841a1e 100644 --- a/paper-server/nms-patches/MerchantRecipe.patch +++ b/paper-server/nms-patches/MerchantRecipe.patch @@ -27,3 +27,11 @@ public MerchantRecipe(NBTTagCompound nbttagcompound) { this.rewardExp = true; +@@ -73,6 +87,7 @@ + + public ItemStack getBuyItem1() { + int i = this.buyingItem1.getCount(); ++ if (i <= 0) return ItemStack.a; // CraftBukkit - SPIGOT-5476 + ItemStack itemstack = this.buyingItem1.cloneItemStack(); + int j = Math.max(0, MathHelper.d((float) (i * this.demand) * this.priceMultiplier)); +