summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorblablubbabc <lukas@wirsindwir.de>2018-05-23 16:17:41 +0200
committermd_5 <git@md-5.net>2018-05-27 17:10:22 +1000
commit8cc5a7ecb6204e23bf883bb9282dd2b70e0f7858 (patch)
tree5efa885e86bbd58acbb7e5b9f93e102529835a30
parentd0a3620c2dc8a22438808f395348c100a183a618 (diff)
downloadcraftbukkit-8cc5a7ecb6204e23bf883bb9282dd2b70e0f7858.tar
craftbukkit-8cc5a7ecb6204e23bf883bb9282dd2b70e0f7858.tar.gz
craftbukkit-8cc5a7ecb6204e23bf883bb9282dd2b70e0f7858.tar.lz
craftbukkit-8cc5a7ecb6204e23bf883bb9282dd2b70e0f7858.tar.xz
craftbukkit-8cc5a7ecb6204e23bf883bb9282dd2b70e0f7858.zip
SPIGOT-3945: Remove RepairCost tag when cost is 0
-rw-r--r--nms-patches/ItemStack.patch17
1 files changed, 16 insertions, 1 deletions
diff --git a/nms-patches/ItemStack.patch b/nms-patches/ItemStack.patch
index 69343909..0e6dbd50 100644
--- a/nms-patches/ItemStack.patch
+++ b/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);
}