当前位置: 首页>>代码示例>>Java>>正文


Java Blocks.stone方法代码示例

本文整理汇总了Java中net.minecraft.init.Blocks.stone方法的典型用法代码示例。如果您正苦于以下问题:Java Blocks.stone方法的具体用法?Java Blocks.stone怎么用?Java Blocks.stone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.init.Blocks的用法示例。


在下文中一共展示了Blocks.stone方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: decorate

import net.minecraft.init.Blocks; //导入方法依赖的package包/类
public void decorate(World worldIn, Random rand, BlockPos pos)
{
    super.decorate(worldIn, rand, pos);
    int i = 3 + rand.nextInt(6);

    for (int j = 0; j < i; ++j)
    {
        int k = rand.nextInt(16);
        int l = rand.nextInt(28) + 4;
        int i1 = rand.nextInt(16);
        BlockPos blockpos = pos.add(k, l, i1);

        if (worldIn.getBlockState(blockpos).getBlock() == Blocks.stone)
        {
            worldIn.setBlockState(blockpos, Blocks.emerald_ore.getDefaultState(), 2);
        }
    }

    for (i = 0; i < 7; ++i)
    {
        int j1 = rand.nextInt(16);
        int k1 = rand.nextInt(64);
        int l1 = rand.nextInt(16);
        this.theWorldGenerator.generate(worldIn, rand, pos.add(j1, k1, l1));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:27,代码来源:BiomeGenHills.java

示例2: createStackedBlock

import net.minecraft.init.Blocks; //导入方法依赖的package包/类
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);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:24,代码来源:BlockSilverfish.java

示例3: getEntityItem

import net.minecraft.init.Blocks; //导入方法依赖的package包/类
/**
 * Returns the ItemStack corresponding to the Entity (Note: if no item exists, will log an error but still return an
 * ItemStack containing Block.stone)
 */
public ItemStack getEntityItem()
{
    ItemStack itemstack = this.getDataWatcher().getWatchableObjectItemStack(10);

    if (itemstack == null)
    {
        if (this.worldObj != null)
        {
            logger.error("Item entity " + this.getEntityId() + " has no item?!");
        }

        return new ItemStack(Blocks.stone);
    }
    else
    {
        return itemstack;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:23,代码来源:EntityItem.java

示例4: BiomeGenSpace

import net.minecraft.init.Blocks; //导入方法依赖的package包/类
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);
    }
}
 
开发者ID:BlesseNtumble,项目名称:TRAPPIST-1,代码行数:17,代码来源:BiomeGenSpace.java

示例5: cacheOre

import net.minecraft.init.Blocks; //导入方法依赖的package包/类
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);
			}
		}
	}
}
 
开发者ID:azacock,项目名称:Prospecting,代码行数:33,代码来源:OreDictCache.java

示例6: generate

import net.minecraft.init.Blocks; //导入方法依赖的package包/类
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();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:52,代码来源:WorldGenBlockBlob.java

示例7: func_175793_a

import net.minecraft.init.Blocks; //导入方法依赖的package包/类
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))))))));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:MapGenCaves.java

示例8: generate

import net.minecraft.init.Blocks; //导入方法依赖的package包/类
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;
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:70,代码来源:WorldGenLiquids.java

示例9: getBlockPathWeight

import net.minecraft.init.Blocks; //导入方法依赖的package包/类
public float getBlockPathWeight(BlockPos pos)
{
    return this.worldObj.getBlockState(pos.down()).getBlock() == Blocks.stone ? 10.0F : super.getBlockPathWeight(pos);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:5,代码来源:EntitySilverfish.java

示例10: func_180519_a

import net.minecraft.init.Blocks; //导入方法依赖的package包/类
public void func_180519_a(ChunkPrimer p_180519_1_)
{
    for (int i = 0; i < 16; ++i)
    {
        for (int j = 0; j < 16; ++j)
        {
            int k = 1;
            int l = -1;
            IBlockState iblockstate = Blocks.end_stone.getDefaultState();
            IBlockState iblockstate1 = Blocks.end_stone.getDefaultState();

            for (int i1 = 127; i1 >= 0; --i1)
            {
                IBlockState iblockstate2 = p_180519_1_.getBlockState(i, i1, j);

                if (iblockstate2.getBlock().getMaterial() == Material.air)
                {
                    l = -1;
                }
                else if (iblockstate2.getBlock() == Blocks.stone)
                {
                    if (l == -1)
                    {
                        if (k <= 0)
                        {
                            iblockstate = Blocks.air.getDefaultState();
                            iblockstate1 = Blocks.end_stone.getDefaultState();
                        }

                        l = k;

                        if (i1 >= 0)
                        {
                            p_180519_1_.setBlockState(i, i1, j, iblockstate);
                        }
                        else
                        {
                            p_180519_1_.setBlockState(i, i1, j, iblockstate1);
                        }
                    }
                    else if (l > 0)
                    {
                        --l;
                        p_180519_1_.setBlockState(i, i1, j, iblockstate1);
                    }
                }
            }
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:51,代码来源:ChunkProviderEnd.java

示例11: getStoneBlock

import net.minecraft.init.Blocks; //导入方法依赖的package包/类
@Override
protected BlockMetaPair getStoneBlock() {
	return new BlockMetaPair(Blocks.stone, (byte) 0);
}
 
开发者ID:BlesseNtumble,项目名称:TRAPPIST-1,代码行数:5,代码来源:ChunkProviderTrappistOneB.java


注:本文中的net.minecraft.init.Blocks.stone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。