From 548b6628252fe463ddfe5e19abc9ca02a8cb090b Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Wed, 23 May 2018 16:17:41 +0200 Subject: [PATCH] SPIGOT-3945: Remove RepairCost tag when cost is 0 By: blablubbabc --- paper-server/nms-patches/ItemStack.patch | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/paper-server/nms-patches/ItemStack.patch b/paper-server/nms-patches/ItemStack.patch index 693439094a..0e6dbd508f 100644 --- a/paper-server/nms-patches/ItemStack.patch +++ b/paper-server/nms-patches/ItemStack.patch @@ -303,7 +303,22 @@ itemstack.d(this.D()); if (this.tag != null) { -@@ -513,6 +719,12 @@ +@@ -464,6 +670,14 @@ + } + + public void setRepairCost(int i) { ++ // CraftBukkit start - remove RepairCost tag when 0 (SPIGOT-3945) ++ if (i == 0) { ++ if (this.hasTag()) { ++ this.tag.remove("RepairCost"); ++ } ++ return; ++ } ++ // CraftBukkit end + if (!this.hasTag()) { + this.tag = new NBTTagCompound(); + } +@@ -513,6 +727,12 @@ nbttaglist.add(nbttagcompound); }