Java Code Examples for net.minecraft.init.Blocks.packed_ice()

The following are Jave code examples for showing how to use packed_ice() of the net.minecraft.init.Blocks class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: connor41-etfuturum2   File: FrostedIce.java   View Source Code Vote up 6 votes
@Override
public void updateTick(World world, int x, int y, int z, Random rand) {
	if (world.isRemote)
		return;

	int surroundingBlockCount = 0;
	for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
		Block block = world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
		if (block == this || block == Blocks.ice || block == Blocks.packed_ice)
			if (++surroundingBlockCount >= 4)
				break;
	}

	if (surroundingBlockCount < 4 || rand.nextInt(100) <= 33) {
		int meta = world.getBlockMetadata(x, y, z);
		if (meta < 3)
			world.setBlockMetadataWithNotify(x, y, z, meta + 1, 2);
		else
			world.setBlock(x, y, z, Blocks.water);
	}

	world.scheduleBlockUpdate(x, y, z, this, 40 + rand.nextInt(40));
}
 
Example 2
Project: DecompiledMinecraft   File: BlockSnow.java   View Source Code Vote up 4 votes
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
{
    IBlockState iblockstate = worldIn.getBlockState(pos.down());
    Block block = iblockstate.getBlock();
    return block != Blocks.ice && block != Blocks.packed_ice ? (block.getMaterial() == Material.leaves ? true : (block == this && ((Integer)iblockstate.getValue(LAYERS)).intValue() >= 7 ? true : block.isOpaqueCube() && block.blockMaterial.blocksMovement())) : false;
}
 
Example 3
Project: DecompiledMinecraft   File: BlockSnow.java   View Source Code Vote up 4 votes
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
{
    IBlockState iblockstate = worldIn.getBlockState(pos.down());
    Block block = iblockstate.getBlock();
    return block != Blocks.ice && block != Blocks.packed_ice ? (block.getMaterial() == Material.leaves ? true : (block == this && ((Integer)iblockstate.getValue(LAYERS)).intValue() >= 7 ? true : block.isOpaqueCube() && block.blockMaterial.blocksMovement())) : false;
}
 
Example 4
Project: TRAPPIST-1   File: ChunkProviderTrappistOneC.java   View Source Code Vote up 4 votes
@Override
protected BlockMetaPair getWaterBlock() {
	return new BlockMetaPair(Blocks.packed_ice, (byte) 0);
}
 
Example 5
Project: BaseClient   File: BlockSnow.java   View Source Code Vote up 4 votes
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
{
    IBlockState iblockstate = worldIn.getBlockState(pos.down());
    Block block = iblockstate.getBlock();
    return block != Blocks.ice && block != Blocks.packed_ice ? (block.getMaterial() == Material.leaves ? true : (block == this && ((Integer)iblockstate.getValue(LAYERS)).intValue() >= 7 ? true : block.isOpaqueCube() && block.blockMaterial.blocksMovement())) : false;
}
 
Example 6
Project: BaseClient   File: BlockSnow.java   View Source Code Vote up 4 votes
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
{
    IBlockState iblockstate = worldIn.getBlockState(pos.down());
    Block block = iblockstate.getBlock();
    return block != Blocks.ice && block != Blocks.packed_ice ? (block.getMaterial() == Material.leaves ? true : (block == this && ((Integer)iblockstate.getValue(LAYERS)).intValue() >= 7 ? true : block.isOpaqueCube() && block.blockMaterial.blocksMovement())) : false;
}