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

The following examples show how to use net.minecraft.init.Blocks#packed_ice() .
Example 1
Project: Et-Futurum   File: FrostedIce.java    License: The Unlicense 6 votes vote down vote up
@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: qcraft-mod   File: BlockQBlock.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean isNormalCube( IBlockAccess world, int x, int y, int z )
{
    Block block = getImpostorBlock( world, x, y, z );
    if( block != null && !( block instanceof BlockCompressedPowered ) && block != Blocks.ice && block != Blocks.packed_ice && block != Blocks.glass && block != Blocks.stained_glass )
    {
        return true;
    }
    return false;
}