craftbukkit/nms-patches/net/minecraft/world/level/block/Block.patch

40 lines
1.5 KiB
Diff
Raw Normal View History

2021-03-16 09:00:00 +11:00
--- a/net/minecraft/world/level/block/Block.java
+++ b/net/minecraft/world/level/block/Block.java
2021-06-11 15:00:00 +10:00
@@ -354,7 +354,13 @@
EntityItem entityitem = (EntityItem) supplier.get();
2019-04-23 12:00:00 +10:00
entityitem.defaultPickupDelay();
- world.addEntity(entityitem);
+ // CraftBukkit start
+ if (world.captureDrops != null) {
+ world.captureDrops.add(entityitem);
+ } else {
+ world.addEntity(entityitem);
+ }
+ // CraftBukkit end
}
}
2021-06-11 15:00:00 +10:00
@@ -380,7 +386,7 @@
2021-03-04 08:28:05 +11:00
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);
}
2021-06-11 15:00:00 +10:00
@@ -514,6 +520,12 @@
return (ImmutableMap) this.stateDefinition.a().stream().collect(ImmutableMap.toImmutableMap(Function.identity(), function));
}
2016-03-01 08:32:46 +11:00
+ // CraftBukkit start
2020-08-12 07:00:00 +10:00
+ public int getExpDrop(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) {
+ return 0;
+ }
+ // CraftBukkit end
2016-03-01 08:32:46 +11:00
+
2020-06-25 10:00:00 +10:00
public static final class a {
2018-08-26 12:00:00 +10:00
2021-06-11 15:00:00 +10:00
private final IBlockData first;