From ba0e812ec167bb87fcce071c7fbcefec52dbdb6b Mon Sep 17 00:00:00 2001 From: Forstride Date: Mon, 3 May 2021 20:30:00 -0400 Subject: [PATCH] Added alternate generation style for hellbark trees/saplings to make collecting wood easier --- .../java/biomesoplenty/common/block/trees/HellbarkTree.java | 2 +- .../common/world/gen/feature/BOPConfiguredFeatures.java | 3 ++- .../biomesoplenty/common/world/gen/feature/BOPFeatures.java | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/biomesoplenty/common/block/trees/HellbarkTree.java b/src/main/java/biomesoplenty/common/block/trees/HellbarkTree.java index 7c898f992..e3287be4f 100644 --- a/src/main/java/biomesoplenty/common/block/trees/HellbarkTree.java +++ b/src/main/java/biomesoplenty/common/block/trees/HellbarkTree.java @@ -10,6 +10,6 @@ public class HellbarkTree extends TreeDefaultConfig @Override protected Feature getFeature(Random random) { - return BOPFeatures.HELLBARK_TREE; + return (random.nextInt(10) == 0 ? BOPFeatures.BIG_HELLBARK_TREE : BOPFeatures.HELLBARK_TREE); } } \ No newline at end of file diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/BOPConfiguredFeatures.java b/src/main/java/biomesoplenty/common/world/gen/feature/BOPConfiguredFeatures.java index 3c8c2cf0b..32e4c973e 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/BOPConfiguredFeatures.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/BOPConfiguredFeatures.java @@ -36,6 +36,7 @@ public class BOPConfiguredFeatures public static final ConfiguredFeature ACACIA_TWIGLET_TREE = register("acacia_twiglet_tree", BOPFeatures.ACACIA_TWIGLET_TREE.configured(Features.OAK.config())); public static final ConfiguredFeature ALPS_SPRUCE_TREE = register("alps_spruce_tree", BOPFeatures.ALPS_SPRUCE_TREE.configured(Features.OAK.config())); public static final ConfiguredFeature BIG_FLOWERING_OAK_TREE = register("big_flowering_oak_tree", BOPFeatures.BIG_FLOWERING_OAK_TREE.configured(Features.OAK.config())); + public static final ConfiguredFeature BIG_HELLBARK_TREE = register("big_hellbark_tree", BOPFeatures.BIG_HELLBARK_TREE.configured(Features.OAK.config())); public static final ConfiguredFeature BIG_JACARANDA_TREE = register("big_jacaranda_tree", BOPFeatures.BIG_JACARANDA_TREE.configured(Features.OAK.config())); public static final ConfiguredFeature BIG_MAGIC_TREE = register("big_magic_tree", BOPFeatures.BIG_MAGIC_TREE.configured(Features.OAK.config())); public static final ConfiguredFeature BIG_MAPLE_TREE = register("big_maple_tree", BOPFeatures.BIG_MAPLE_TREE.configured(Features.OAK.config())); @@ -158,7 +159,7 @@ public class BOPConfiguredFeatures public static final ConfiguredFeature TROPICS_TREES = register("tropics_trees", Feature.RANDOM_SELECTOR.configured(new MultipleRandomFeatureConfig(ImmutableList.of(JUNGLE_TWIGLET_TREE.weighted(0.3F), FLOWERING_BUSH.weighted(0.1F)), PALM_TREE)).decorated(Features.Placements.HEIGHTMAP_SQUARE).decorated(Placement.COUNT_EXTRA.configured(new AtSurfaceWithExtraConfig(11, 0.2F, 1)))); public static final ConfiguredFeature TUNDRA_TREES = register("tundra_trees", Feature.RANDOM_SELECTOR.configured(new MultipleRandomFeatureConfig(ImmutableList.of(DEAD_TWIGLET_TREE_SMALL.weighted(0.1F)), MAPLE_TWIGLET_TREE)).decorated(Features.Placements.HEIGHTMAP_SQUARE).decorated(Placement.COUNT_EXTRA.configured(new AtSurfaceWithExtraConfig(1, 0.3F, 1)))); public static final ConfiguredFeature TUNDRA_BOG_TREES = register("tundra_bog_trees", Feature.RANDOM_SELECTOR.configured(new MultipleRandomFeatureConfig(ImmutableList.of(SPRUCE_TWIGLET_TREE.weighted(0.4F), MAPLE_TWIGLET_TREE.weighted(0.6F)), TWIGLET_TREE)).decorated(Features.Placements.HEIGHTMAP_SQUARE).decorated(Placement.COUNT_EXTRA.configured(new AtSurfaceWithExtraConfig(16, 0.4F, 1)))); - public static final ConfiguredFeature UNDERGROWTH_TREES = register("undergrowth_trees", HELLBARK_TREE.decorated(Features.Placements.HEIGHTMAP_DOUBLE_SQUARE.count(35))); + public static final ConfiguredFeature UNDERGROWTH_TREES = register("undergrowth_trees", Feature.RANDOM_SELECTOR.configured(new MultipleRandomFeatureConfig(ImmutableList.of(BIG_HELLBARK_TREE.weighted(0.1F)), HELLBARK_TREE)).decorated(Features.Placements.HEIGHTMAP_DOUBLE_SQUARE.count(35))); public static final ConfiguredFeature VOLCANIC_PLAINS_TREES = register("volcanic_plains_trees", TWIGLET_TREE_VOLCANO.decorated(Features.Placements.HEIGHTMAP_SQUARE).decorated(Placement.COUNT_EXTRA.configured(new AtSurfaceWithExtraConfig(1, 0.1F, 1)))); public static final ConfiguredFeature WASTELAND_TREES = register("wasteland_trees", Feature.RANDOM_SELECTOR.configured(new MultipleRandomFeatureConfig(ImmutableList.of(DEAD_TREE_WASTELAND.weighted(0.2F)), DYING_TREE_WASTELAND)).decorated(Features.Placements.HEIGHTMAP_SQUARE).decorated(Placement.COUNT_EXTRA.configured(new AtSurfaceWithExtraConfig((int)0.8F, 0.2F, 1)))); public static final ConfiguredFeature WETLAND_TREES = register("wetland_trees", Feature.RANDOM_SELECTOR.configured(new MultipleRandomFeatureConfig(ImmutableList.of(TALL_SPRUCE_TREE.weighted(0.5F)), WILLOW_TREE)).decorated(Features.Placements.HEIGHTMAP_SQUARE).decorated(Placement.COUNT_EXTRA.configured(new AtSurfaceWithExtraConfig(5, 0.1F, 1)))); diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/BOPFeatures.java b/src/main/java/biomesoplenty/common/world/gen/feature/BOPFeatures.java index 736558edd..7624acf45 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/BOPFeatures.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/BOPFeatures.java @@ -101,6 +101,7 @@ public class BOPFeatures public static final Feature DEAD_TWIGLET_TREE = register("dead_twiglet_tree", new TwigletTreeFeature.Builder().trunkFruit(BOPBlocks.dead_branch.defaultBlockState()).leafChance(0.05F, 0.25F).leaves(BOPBlocks.dead_leaves.defaultBlockState()).log(BOPBlocks.dead_log.defaultBlockState()).minHeight(4).maxHeight(7).create()); public static final Feature DEAD_TWIGLET_TREE_TALL = register("dead_twiglet_tree_tall", new TwigletTreeFeature.Builder().trunkFruit(BOPBlocks.dead_branch.defaultBlockState()).leafChance(0.15F, 0.6F).leaves(BOPBlocks.dead_leaves.defaultBlockState()).log(BOPBlocks.dead_log.defaultBlockState()).minHeight(8).maxHeight(12).create()); public static final Feature TWIGLET_TREE_VOLCANO = register("twiglet_tree_volcano", new TwigletTreeFeature.Builder().placeOn((world, pos) -> world.getBlockState(pos).getBlock() == BOPBlocks.black_sand).log(Blocks.DARK_OAK_LOG.defaultBlockState()).leaves(Blocks.DARK_OAK_LEAVES.defaultBlockState()).minHeight(1).maxHeight(2).create()); + public static final Feature BIG_HELLBARK_TREE = register("big_hellbark_tree", new TwigletTreeFeature.Builder().placeOn((world, pos) -> world.getBlockState(pos).getBlock() == Blocks.NETHERRACK || world.getBlockState(pos).canSustainPlant(world, pos, Direction.UP, (SaplingBlock)Blocks.OAK_SAPLING)).log(BOPBlocks.hellbark_log.defaultBlockState()).leaves(BOPBlocks.hellbark_leaves.defaultBlockState()).minHeight(3).maxHeight(7).create()); //Special Trees public static final Feature REDWOOD_TREE = register("redwood_tree", new RedwoodTreeFeature.Builder().create());