2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/level/block/Block.java
|
|
|
|
+++ b/net/minecraft/world/level/block/Block.java
|
2023-06-07 17:30:00 +02:00
|
|
|
@@ -342,7 +342,13 @@
|
2021-06-11 07:00:00 +02:00
|
|
|
EntityItem entityitem = (EntityItem) supplier.get();
|
2017-07-28 09:23:39 +02:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
entityitem.setDefaultPickUpDelay();
|
|
|
|
- world.addFreshEntity(entityitem);
|
2017-07-28 09:23:39 +02:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ if (world.captureDrops != null) {
|
|
|
|
+ world.captureDrops.add(entityitem);
|
|
|
|
+ } else {
|
2021-11-21 23:00:00 +01:00
|
|
|
+ world.addFreshEntity(entityitem);
|
2017-07-28 09:23:39 +02:00
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-07 17:30:00 +02:00
|
|
|
@@ -368,7 +374,7 @@
|
2021-03-03 22:28:05 +01:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
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);
|
2021-03-03 22:28:05 +01:00
|
|
|
}
|
|
|
|
|
2023-09-21 18:57:13 +02:00
|
|
|
@@ -504,17 +510,25 @@
|
2022-02-28 16:00:00 +01:00
|
|
|
return this.builtInRegistryHolder;
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
2016-02-29 22:32:46 +01:00
|
|
|
|
2022-06-07 18:00:00 +02:00
|
|
|
- protected void tryDropExperience(WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, IntProvider intprovider) {
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit start
|
2022-06-07 18:00:00 +02:00
|
|
|
+ protected int tryDropExperience(WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, IntProvider intprovider) {
|
|
|
|
if (EnchantmentManager.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) {
|
|
|
|
int i = intprovider.sample(worldserver.random);
|
|
|
|
|
|
|
|
if (i > 0) {
|
|
|
|
- this.popExperience(worldserver, blockposition, i);
|
|
|
|
+ // this.popExperience(worldserver, blockposition, i);
|
|
|
|
+ return i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-11-25 22:32:16 +01:00
|
|
|
+ return 0;
|
2023-09-21 18:57:13 +02:00
|
|
|
}
|
|
|
|
|
2022-06-07 18:00:00 +02:00
|
|
|
+ public int getExpDrop(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, boolean flag) {
|
|
|
|
+ return 0;
|
2023-09-21 18:57:13 +02:00
|
|
|
+ }
|
2022-06-07 18:00:00 +02:00
|
|
|
+ // CraftBukkit end
|
2023-09-21 18:57:13 +02:00
|
|
|
+
|
2020-06-25 02:00:00 +02:00
|
|
|
public static final class a {
|
2018-08-26 04:00:00 +02:00
|
|
|
|
2023-09-21 18:57:13 +02:00
|
|
|
private final IBlockData first;
|