本文整理了Java中net.minecraft.world.gen.feature.WorldGenTrees
类的一些代码示例,展示了WorldGenTrees
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorldGenTrees
类的具体详情如下:
包路径:net.minecraft.world.gen.feature.WorldGenTrees
类名称:WorldGenTrees
暂无
代码示例来源:origin: EngineHub/WorldEdit
@Nullable
private static WorldGenerator createWorldGenerator(TreeType type) {
switch (type) {
case TREE: return new WorldGenTrees(true);
case BIG_TREE: return new WorldGenBigTree(true);
case REDWOOD: return new WorldGenTaiga2(true);
case TALL_REDWOOD: return new WorldGenTaiga1();
case BIRCH: return new WorldGenBirchTree(true, false);
case JUNGLE: return new WorldGenMegaJungle(true, 10, 20, JUNGLE_LOG, JUNGLE_LEAF);
case SMALL_JUNGLE: return new WorldGenTrees(true, 4 + random.nextInt(7), JUNGLE_LOG, JUNGLE_LEAF, false);
case SHORT_JUNGLE: return new WorldGenTrees(true, 4 + random.nextInt(7), JUNGLE_LOG, JUNGLE_LEAF, true);
case JUNGLE_BUSH: return new WorldGenShrub(JUNGLE_LOG, JUNGLE_SHRUB);
case RED_MUSHROOM: return new WorldGenBigMushroom(Blocks.BROWN_MUSHROOM_BLOCK);
case BROWN_MUSHROOM: return new WorldGenBigMushroom(Blocks.RED_MUSHROOM_BLOCK);
case SWAMP: return new WorldGenSwamp();
case ACACIA: return new WorldGenSavannaTree(true);
case DARK_OAK: return new WorldGenCanopyTree(true);
case MEGA_REDWOOD: return new WorldGenMegaPineTree(false, random.nextBoolean());
case TALL_BIRCH: return new WorldGenBirchTree(true, true);
case RANDOM:
case PINE:
case RANDOM_REDWOOD:
default:
return null;
}
}
代码示例来源:origin: gegy1000/Terrarium
@Override
public boolean generate(World world, Random rand, BlockPos position) {
IBlockState previousGround = world.getBlockState(position.down());
boolean replacedGround = false;
if (previousGround.getBlock() == Blocks.SAND) {
world.setBlockState(position.down(), Blocks.DIRT.getDefaultState());
replacedGround = true;
}
boolean result = super.generate(world, rand, position);
if (replacedGround) {
world.setBlockState(position.down(), previousGround);
}
return result;
}
代码示例来源:origin: gegy1000/Terrarium
@Override
protected void setBlockAndNotifyAdequately(World world, BlockPos pos, IBlockState state) {
if (this.beans || state.getBlock() != Blocks.COCOA) {
super.setBlockAndNotifyAdequately(world, pos, state);
}
}
}
代码示例来源:origin: gegy1000/Terrarium
@Override
protected boolean canGrowInto(Block blockType) {
if (super.canGrowInto(blockType)) {
return true;
}
Material material = blockType.getDefaultState().getMaterial();
return material == Material.PLANTS || material == Material.VINE;
}
代码示例来源:origin: MCTCP/TerrainControl
return this.tree.generate(this.world, rand, blockPos);
case BigTree:
return this.bigTree.generate(this.world, rand, blockPos);
return this.groundBush.generate(this.world, rand, blockPos);
case CocoaTree:
return this.cocoaTree.generate(this.world, rand, blockPos);
case Acacia:
return this.acaciaTree.generate(this.world, rand, blockPos);
代码示例来源:origin: TeamLapen/Vampirism
public BiomeGenVampireForest() {
super(new BiomeProperties(name).setWaterColor(0xEE2505).setBaseHeight(0.1F).setHeightVariation(0.025F));
this.spawnableCreatureList.clear();
this.spawnableMonsterList.clear();
this.spawnableWaterCreatureList.clear();
this.spawnableCaveCreatureList.clear();
this.spawnableMonsterList.add(new SpawnListEntry(EntityGhost.class, 3, 1, 1));
this.spawnableMonsterList.add(new SpawnListEntry(EntityBasicVampire.class, 7, 1, 3));
this.spawnableMonsterList.add(new SpawnListEntry(EntityVampireBaron.class, 2, 1, 1));
this.spawnableCaveCreatureList.add(new SpawnListEntry(EntityBlindingBat.class, 8, 2, 4));
this.spawnableCreatureList.add(new SpawnListEntry(EntityDummyBittenAnimal.class, 15, 3, 6));
this.topBlock = ModBlocks.cursed_earth.getDefaultState();
this.fillerBlock = ModBlocks.cursed_earth.getDefaultState();
this.decorator.treesPerChunk = 5;
this.decorator.grassPerChunk = 4;
this.decorator.deadBushPerChunk = 3;
this.worldGenTrees = new WorldGenTrees(false, 4, Blocks.LOG.getDefaultState().withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.SPRUCE), Blocks.LEAVES.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.OAK), false);
}
代码示例来源:origin: GregTechCE/GregTech
public void generateTree(World worldIn, BlockPos pos, IBlockState state, Random rand) {
if (!TerrainGen.saplingGrowTree(worldIn, rand, pos)) return;
WorldGenerator worldgenerator;
IBlockState logState = MetaBlocks.LOG.getDefaultState()
.withProperty(BlockGregLog.VARIANT, LogVariant.RUBBER_WOOD)
.withProperty(BlockGregLog.NATURAL, true);
IBlockState leavesState = MetaBlocks.LEAVES.getDefaultState()
.withProperty(BlockGregLeaves.VARIANT, LogVariant.RUBBER_WOOD);
if(rand.nextInt(10) == 0) {
worldgenerator = new WorldGenBigTreeCustom(true, logState, leavesState.withProperty(BlockGregLeaves.CHECK_DECAY, false), BlockGregLog.LOG_AXIS);
} else {
worldgenerator = new WorldGenTrees(true, 6, logState, leavesState, false);
}
worldIn.setBlockState(pos, Blocks.AIR.getDefaultState(), 4);
if (!worldgenerator.generate(worldIn, rand, pos)) {
worldIn.setBlockState(pos, state, 4);
}
}
代码示例来源:origin: SonarSonic/Calculator
public void generateTree(World worldIn, BlockPos pos, IBlockState state, Random rand) {
if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(worldIn, rand, pos))
return;
WorldGenerator worldgenerator = rand.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true);
int i = 0;
int j = 0;
boolean flag = false;
switch (type) {
case 0:
worldgenerator = new CalculatorTreeBuilder(true, Calculator.amethystSapling, Calculator.amethystLeaves, Calculator.amethystLog);
break;
case 1:
worldgenerator = new CalculatorTreeBuilder(true, Calculator.tanzaniteSapling, Calculator.tanzaniteLeaves, Calculator.tanzaniteLog);
break;
case 2:
worldgenerator = new CalculatorTreeBuilder(true, Calculator.pearSapling, Calculator.pearLeaves, Calculator.pearLog);
break;
case 3:
worldgenerator = new CalculatorTreeBuilder(true, Calculator.diamondSapling, Calculator.diamondLeaves, Calculator.diamondLog);
break;
}
IBlockState iblockstate2 = Blocks.AIR.getDefaultState();
worldIn.setBlockState(pos, iblockstate2, 4);
if (!worldgenerator.generate(worldIn, rand, pos.add(i, 0, j))) {
worldIn.setBlockState(pos, state, 4);
}
}
代码示例来源:origin: Ellpeck/ActuallyAdditions
trees = new WorldGenTrees(false);
代码示例来源:origin: MCTCP/TerrainControl
.withProperty(BlockLeaves.CHECK_DECAY, false);
this.tree = new WorldGenTrees(false);
this.acaciaTree = new WorldGenSavannaTree(false);
this.cocoaTree = new WorldGenTrees(false, 5, jungleLog, jungleLeaves, true);
this.bigTree = new WorldGenBigTree(false);
this.birchTree = new WorldGenBirchTree(false, false);
内容来源于网络,如有侵权,请联系作者删除!