From 6a5d87037668532db7719129a8ad4a72edf364d6 Mon Sep 17 00:00:00 2001 From: Forstride Date: Fri, 12 Feb 2016 19:04:56 -0500 Subject: [PATCH] Added option for trees to have alternate leaf blocks, and added flowering leaves to trees in some biomes --- .../biome/overworld/BiomeGenFungiForest.java | 5 ++-- .../biome/overworld/BiomeGenGarden.java | 3 +- .../common/biome/overworld/BiomeGenGrove.java | 11 +++---- .../overworld/BiomeGenLavenderFields.java | 2 +- .../biome/overworld/BiomeGenMysticGrove.java | 2 +- .../biome/overworld/BiomeGenOrchard.java | 3 +- .../biome/overworld/BiomeGenRainforest.java | 2 +- .../overworld/BiomeGenSacredSprings.java | 2 +- .../common/biome/vanilla/BiomeExtForest.java | 9 ++++++ .../common/block/BlockBOPSapling.java | 6 ++-- .../feature/tree/GeneratorBasicTree.java | 24 ++++++++++++--- .../feature/tree/GeneratorBayouTree.java | 7 +++-- .../world/feature/tree/GeneratorBigTree.java | 28 +++++++++++++++--- .../world/feature/tree/GeneratorBulbTree.java | 7 +++-- .../world/feature/tree/GeneratorBush.java | 23 +++++++++++--- .../world/feature/tree/GeneratorHugeTree.java | 4 +-- .../feature/tree/GeneratorMahoganyTree.java | 7 +++-- .../feature/tree/GeneratorMegaJungleTree.java | 7 +++-- .../world/feature/tree/GeneratorPineTree.java | 7 +++-- .../feature/tree/GeneratorProfileTree.java | 7 +++-- .../feature/tree/GeneratorRedwoodTree.java | 7 +++-- .../feature/tree/GeneratorTaigaTree.java | 7 +++-- .../world/feature/tree/GeneratorTreeBase.java | 28 +++++++++++++++++- .../feature/tree/GeneratorTwigletTree.java | 7 +++-- .../models/item/flowering_leaves.json | 2 +- .../textures/items/leaves_flowering.png | Bin 0 -> 612 bytes 26 files changed, 157 insertions(+), 60 deletions(-) create mode 100644 src/main/resources/assets/biomesoplenty/textures/items/leaves_flowering.png diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenFungiForest.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenFungiForest.java index 1e8620482..8ba633ae7 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenFungiForest.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenFungiForest.java @@ -14,7 +14,6 @@ import net.minecraft.block.BlockTallGrass; import net.minecraft.entity.passive.EntityMooshroom; import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; -import net.minecraft.world.biome.BiomeGenBase.SpawnListEntry; import biomesoplenty.api.biome.BOPBiome; import biomesoplenty.api.biome.generation.GeneratorStage; import biomesoplenty.api.biome.generation.GeneratorWeighted; @@ -28,13 +27,13 @@ import biomesoplenty.common.enums.BOPClimates; import biomesoplenty.common.enums.BOPFlowers; import biomesoplenty.common.enums.BOPGems; import biomesoplenty.common.enums.BOPPlants; +import biomesoplenty.common.enums.BOPTrees; import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod; import biomesoplenty.common.world.BOPWorldSettings; import biomesoplenty.common.world.feature.GeneratorBigMushroom; import biomesoplenty.common.world.feature.GeneratorColumns; import biomesoplenty.common.world.feature.GeneratorFlora; import biomesoplenty.common.world.feature.GeneratorGrass; -import biomesoplenty.common.world.feature.GeneratorMixedLily; import biomesoplenty.common.world.feature.GeneratorOreSingle; import biomesoplenty.common.world.feature.GeneratorSplotches; import biomesoplenty.common.world.feature.tree.GeneratorBush; @@ -73,7 +72,7 @@ public class BiomeGenFungiForest extends BOPBiome GeneratorWeighted treeGenerator = new GeneratorWeighted(12); this.addGenerator("trees", GeneratorStage.TREE, treeGenerator); treeGenerator.add("mega_oak", 1, (new GeneratorMegaJungleTree.Builder()).log(BlockPlanks.EnumType.OAK).leaves(BlockPlanks.EnumType.OAK).vine(BOPBlocks.ivy.getDefaultState()).create()); - treeGenerator.add("oak_bush", 1, (new GeneratorBush.Builder()).maxHeight(2).create()); + treeGenerator.add("oak_bush", 1, (new GeneratorBush.Builder()).maxHeight(2).altLeaves(BOPTrees.FLOWERING).create()); // grasses GeneratorWeighted grassGenerator = new GeneratorWeighted(5.0F); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenGarden.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenGarden.java index 877c494fa..f46a220f0 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenGarden.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenGarden.java @@ -26,6 +26,7 @@ import biomesoplenty.common.enums.BOPClimates; import biomesoplenty.common.enums.BOPFlowers; import biomesoplenty.common.enums.BOPGems; import biomesoplenty.common.enums.BOPPlants; +import biomesoplenty.common.enums.BOPTrees; import biomesoplenty.common.world.BOPWorldSettings; import biomesoplenty.common.world.feature.GeneratorBigFlower; import biomesoplenty.common.world.feature.GeneratorDoubleFlora; @@ -62,7 +63,7 @@ public class BiomeGenGarden extends BOPBiome this.addGenerator("trees", GeneratorStage.TREE, treeGenerator); treeGenerator.add("red_big_flowers", 1, (new GeneratorBigFlower.Builder()).flowerType(GeneratorBigFlower.BigFlowerType.RED).create()); treeGenerator.add("yellow_big_flowers", 1, (new GeneratorBigFlower.Builder()).flowerType(GeneratorBigFlower.BigFlowerType.YELLOW).create()); - treeGenerator.add("oak_bush", 2, (new GeneratorBush.Builder()).maxHeight(2).create()); + treeGenerator.add("oak_bush", 2, (new GeneratorBush.Builder()).maxHeight(2).altLeaves(BOPTrees.FLOWERING).create()); // grasses GeneratorWeighted grassGenerator = new GeneratorWeighted(6.0F); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenGrove.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenGrove.java index 91193ef80..c43c44899 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenGrove.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenGrove.java @@ -23,6 +23,7 @@ import biomesoplenty.common.enums.BOPClimates; import biomesoplenty.common.enums.BOPFlowers; import biomesoplenty.common.enums.BOPGems; import biomesoplenty.common.enums.BOPPlants; +import biomesoplenty.common.enums.BOPTrees; import biomesoplenty.common.world.BOPWorldSettings; import biomesoplenty.common.world.feature.GeneratorDoubleFlora; import biomesoplenty.common.world.feature.GeneratorFlora; @@ -52,8 +53,8 @@ public class BiomeGenGrove extends BOPBiome this.addGenerator("sprouts", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.SPROUT).create()); this.addGenerator("berry_bushes", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BOPPlants.BERRYBUSH).create()); this.addGenerator("bushes", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.4F).with(BOPPlants.BUSH).create()); - this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.3F).with(BOPPlants.SHRUB).create()); - this.addGenerator("clover_patches", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(3.0F).with(BOPPlants.CLOVERPATCH).create()); + this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.SHRUB).create()); + this.addGenerator("clover_patches", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.6F).with(BOPPlants.CLOVERPATCH).create()); this.addGenerator("leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.LEAFPILE).create()); // trees @@ -61,11 +62,11 @@ public class BiomeGenGrove extends BOPBiome this.addGenerator("trees", GeneratorStage.TREE, treeGenerator); treeGenerator.add("dark_poplar", 1, (new GeneratorProfileTree.Builder()).minHeight(6).maxHeight(14).log(BlockPlanks.EnumType.DARK_OAK).leaves(BlockPlanks.EnumType.DARK_OAK).profile(GeneratorProfileTree.TreeProfile.POPLAR).create()); treeGenerator.add("poplar", 1, (new GeneratorProfileTree.Builder()).minHeight(8).maxHeight(18).log(BlockPlanks.EnumType.BIRCH).leaves(BlockPlanks.EnumType.BIRCH).profile(GeneratorProfileTree.TreeProfile.POPLAR).create()); - treeGenerator.add("bush", 1, (new GeneratorBush.Builder()).maxHeight(2).create()); + treeGenerator.add("bush", 1, (new GeneratorBush.Builder()).maxHeight(2).altLeaves(BOPTrees.FLOWERING).create()); // flowers - GeneratorWeighted flowerGenerator = new GeneratorWeighted(5.0F); + GeneratorWeighted flowerGenerator = new GeneratorWeighted(3.0F); this.addGenerator("flowers", GeneratorStage.GRASS, flowerGenerator); flowerGenerator.add("clover", 4, (new GeneratorFlora.Builder().with(BOPFlowers.CLOVER).create())); flowerGenerator.add("white_anemones", 2, (new GeneratorFlora.Builder().with(BOPFlowers.WHITE_ANEMONE).create())); @@ -75,7 +76,7 @@ public class BiomeGenGrove extends BOPBiome flowerGenerator.add("poppy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.POPPY).create())); // grasses - GeneratorWeighted grassGenerator = new GeneratorWeighted(2.0F); + GeneratorWeighted grassGenerator = new GeneratorWeighted(9.0F); this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator); grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create()); grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create()); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenLavenderFields.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenLavenderFields.java index 402dbce6a..1088c4ac7 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenLavenderFields.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenLavenderFields.java @@ -52,7 +52,7 @@ public class BiomeGenLavenderFields extends BOPBiome GeneratorWeighted treeGenerator = new GeneratorWeighted(1); this.addGenerator("trees", GeneratorStage.TREE, treeGenerator); treeGenerator.add("jacaranda", 3, (new GeneratorBasicTree.Builder()).minHeight(4).maxHeight(7).log(BOPWoods.JACARANDA).leaves(BOPTrees.JACARANDA).create()); - treeGenerator.add("oak", 1, (new GeneratorBigTree.Builder()).create()); + treeGenerator.add("oak", 1, (new GeneratorBigTree.Builder()).altLeaves(BOPTrees.FLOWERING).create()); // grasses GeneratorWeighted grassGenerator = new GeneratorWeighted(15); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMysticGrove.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMysticGrove.java index e1daeb854..26463dcd9 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMysticGrove.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMysticGrove.java @@ -83,7 +83,7 @@ public class BiomeGenMysticGrove extends BOPBiome treeGenerator.add("flowering_vine", 2, (new GeneratorBasicTree.Builder()).minHeight(8).maxHeight(12).maxLeavesRadius(2).vine(BOPBlocks.flower_vine.getDefaultState()).create()); treeGenerator.add("magic", 9, (new GeneratorBasicTree.Builder()).log(BOPWoods.MAGIC).leaves(BOPTrees.MAGIC).create()); treeGenerator.add("jacaranda", 1, (new GeneratorBasicTree.Builder()).minHeight(4).maxHeight(7).log(BOPWoods.JACARANDA).leaves(BOPTrees.JACARANDA).create()); - treeGenerator.add("oak_large", 3, (new GeneratorBigTree.Builder()).create()); + treeGenerator.add("oak_large", 3, (new GeneratorBigTree.Builder()).altLeaves(BOPTrees.FLOWERING).create()); // grasses GeneratorWeighted grassGenerator = new GeneratorWeighted(3.0F); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenOrchard.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenOrchard.java index 6667016e4..22b7ddb86 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenOrchard.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenOrchard.java @@ -13,6 +13,7 @@ import biomesoplenty.common.enums.BOPClimates; import biomesoplenty.common.enums.BOPFlowers; import biomesoplenty.common.enums.BOPGems; import biomesoplenty.common.enums.BOPPlants; +import biomesoplenty.common.enums.BOPTrees; import biomesoplenty.common.world.BOPWorldSettings; import biomesoplenty.common.world.feature.GeneratorDoubleFlora; import biomesoplenty.common.world.feature.GeneratorFlora; @@ -50,7 +51,7 @@ public class BiomeGenOrchard extends BOPBiome // trees GeneratorWeighted treeGenerator = new GeneratorWeighted(4); this.addGenerator("trees", GeneratorStage.TREE, treeGenerator); - treeGenerator.add("oak_large", 1, (new GeneratorBigTree.Builder()).create()); + treeGenerator.add("oak_large", 1, (new GeneratorBigTree.Builder()).altLeaves(BOPTrees.FLOWERING).create()); // grasses GeneratorWeighted grassGenerator = new GeneratorWeighted(15); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenRainforest.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenRainforest.java index 3636b14b3..3621cb090 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenRainforest.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenRainforest.java @@ -59,7 +59,7 @@ public class BiomeGenRainforest extends BOPBiome GeneratorWeighted treeGenerator = new GeneratorWeighted(20); this.addGenerator("trees", GeneratorStage.TREE, treeGenerator); treeGenerator.add("birch", 1, (new GeneratorBasicTree.Builder()).log(BlockPlanks.EnumType.BIRCH).leaves(BlockPlanks.EnumType.BIRCH).minHeight(5).maxHeight(8).create()); - treeGenerator.add("oak", 4, (new GeneratorBasicTree.Builder()).minHeight(8).maxHeight(12).create()); + treeGenerator.add("oak", 4, (new GeneratorBasicTree.Builder()).minHeight(8).maxHeight(12).altLeaves(BOPTrees.FLOWERING).create()); treeGenerator.add("large_oak", 1, (new GeneratorBigTree.Builder()).log(BlockPlanks.EnumType.OAK).leaves(BlockPlanks.EnumType.OAK).create()); // grasses diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenSacredSprings.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenSacredSprings.java index 2e85ca036..bae265674 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenSacredSprings.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenSacredSprings.java @@ -57,7 +57,7 @@ public class BiomeGenSacredSprings extends BOPBiome // trees this.addGenerator("sacred_oak_trees", GeneratorStage.POST, (new GeneratorBigTree.Builder()).amountPerChunk(0.2F).log(BOPWoods.SACRED_OAK).leaves(BOPTrees.SACRED_OAK).minHeight(35).maxHeight(40).trunkWidth(2).foliageDensity(2.0D).create()); this.addGenerator("leaves_clusters", GeneratorStage.TREE, (new GeneratorBush.Builder()).amountPerChunk(12.5F).maxHeight(2).create()); - this.addGenerator("large_oak", GeneratorStage.TREE, (new GeneratorBigTree.Builder()).amountPerChunk(3.0F).log(BlockPlanks.EnumType.OAK).leaves(BlockPlanks.EnumType.OAK).create()); + this.addGenerator("large_oak", GeneratorStage.TREE, (new GeneratorBigTree.Builder()).amountPerChunk(3.0F).log(BlockPlanks.EnumType.OAK).leaves(BlockPlanks.EnumType.OAK).altLeaves(BOPTrees.FLOWERING).create()); // grasses GeneratorWeighted grassGenerator = new GeneratorWeighted(2.75F); diff --git a/src/main/java/biomesoplenty/common/biome/vanilla/BiomeExtForest.java b/src/main/java/biomesoplenty/common/biome/vanilla/BiomeExtForest.java index ad04feb90..f737311ab 100644 --- a/src/main/java/biomesoplenty/common/biome/vanilla/BiomeExtForest.java +++ b/src/main/java/biomesoplenty/common/biome/vanilla/BiomeExtForest.java @@ -13,11 +13,14 @@ import biomesoplenty.common.block.BlockBOPMushroom; import biomesoplenty.common.enums.BOPFlowers; import biomesoplenty.common.enums.BOPGems; import biomesoplenty.common.enums.BOPPlants; +import biomesoplenty.common.enums.BOPTrees; +import biomesoplenty.common.enums.BOPWoods; import biomesoplenty.common.world.BOPWorldSettings; import biomesoplenty.common.world.feature.GeneratorDoubleFlora; 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; public class BiomeExtForest extends ExtendedBiomeWrapper { @@ -30,6 +33,12 @@ public class BiomeExtForest extends ExtendedBiomeWrapper this.beachBiomeId = BOPBiomes.gravel_beach.get().biomeID; } + // trees + GeneratorWeighted treeGenerator = new GeneratorWeighted(0.5F); + this.addGenerator("trees", GeneratorStage.TREE, treeGenerator); + treeGenerator.add("flowering_oak", 1, (new GeneratorBasicTree.Builder()).altLeaves(BOPTrees.FLOWERING).create()); + + // grasses GeneratorWeighted grassGenerator = new GeneratorWeighted(5.0F); this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator); diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPSapling.java b/src/main/java/biomesoplenty/common/block/BlockBOPSapling.java index 7197e3685..cf81223cd 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPSapling.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPSapling.java @@ -184,8 +184,8 @@ public class BlockBOPSapling extends BlockBOPDecoration implements IGrowable { return new GeneratorBasicTree.Builder().log(BlockPlanks.EnumType.OAK).leaves(BOPTrees.MAPLE).minHeight(5).maxHeight(10).create(); case HELLBARK: //Not implemented return new WorldGenTrees(true); - case FLOWERING: //Not implemented - return new WorldGenTrees(true); + case FLOWERING: + return new GeneratorBasicTree.Builder().altLeaves(BOPTrees.FLOWERING).create(); case JACARANDA: return new GeneratorBasicTree.Builder().minHeight(4).maxHeight(7).log(BOPWoods.JACARANDA).leaves(BOPTrees.JACARANDA).create(); case SACRED_OAK: @@ -204,7 +204,7 @@ public class BlockBOPSapling extends BlockBOPDecoration implements IGrowable { return new GeneratorMahoganyTree.Builder().create(); case EBONY: return new GeneratorBigTree.Builder().log(BOPWoods.EBONY).leaves(BOPTrees.EBONY).minHeight(4).maxHeight(10).foliageHeight(1).create(); - case EUCALYPTUS: //Not implemented + case EUCALYPTUS: return new GeneratorBulbTree.Builder().minHeight(15).maxHeight(30).log(BOPWoods.EUCALYPTUS).leaves(BOPTrees.EUCALYPTUS).create(); default: return null; 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 e13e9e42b..9d9a8fd45 100644 --- a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorBasicTree.java +++ b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorBasicTree.java @@ -46,6 +46,7 @@ public class GeneratorBasicTree extends GeneratorTreeBase this.leaves = Blocks.leaves.getDefaultState(); this.vine = null; this.hanging = null; + this.altLeaves = null; this.minHeight = 4; this.maxHeight = 7; this.leafLayers = 4; @@ -59,7 +60,7 @@ public class GeneratorBasicTree extends GeneratorTreeBase @Override public GeneratorBasicTree create() { - return new GeneratorBasicTree(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.minHeight, this.maxHeight, false, this.leafLayers, this.leavesOffset, this.maxLeavesRadius, this.leavesLayerHeight, this.placeVinesOn, this.hangingChance); + return new GeneratorBasicTree(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.altLeaves, this.minHeight, this.maxHeight, false, this.leafLayers, this.leavesOffset, this.maxLeavesRadius, this.leavesLayerHeight, this.placeVinesOn, this.hangingChance); } } @@ -94,9 +95,9 @@ public class GeneratorBasicTree extends GeneratorTreeBase protected IBlockPosQuery placeVinesOn; protected float hangingChance; - public GeneratorBasicTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, int minHeight, int maxHeight, boolean updateNeighbours, int leafLayers, int leavesOffset, int maxLeavesRadius, int leavesLayerHeight, IBlockPosQuery placeVinesOn, float hangingChance) + public GeneratorBasicTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, IBlockState altLeaves, int minHeight, int maxHeight, boolean updateNeighbours, int leafLayers, int leavesOffset, int maxLeavesRadius, int leavesLayerHeight, IBlockPosQuery placeVinesOn, float hangingChance) { - super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, minHeight, maxHeight); + super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, altLeaves, minHeight, maxHeight); this.updateNeighbours = updateNeighbours; this.leavesOffset = leavesOffset; this.leafLayers = leafLayers; @@ -193,7 +194,21 @@ public class GeneratorBasicTree extends GeneratorTreeBase BlockPos leavesPos = new BlockPos(x, y, z); if (this.replace.matches(world, leavesPos)) { - this.setBlockAndNotifyAdequately(world, leavesPos, this.leaves); + if (this.altLeaves != null) + { + if (random.nextInt(4) == 0) + { + this.setBlockAndNotifyAdequately(world, leavesPos, this.altLeaves); + } + else + { + this.setBlockAndNotifyAdequately(world, leavesPos, this.leaves); + } + } + else + { + this.setBlockAndNotifyAdequately(world, leavesPos, this.leaves); + } } } } @@ -348,6 +363,7 @@ public class GeneratorBasicTree extends GeneratorTreeBase this.leaves = conf.getBlockState("leavesState", this.leaves); this.vine = conf.getBlockState("vineState", this.vine); this.hanging = conf.getBlockState("hangingState", this.hanging); + this.altLeaves = conf.getBlockState("altLeavesState", this.altLeaves); this.hangingChance = conf.getFloat("hangingChance", this.hangingChance); } diff --git a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorBayouTree.java b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorBayouTree.java index d7f6f24a5..409e89e1a 100644 --- a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorBayouTree.java +++ b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorBayouTree.java @@ -55,6 +55,7 @@ public class GeneratorBayouTree extends GeneratorTreeBase this.leaves = Blocks.leaves.getDefaultState(); this.vine = Blocks.vine.getDefaultState(); this.hanging = null; + this.altLeaves = null; this.minHeight = 8; this.maxHeight = 18; this.minLeavesRadius = 2; @@ -66,7 +67,7 @@ public class GeneratorBayouTree extends GeneratorTreeBase @Override public GeneratorBayouTree create() { - return new GeneratorBayouTree(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.minHeight, this.maxHeight, this.minLeavesRadius, this.leavesGradient, this.vineAttempts, this.maxVineLength, this.rootsReplace); + return new GeneratorBayouTree(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.altLeaves, this.minHeight, this.maxHeight, this.minLeavesRadius, this.leavesGradient, this.vineAttempts, this.maxVineLength, this.rootsReplace); } } @@ -77,9 +78,9 @@ public class GeneratorBayouTree extends GeneratorTreeBase private int maxVineLength; private IBlockPosQuery rootsReplace; - public GeneratorBayouTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, int minHeight, int maxHeight, int minLeavesRadius, int leavesGradient, int vineAttempts, int maxVineLength, IBlockPosQuery rootsReplace) + public GeneratorBayouTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, IBlockState altLeaves, int minHeight, int maxHeight, int minLeavesRadius, int leavesGradient, int vineAttempts, int maxVineLength, IBlockPosQuery rootsReplace) { - super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, minHeight, maxHeight); + super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, altLeaves, minHeight, maxHeight); this.minLeavesRadius = minLeavesRadius; this.leavesGradient = leavesGradient; this.vineAttempts = vineAttempts; diff --git a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorBigTree.java b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorBigTree.java index 1827a565d..d54e375b1 100644 --- a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorBigTree.java +++ b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorBigTree.java @@ -53,6 +53,7 @@ public class GeneratorBigTree extends GeneratorTreeBase this.leaves = Blocks.leaves.getDefaultState(); this.vine = null; this.hanging = null; + this.altLeaves = null; this.minHeight = 5; this.maxHeight = 17; @@ -70,7 +71,7 @@ public class GeneratorBigTree extends GeneratorTreeBase @Override public GeneratorBigTree create() { - return new GeneratorBigTree(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.minHeight, this.maxHeight, this.trunkWidth, this.foliageHeight, this.foliageDensity, false); + return new GeneratorBigTree(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.altLeaves, this.minHeight, this.maxHeight, this.trunkWidth, this.foliageHeight, this.foliageDensity, false); } } @@ -95,9 +96,9 @@ public class GeneratorBigTree extends GeneratorTreeBase private List foliageCoords; - public GeneratorBigTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, int minHeight, int maxHeight, int trunkWidth, int foliageHeight, double foliageDensity, boolean updateNeighbours) + public GeneratorBigTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, IBlockState altLeaves, int minHeight, int maxHeight, int trunkWidth, int foliageHeight, double foliageDensity, boolean updateNeighbours) { - super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, minHeight, maxHeight); + super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, altLeaves, minHeight, maxHeight); this.foliageHeight = foliageHeight; this.foliageDensity = foliageDensity; this.trunkWidth = trunkWidth; @@ -271,7 +272,26 @@ public class GeneratorBigTree extends GeneratorTreeBase for (int y = 0; y < foliageHeight; y++) { - crossection(blockPos.up(y), foliageShape(y), this.leaves); + if (this.altLeaves != null) + { + IBlockState clusterLeaves = this.leaves; + int rand = new Random().nextInt(4); + + if (rand == 0) + { + clusterLeaves = this.altLeaves; + } + else + { + clusterLeaves = this.leaves; + } + + crossection(blockPos.up(y), foliageShape(y), clusterLeaves); + } + else + { + crossection(blockPos.up(y), foliageShape(y), this.leaves); + } } } diff --git a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorBulbTree.java b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorBulbTree.java index 13a7368c3..ac68181eb 100644 --- a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorBulbTree.java +++ b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorBulbTree.java @@ -36,19 +36,20 @@ public class GeneratorBulbTree extends GeneratorTreeBase this.leaves = Blocks.leaves.getDefaultState(); this.vine = null; this.hanging = null; + this.altLeaves = null; } @Override public GeneratorBulbTree create() { - return new GeneratorBulbTree(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.minHeight, this.maxHeight); + return new GeneratorBulbTree(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.altLeaves, this.minHeight, this.maxHeight); } } - public GeneratorBulbTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, int minHeight, int maxHeight) + public GeneratorBulbTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, IBlockState altLeaves, int minHeight, int maxHeight) { - super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, minHeight, maxHeight); + super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, altLeaves, minHeight, maxHeight); } public boolean setCocoa(World world, BlockPos pos, EnumFacing side) diff --git a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorBush.java b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorBush.java index c7e36561f..57482479f 100644 --- a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorBush.java +++ b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorBush.java @@ -34,18 +34,19 @@ public class GeneratorBush extends GeneratorTreeBase this.leaves = Blocks.leaves.getDefaultState(); this.vine = null; this.hanging = null; + this.altLeaves = null; } @Override public GeneratorBush create() { - return new GeneratorBush(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.minHeight, this.maxHeight); + return new GeneratorBush(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.altLeaves, this.minHeight, this.maxHeight); } } - public GeneratorBush(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, int minHeight, int maxHeight) + public GeneratorBush(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, IBlockState altLeaves, int minHeight, int maxHeight) { - super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, minHeight, maxHeight); + super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, altLeaves, minHeight, maxHeight); } @Override @@ -79,7 +80,21 @@ public class GeneratorBush extends GeneratorTreeBase //Randomly prevent the generation of leaves on the corners of each layer if (Math.abs(x) < leavesRadius || Math.abs(z) < leavesRadius || random.nextInt(2) != 0) { - this.setLeaves(world, pos.add(x, y, z)); + if (this.altLeaves != null) + { + if (random.nextInt(4) == 0) + { + this.setAltLeaves(world, pos.add(x, y, z)); + } + else + { + this.setLeaves(world, pos.add(x, y, z)); + } + } + else + { + this.setLeaves(world, pos.add(x, y, z)); + } } } } diff --git a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorHugeTree.java b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorHugeTree.java index fcb931647..14b0b5b75 100644 --- a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorHugeTree.java +++ b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorHugeTree.java @@ -20,8 +20,8 @@ import net.minecraft.world.World; public abstract class GeneratorHugeTree extends GeneratorTreeBase { - protected GeneratorHugeTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, int minHeight, int maxHeight) { - super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, minHeight, maxHeight); + protected GeneratorHugeTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, IBlockState altLeaves, int minHeight, int maxHeight) { + super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, altLeaves, minHeight, maxHeight); } protected int chooseHeight(Random rand) diff --git a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorMahoganyTree.java b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorMahoganyTree.java index e9e4a30d1..079703e75 100644 --- a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorMahoganyTree.java +++ b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorMahoganyTree.java @@ -35,6 +35,7 @@ public class GeneratorMahoganyTree extends GeneratorBasicTree this.leaves = BlockBOPLeaves.paging.getVariantState(BOPTrees.MAHOGANY); this.vine = null; this.hanging = null; + this.altLeaves = null; this.minHeight = 10; this.maxHeight = 15; this.leafLayers = 4; @@ -48,13 +49,13 @@ public class GeneratorMahoganyTree extends GeneratorBasicTree @Override public GeneratorMahoganyTree create() { - return new GeneratorMahoganyTree(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.minHeight, this.maxHeight, false, this.leafLayers, this.leavesOffset, this.maxLeavesRadius, this.leavesLayerHeight, this.placeVinesOn, this.hangingChance); + return new GeneratorMahoganyTree(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.altLeaves, this.minHeight, this.maxHeight, false, this.leafLayers, this.leavesOffset, this.maxLeavesRadius, this.leavesLayerHeight, this.placeVinesOn, this.hangingChance); } } - public GeneratorMahoganyTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, int minHeight, int maxHeight, boolean updateNeighbours, int leafLayers, int leavesOffset, int minLeavesRadius, int leavesLayerHeight, IBlockPosQuery placeVinesOn, float hangingChance) + public GeneratorMahoganyTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, IBlockState altLeaves, int minHeight, int maxHeight, boolean updateNeighbours, int leafLayers, int leavesOffset, int minLeavesRadius, int leavesLayerHeight, IBlockPosQuery placeVinesOn, float hangingChance) { - super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, minHeight, maxHeight, updateNeighbours, leafLayers, leavesOffset, minLeavesRadius, leavesLayerHeight, placeVinesOn, hangingChance); + super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, altLeaves, minHeight, maxHeight, updateNeighbours, leafLayers, leavesOffset, minLeavesRadius, leavesLayerHeight, placeVinesOn, hangingChance); } @Override diff --git a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorMegaJungleTree.java b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorMegaJungleTree.java index 2f0a75070..22e6f7752 100644 --- a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorMegaJungleTree.java +++ b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorMegaJungleTree.java @@ -36,18 +36,19 @@ public class GeneratorMegaJungleTree extends GeneratorHugeTree this.leaves(BlockPlanks.EnumType.JUNGLE); this.vine = Blocks.vine.getDefaultState(); this.hanging = null; + this.altLeaves = null; } @Override public GeneratorMegaJungleTree create() { - return new GeneratorMegaJungleTree(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.minHeight, this.maxHeight); + return new GeneratorMegaJungleTree(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.altLeaves, this.minHeight, this.maxHeight); } } - protected GeneratorMegaJungleTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, int minHeight, int maxHeight) + protected GeneratorMegaJungleTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, IBlockState altLeaves, int minHeight, int maxHeight) { - super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, minHeight, maxHeight); + super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, altLeaves, minHeight, maxHeight); } diff --git a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorPineTree.java b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorPineTree.java index 3bd1335cb..1da8825e7 100644 --- a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorPineTree.java +++ b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorPineTree.java @@ -36,18 +36,19 @@ public class GeneratorPineTree extends GeneratorTreeBase this.leaves = Blocks.leaves.getDefaultState(); this.vine = null; this.hanging = hanging; + this.altLeaves = null; } @Override public GeneratorPineTree create() { - return new GeneratorPineTree(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.minHeight, this.maxHeight); + return new GeneratorPineTree(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.altLeaves, this.minHeight, this.maxHeight); } } - public GeneratorPineTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, int minHeight, int maxHeight) + public GeneratorPineTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, IBlockState altLeaves, int minHeight, int maxHeight) { - super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, minHeight, maxHeight); + super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, altLeaves, minHeight, maxHeight); } diff --git a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorProfileTree.java b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorProfileTree.java index 7f44572a1..fb3bfcf8c 100644 --- a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorProfileTree.java +++ b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorProfileTree.java @@ -39,21 +39,22 @@ public class GeneratorProfileTree extends GeneratorTreeBase this.leaves = Blocks.leaves.getDefaultState(); this.vine = null; this.hanging = null; + this.altLeaves = null; this.profile = TreeProfile.POPLAR; } @Override public GeneratorProfileTree create() { - return new GeneratorProfileTree(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.minHeight, this.maxHeight, this.profile); + return new GeneratorProfileTree(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.altLeaves, this.minHeight, this.maxHeight, this.profile); } } protected TreeProfile profile; - public GeneratorProfileTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, int minHeight, int maxHeight, TreeProfile profile) + public GeneratorProfileTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, IBlockState altLeaves, int minHeight, int maxHeight, TreeProfile profile) { - super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, minHeight, maxHeight); + super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, altLeaves, minHeight, maxHeight); this.profile = profile; } diff --git a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorRedwoodTree.java b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorRedwoodTree.java index a86fdae6e..b79c58b83 100644 --- a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorRedwoodTree.java +++ b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorRedwoodTree.java @@ -41,19 +41,20 @@ public class GeneratorRedwoodTree extends GeneratorTreeBase this.leaves = BlockBOPLeaves.paging.getVariantState(BOPTrees.REDWOOD); this.vine = null; this.hanging = null; + this.altLeaves = null; } @Override public GeneratorRedwoodTree create() { - return new GeneratorRedwoodTree(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.minHeight, this.maxHeight); + return new GeneratorRedwoodTree(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.altLeaves, this.minHeight, this.maxHeight); } } - protected GeneratorRedwoodTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, int minHeight, int maxHeight) + protected GeneratorRedwoodTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, IBlockState altLeaves, int minHeight, int maxHeight) { - super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, minHeight, maxHeight); + super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, altLeaves, minHeight, maxHeight); } public boolean canPlaceHere(World world, BlockPos pos, int height, int radius) diff --git a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorTaigaTree.java b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorTaigaTree.java index f36fe103b..b4fcb4dca 100644 --- a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorTaigaTree.java +++ b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorTaigaTree.java @@ -43,21 +43,22 @@ public class GeneratorTaigaTree extends GeneratorTreeBase this.leaves = Blocks.leaves.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.SPRUCE); this.vine = Blocks.vine.getDefaultState(); this.hanging = null; + this.altLeaves = null; this.trunkWidth = 1; } @Override public GeneratorTaigaTree create() { - return new GeneratorTaigaTree(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.minHeight, this.maxHeight, this.trunkWidth); + return new GeneratorTaigaTree(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.altLeaves, this.minHeight, this.maxHeight, this.trunkWidth); } } private int trunkWidth; - public GeneratorTaigaTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, int minHeight, int maxHeight, int trunkWidth) + public GeneratorTaigaTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, IBlockState altLeaves, int minHeight, int maxHeight, int trunkWidth) { - super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, minHeight, maxHeight); + super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, altLeaves, minHeight, maxHeight); this.trunkWidth = trunkWidth; } diff --git a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorTreeBase.java b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorTreeBase.java index 8c90f14e8..ffc5feb9a 100644 --- a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorTreeBase.java +++ b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorTreeBase.java @@ -47,11 +47,12 @@ public abstract class GeneratorTreeBase extends BOPGeneratorBase protected IBlockState leaves; protected IBlockState vine; protected IBlockState hanging; + protected IBlockState altLeaves; protected int minHeight; protected int maxHeight; protected IProperty logAxisProperty; - protected GeneratorTreeBase(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, int minHeight, int maxHeight) { + protected GeneratorTreeBase(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, IBlockState altLeaves, int minHeight, int maxHeight) { super(amountPerChunk); this.placeOn = placeOn; this.replace = replace; @@ -59,6 +60,7 @@ public abstract class GeneratorTreeBase extends BOPGeneratorBase this.leaves = leaves; this.vine = vine; this.hanging = hanging; + this.altLeaves = altLeaves; this.minHeight = minHeight; this.maxHeight = maxHeight; this.logAxisProperty = GeneratorUtils.getAxisProperty(log); @@ -72,6 +74,7 @@ public abstract class GeneratorTreeBase extends BOPGeneratorBase protected IBlockState leaves; protected IBlockState vine; protected IBlockState hanging; + protected IBlockState altLeaves; protected int minHeight; protected int maxHeight; @@ -122,6 +125,19 @@ public abstract class GeneratorTreeBase extends BOPGeneratorBase return this.self(); } + public T altLeaves(IBlockState a) {this.altLeaves = a; return this.self();} + public T altLeaves(BOPTrees a) {this.altLeaves = BlockBOPLeaves.paging.getVariantState(a).withProperty(BlockLeaves.CHECK_DECAY, false); return this.self();} + public T altLeaves(BlockPlanks.EnumType a) + { + if (a.getMetadata() < 4) + { + this.altLeaves = Blocks.leaves.getDefaultState().withProperty(BlockLeaves.CHECK_DECAY, false).withProperty(BlockOldLeaf.VARIANT, a); + } else { + this.altLeaves = Blocks.leaves2.getDefaultState().withProperty(BlockLeaves.CHECK_DECAY, false).withProperty(BlockNewLeaf.VARIANT, a); + } + return this.self(); + } + public T minHeight(int a) {this.minHeight = a; return this.self();} public T maxHeight(int a) {this.maxHeight = a; return this.self();} @@ -185,4 +201,14 @@ public abstract class GeneratorTreeBase extends BOPGeneratorBase } return false; } + + public boolean setAltLeaves(World world, BlockPos pos) + { + if (this.replace.matches(world, pos)) + { + world.setBlockState(pos, this.altLeaves, 2); + return true; + } + return false; + } } \ No newline at end of file diff --git a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorTwigletTree.java b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorTwigletTree.java index 23099101c..40b03e18f 100644 --- a/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorTwigletTree.java +++ b/src/main/java/biomesoplenty/common/world/feature/tree/GeneratorTwigletTree.java @@ -40,22 +40,23 @@ public class GeneratorTwigletTree extends GeneratorTreeBase this.leaves = Blocks.leaves.getDefaultState(); this.vine = null; this.hanging = null; + this.altLeaves = null; this.leafChanceEven = 0.2F; this.leafChanceOdd = 0.9F; } @Override public GeneratorTwigletTree create() { - return new GeneratorTwigletTree(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.minHeight, this.maxHeight, this.leafChanceEven, this.leafChanceOdd); + return new GeneratorTwigletTree(this.amountPerChunk, this.placeOn, this.replace, this.log, this.leaves, this.vine, this.hanging, this.altLeaves, this.minHeight, this.maxHeight, this.leafChanceEven, this.leafChanceOdd); } } private float leafChanceEven; private float leafChanceOdd; - public GeneratorTwigletTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, int minHeight, int maxHeight, float leafChanceEven, float leafChanceOdd) + public GeneratorTwigletTree(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState log, IBlockState leaves, IBlockState vine, IBlockState hanging, IBlockState altLeaves, int minHeight, int maxHeight, float leafChanceEven, float leafChanceOdd) { - super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, minHeight, maxHeight); + super(amountPerChunk, placeOn, replace, log, leaves, vine, hanging, altLeaves, minHeight, maxHeight); this.leafChanceEven = leafChanceEven; this.leafChanceOdd = leafChanceOdd; } diff --git a/src/main/resources/assets/biomesoplenty/models/item/flowering_leaves.json b/src/main/resources/assets/biomesoplenty/models/item/flowering_leaves.json index 48650f47f..3ef44d034 100644 --- a/src/main/resources/assets/biomesoplenty/models/item/flowering_leaves.json +++ b/src/main/resources/assets/biomesoplenty/models/item/flowering_leaves.json @@ -1,5 +1,5 @@ { - "parent": "biomesoplenty:block/flowering_leaves", + "parent": "biomesoplenty:items/flowering_leaves", "display": { "thirdperson": { "rotation": [ 10, -45, 170 ], diff --git a/src/main/resources/assets/biomesoplenty/textures/items/leaves_flowering.png b/src/main/resources/assets/biomesoplenty/textures/items/leaves_flowering.png new file mode 100644 index 0000000000000000000000000000000000000000..af60ea11bd33d8db9f6e34139415672eae32d7c3 GIT binary patch literal 612 zcmV-q0-ODbP)<{97<5HgbW?9;ba!ELWdLwtX>N2bZe?^J zG%heMIczh2P5=M_;z>k7R5(vvQ^`&OK@goAV8od*QN-n@q9Edk#(huJZ}8wsP$3%k z6}K3_fD?QiCm><_hH_rD)qs_d>8h@NwY-NBNq3Rqn)7N=^xCB0x|e;i;l0i_AJ(^` za;BawGDZ*m?9BdjQ{+N{^({9+klZ`xVL$$1Q~cAWz=FDO%`?W5eyZ2&eCcE?n!Gjn zGJ0haDh+J;_&$8DicG)R9LJfhQmIfjo1jvuL>MP@tU5yyI_sVHFmUKZ#gQW&8_^q+ z@GBOJ9Ejap6j)U4A!#h39>L@sKI_s&xSi1h<)9Lh`Zs;-14t?bR~2aghPoTscNZL3 z^6I%Tza(J?vB&0&L%SWiLx2X?yu?6AjDOjD5qq$B%K*W`#!nS6fU4Ch<@0GOm&l-l~A_5mP@)MJ5PKDY)Da4VuJ6bk$u-0?Ap yEE3&?q%F6b}&q0000