@Override public void updateTick(World world, int x, int y, int z, Random rand) { if (world.getSavedLightValue(EnumSkyBlock.Block, x, y, z) > 11 - this.getLightOpacity() && world.getBlockMetadata(x, y, z) != 1) { if (world.provider.isHellWorld) { world.setBlockToAir(x, y, z); return; } this.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0); world.setBlock(x, y, z, Blocks.water); } if (WorldUtilMP.isMercuryWorld(world, x, y, z)) { world.setBlockToAir(x, y, z); return; } }
@Override public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta) { player.addExhaustion(0.025F); if (this.canSilkHarvest(world, player, x, y, z, meta) && EnchantmentHelper.getSilkTouchModifier(player)) { ArrayList<ItemStack> items = new ArrayList(); ItemStack itemstack = this.createStackedBlock(meta); if (itemstack != null) { items.add(itemstack); } ForgeEventFactory.fireBlockHarvesting( items, world, this, x, y, z, meta, 0, 1.0F, true, player); for (ItemStack is : items) { this.dropBlockAsItem(world, x, y, z, is); } } else { if (world.provider.isHellWorld) { world.setBlockToAir(x, y, z); return; } else if (WorldUtilMP.isMercuryWorld(world, x, y, z)) { world.setBlockToAir(x, y, z); return; } int i1 = EnchantmentHelper.getFortuneModifier(player); this.harvesters.set(player); this.dropBlockAsItem(world, x, y, z, meta, i1); this.harvesters.set(null); Material material = world.getBlock(x, y - 1, z).getMaterial(); if (material.blocksMovement() || material.isLiquid()) { world.setBlock(x, y, z, Blocks.flowing_water); } } }