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


Java WorldGenAbstractTree类代码示例

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


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

示例1: genDecorations

import net.minecraft.world.gen.feature.WorldGenAbstractTree; //导入依赖的package包/类
@Override
protected void genDecorations(Biome biomeIn, World worldIn, Random random) {
	 			 	
	 	int k1 = this.treesPerChunk;
        if (random.nextFloat() < this.extraTreeChance)
        {
            ++k1;
        }

        if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, random, chunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.TREE))
        for (int j2 = 0; j2 < k1; ++j2)
        {
            int k6 = random.nextInt(16) + 8;
            int l = random.nextInt(16) + 8;
            WorldGenAbstractTree worldgenabstracttree = biomeIn.getRandomTreeFeature(random);
            worldgenabstracttree.setDecorationDefaults();
            BlockPos blockpos = worldIn.getHeight(this.chunkPos.add(k6, 0, l));

            if (worldgenabstracttree.generate(worldIn, random, blockpos))
            {
                worldgenabstracttree.generateSaplings(worldIn, random, blockpos);
            }
        }
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:25,代码来源:PontusBiomeDecorator.java

示例2: decorate

import net.minecraft.world.gen.feature.WorldGenAbstractTree; //导入依赖的package包/类
public void decorate(World world, Random rand, int chunkX, int chunkZ)
{
    this.theBiomeDecorator.decorateChunk(world, rand, this, chunkX, chunkZ);
    for (int j = 0; j < 3; ++j)
    {
        int x = chunkX + rand.nextInt(16) + 8;
        int z = chunkZ + rand.nextInt(16) + 8;
        /*int y = 70;
        for(int wy = 80;wy > 30;wy--){
            if(world.getBlock(x, wy, z) != Blocks.air){
                y = wy;
                break;
            }
        }*/
        int y = world.getTopSolidOrLiquidBlock(x, z);

        WorldGenAbstractTree worldgenabstracttree = func_150567_a(rand);
        worldgenabstracttree.setScale(1.0D, 1.0D, 1.0D);

        if (worldgenabstracttree.generate(world, rand, x, y, z))
        {
            worldgenabstracttree.func_150524_b(world, rand, x, y, z);
        }
    }

}
 
开发者ID:SpitefulFox,项目名称:RidiculousWorld,代码行数:27,代码来源:BiomeGenShadow.java

示例3: func_150567_a

import net.minecraft.world.gen.feature.WorldGenAbstractTree; //导入依赖的package包/类
@Override
public WorldGenAbstractTree func_150567_a(Random par1Random){
	int i = par1Random.nextInt(11);
	if(i <= 1) {return new WorldGenModTree(ModBlocks.ebonyWood, ModBlocks.ebonyLeaves, 10, 1, false);}
	else if(i <= 2) {return new WorldGenModTree(ModBlocks.oliveWood, ModBlocks.oliveLeaves, 10, 1, false);}
	else if(i <= 3) {return new WorldGenModTree(ModBlocks.mapleWood, ModBlocks.mapleLeaves, 10, 1, false);}
	else if(i <= 4) {return new WorldGenModTree(ModBlocks.jacarandaWood, ModBlocks.jacarandaLeaves, 10, 1, false);}
	else if(i <= 5) {return new WorldGenModTree(ModBlocks.rubberWood, ModBlocks.rubberLeaves, 10, 1, false);}
	else if(i <= 6) {return new WorldGenModTree(Blocks.log2, Blocks.leaves2, 1, 1, false, 10, 1, false);}
	else if(i <= 7) {return new WorldGenModTree(ModBlocks.ebonyWood, ModBlocks.ebonyLeaves, 10, 1, true);}
	else if(i <= 8) {return new WorldGenModTree(ModBlocks.oliveWood, ModBlocks.oliveLeaves, 10, 1, true);}
	else if(i <= 9) {return new WorldGenModTree(ModBlocks.mapleWood, ModBlocks.mapleLeaves, 10, 1, true);}
	else if(i <= 10) {return new WorldGenModTree(ModBlocks.jacarandaWood, ModBlocks.jacarandaLeaves, 10, 1, true);}
	else if(i <= 11) {return new WorldGenModTree(ModBlocks.rubberWood, ModBlocks.rubberLeaves, 10, 1, true);}
	else {return new WorldGenModTree(Blocks.log2, Blocks.leaves2, 1, 1, false, 10, 1, true);}
}
 
开发者ID:OmgImAlexis,项目名称:TheStuffMod,代码行数:17,代码来源:BiomeEndearingWoods.java

示例4: makeTree

import net.minecraft.world.gen.feature.WorldGenAbstractTree; //导入依赖的package包/类
private void makeTree(WorldGenAbstractTree tree, int chunkX, int chunkZ, Random random, World world, int min, int max) {

		int num = min + random.nextInt(max - min);
		for (int i = 0; i < num; i++) {
			int randX = chunkX * 16 + 8 + random.nextInt(16);
			int randZ = chunkZ * 16 + 8 + random.nextInt(16);
			tree.generate(world, random, world.getHeight(new BlockPos(randX, 0, randZ)));
		}
	}
 
开发者ID:MinecraftModDevelopmentMods,项目名称:Got-Wood,代码行数:10,代码来源:WorldGenerator.java

示例5: addMushrooms

import net.minecraft.world.gen.feature.WorldGenAbstractTree; //导入依赖的package包/类
protected void addMushrooms(World p_185379_1_, Random p_185379_2_, BlockPos p_185379_3_)
{
    for (int i = 0; i < 4; ++i)
    {
        for (int j = 0; j < 4; ++j)
        {
            int k = i * 4 + 1 + 8 + p_185379_2_.nextInt(3);
            int l = j * 4 + 1 + 8 + p_185379_2_.nextInt(3);
            BlockPos blockpos = p_185379_1_.getHeight(p_185379_3_.add(k, 0, l));

            if (p_185379_2_.nextInt(20) == 0)
            {
                WorldGenBigMushroom worldgenbigmushroom = new WorldGenBigMushroom();
                worldgenbigmushroom.generate(p_185379_1_, p_185379_2_, blockpos);
            }
            else
            {
                WorldGenAbstractTree worldgenabstracttree = this.genBigTreeChance(p_185379_2_);
                worldgenabstracttree.setDecorationDefaults();

                if (worldgenabstracttree.generate(p_185379_1_, p_185379_2_, blockpos))
                {
                    worldgenabstracttree.generateSaplings(p_185379_1_, p_185379_2_, blockpos);
                }
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:29,代码来源:BiomeForest.java

示例6: addMushrooms

import net.minecraft.world.gen.feature.WorldGenAbstractTree; //导入依赖的package包/类
public void addMushrooms(World p_185379_1_, Random p_185379_2_, BlockPos p_185379_3_)
{

    for (int i = 0; i < 4; ++i)
    {
        for (int j = 0; j < 4; ++j)
        {
            int k = i * 4 + 1 + 8 + p_185379_2_.nextInt(3);
            int l = j * 4 + 1 + 8 + p_185379_2_.nextInt(3);
            BlockPos blockpos = p_185379_1_.getHeight(p_185379_3_.add(k, 0, l));

            if (p_185379_2_.nextInt(20) == 0 && net.minecraftforge.event.terraingen.TerrainGen.decorate(p_185379_1_, p_185379_2_, blockpos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.BIG_SHROOM))
            {
                WorldGenBigMushroom worldgenbigmushroom = new WorldGenBigMushroom();
                worldgenbigmushroom.generate(p_185379_1_, p_185379_2_, blockpos);
            }
            else if (net.minecraftforge.event.terraingen.TerrainGen.decorate(p_185379_1_, p_185379_2_, blockpos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.TREE))
            {
                WorldGenAbstractTree worldgenabstracttree = this.genBigTreeChance(p_185379_2_);
                worldgenabstracttree.setDecorationDefaults();

                if (worldgenabstracttree.generate(p_185379_1_, p_185379_2_, blockpos))
                {
                    worldgenabstracttree.generateSaplings(p_185379_1_, p_185379_2_, blockpos);
                }
            }
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:30,代码来源:BiomeForest.java

示例7: func_150567_a

import net.minecraft.world.gen.feature.WorldGenAbstractTree; //导入依赖的package包/类
public WorldGenAbstractTree func_150567_a(Random rand)
{
	switch (rand.nextInt(7))
	{
 	case 0 : 
 		return (WorldGenAbstractTree) new WorldGenRoofedTrees(0, 0);
 		
 	case 1 : 
 		return (WorldGenAbstractTree) new WorldGenRoofedTrees(0, 3);
 		
 	case 2 : 
 		return (WorldGenAbstractTree) new WorldGenRoofedTrees(2, 0);
 		
 	case 3 : 
 		return (WorldGenAbstractTree) new WorldGenRoofedTrees(2, 3);
 		
 	case 4 : 
 		return (WorldGenAbstractTree) new WorldGenTreesDim(5 + rand.nextInt(8), 2, 3);
 		
 	case 5 : 
 		return (WorldGenAbstractTree) new WorldGenTreesDim(5 + rand.nextInt(8), 2, 0);
 		
 	case 6 : 
 		return (WorldGenAbstractTree) new WorldGenBigTreesDim();
	}
	
	return (null);
}
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:29,代码来源:BiomRoofedForest.java

示例8: func_150567_a

import net.minecraft.world.gen.feature.WorldGenAbstractTree; //导入依赖的package包/类
public WorldGenAbstractTree func_150567_a(Random rand)
{
	switch (rand.nextInt(7))
	{
 	case 0 : 
 		return (WorldGenAbstractTree) new WorldGenTreesDim(4 + rand.nextInt(8), 0, 0);
 		
 	case 1 : 
 		return (WorldGenAbstractTree) new WorldGenTreesDim(4 + rand.nextInt(8), 0, 1);
 		
 	case 2 : 
 		return (WorldGenAbstractTree) new WorldGenTreesDim(4 + rand.nextInt(8), 0, 2);
 		
 	case 3 : 
 		return (WorldGenAbstractTree) new WorldGenTreesDim(4 + rand.nextInt(8), 2, 0);
 		
 	case 4 : 
 		return (WorldGenAbstractTree) new WorldGenTreesDim(4 + rand.nextInt(8), 2, 1);
 		
 	case 5 : 
 		return (WorldGenAbstractTree) new WorldGenTreesDim(4 + rand.nextInt(8), 2, 2);
 		
 	case 6 : 
 		return (WorldGenAbstractTree) new WorldGenBigTreesDim();
	}
	
	return (null);
}
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:29,代码来源:BiomMagicForest.java

示例9: genBigTreeChance

import net.minecraft.world.gen.feature.WorldGenAbstractTree; //导入依赖的package包/类
@Override
public WorldGenAbstractTree genBigTreeChance(Random random)
{
	return random.nextInt(4) == 0 ?
		       new WorldGenRedWoodTree() :
		       random.nextInt(8) < 2 ? this.worldGeneratorTrees : new WorldGenRedWoodTreeSmall();
}
 
开发者ID:MinestrapTeam,项目名称:Minestrappolation-4,代码行数:8,代码来源:BiomeRedwood.java

示例10: func_150567_a

import net.minecraft.world.gen.feature.WorldGenAbstractTree; //导入依赖的package包/类
public WorldGenAbstractTree func_150567_a(Random random)
{
	//return (WorldGenAbstractTree)(random.nextInt(3) == 0 ? new WorldGenDarkJungleTree(false, 10, 20, 3, 3) : this.worldGeneratorTrees);
	//return new WorldGenOriginalTree(TDEBlocks.dark_emerald_ore, Blocks.leaves, 4, 7, false);
	//return new TDEWorldGenBigTree(false);
	return new WorldGenTestTree(false, 10, 20, 1, 3);
	
}
 
开发者ID:TheDarkEra,项目名称:TheDarkEra,代码行数:9,代码来源:BiomeDarkJungle.java

示例11: func_150567_a

import net.minecraft.world.gen.feature.WorldGenAbstractTree; //导入依赖的package包/类
public WorldGenAbstractTree func_150567_a(Random rand)
{
    if(rand.nextBoolean())
        return pineTree;
    else
        return bubblegum;
}
 
开发者ID:SpitefulFox,项目名称:RidiculousWorld,代码行数:8,代码来源:BiomeGenCandy.java

示例12: func_150567_a

import net.minecraft.world.gen.feature.WorldGenAbstractTree; //导入依赖的package包/类
public WorldGenAbstractTree func_150567_a(Random rand)
{
    if(rand.nextInt(3) == 1)
        return livingwood;
    else
        return worldGeneratorTrees;
}
 
开发者ID:SpitefulFox,项目名称:RidiculousWorld,代码行数:8,代码来源:BiomeGenBotania.java

示例13: createMutation

import net.minecraft.world.gen.feature.WorldGenAbstractTree; //导入依赖的package包/类
public BiomeGenBase createMutation()
{
    if (this.biomeID == BiomeGenBase.forest.biomeID)
    {
        BiomeGenForest biomegenforest = new BiomeGenForest(this.biomeID + 128, 1);
        biomegenforest.setHeight(new BiomeGenBase.Height(this.rootHeight, this.heightVariation + 0.2F));
        biomegenforest.setBiomeName("Flower Forest");
        biomegenforest.func_150557_a(6976549, true);
        biomegenforest.func_76733_a(8233509);
        return biomegenforest;
    }
    else
    {
        return this.biomeID != BiomeGenBase.birchForest.biomeID && this.biomeID != BiomeGenBase.birchForestHills.biomeID ? new BiomeGenMutated(this.biomeID + 128, this)
        {
            private static final String __OBFID = "CL_00000172";
            public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_)
            {
                this.baseBiome.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_);
            }
        }: new BiomeGenMutated(this.biomeID + 128, this)
        {
            private static final String __OBFID = "CL_00001861";
            public WorldGenAbstractTree func_150567_a(Random p_150567_1_)
            {
                return p_150567_1_.nextBoolean() ? BiomeGenForest.field_150629_aC : BiomeGenForest.field_150630_aD;
            }
        };
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:31,代码来源:BiomeGenForest.java

示例14: DerpyTreeGen

import net.minecraft.world.gen.feature.WorldGenAbstractTree; //导入依赖的package包/类
public DerpyTreeGen(WorldGenAbstractTree tree, BiomeGenBase biome, int tries, int chance) {
	super();
	this.tree = tree;
	this.biome = biome;
	this.tries = tries;
	this.chance = chance;
}
 
开发者ID:Wuerfel21,项目名称:The-Derpy-Shiz-Mod,代码行数:8,代码来源:DerpyTreeGen.java

示例15: func_150567_a

import net.minecraft.world.gen.feature.WorldGenAbstractTree; //导入依赖的package包/类
@Override
public WorldGenAbstractTree func_150567_a(Random par1Random){
	int i = par1Random.nextInt(6);
	if(i <= 1) {return new WorldGenModTree(ModBlocks.lemonWood, ModBlocks.lemonLeaves);}
	else if(i <= 2) {return new WorldGenModTree(ModBlocks.bananaWood, ModBlocks.bananaLeaves);}
	else if(i <= 3) {return new WorldGenModTree(ModBlocks.pearWood, ModBlocks.pearLeaves);}
	else if(i <= 4) {return new WorldGenModTree(ModBlocks.mangoWood, ModBlocks.mangoLeaves);}
	else {return new WorldGenModTree(ModBlocks.cherryWood, ModBlocks.cherryLeaves);}
}
 
开发者ID:OmgImAlexis,项目名称:TheStuffMod,代码行数:10,代码来源:BiomeFruitForest.java


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