mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 01:39:52 +03:00
40 lines
1.8 KiB
Diff
40 lines
1.8 KiB
Diff
--- ../src-base/minecraft/net/minecraft/block/BlockIce.java
|
|
+++ ../src-work/minecraft/net/minecraft/block/BlockIce.java
|
|
@@ -41,9 +41,14 @@
|
|
player.addStat(StatList.getBlockStats(this));
|
|
player.addExhaustion(0.005F);
|
|
|
|
- if (this.canSilkHarvest() && EnchantmentHelper.getEnchantmentLevel(Enchantments.SILK_TOUCH, stack) > 0)
|
|
+ if (this.canSilkHarvest(worldIn, pos, state, player) && EnchantmentHelper.getEnchantmentLevel(Enchantments.SILK_TOUCH, stack) > 0)
|
|
{
|
|
- spawnAsEntity(worldIn, pos, this.getSilkTouchDrop(state));
|
|
+ java.util.List<ItemStack> items = new java.util.ArrayList<ItemStack>();
|
|
+ items.add(this.getSilkTouchDrop(state));
|
|
+
|
|
+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, worldIn, pos, state, 0, 1.0f, true, player);
|
|
+ for (ItemStack is : items)
|
|
+ spawnAsEntity(worldIn, pos, is);
|
|
}
|
|
else
|
|
{
|
|
@@ -54,7 +59,9 @@
|
|
}
|
|
|
|
int i = EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, stack);
|
|
+ harvesters.set(player);
|
|
this.dropBlockAsItem(worldIn, pos, state, i);
|
|
+ harvesters.set(null);
|
|
Material material = worldIn.getBlockState(pos.down()).getMaterial();
|
|
|
|
if (material.blocksMovement() || material.isLiquid())
|
|
@@ -79,6 +86,9 @@
|
|
|
|
protected void turnIntoWater(World worldIn, BlockPos pos)
|
|
{
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldIn.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()), worldIn.provider.doesWaterVaporize() ? Blocks.AIR : Blocks.WATER).isCancelled()) {
|
|
+ return;
|
|
+ }
|
|
if (worldIn.provider.doesWaterVaporize())
|
|
{
|
|
worldIn.setBlockToAir(pos);
|