Update to Minecraft 1.18.1

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-12-11 00:11:02 +11:00
parent aa726a99dc
commit 667cb32115
10 changed files with 125 additions and 127 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/item/ItemStack.java
+++ b/net/minecraft/world/item/ItemStack.java
@@ -73,6 +73,40 @@
@@ -72,6 +72,40 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -41,7 +41,7 @@
public final class ItemStack {
public static final Codec<ItemStack> CODEC = RecordCodecBuilder.create((instance) -> {
@@ -140,16 +174,30 @@
@@ -139,16 +173,30 @@
this.updateEmptyCacheFlag();
}
@@ -74,7 +74,7 @@
this.getItem().verifyTagAfterLoad(this.tag);
}
@@ -157,6 +205,11 @@
@@ -156,6 +204,11 @@
this.setDamageValue(this.getDamageValue());
}
@@ -86,7 +86,7 @@
this.updateEmptyCacheFlag();
}
@@ -194,7 +247,7 @@
@@ -193,7 +246,7 @@
return this.getItem() == item;
}
@@ -95,7 +95,7 @@
EntityHuman entityhuman = itemactioncontext.getPlayer();
BlockPosition blockposition = itemactioncontext.getClickedPos();
ShapeDetectorBlock shapedetectorblock = new ShapeDetectorBlock(itemactioncontext.getLevel(), blockposition, false);
@@ -202,12 +255,157 @@
@@ -201,12 +254,157 @@
if (entityhuman != null && !entityhuman.getAbilities().mayBuild && !this.hasAdventureModePlaceTagForBlock(itemactioncontext.getLevel().getTagManager(), shapedetectorblock)) {
return EnumInteractionResult.PASS;
} else {
@@ -254,7 +254,7 @@
return enuminteractionresult;
}
@@ -288,6 +486,21 @@
@@ -287,6 +485,21 @@
}
i -= k;
@@ -276,7 +276,7 @@
if (i <= 0) {
return false;
}
@@ -309,6 +522,11 @@
@@ -308,6 +521,11 @@
if (this.hurt(i, t0.getRandom(), t0 instanceof EntityPlayer ? (EntityPlayer) t0 : null)) {
consumer.accept(t0);
Item item = this.getItem();
@@ -288,7 +288,7 @@
this.shrink(1);
if (t0 instanceof EntityHuman) {
@@ -464,6 +682,17 @@
@@ -463,6 +681,17 @@
return this.tag;
}
@@ -306,7 +306,7 @@
public NBTTagCompound getOrCreateTag() {
if (this.tag == null) {
this.setTag(new NBTTagCompound());
@@ -844,6 +1073,12 @@
@@ -843,6 +1072,12 @@
}
public void setRepairCost(int i) {
@@ -319,7 +319,7 @@
this.getOrCreateTag().putInt("RepairCost", i);
}
@@ -893,6 +1128,13 @@
@@ -892,6 +1127,13 @@
nbttaglist.add(nbttagcompound);
}