@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/net/minecraft/world/item/ItemStack.java
|
||||
@@ -76,6 +76,43 @@
|
||||
@@ -77,6 +77,43 @@
|
||||
import net.minecraft.world.level.block.state.pattern.ShapeDetectorBlock;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
public final class ItemStack {
|
||||
|
||||
public static final Codec<ItemStack> CODEC = RecordCodecBuilder.create((instance) -> {
|
||||
@@ -151,11 +188,24 @@
|
||||
@@ -152,11 +189,24 @@
|
||||
this.item = null;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
this.getItem().verifyTagAfterLoad(this.tag);
|
||||
}
|
||||
|
||||
@@ -165,6 +215,11 @@
|
||||
@@ -166,6 +216,11 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
public static ItemStack of(NBTTagCompound nbttagcompound) {
|
||||
try {
|
||||
return new ItemStack(nbttagcompound);
|
||||
@@ -238,11 +293,190 @@
|
||||
@@ -243,11 +298,190 @@
|
||||
return EnumInteractionResult.PASS;
|
||||
} else {
|
||||
Item item = this.getItem();
|
||||
@@ -276,7 +276,7 @@
|
||||
|
||||
return enuminteractionresult;
|
||||
}
|
||||
@@ -323,6 +557,21 @@
|
||||
@@ -328,6 +562,21 @@
|
||||
}
|
||||
|
||||
i -= k;
|
||||
@@ -298,7 +298,7 @@
|
||||
if (i <= 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -344,6 +593,11 @@
|
||||
@@ -349,6 +598,11 @@
|
||||
if (this.hurt(i, t0.getRandom(), t0 instanceof EntityPlayer ? (EntityPlayer) t0 : null)) {
|
||||
consumer.accept(t0);
|
||||
Item item = this.getItem();
|
||||
@@ -310,7 +310,7 @@
|
||||
|
||||
this.shrink(1);
|
||||
if (t0 instanceof EntityHuman) {
|
||||
@@ -492,6 +746,17 @@
|
||||
@@ -497,6 +751,17 @@
|
||||
return this.tag;
|
||||
}
|
||||
|
||||
@@ -328,20 +328,7 @@
|
||||
public NBTTagCompound getOrCreateTag() {
|
||||
if (this.tag == null) {
|
||||
this.setTag(new NBTTagCompound());
|
||||
@@ -862,6 +1127,12 @@
|
||||
}
|
||||
|
||||
public void setRepairCost(int i) {
|
||||
+ // CraftBukkit start - remove RepairCost tag when 0 (SPIGOT-3945)
|
||||
+ if (i == 0) {
|
||||
+ this.removeTagKey("RepairCost");
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.getOrCreateTag().putInt("RepairCost", i);
|
||||
}
|
||||
|
||||
@@ -911,6 +1182,13 @@
|
||||
@@ -921,6 +1186,13 @@
|
||||
nbttaglist.add(nbttagcompound);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user