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

The following are Jave code examples for showing how to use stone() 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.
Example 1
Project: BaseClient   File: BlockSilverfish.java   Source Code and License Vote up 6 votes
protected ItemStack createStackedBlock(IBlockState state)
{
    switch ((BlockSilverfish.EnumType)state.getValue(VARIANT))
    {
        case COBBLESTONE:
            return new ItemStack(Blocks.cobblestone);

        case STONEBRICK:
            return new ItemStack(Blocks.stonebrick);

        case MOSSY_STONEBRICK:
            return new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.EnumType.MOSSY.getMetadata());

        case CRACKED_STONEBRICK:
            return new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.EnumType.CRACKED.getMetadata());

        case CHISELED_STONEBRICK:
            return new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.EnumType.CHISELED.getMetadata());

        default:
            return new ItemStack(Blocks.stone);
    }
}
 
Example 2
Project: TRAPPIST-1   File: BiomeGenSpace.java   Source Code and License Vote up 6 votes
public BiomeGenSpace(int var1)
{
	super(var1);
	this.topBlock = Blocks.grass;
	this.fillerBlock = Blocks.dirt;
	this.stoneBlock = Blocks.stone;
	this.spawnableCaveCreatureList.clear();
	this.spawnableCreatureList.clear();
	this.spawnableMonsterList.clear();
	this.spawnableWaterCreatureList.clear();
	
	if (!ConfigManagerCore.disableBiomeTypeRegistrations)
    {
	        BiomeDictionary.registerBiomeType(this, BiomeDictionary.Type.COLD, BiomeDictionary.Type.DRY, BiomeDictionary.Type.DEAD, BiomeDictionary.Type.SPOOKY);
    }
}
 
Example 3
Project: BaseClient   File: BlockSilverfish.java   Source Code and License Vote up 6 votes
protected ItemStack createStackedBlock(IBlockState state)
{
    switch ((BlockSilverfish.EnumType)state.getValue(VARIANT))
    {
        case COBBLESTONE:
            return new ItemStack(Blocks.cobblestone);

        case STONEBRICK:
            return new ItemStack(Blocks.stonebrick);

        case MOSSY_STONEBRICK:
            return new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.EnumType.MOSSY.getMetadata());

        case CRACKED_STONEBRICK:
            return new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.EnumType.CRACKED.getMetadata());

        case CHISELED_STONEBRICK:
            return new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.EnumType.CHISELED.getMetadata());

        default:
            return new ItemStack(Blocks.stone);
    }
}
 
Example 4
Project: Prospecting   File: OreDictCache.java   Source Code and License Vote up 5 votes
private static void cacheOre(Block b, int meta) {
	List key = Arrays.asList(b, meta);
	if (!name_cache.containsKey(key) && b != Blocks.stone && b != Blocks.air && b != Blocks.dirt && b != Blocks.grass && b != Blocks.gravel) {
		String name = null;
		float value = 1f;
		int[] ids = OreDictionary.getOreIDs(new ItemStack(b, 1, meta));

		if (ids.length > 0) {
			String dict_name = OreDictionary.getOreName(ids[0]);

			if (dict_name.length() > 3 && dict_name.substring(0, 3).equals("ore")) {
				dict_name = dict_name.substring(3);
				if (dict_name.length() > 4 && dict_name.substring(0, 4).equals("Poor")) {
					dict_name = dict_name.substring(4);
					value = (1f/9f);
				}
			} else if (dict_name.length() > 8 && dict_name.substring(0, 8).equals("denseore")) {
				dict_name = dict_name.substring(8);
				value = 3f;
			}

			String norm = normalizeName(dict_name);

			if (hasNugget(norm)) {
				Prospecting.logger.info("Parsed name: " + norm);
				Prospecting.logger.info("Amount: " + value);
				name_cache.put(key, norm);
				value_cache.put(key, value);
			}
		}
	}
}
 
Example 5
Project: BaseClient   File: WorldGenBlockBlob.java   Source Code and License Vote up 4 votes
public boolean generate(World worldIn, Random rand, BlockPos position)
{
    while (true)
    {
        label0:
        {
            if (position.getY() > 3)
            {
                if (worldIn.isAirBlock(position.down()))
                {
                    break label0;
                }

                Block block = worldIn.getBlockState(position.down()).getBlock();

                if (block != Blocks.grass && block != Blocks.dirt && block != Blocks.stone)
                {
                    break label0;
                }
            }

            if (position.getY() <= 3)
            {
                return false;
            }

            int i1 = this.field_150544_b;

            for (int i = 0; i1 >= 0 && i < 3; ++i)
            {
                int j = i1 + rand.nextInt(2);
                int k = i1 + rand.nextInt(2);
                int l = i1 + rand.nextInt(2);
                float f = (float)(j + k + l) * 0.333F + 0.5F;

                for (BlockPos blockpos : BlockPos.getAllInBox(position.add(-j, -k, -l), position.add(j, k, l)))
                {
                    if (blockpos.distanceSq(position) <= (double)(f * f))
                    {
                        worldIn.setBlockState(blockpos, this.field_150545_a.getDefaultState(), 4);
                    }
                }

                position = position.add(-(i1 + 1) + rand.nextInt(2 + i1 * 2), 0 - rand.nextInt(2), -(i1 + 1) + rand.nextInt(2 + i1 * 2));
            }

            return true;
        }
        position = position.down();
    }
}
 
Example 6
Project: BaseClient   File: WorldGenLiquids.java   Source Code and License Vote up 4 votes
public boolean generate(World worldIn, Random rand, BlockPos position)
{
    if (worldIn.getBlockState(position.up()).getBlock() != Blocks.stone)
    {
        return false;
    }
    else if (worldIn.getBlockState(position.down()).getBlock() != Blocks.stone)
    {
        return false;
    }
    else if (worldIn.getBlockState(position).getBlock().getMaterial() != Material.air && worldIn.getBlockState(position).getBlock() != Blocks.stone)
    {
        return false;
    }
    else
    {
        int i = 0;

        if (worldIn.getBlockState(position.west()).getBlock() == Blocks.stone)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.east()).getBlock() == Blocks.stone)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.north()).getBlock() == Blocks.stone)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.south()).getBlock() == Blocks.stone)
        {
            ++i;
        }

        int j = 0;

        if (worldIn.isAirBlock(position.west()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.east()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.north()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.south()))
        {
            ++j;
        }

        if (i == 3 && j == 1)
        {
            worldIn.setBlockState(position, this.block.getDefaultState(), 2);
            worldIn.forceBlockUpdateTick(this.block, position, rand);
        }

        return true;
    }
}
 
Example 7
Project: BaseClient   File: MapGenCaves.java   Source Code and License Vote up 4 votes
protected boolean func_175793_a(IBlockState p_175793_1_, IBlockState p_175793_2_)
{
    return p_175793_1_.getBlock() == Blocks.stone ? true : (p_175793_1_.getBlock() == Blocks.dirt ? true : (p_175793_1_.getBlock() == Blocks.grass ? true : (p_175793_1_.getBlock() == Blocks.hardened_clay ? true : (p_175793_1_.getBlock() == Blocks.stained_hardened_clay ? true : (p_175793_1_.getBlock() == Blocks.sandstone ? true : (p_175793_1_.getBlock() == Blocks.red_sandstone ? true : (p_175793_1_.getBlock() == Blocks.mycelium ? true : (p_175793_1_.getBlock() == Blocks.snow_layer ? true : (p_175793_1_.getBlock() == Blocks.sand || p_175793_1_.getBlock() == Blocks.gravel) && p_175793_2_.getBlock().getMaterial() != Material.water))))))));
}
 
Example 8
Project: BaseClient   File: EntitySilverfish.java   Source Code and License Vote up 4 votes
public float getBlockPathWeight(BlockPos pos)
{
    return this.worldObj.getBlockState(pos.down()).getBlock() == Blocks.stone ? 10.0F : super.getBlockPathWeight(pos);
}
 
Example 9
Project: BaseClient   File: MapGenCaves.java   Source Code and License Vote up 4 votes
protected boolean func_175793_a(IBlockState p_175793_1_, IBlockState p_175793_2_)
{
    return p_175793_1_.getBlock() == Blocks.stone ? true : (p_175793_1_.getBlock() == Blocks.dirt ? true : (p_175793_1_.getBlock() == Blocks.grass ? true : (p_175793_1_.getBlock() == Blocks.hardened_clay ? true : (p_175793_1_.getBlock() == Blocks.stained_hardened_clay ? true : (p_175793_1_.getBlock() == Blocks.sandstone ? true : (p_175793_1_.getBlock() == Blocks.red_sandstone ? true : (p_175793_1_.getBlock() == Blocks.mycelium ? true : (p_175793_1_.getBlock() == Blocks.snow_layer ? true : (p_175793_1_.getBlock() == Blocks.sand || p_175793_1_.getBlock() == Blocks.gravel) && p_175793_2_.getBlock().getMaterial() != Material.water))))))));
}
 
Example 10
Project: TRAPPIST-1   File: ChunkProviderTrappistOneB.java   Source Code and License Vote up 4 votes
@Override
protected BlockMetaPair getStoneBlock() {
	return new BlockMetaPair(Blocks.stone, (byte) 0);
}
 
Example 11
Project: TRAPPIST-1   File: ChunkProviderTrappistOneC.java   Source Code and License Vote up 4 votes
@Override
protected BlockMetaPair getStoneBlock() {
	return new BlockMetaPair(Blocks.stone, (byte) 0);
}