Update to Minecraft 1.18-pre5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-11-22 09:00:00 +11:00
parent a852b81a69
commit 43702a9e10
700 changed files with 10286 additions and 10098 deletions

View File

@@ -1,31 +1,31 @@
--- a/net/minecraft/world/level/block/Block.java
+++ b/net/minecraft/world/level/block/Block.java
@@ -354,7 +354,13 @@
@@ -352,7 +352,13 @@
EntityItem entityitem = (EntityItem) supplier.get();
entityitem.defaultPickupDelay();
- world.addEntity(entityitem);
entityitem.setDefaultPickUpDelay();
- world.addFreshEntity(entityitem);
+ // CraftBukkit start
+ if (world.captureDrops != null) {
+ world.captureDrops.add(entityitem);
+ } else {
+ world.addEntity(entityitem);
+ world.addFreshEntity(entityitem);
+ }
+ // CraftBukkit end
}
}
@@ -380,7 +386,7 @@
@@ -378,7 +384,7 @@
public void a(World world, EntityHuman entityhuman, BlockPosition blockposition, IBlockData iblockdata, @Nullable TileEntity tileentity, ItemStack itemstack) {
entityhuman.b(StatisticList.BLOCK_MINED.b(this));
- entityhuman.applyExhaustion(0.005F);
+ entityhuman.applyExhaustion(0.005F, org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.BLOCK_MINED); // CraftBukkit - EntityExhaustionEvent
dropItems(iblockdata, world, blockposition, tileentity, entityhuman, itemstack);
public void playerDestroy(World world, EntityHuman entityhuman, BlockPosition blockposition, IBlockData iblockdata, @Nullable TileEntity tileentity, ItemStack itemstack) {
entityhuman.awardStat(StatisticList.BLOCK_MINED.get(this));
- entityhuman.causeFoodExhaustion(0.005F);
+ entityhuman.causeFoodExhaustion(0.005F, org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.BLOCK_MINED); // CraftBukkit - EntityExhaustionEvent
dropResources(iblockdata, world, blockposition, tileentity, entityhuman, itemstack);
}
@@ -514,6 +520,12 @@
return (ImmutableMap) this.stateDefinition.a().stream().collect(ImmutableMap.toImmutableMap(Function.identity(), function));
@@ -512,6 +518,12 @@
return (ImmutableMap) this.stateDefinition.getPossibleStates().stream().collect(ImmutableMap.toImmutableMap(Function.identity(), function));
}
+ // CraftBukkit start