package net.minecraft.block; import java.util.Random; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.stats.StatList; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.world.EnumSkyBlock; import net.minecraft.world.World; public class BlockIce extends BlockBreakable { private static final String __OBFID = "CL_00000259"; public BlockIce() { super(Material.ice, false); this.slipperiness = 0.98F; this.setTickRandomly(true); this.setCreativeTab(CreativeTabs.tabBlock); } public void harvestBlock(World worldIn, EntityPlayer playerIn, BlockPos pos, IBlockState state, TileEntity te) { playerIn.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); playerIn.addExhaustion(0.025F); if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(playerIn)) { ItemStack var8 = this.createStackedBlock(state); if (var8 != null) { spawnAsEntity(worldIn, pos, var8); } } else { if (worldIn.provider.func_177500_n()) { worldIn.setBlockToAir(pos); return; } int var6 = EnchantmentHelper.getFortuneModifier(playerIn); this.dropBlockAsItem(worldIn, pos, state, var6); Material var7 = worldIn.getBlockState(pos.offsetDown()).getBlock().getMaterial(); if (var7.blocksMovement() || var7.isLiquid()) { worldIn.setBlockState(pos, Blocks.flowing_water.getDefaultState()); } } } /** * Returns the quantity of items to drop on block destruction. */ public int quantityDropped(Random random) { return 0; } public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { if (worldIn.getLightFor(EnumSkyBlock.BLOCK, pos) > 11 - this.getLightOpacity()) { if (worldIn.provider.func_177500_n()) { worldIn.setBlockToAir(pos); } else { this.dropBlockAsItem(worldIn, pos, worldIn.getBlockState(pos), 0); worldIn.setBlockState(pos, Blocks.water.getDefaultState()); } } } public int getMobilityFlag() { return 0; } }