mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-25 22:44:32 +00:00
36 lines
1.5 KiB
Diff
36 lines
1.5 KiB
Diff
--- ../src-base/minecraft/net/minecraft/block/BlockIce.java
|
|
+++ ../src-work/minecraft/net/minecraft/block/BlockIce.java
|
|
@@ -40,14 +40,17 @@
|
|
player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]);
|
|
player.addExhaustion(0.025F);
|
|
|
|
- if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(player))
|
|
+ if (this.canSilkHarvest(worldIn, pos, worldIn.getBlockState(pos), player) && EnchantmentHelper.getSilkTouchModifier(player))
|
|
{
|
|
+ java.util.List<ItemStack> items = new java.util.ArrayList<ItemStack>();
|
|
ItemStack itemstack = this.createStackedBlock(state);
|
|
|
|
- if (itemstack != null)
|
|
- {
|
|
- spawnAsEntity(worldIn, pos, itemstack);
|
|
- }
|
|
+ if (itemstack != null) items.add(itemstack);
|
|
+
|
|
+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, worldIn, pos, worldIn.getBlockState(pos), 0, 1.0f, true, player);
|
|
+
|
|
+ for (ItemStack is : items)
|
|
+ spawnAsEntity(worldIn, pos, is);
|
|
}
|
|
else
|
|
{
|
|
@@ -58,7 +61,9 @@
|
|
}
|
|
|
|
int i = EnchantmentHelper.getFortuneModifier(player);
|
|
+ harvesters.set(player);
|
|
this.dropBlockAsItem(worldIn, pos, state, i);
|
|
+ harvesters.set(null);
|
|
Material material = worldIn.getBlockState(pos.down()).getBlock().getMaterial();
|
|
|
|
if (material.blocksMovement() || material.isLiquid())
|