diff options
Diffstat (limited to 'patch-remap/og/net/minecraft/world/level/block/Block.patch')
-rw-r--r-- | patch-remap/og/net/minecraft/world/level/block/Block.patch | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/level/block/Block.patch b/patch-remap/og/net/minecraft/world/level/block/Block.patch new file mode 100644 index 0000000000..f388912c32 --- /dev/null +++ b/patch-remap/og/net/minecraft/world/level/block/Block.patch @@ -0,0 +1,54 @@ +--- a/net/minecraft/world/level/block/Block.java ++++ b/net/minecraft/world/level/block/Block.java +@@ -349,7 +349,13 @@ + EntityItem entityitem = (EntityItem) supplier.get(); + + entityitem.setDefaultPickUpDelay(); +- world.addFreshEntity(entityitem); ++ // CraftBukkit start ++ if (world.captureDrops != null) { ++ world.captureDrops.add(entityitem); ++ } else { ++ world.addFreshEntity(entityitem); ++ } ++ // CraftBukkit end + } + } + +@@ -375,7 +381,7 @@ + + 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); + } + +@@ -512,17 +518,25 @@ + return this.builtInRegistryHolder; + } + +- protected void tryDropExperience(WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, IntProvider intprovider) { ++ // CraftBukkit start ++ 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; + } + } + ++ return 0; + } + ++ public int getExpDrop(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, boolean flag) { ++ return 0; ++ } ++ // CraftBukkit end ++ + public static final class a { + + private final IBlockData first; |