From 73790cfe0fac29f8d6e1c591562bf4b78b9479b7 Mon Sep 17 00:00:00 2001 From: Adubbz Date: Sun, 19 Apr 2015 13:06:09 +1000 Subject: [PATCH] Added bushes to the Shrubland, added the Dense Forest --- .../biomesoplenty/api/biome/BOPBiomes.java | 1 + .../biome/overworld/BiomeGenDenseForest.java | 99 +++++++++++++++++++ .../biome/overworld/BiomeGenShrubland.java | 1 + .../biomesoplenty/common/init/ModBiomes.java | 2 + .../feature/tree/GeneratorBasicTree.java | 2 - .../models/block/pink_cherry_leaves.json | 2 +- .../models/block/white_cherry_leaves.json | 2 +- 7 files changed, 105 insertions(+), 4 deletions(-) create mode 100644 src/main/java/biomesoplenty/common/biome/overworld/BiomeGenDenseForest.java diff --git a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java index eb1caf202..23ffd4095 100644 --- a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java +++ b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java @@ -17,6 +17,7 @@ public class BOPBiomes public static Optional alps = Optional.absent(); public static Optional arctic = Optional.absent(); public static Optional crag = Optional.absent(); + public static Optional denseForest = Optional.absent(); public static Optional flowerField = Optional.absent(); public static Optional lavenderFields = Optional.absent(); public static Optional originValley = Optional.absent(); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenDenseForest.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenDenseForest.java new file mode 100644 index 000000000..9f4a30a87 --- /dev/null +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenDenseForest.java @@ -0,0 +1,99 @@ +/******************************************************************************* + * Copyright 2015, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ + +package biomesoplenty.common.biome.overworld; + +import java.util.Random; + +import biomesoplenty.api.biome.BOPBiome; +import biomesoplenty.api.biome.generation.GeneratorStage; +import biomesoplenty.api.biome.generation.GeneratorWeighted; +import biomesoplenty.api.block.BOPBlocks; +import biomesoplenty.api.block.BOPPlantEnums.AllPlants; +import biomesoplenty.api.block.BOPTreeEnums.AllTrees; +import biomesoplenty.api.block.BOPWoodEnums.AllWoods; +import biomesoplenty.common.block.BlockBOPLeaves; +import biomesoplenty.common.block.BlockBOPLeaves3; +import biomesoplenty.common.block.BlockBOPLog; +import biomesoplenty.common.block.BlockBOPLog3; +import biomesoplenty.common.block.BlockBOPPlant; +import biomesoplenty.common.block.BlockGem; +import biomesoplenty.common.block.BlockGem.GemType; +import biomesoplenty.common.world.feature.GeneratorFlora; +import biomesoplenty.common.world.feature.GeneratorGrass; +import biomesoplenty.common.world.feature.GeneratorOreSingle; +import biomesoplenty.common.world.feature.tree.GeneratorBasicTree; +import biomesoplenty.common.world.feature.tree.GeneratorBigTree; +import biomesoplenty.common.world.feature.tree.GeneratorBush; +import net.minecraft.block.BlockDirt; +import net.minecraft.block.BlockTallGrass; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase.Height; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraftforge.common.BiomeManager.BiomeType; + +public class BiomeGenDenseForest extends BOPBiome +{ + private static final Height biomeHeight = new Height(0.075F, 0.05F); + + public BiomeGenDenseForest() + { + this.setHeight(biomeHeight); + this.setColor(8246897); + this.setTemperatureRainfall(0.7F, 0.7F); + + this.addWeight(BiomeType.WARM, 7); + + this.addGenerator("bushes", GeneratorStage.FLOWERS, new GeneratorFlora(1, BlockBOPPlant.getVariantState(AllPlants.BUSH))); + this.addGenerator("berry_bushes", GeneratorStage.FLOWERS, new GeneratorFlora(1, BlockBOPPlant.getVariantState(AllPlants.BERRYBUSH))); + this.addGenerator("shrubs", GeneratorStage.FLOWERS, new GeneratorFlora(1, BlockBOPPlant.getVariantState(AllPlants.SHRUB))); + this.addGenerator("water_reeds", GeneratorStage.LILYPAD, new GeneratorFlora(2, BlockBOPPlant.getVariantState(AllPlants.REED), 128)); + + this.addGenerator("leaf_piles", GeneratorStage.FLOWERS, new GeneratorFlora(15, BlockBOPPlant.getVariantState(AllPlants.LEAFPILE), 256)); + + this.addGenerator("huge_trees", GeneratorStage.TREE, new GeneratorBigTree(7, false, 15, 25, Blocks.log.getDefaultState(), Blocks.leaves.getDefaultState())); + this.addGenerator("leaves_clusters", GeneratorStage.POST, new GeneratorBush(7, Blocks.log.getDefaultState(), Blocks.leaves.getDefaultState())); + + GeneratorWeighted grassGenerator = new GeneratorWeighted(10); + grassGenerator.add(1, new GeneratorGrass(1, BlockBOPPlant.getVariantState(AllPlants.WHEATGRASS))); + grassGenerator.add(1, new GeneratorGrass(1, BlockBOPPlant.getVariantState(AllPlants.DAMPGRASS))); + grassGenerator.add(1, new GeneratorGrass(1, Blocks.tallgrass.getDefaultState().withProperty(BlockTallGrass.TYPE, BlockTallGrass.EnumType.FERN))); + grassGenerator.add(2, new GeneratorGrass(1, Blocks.tallgrass.getDefaultState().withProperty(BlockTallGrass.TYPE, BlockTallGrass.EnumType.GRASS))); + this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator); + + this.addGenerator("amber", GeneratorStage.SAND, new GeneratorOreSingle(BOPBlocks.gem_ore.getDefaultState().withProperty(BlockGem.VARIANT, GemType.AMBER), 12, 4, 32)); + } + + @Override + public void genTerrainBlocks(World world, Random random, ChunkPrimer primer, int x, int z, double noise) + { + this.topBlock = Blocks.grass.getDefaultState(); + this.fillerBlock = Blocks.dirt.getDefaultState(); + + if (noise > 1.75D) + { + this.topBlock = Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT); + } + + this.generateBiomeTerrain(world, random, primer, x, z, noise); + } + + @Override + public int getGrassColorAtPos(BlockPos pos) + { + return 8246897; + } + + @Override + public int getFoliageColorAtPos(BlockPos pos) + { + return 10022742; + } +} diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenShrubland.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenShrubland.java index c01020686..ff111dcd3 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenShrubland.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenShrubland.java @@ -47,6 +47,7 @@ public class BiomeGenShrubland extends BOPBiome this.spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5, 2, 6)); this.addGenerator("gravel", GeneratorStage.SAND_PASS2, new GeneratorWaterside(4, 7, Blocks.gravel.getDefaultState())); + this.addGenerator("bushes", GeneratorStage.FLOWERS, new GeneratorFlora(7, BlockBOPPlant.getVariantState(AllPlants.BUSH))); this.addGenerator("shrubs", GeneratorStage.FLOWERS, new GeneratorFlora(5, BlockBOPPlant.getVariantState(AllPlants.SHRUB))); this.addGenerator("flax", GeneratorStage.FLOWERS, new GeneratorDoubleFlora(1, BOPBlocks.double_plant.getDefaultState().withProperty(VARIANT, FoliageType.FLAX).withProperty(HALF, Half.LOWER), BOPBlocks.double_plant.getDefaultState().withProperty(VARIANT, FoliageType.FLAX).withProperty(HALF, Half.UPPER), 24)); this.addGenerator("water_reeds", GeneratorStage.LILYPAD, new GeneratorFlora(3, BlockBOPPlant.getVariantState(AllPlants.REED), 128)); diff --git a/src/main/java/biomesoplenty/common/init/ModBiomes.java b/src/main/java/biomesoplenty/common/init/ModBiomes.java index 393638324..fd1f7f36f 100644 --- a/src/main/java/biomesoplenty/common/init/ModBiomes.java +++ b/src/main/java/biomesoplenty/common/init/ModBiomes.java @@ -20,6 +20,7 @@ import org.apache.commons.io.FileUtils; import biomesoplenty.common.biome.overworld.BiomeGenAlps; import biomesoplenty.common.biome.overworld.BiomeGenArctic; import biomesoplenty.common.biome.overworld.BiomeGenCrag; +import biomesoplenty.common.biome.overworld.BiomeGenDenseForest; import biomesoplenty.common.biome.overworld.BiomeGenFlowerField; import biomesoplenty.common.biome.overworld.BiomeGenLavenderFields; import biomesoplenty.common.biome.overworld.BiomeGenOriginValley; @@ -53,6 +54,7 @@ public class ModBiomes alps = registerBiome(new BiomeGenAlps().setBiomeName("Alps"), "alps"); arctic = registerBiome(new BiomeGenArctic().setBiomeName("Arctic"), "arctic"); crag = registerBiome(new BiomeGenCrag().setBiomeName("Crag"), "crag"); + denseForest = registerBiome(new BiomeGenDenseForest().setBiomeName("Dense Forest"), "dense_forest"); flowerField = registerBiome(new BiomeGenFlowerField().setBiomeName("Flower Field"), "flower_field"); lavenderFields = registerBiome(new BiomeGenLavenderFields().setBiomeName("Lavender Fields"), "lavender_fields"); originValley = registerBiome(new BiomeGenOriginValley().setBiomeName("Origin Valley"), "origin_valley"); diff --git a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorBasicTree.java b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorBasicTree.java index ccfaab249..8050db9f0 100644 --- a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorBasicTree.java +++ b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorBasicTree.java @@ -327,7 +327,5 @@ public class GeneratorBasicTree extends GeneratorCustomizable this.log = context.deserialize(json.get("log_state"), IBlockState.class); this.leaves = context.deserialize(json.get("leaves_state"), IBlockState.class); this.vine = context.deserialize(json.get("vine_state"), IBlockState.class); - - System.out.println(amountPerChunk + " " + updateNeighbours + " " + minHeight + " " + maxHeight + " " + log + " " + leaves); } } diff --git a/src/main/resources/assets/biomesoplenty/models/block/pink_cherry_leaves.json b/src/main/resources/assets/biomesoplenty/models/block/pink_cherry_leaves.json index 4425c6ccc..73f33dd03 100644 --- a/src/main/resources/assets/biomesoplenty/models/block/pink_cherry_leaves.json +++ b/src/main/resources/assets/biomesoplenty/models/block/pink_cherry_leaves.json @@ -1,5 +1,5 @@ { - "parent": "block/cube_all", + "parent": "block/leaves", "textures": { "all": "biomesoplenty:blocks/leaves_pink_cherry" } diff --git a/src/main/resources/assets/biomesoplenty/models/block/white_cherry_leaves.json b/src/main/resources/assets/biomesoplenty/models/block/white_cherry_leaves.json index 73ae9f739..5357cb96b 100644 --- a/src/main/resources/assets/biomesoplenty/models/block/white_cherry_leaves.json +++ b/src/main/resources/assets/biomesoplenty/models/block/white_cherry_leaves.json @@ -1,5 +1,5 @@ { - "parent": "block/cube_all", + "parent": "block/leaves", "textures": { "all": "biomesoplenty:blocks/leaves_white_cherry" }