Java Code Examples for net.minecraft.init.Blocks.CLAY

The following are Jave code examples for showing how to use CLAY 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: uniquecrops   File: UCRecipes.java   View Source Code Vote up 6 votes
private static ItemStack getDyeCraftingResult(int meta) {
	
	switch (meta) {
		default: return new ItemStack(Items.GHAST_TEAR);
		case 1: return new ItemStack(Items.FIRE_CHARGE, 8, 0);
		case 2: return new ItemStack(Items.DRAGON_BREATH);
		case 3: return new ItemStack(Items.DIAMOND);
		case 4: return new ItemStack(Items.GOLD_INGOT);
		case 5: return new ItemStack(Items.SLIME_BALL, 4, 0);
		case 6: return new ItemStack(Items.SADDLE);
		case 7: return new ItemStack(Blocks.CLAY, 8, 0);
		case 8: return new ItemStack(Items.IRON_INGOT, 2, 0);
		case 9: return new ItemStack(Blocks.STAINED_HARDENED_CLAY, 16, EnumDyeColor.CYAN.getMetadata());
		case 10: return new ItemStack(Items.CHORUS_FRUIT);
		case 11: return new ItemStack(Blocks.PRISMARINE, 8, 0);
		case 12: return new ItemStack(Blocks.DIRT, 3, 0);
		case 13: return new ItemStack(Items.EMERALD);
		case 14: return new ItemStack(Items.NETHER_WART);
		case 15: return new ItemStack(Items.SKULL, 1, 1);
	}
}
 
Example 2
Project: Backmemed   File: WorldGenClay.java   View Source Code Vote up 5 votes
public boolean generate(World worldIn, Random rand, BlockPos position)
{
    if (worldIn.getBlockState(position).getMaterial() != Material.WATER)
    {
        return false;
    }
    else
    {
        int i = rand.nextInt(this.numberOfBlocks - 2) + 2;
        int j = 1;

        for (int k = position.getX() - i; k <= position.getX() + i; ++k)
        {
            for (int l = position.getZ() - i; l <= position.getZ() + i; ++l)
            {
                int i1 = k - position.getX();
                int j1 = l - position.getZ();

                if (i1 * i1 + j1 * j1 <= i * i)
                {
                    for (int k1 = position.getY() - 1; k1 <= position.getY() + 1; ++k1)
                    {
                        BlockPos blockpos = new BlockPos(k, k1, l);
                        Block block = worldIn.getBlockState(blockpos).getBlock();

                        if (block == Blocks.DIRT || block == Blocks.CLAY)
                        {
                            worldIn.setBlockState(blockpos, this.block.getDefaultState(), 2);
                        }
                    }
                }
            }
        }

        return true;
    }
}
 
Example 3
Project: CustomWorldGen   File: WorldGenClay.java   View Source Code Vote up 5 votes
public boolean generate(World worldIn, Random rand, BlockPos position)
{
    if (worldIn.getBlockState(position).getMaterial() != Material.WATER)
    {
        return false;
    }
    else
    {
        int i = rand.nextInt(this.numberOfBlocks - 2) + 2;
        int j = 1;

        for (int k = position.getX() - i; k <= position.getX() + i; ++k)
        {
            for (int l = position.getZ() - i; l <= position.getZ() + i; ++l)
            {
                int i1 = k - position.getX();
                int j1 = l - position.getZ();

                if (i1 * i1 + j1 * j1 <= i * i)
                {
                    for (int k1 = position.getY() - 1; k1 <= position.getY() + 1; ++k1)
                    {
                        BlockPos blockpos = new BlockPos(k, k1, l);
                        Block block = worldIn.getBlockState(blockpos).getBlock();

                        if (block == Blocks.DIRT || block == Blocks.CLAY)
                        {
                            worldIn.setBlockState(blockpos, this.block.getDefaultState(), 2);
                        }
                    }
                }
            }
        }

        return true;
    }
}