當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。