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


Java BlockFlower类代码示例

本文整理汇总了Java中net.minecraft.block.BlockFlower的典型用法代码示例。如果您正苦于以下问题:Java BlockFlower类的具体用法?Java BlockFlower怎么用?Java BlockFlower使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: flowerGenerator

import net.minecraft.block.BlockFlower; //导入依赖的package包/类
private void flowerGenerator(BlockFlower flower, World worldIn, Random random, int chunkX, int chunkZ, float chancesToSpawn)
{
	for(int i = 0; i < chancesToSpawn; i++)
		if(random.nextFloat() < chancesToSpawn)
		{
			int x = chunkX * 16 + random.nextInt(16);
			int z = chunkZ * 16 + random.nextInt(16);
			BlockPos position = worldIn.getTopSolidOrLiquidBlock(new BlockPos(x, 0, z));
			BlockPos blockpos = position.add(random.nextInt(8) - random.nextInt(8), random.nextInt(4) - random.nextInt(4), random.nextInt(8) - random.nextInt(8));
	
	        if (worldIn.isAirBlock(blockpos) && (worldIn.provider.isSurfaceWorld() || blockpos.getY() < 255) && 
	        		flower.canBlockStay(worldIn, blockpos, flower.getDefaultState()))
	        {
	            worldIn.setBlockState(blockpos,flower.getDefaultState(), 2);
	        }
		}

}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:19,代码来源:WorldGen.java

示例2: dropFewItems

import net.minecraft.block.BlockFlower; //导入依赖的package包/类
/**
 * Drop 0-2 items of this living's type
 */
protected void dropFewItems(boolean p_70628_1_, int p_70628_2_)
{
    int i = this.rand.nextInt(3);

    for (int j = 0; j < i; ++j)
    {
        this.dropItemWithOffset(Item.getItemFromBlock(Blocks.red_flower), 1, (float)BlockFlower.EnumFlowerType.POPPY.getMeta());
    }

    int l = 3 + this.rand.nextInt(3);

    for (int k = 0; k < l; ++k)
    {
        this.dropItem(Items.iron_ingot, 1);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:20,代码来源:EntityIronGolem.java

示例3: func_150572_a

import net.minecraft.block.BlockFlower; //导入依赖的package包/类
public String func_150572_a(Random p_150572_1_, int p_150572_2_, int p_150572_3_, int p_150572_4_)
{
    if (this.field_150632_aF == 1)
    {
        double var5 = MathHelper.clamp_double((1.0D + field_150606_ad.func_151601_a((double)p_150572_2_ / 48.0D, (double)p_150572_4_ / 48.0D)) / 2.0D, 0.0D, 0.9999D);
        int var7 = (int)(var5 * (double)BlockFlower.field_149859_a.length);

        if (var7 == 1)
        {
            var7 = 0;
        }

        return BlockFlower.field_149859_a[var7];
    }
    else
    {
        return super.func_150572_a(p_150572_1_, p_150572_2_, p_150572_3_, p_150572_4_);
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:20,代码来源:BiomeGenForest.java

示例4: func_150572_a

import net.minecraft.block.BlockFlower; //导入依赖的package包/类
public String func_150572_a(Random p_150572_1_, int p_150572_2_, int p_150572_3_, int p_150572_4_)
{
    double var5 = field_150606_ad.func_151601_a((double)p_150572_2_ / 200.0D, (double)p_150572_4_ / 200.0D);
    int var7;

    if (var5 < -0.8D)
    {
        var7 = p_150572_1_.nextInt(4);
        return BlockFlower.field_149859_a[4 + var7];
    }
    else if (p_150572_1_.nextInt(3) > 0)
    {
        var7 = p_150572_1_.nextInt(3);
        return var7 == 0 ? BlockFlower.field_149859_a[0] : (var7 == 1 ? BlockFlower.field_149859_a[3] : BlockFlower.field_149859_a[8]);
    }
    else
    {
        return BlockFlower.field_149858_b[0];
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:21,代码来源:BiomeGenPlains.java

示例5: func_149857_e

import net.minecraft.block.BlockFlower; //导入依赖的package包/类
public static BlockFlower func_149857_e(String name) {

        String[] astring = field_149858_b;
        int i = astring.length;
        int j;
        String s1;

        for (j = 0; j < i; ++j) {
            s1 = astring[j];

            if (s1.equals(name)) {
                return (BlockFlower) BPBlocks.indigo_flower;
            }
        }
        return null;
    }
 
开发者ID:Quetzi,项目名称:BluePower,代码行数:17,代码来源:BlockCustomFlower.java

示例6: func_150572_a

import net.minecraft.block.BlockFlower; //导入依赖的package包/类
public String func_150572_a(Random p_150572_1_, int p_150572_2_, int p_150572_3_, int p_150572_4_)
{
    double d0 = plantNoise.func_151601_a((double)p_150572_2_ / 200.0D, (double)p_150572_4_ / 200.0D);
    int l;

    if (d0 < -0.8D)
    {
        l = p_150572_1_.nextInt(4);
        return BlockFlower.field_149859_a[4 + l];
    }
    else if (p_150572_1_.nextInt(3) > 0)
    {
        l = p_150572_1_.nextInt(3);
        return l == 0 ? BlockFlower.field_149859_a[0] : (l == 1 ? BlockFlower.field_149859_a[3] : BlockFlower.field_149859_a[8]);
    }
    else
    {
        return BlockFlower.field_149858_b[0];
    }
}
 
开发者ID:NovaViper,项目名称:ZeroQuest,代码行数:21,代码来源:BiomeGenRedSeed.java

示例7: func_150572_a

import net.minecraft.block.BlockFlower; //导入依赖的package包/类
public String func_150572_a(Random p_150572_1_, int p_150572_2_, int p_150572_3_, int p_150572_4_)
{
    if (this.field_150632_aF == 1)
    {
        double d0 = MathHelper.clamp_double((1.0D + plantNoise.func_151601_a((double)p_150572_2_ / 48.0D, (double)p_150572_4_ / 48.0D)) / 2.0D, 0.0D, 0.9999D);
        int l = (int)(d0 * (double)BlockFlower.field_149859_a.length);

        if (l == 1)
        {
            l = 0;
        }

        return BlockFlower.field_149859_a[l];
    }
    else
    {
        return super.func_150572_a(p_150572_1_, p_150572_2_, p_150572_3_, p_150572_4_);
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:20,代码来源:BiomeGenForest.java

示例8: onBlockDestroyed

import net.minecraft.block.BlockFlower; //导入依赖的package包/类
@Override
public boolean onBlockDestroyed(ItemStack itemstack, World world, IBlockState state, BlockPos pos, EntityLivingBase entityLiving)
{
	boolean done = false;
	int size = 2;
	for(int newX = -size; newX <= size; newX++)
	{
		for(int newZ = -size; newZ <= size; newZ++)
		{
			BlockPos pos2 = pos.add(newX, 0, newZ);
			IBlockState sta = world.getBlockState(pos2);
			Block block = sta.getBlock();
			if((block instanceof BlockBush) || (block instanceof BlockFlower) || (block instanceof BlockDoublePlant))
			{
				block.dropBlockAsItem(world, pos2, sta, 0);
				world.setBlockToAir(pos2);
				itemstack.damageItem(1, entityLiving);
				done = true;
			}
		}
	}
	return done;
}
 
开发者ID:lukeplechaty,项目名称:Ores-and-Tools,代码行数:24,代码来源:ItemSickle.java

示例9: canSustainPlant

import net.minecraft.block.BlockFlower; //导入依赖的package包/类
@Override
public boolean canSustainPlant(World world, int x, int y, int z, ForgeDirection direction, IPlantable plant)
{
    final int metadata = world.getBlockMetadata(x, y, z);

    if (metadata < 5 && metadata > 13)
    {
        return false;
    }

    plant.getPlantID(world, x, y + 1, z);

    if (plant instanceof BlockFlower)
    {
        return true;
    }

    return false;
}
 
开发者ID:4Space,项目名称:4-Space-Legacy,代码行数:20,代码来源:SCVestaGrass.java

示例10: pickRandomFlower

import net.minecraft.block.BlockFlower; //导入依赖的package包/类
public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos)
{
    if (this.field_150632_aF == 1)
    {
        double d0 = MathHelper.clamp_double((1.0D + GRASS_COLOR_NOISE.func_151601_a((double)pos.getX() / 48.0D, (double)pos.getZ() / 48.0D)) / 2.0D, 0.0D, 0.9999D);
        BlockFlower.EnumFlowerType blockflower$enumflowertype = BlockFlower.EnumFlowerType.values()[(int)(d0 * (double)BlockFlower.EnumFlowerType.values().length)];
        return blockflower$enumflowertype == BlockFlower.EnumFlowerType.BLUE_ORCHID ? BlockFlower.EnumFlowerType.POPPY : blockflower$enumflowertype;
    }
    else
    {
        return super.pickRandomFlower(rand, pos);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:14,代码来源:BiomeGenForest.java

示例11: pickRandomFlower

import net.minecraft.block.BlockFlower; //导入依赖的package包/类
public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos)
{
    double d0 = GRASS_COLOR_NOISE.func_151601_a((double)pos.getX() / 200.0D, (double)pos.getZ() / 200.0D);

    if (d0 < -0.8D)
    {
        int j = rand.nextInt(4);

        switch (j)
        {
            case 0:
                return BlockFlower.EnumFlowerType.ORANGE_TULIP;

            case 1:
                return BlockFlower.EnumFlowerType.RED_TULIP;

            case 2:
                return BlockFlower.EnumFlowerType.PINK_TULIP;

            case 3:
            default:
                return BlockFlower.EnumFlowerType.WHITE_TULIP;
        }
    }
    else if (rand.nextInt(3) > 0)
    {
        int i = rand.nextInt(3);
        return i == 0 ? BlockFlower.EnumFlowerType.POPPY : (i == 1 ? BlockFlower.EnumFlowerType.HOUSTONIA : BlockFlower.EnumFlowerType.OXEYE_DAISY);
    }
    else
    {
        return BlockFlower.EnumFlowerType.DANDELION;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:35,代码来源:BiomeGenPlains.java

示例12: pickRandomFlower

import net.minecraft.block.BlockFlower; //导入依赖的package包/类
public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos)
{
    double d0 = GRASS_COLOR_NOISE.getValue((double)pos.getX() / 200.0D, (double)pos.getZ() / 200.0D);

    if (d0 < -0.8D)
    {
        int j = rand.nextInt(4);

        switch (j)
        {
            case 0:
                return BlockFlower.EnumFlowerType.ORANGE_TULIP;

            case 1:
                return BlockFlower.EnumFlowerType.RED_TULIP;

            case 2:
                return BlockFlower.EnumFlowerType.PINK_TULIP;

            case 3:
            default:
                return BlockFlower.EnumFlowerType.WHITE_TULIP;
        }
    }
    else if (rand.nextInt(3) > 0)
    {
        int i = rand.nextInt(3);
        return i == 0 ? BlockFlower.EnumFlowerType.POPPY : (i == 1 ? BlockFlower.EnumFlowerType.HOUSTONIA : BlockFlower.EnumFlowerType.OXEYE_DAISY);
    }
    else
    {
        return BlockFlower.EnumFlowerType.DANDELION;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:35,代码来源:BiomePlains.java

示例13: pickRandomFlower

import net.minecraft.block.BlockFlower; //导入依赖的package包/类
public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos)
{
    if (this.type == BiomeForest.Type.FLOWER)
    {
        double d0 = MathHelper.clamp((1.0D + GRASS_COLOR_NOISE.getValue((double)pos.getX() / 48.0D, (double)pos.getZ() / 48.0D)) / 2.0D, 0.0D, 0.9999D);
        BlockFlower.EnumFlowerType blockflower$enumflowertype = BlockFlower.EnumFlowerType.values()[(int)(d0 * (double)BlockFlower.EnumFlowerType.values().length)];
        return blockflower$enumflowertype == BlockFlower.EnumFlowerType.BLUE_ORCHID ? BlockFlower.EnumFlowerType.POPPY : blockflower$enumflowertype;
    }
    else
    {
        return super.pickRandomFlower(rand, pos);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:14,代码来源:BiomeForest.java

示例14: getBoundingBox

import net.minecraft.block.BlockFlower; //导入依赖的package包/类
public AxisAlignedBB getBoundingBox(IBlockAccess blockAccess, BlockPos pos)
{
    Block.EnumOffsetType block$enumoffsettype = this.block.getOffsetType();

    if (block$enumoffsettype != Block.EnumOffsetType.NONE && !(this.block instanceof BlockFlower))
    {
        AxisAlignedBB axisalignedbb = this.block.getBoundingBox(this, blockAccess, pos);
        axisalignedbb = BlockModelUtils.getOffsetBoundingBox(axisalignedbb, block$enumoffsettype, pos);
        return axisalignedbb;
    }
    else
    {
        return this.block.getBoundingBox(this, blockAccess, pos);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:16,代码来源:BlockStateContainer.java

示例15: pickRandomFlower

import net.minecraft.block.BlockFlower; //导入依赖的package包/类
public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos)
{
    double d0 = GRASS_COLOR_NOISE.getValue((double)pos.getX() / 200.0D, (double)pos.getZ() / 200.0D);

    if (d0 < -0.8D)
    {
        int j = rand.nextInt(4);

        switch (j)
        {
            case 0:
                return BlockFlower.EnumFlowerType.ORANGE_TULIP;
            case 1:
                return BlockFlower.EnumFlowerType.RED_TULIP;
            case 2:
                return BlockFlower.EnumFlowerType.PINK_TULIP;
            case 3:
            default:
                return BlockFlower.EnumFlowerType.WHITE_TULIP;
        }
    }
    else if (rand.nextInt(3) > 0)
    {
        int i = rand.nextInt(3);
        return i == 0 ? BlockFlower.EnumFlowerType.POPPY : (i == 1 ? BlockFlower.EnumFlowerType.HOUSTONIA : BlockFlower.EnumFlowerType.OXEYE_DAISY);
    }
    else
    {
        return BlockFlower.EnumFlowerType.DANDELION;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:32,代码来源:BiomePlains.java


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