• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BlockDoublePlant类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getStateFromMeta

import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
private IBlockState getStateFromMeta(Block p_getStateFromMeta_1_, int p_getStateFromMeta_2_)
{
    try
    {
        IBlockState iblockstate = p_getStateFromMeta_1_.getStateFromMeta(p_getStateFromMeta_2_);

        if (p_getStateFromMeta_1_ == Blocks.double_plant && p_getStateFromMeta_2_ > 7)
        {
            IBlockState iblockstate1 = p_getStateFromMeta_1_.getStateFromMeta(p_getStateFromMeta_2_ & 7);
            iblockstate = iblockstate.withProperty(BlockDoublePlant.VARIANT, iblockstate1.getValue(BlockDoublePlant.VARIANT));
        }

        return iblockstate;
    }
    catch (IllegalArgumentException var5)
    {
        return p_getStateFromMeta_1_.getDefaultState();
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:20,代码来源:ConnectedParser.java


示例2: getStateFromMeta

import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
private IBlockState getStateFromMeta(Block p_getStateFromMeta_1_, int p_getStateFromMeta_2_)
{
    try
    {
        IBlockState iblockstate = p_getStateFromMeta_1_.getStateFromMeta(p_getStateFromMeta_2_);

        if (p_getStateFromMeta_1_ == Blocks.DOUBLE_PLANT && p_getStateFromMeta_2_ > 7)
        {
            IBlockState iblockstate1 = p_getStateFromMeta_1_.getStateFromMeta(p_getStateFromMeta_2_ & 7);
            iblockstate = iblockstate.withProperty(BlockDoublePlant.VARIANT, iblockstate1.getValue(BlockDoublePlant.VARIANT));
        }

        return iblockstate;
    }
    catch (IllegalArgumentException var5)
    {
        return p_getStateFromMeta_1_.getDefaultState();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:20,代码来源:ConnectedParser.java


示例3: addWinnowingRecipes

import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
private static void addWinnowingRecipes() {
    IWinnowingMachineHandler winnowing = CulinaryCultivationAPI.winnowing;

    ItemStack tallGrass = new ItemStack(Blocks.TALLGRASS, 1, BlockTallGrass.EnumType.GRASS.getMeta());
    ItemStack doubleTallGrass = new ItemStack(Blocks.DOUBLE_PLANT, 1, BlockDoublePlant.EnumPlantType.GRASS.getMeta());

    //Culinary Cultivation outputs
    winnowing.addOutput(tallGrass, new ItemStack(CROP_SEEDS, 1, ProductType.CUCUMBER.getMetadata()), 10);
    winnowing.addOutput(tallGrass, new ItemStack(CROP_SEEDS, 1, ProductType.TOMATO.getMetadata()), 8);
    winnowing.addJunk(tallGrass, new ItemStack(GENERAL, 1, ItemGeneral.Type.CHAFF_PILE.getMetadata()), 10);
    winnowing.addRecipe(doubleTallGrass, new ItemStack(CROP_SEEDS, 1, ProductType.BLACK_PEPPER_DRUPE.getMetadata()), 18);
    winnowing.addRecipe(doubleTallGrass, new ItemStack(CROP_SEEDS, 1, ProductType.CORN.getMetadata()), 8);

    //Vanilla outputs
    winnowing.addOutput(tallGrass, new ItemStack(Items.WHEAT_SEEDS), 10);
    winnowing.addOutput(tallGrass, new ItemStack(Items.BEETROOT_SEEDS), 2);
    winnowing.addOutput(tallGrass, new ItemStack(Items.PUMPKIN_SEEDS), 1);
    winnowing.addRecipe(new ItemStack(Blocks.SAPLING, 1, BlockPlanks.EnumType.JUNGLE.getMetadata()), new ItemStack(Items.MELON_SEEDS), 1, new ItemStack(Blocks.DEADBUSH), 10);
    winnowing.addRecipe(new ItemStack(Items.WHEAT), new ItemStack(Items.WHEAT_SEEDS), 15, new ItemStack(GENERAL, 1, ItemGeneral.Type.CHAFF_PILE.getMetadata()), 90);
}
 
开发者ID:GirafiStudios,项目名称:Culinary-Cultivation,代码行数:21,代码来源:Recipes.java


示例4: onBlockDestroyed

import net.minecraft.block.BlockDoublePlant; //导入依赖的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


示例5: applyPlantable

import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
protected void applyPlantable (World world, int x, int y, int z, TileEntityLargePot tile, EntityPlayer player, IPlantable plantable) {
    ItemStack itemStack = player.inventory.getCurrentItem();

    // TODO: Non-compliant IPlantable, use config
    Block itemBlock = plantable.getPlant(world, x, y, z);
    int itemMeta = itemStack.getItemDamage();
    if (itemBlock == null && plantable instanceof Block) {
        itemBlock = (Block) plantable;
    }
    else {
        int plantMeta = plantable.getPlantMetadata(world, x, y, z);
        if (plantMeta != world.getBlockMetadata(x, y, z))
            itemMeta = plantMeta;
    }

    world.setBlock(x, y + 1, z, ModBlocks.largePotPlantProxy, itemMeta, 3);
    if (itemBlock instanceof BlockDoublePlant || itemBlock.getRenderType() == 40)
        world.setBlock(x, y + 2, z, ModBlocks.largePotPlantProxy, itemMeta | 8, 3);

    tile.setItem(itemStack.getItem(), itemMeta);
    tile.markDirty();

    if (!player.capabilities.isCreativeMode && --itemStack.stackSize <= 0)
        player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
}
 
开发者ID:jaquadro,项目名称:ForgeMods,代码行数:26,代码来源:BlockLargePot.java


示例6: decorate

import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
public void decorate(World worldIn, Random rand, BlockPos pos)
{
    DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.GRASS);

    for (int i = 0; i < 7; ++i)
    {
        int j = rand.nextInt(16) + 8;
        int k = rand.nextInt(16) + 8;
        int l = rand.nextInt(worldIn.getHeight(pos.add(j, 0, k)).getY() + 32);
        DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j, l, k));
    }

    super.decorate(worldIn, rand, pos);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:15,代码来源:BiomeGenSavanna.java


示例7: decorate

import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
public void decorate(World worldIn, Random rand, BlockPos pos)
{
    if (this.field_150644_aH == 1 || this.field_150644_aH == 2)
    {
        int i = rand.nextInt(3);

        for (int j = 0; j < i; ++j)
        {
            int k = rand.nextInt(16) + 8;
            int l = rand.nextInt(16) + 8;
            BlockPos blockpos = worldIn.getHeight(pos.add(k, 0, l));
            field_150643_aG.generate(worldIn, rand, blockpos);
        }
    }

    DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.FERN);

    for (int i1 = 0; i1 < 7; ++i1)
    {
        int j1 = rand.nextInt(16) + 8;
        int k1 = rand.nextInt(16) + 8;
        int l1 = rand.nextInt(worldIn.getHeight(pos.add(j1, 0, k1)).getY() + 32);
        DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j1, l1, k1));
    }

    super.decorate(worldIn, rand, pos);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:28,代码来源:BiomeGenTaiga.java


示例8: decorate

import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
public void decorate(World worldIn, Random rand, BlockPos pos)
{
    double d0 = GRASS_COLOR_NOISE.func_151601_a((double)(pos.getX() + 8) / 200.0D, (double)(pos.getZ() + 8) / 200.0D);

    if (d0 < -0.8D)
    {
        this.theBiomeDecorator.flowersPerChunk = 15;
        this.theBiomeDecorator.grassPerChunk = 5;
    }
    else
    {
        this.theBiomeDecorator.flowersPerChunk = 4;
        this.theBiomeDecorator.grassPerChunk = 10;
        DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.GRASS);

        for (int i = 0; i < 7; ++i)
        {
            int j = rand.nextInt(16) + 8;
            int k = rand.nextInt(16) + 8;
            int l = rand.nextInt(worldIn.getHeight(pos.add(j, 0, k)).getY() + 32);
            DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j, l, k));
        }
    }

    if (this.field_150628_aC)
    {
        DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.SUNFLOWER);

        for (int i1 = 0; i1 < 10; ++i1)
        {
            int j1 = rand.nextInt(16) + 8;
            int k1 = rand.nextInt(16) + 8;
            int l1 = rand.nextInt(worldIn.getHeight(pos.add(j1, 0, k1)).getY() + 32);
            DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j1, l1, k1));
        }
    }

    super.decorate(worldIn, rand, pos);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:40,代码来源:BiomeGenPlains.java


示例9: decorate

import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
@Override
public void decorate(World worldIn, Random rand, BlockPos pos)
{
    DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.GRASS);

    for (int i = 0; i < 4; ++i)
    {
        int j = rand.nextInt(16) + 8;
        int k = rand.nextInt(16) + 8;
        int l = rand.nextInt(worldIn.getHeight(pos.add(j, 0, k)).getY() + 32);
        DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j, l, k));
    }

    super.decorate(worldIn, rand, pos);
}
 
开发者ID:stuebz88,项目名称:modName,代码行数:16,代码来源:BiomeTropicalShrubland.java


示例10: decorate

import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
public void decorate(World worldIn, Random rand, BlockPos pos)
{
    double d0 = GRASS_COLOR_NOISE.getValue((double)(pos.getX() + 8) / 200.0D, (double)(pos.getZ() + 8) / 200.0D);

    if (d0 < -0.8D)
    {
        this.theBiomeDecorator.flowersPerChunk = 15;
        this.theBiomeDecorator.grassPerChunk = 5;
    }
    else
    {
        this.theBiomeDecorator.flowersPerChunk = 4;
        this.theBiomeDecorator.grassPerChunk = 10;
        DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.GRASS);

        for (int i = 0; i < 7; ++i)
        {
            int j = rand.nextInt(16) + 8;
            int k = rand.nextInt(16) + 8;
            int l = rand.nextInt(worldIn.getHeight(pos.add(j, 0, k)).getY() + 32);
            DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j, l, k));
        }
    }

    if (this.sunflowers)
    {
        DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.SUNFLOWER);

        for (int i1 = 0; i1 < 10; ++i1)
        {
            int j1 = rand.nextInt(16) + 8;
            int k1 = rand.nextInt(16) + 8;
            int l1 = rand.nextInt(worldIn.getHeight(pos.add(j1, 0, k1)).getY() + 32);
            DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j1, l1, k1));
        }
    }

    super.decorate(worldIn, rand, pos);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:40,代码来源:BiomePlains.java


示例11: addDoublePlants

import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
protected void addDoublePlants(World p_185378_1_, Random p_185378_2_, BlockPos p_185378_3_, int p_185378_4_)
{
    for (int i = 0; i < p_185378_4_; ++i)
    {
        int j = p_185378_2_.nextInt(3);

        if (j == 0)
        {
            DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.SYRINGA);
        }
        else if (j == 1)
        {
            DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.ROSE);
        }
        else if (j == 2)
        {
            DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.PAEONIA);
        }

        for (int k = 0; k < 5; ++k)
        {
            int l = p_185378_2_.nextInt(16) + 8;
            int i1 = p_185378_2_.nextInt(16) + 8;
            int j1 = p_185378_2_.nextInt(p_185378_1_.getHeight(p_185378_3_.add(l, 0, i1)).getY() + 32);

            if (DOUBLE_PLANT_GENERATOR.generate(p_185378_1_, p_185378_2_, new BlockPos(p_185378_3_.getX() + l, j1, p_185378_3_.getZ() + i1)))
            {
                break;
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:33,代码来源:BiomeForest.java


示例12: decorate

import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
public void decorate(World worldIn, Random rand, BlockPos pos)
{
    if (this.type == BiomeTaiga.Type.MEGA || this.type == BiomeTaiga.Type.MEGA_SPRUCE)
    {
        int i = rand.nextInt(3);

        for (int j = 0; j < i; ++j)
        {
            int k = rand.nextInt(16) + 8;
            int l = rand.nextInt(16) + 8;
            BlockPos blockpos = worldIn.getHeight(pos.add(k, 0, l));
            FOREST_ROCK_GENERATOR.generate(worldIn, rand, blockpos);
        }
    }

    DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.FERN);

    for (int i1 = 0; i1 < 7; ++i1)
    {
        int j1 = rand.nextInt(16) + 8;
        int k1 = rand.nextInt(16) + 8;
        int l1 = rand.nextInt(worldIn.getHeight(pos.add(j1, 0, k1)).getY() + 32);
        DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j1, l1, k1));
    }

    super.decorate(worldIn, rand, pos);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:28,代码来源:BiomeTaiga.java


示例13: decorate

import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
public void decorate(World worldIn, Random rand, BlockPos pos)
{
    double d0 = GRASS_COLOR_NOISE.getValue((double)(pos.getX() + 8) / 200.0D, (double)(pos.getZ() + 8) / 200.0D);

    if (d0 < -0.8D)
    {
        this.theBiomeDecorator.flowersPerChunk = 15;
        this.theBiomeDecorator.grassPerChunk = 5;
    }
    else
    {
        this.theBiomeDecorator.flowersPerChunk = 4;
        this.theBiomeDecorator.grassPerChunk = 10;
        DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.GRASS);

        if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS))
        for (int i = 0; i < 7; ++i)
        {
            int j = rand.nextInt(16) + 8;
            int k = rand.nextInt(16) + 8;
            int l = rand.nextInt(worldIn.getHeight(pos.add(j, 0, k)).getY() + 32);
            DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j, l, k));
        }
    }

    if (this.sunflowers && net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FLOWERS))
    {
        DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.SUNFLOWER);

        for (int i1 = 0; i1 < 10; ++i1)
        {
            int j1 = rand.nextInt(16) + 8;
            int k1 = rand.nextInt(16) + 8;
            int l1 = rand.nextInt(worldIn.getHeight(pos.add(j1, 0, k1)).getY() + 32);
            DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j1, l1, k1));
        }
    }

    super.decorate(worldIn, rand, pos);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:41,代码来源:BiomePlains.java


示例14: addDoublePlants

import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
public void addDoublePlants(World p_185378_1_, Random p_185378_2_, BlockPos p_185378_3_, int p_185378_4_)
{
    for (int i = 0; i < p_185378_4_; ++i)
    {
        int j = p_185378_2_.nextInt(3);

        if (j == 0)
        {
            DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.SYRINGA);
        }
        else if (j == 1)
        {
            DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.ROSE);
        }
        else if (j == 2)
        {
            DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.PAEONIA);
        }

        for (int k = 0; k < 5; ++k)
        {
            int l = p_185378_2_.nextInt(16) + 8;
            int i1 = p_185378_2_.nextInt(16) + 8;
            int j1 = p_185378_2_.nextInt(p_185378_1_.getHeight(p_185378_3_.add(l, 0, i1)).getY() + 32);

            if (DOUBLE_PLANT_GENERATOR.generate(p_185378_1_, p_185378_2_, new BlockPos(p_185378_3_.getX() + l, j1, p_185378_3_.getZ() + i1)))
            {
                break;
            }
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:33,代码来源:BiomeForest.java


示例15: decorate

import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
public void decorate(World worldIn, Random rand, BlockPos pos)
{
    if ((this.type == BiomeTaiga.Type.MEGA || this.type == BiomeTaiga.Type.MEGA_SPRUCE) && net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.ROCK))
    {
        int i = rand.nextInt(3);

        for (int j = 0; j < i; ++j)
        {
            int k = rand.nextInt(16) + 8;
            int l = rand.nextInt(16) + 8;
            BlockPos blockpos = worldIn.getHeight(pos.add(k, 0, l));
            FOREST_ROCK_GENERATOR.generate(worldIn, rand, blockpos);
        }
    }

    DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.FERN);

    if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FLOWERS))
    for (int i1 = 0; i1 < 7; ++i1)
    {
        int j1 = rand.nextInt(16) + 8;
        int k1 = rand.nextInt(16) + 8;
        int l1 = rand.nextInt(worldIn.getHeight(pos.add(j1, 0, k1)).getY() + 32);
        DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j1, l1, k1));
    }

    super.decorate(worldIn, rand, pos);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:29,代码来源:BiomeTaiga.java


示例16: decorate

import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
public void decorate(World worldIn, Random rand, BlockPos pos)
{
    DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.GRASS);

    if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS))
    for (int i = 0; i < 7; ++i)
    {
        int j = rand.nextInt(16) + 8;
        int k = rand.nextInt(16) + 8;
        int l = rand.nextInt(worldIn.getHeight(pos.add(j, 0, k)).getY() + 32);
        DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j, l, k));
    }

    super.decorate(worldIn, rand, pos);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:16,代码来源:BiomeSavanna.java


示例17: updateTick

import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
public void updateTick(World world, BlockPos pos, IBlockState state, Random rand)
{
	this.checkAndDropBlock(world, pos, state);

    if (world.getLightFromNeighbors(pos.up()) >= 9)
    {
        float f = getGrowthChance(this, world, pos);

        if (rand.nextInt((int)(25.0F / f) + 1) == 0)
        {
        	world.setBlockToAir(pos.up());
        	Blocks.double_plant.placeAt(world, pos, BlockDoublePlant.EnumPlantType.PAEONIA, 2);
        }
    }
}
 
开发者ID:Stormister,项目名称:Rediscovered-Mod-1.8,代码行数:16,代码来源:BlockEmptyPeonyBush.java


示例18: updateTick

import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
public void updateTick(World world, BlockPos pos, IBlockState state, Random rand)
{
	this.checkAndDropBlock(world, pos, state);

    if (world.getLightFromNeighbors(pos.up()) >= 9)
    {
        float f = getGrowthChance(this, world, pos);

        if (rand.nextInt((int)(25.0F / f) + 1) == 0)
        {
        	world.setBlockToAir(pos.up());
        	Blocks.double_plant.placeAt(world, pos, BlockDoublePlant.EnumPlantType.ROSE, 2);
        }
    }
}
 
开发者ID:Stormister,项目名称:Rediscovered-Mod-1.8,代码行数:16,代码来源:BlockEmptyRoseBush.java


示例19: registerVanillaVariantProps

import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
private static void registerVanillaVariantProps() {
	// TODO: omit similar blocks
	registerVariantProperty(BlockStone.VARIANT);
	registerVariantProperty(BlockPlanks.VARIANT);
	registerVariantProperty(BlockSapling.TYPE);
	registerVariantProperty(BlockDirt.VARIANT);
	registerVariantProperty(BlockSand.VARIANT);
	registerVariantProperty(BlockOldLog.VARIANT);
	registerVariantProperty(BlockNewLog.VARIANT);
	registerVariantProperty(BlockOldLeaf.VARIANT);
	registerVariantProperty(BlockNewLeaf.VARIANT);
	registerVariantProperty(BlockSandStone.TYPE);
	registerVariantProperty(BlockTallGrass.TYPE);
	registerVariantProperty(BlockPistonExtension.TYPE);
	registerVariantProperty(BlockColored.COLOR);
	registerVariantProperty(BlockPistonMoving.TYPE);
	registerVariantProperty(Blocks.YELLOW_FLOWER.getTypeProperty());
	registerVariantProperty(Blocks.RED_FLOWER.getTypeProperty());
	registerVariantProperty(BlockStoneSlab.VARIANT);
	registerVariantProperty(BlockWoodSlab.VARIANT);
	registerVariantProperty(BlockAnvil.DAMAGE);
	registerVariantProperty(BlockQuartz.VARIANT);
	registerVariantProperty(BlockCarpet.COLOR);
	registerVariantProperty(BlockDoublePlant.VARIANT);
	registerVariantProperty(BlockStainedGlass.COLOR);
	registerVariantProperty(BlockStainedGlassPane.COLOR);
	registerVariantProperty(BlockPrismarine.VARIANT);
	registerVariantProperty(BlockRedSandstone.TYPE);
	registerVariantProperty(BlockStoneSlabNew.VARIANT);
}
 
开发者ID:Earthcomputer,项目名称:Easy-Editors,代码行数:31,代码来源:BlockPropertyRegistry.java


示例20: decorate

import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
public void decorate(World worldIn, Random p_180624_2_, BlockPos p_180624_3_)
{
    int i;
    int j;
    int k;
    int l;

    if (this.field_150644_aH == 1 || this.field_150644_aH == 2)
    {
        i = p_180624_2_.nextInt(3);

        for (j = 0; j < i; ++j)
        {
            k = p_180624_2_.nextInt(16) + 8;
            l = p_180624_2_.nextInt(16) + 8;
            BlockPos blockpos1 = worldIn.getHeight(p_180624_3_.add(k, 0, l));
            field_150643_aG.generate(worldIn, p_180624_2_, blockpos1);
        }
    }

    DOUBLE_PLANT_GENERATOR.func_180710_a(BlockDoublePlant.EnumPlantType.FERN);

    for (i = 0; i < 7; ++i)
    {
        j = p_180624_2_.nextInt(16) + 8;
        k = p_180624_2_.nextInt(16) + 8;
        l = p_180624_2_.nextInt(worldIn.getHeight(p_180624_3_.add(j, 0, k)).getY() + 32);
        DOUBLE_PLANT_GENERATOR.generate(worldIn, p_180624_2_, p_180624_3_.add(j, l, k));
    }

    super.decorate(worldIn, p_180624_2_, p_180624_3_);
}
 
开发者ID:NovaViper,项目名称:ZeroQuest,代码行数:33,代码来源:BiomeGenBlueTaiga.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EnumMovingObjectType类代码示例发布时间:2022-05-21
下一篇:
Java IntegerRange类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap