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,7 +1,7 @@
--- a/net/minecraft/world/inventory/ContainerBeacon.java
+++ b/net/minecraft/world/inventory/ContainerBeacon.java
@@ -10,6 +10,11 @@
import net.minecraft.world.item.ItemStack;
@@ -11,6 +11,11 @@
import net.minecraft.world.level.World;
import net.minecraft.world.level.block.Blocks;
+// CraftBukkit start
@@ -12,7 +12,7 @@
public class ContainerBeacon extends Container {
private static final int PAYMENT_SLOT = 0;
@@ -23,6 +28,10 @@
@@ -24,6 +29,10 @@
private final ContainerBeacon.SlotBeacon paymentSlot;
private final ContainerAccess access;
private final IContainerProperties beaconData;
@@ -23,7 +23,7 @@
public ContainerBeacon(int i, IInventory iinventory) {
this(i, iinventory, new ContainerProperties(3), ContainerAccess.NULL);
@@ -30,6 +39,7 @@
@@ -31,6 +40,7 @@
public ContainerBeacon(int i, IInventory iinventory, IContainerProperties icontainerproperties, ContainerAccess containeraccess) {
super(Containers.BEACON, i);
@@ -31,7 +31,7 @@
this.beacon = new InventorySubcontainer(1) {
@Override
public boolean canPlaceItem(int j, ItemStack itemstack) {
@@ -79,6 +89,7 @@
@@ -80,6 +90,7 @@
@Override
public boolean stillValid(EntityHuman entityhuman) {
@@ -39,7 +39,7 @@
return stillValid(this.access, entityhuman, Blocks.BEACON);
}
@@ -178,4 +189,17 @@
@@ -180,4 +191,17 @@
return 1;
}
}

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);
}

View File

@@ -42,9 +42,9 @@
+ return releaseBee(this.level, this.worldPosition, iblockdata, tileentitybeehive_hivebee, list, tileentitybeehive_releasestatus, this.savedFlowerPos, force);
+ // CraftBukkit end
});
return list;
}
@@ -138,7 +145,19 @@
if (!list.isEmpty()) {
super.setChanged();
@@ -142,7 +149,19 @@
}
public void addOccupantWithPresetTicks(Entity entity, boolean flag, int i) {
@@ -65,7 +65,7 @@
entity.stopRiding();
entity.ejectPassengers();
NBTTagCompound nbttagcompound = new NBTTagCompound();
@@ -168,7 +187,13 @@
@@ -173,7 +192,13 @@
}
private static boolean releaseOccupant(World world, BlockPosition blockposition, IBlockData iblockdata, TileEntityBeehive.HiveBee tileentitybeehive_hivebee, @Nullable List<Entity> list, TileEntityBeehive.ReleaseStatus tileentitybeehive_releasestatus, @Nullable BlockPosition blockposition1) {
@@ -79,8 +79,8 @@
+ // CraftBukkit end
return false;
} else {
NBTTagCompound nbttagcompound = tileentitybeehive_hivebee.entityData;
@@ -191,6 +216,18 @@
NBTTagCompound nbttagcompound = tileentitybeehive_hivebee.entityData.copy();
@@ -196,6 +221,18 @@
if (!entity.getType().is(TagsEntity.BEEHIVE_INHABITORS)) {
return false;
} else {
@@ -99,7 +99,7 @@
if (entity instanceof EntityBee) {
EntityBee entitybee = (EntityBee) entity;
@@ -220,6 +257,7 @@
@@ -225,6 +262,7 @@
list.add(entitybee);
}
@@ -107,7 +107,7 @@
float f = entity.getBbWidth();
double d0 = flag ? 0.0D : 0.55D + (double) (f / 2.0F);
double d1 = (double) blockposition.getX() + 0.5D + d0 * (double) enumdirection.getStepX();
@@ -227,10 +265,11 @@
@@ -232,10 +270,11 @@
double d3 = (double) blockposition.getZ() + 0.5D + d0 * (double) enumdirection.getStepZ();
entity.moveTo(d1, d2, d3, entity.getYRot(), entity.getXRot());
@@ -120,9 +120,9 @@
}
} else {
return false;
@@ -276,6 +315,10 @@
@@ -284,6 +323,10 @@
if (releaseOccupant(world, blockposition, iblockdata, tileentitybeehive_hivebee, (List) null, tileentitybeehive_releasestatus, blockposition1)) {
flag = true;
iterator.remove();
+ // CraftBukkit start
+ } else {
@@ -131,7 +131,7 @@
}
}
}
@@ -313,6 +356,11 @@
@@ -325,6 +368,11 @@
this.savedFlowerPos = GameProfileSerializer.readBlockPos(nbttagcompound.getCompound("FlowerPos"));
}
@@ -143,7 +143,7 @@
}
@Override
@@ -322,6 +370,7 @@
@@ -334,6 +382,7 @@
if (this.hasSavedFlowerPos()) {
nbttagcompound.put("FlowerPos", GameProfileSerializer.writeBlockPos(this.savedFlowerPos));
}