added Pine forest and Mixed forest, started pine trees and birch trees

This commit is contained in:
Halbear
2026-08-03 22:49:24 +01:00
parent 7d8a000ba6
commit a7dda26cdd
23 changed files with 913 additions and 59 deletions
@@ -0,0 +1,9 @@
{
"type": "neoforge:add_features",
"biomes": [
"ageofthegods:mixed_forest",
"ageofthegods:pine_forest"
],
"features": "ageofthegods:pine_tree_placed",
"step": "vegetal_decoration"
}
@@ -0,0 +1,6 @@
{
"type": "neoforge:add_features",
"biomes": "ageofthegods:mixed_forest",
"features": "ageofthegods:tall_thin_birch_tree_placed",
"step": "vegetal_decoration"
}
@@ -2,6 +2,7 @@
"type": "neoforge:add_features",
"biomes": [
"ageofthegods:garrigue",
"ageofthegods:mixed_forest",
"ageofthegods:mediterranean_forest"
],
"features": "ageofthegods:short_garrigue_twisty_tree_placed",
@@ -1,6 +1,9 @@
{
"type": "neoforge:add_features",
"biomes": "ageofthegods:mediterranean_forest",
"biomes": [
"ageofthegods:mediterranean_forest",
"ageofthegods:mixed_forest"
],
"features": "ageofthegods:twisty_tree_placed",
"step": "vegetal_decoration"
}
@@ -2,6 +2,7 @@
"type": "neoforge:add_features",
"biomes": [
"ageofthegods:garrigue",
"ageofthegods:mixed_forest",
"ageofthegods:mediterranean_forest"
],
"features": "ageofthegods:limestone_boulder_placed",
@@ -0,0 +1,64 @@
{
"type": "minecraft:tree",
"config": {
"below_trunk_provider": {
"type": "minecraft:rule_based_state_provider",
"rules": [
{
"if_true": {
"type": "minecraft:not",
"predicate": {
"type": "minecraft:matching_block_tag",
"tag": "minecraft:cannot_replace_below_tree_trunk"
}
},
"then": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "minecraft:dirt"
}
}
}
]
},
"decorators": [],
"foliage_placer": {
"type": "ageofthegods:pine_leaves_foliage_placer",
"offset": 0,
"radius": 1
},
"foliage_provider": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "minecraft:spruce_leaves",
"Properties": {
"distance": "7",
"persistent": "false",
"waterlogged": "false"
}
}
},
"ignore_vines": false,
"minimum_size": {
"type": "minecraft:two_layers_feature_size",
"limit": 3,
"lower_size": 1,
"upper_size": 3
},
"trunk_placer": {
"type": "ageofthegods:pine_trunk_pacer",
"base_height": 21,
"height_rand_a": 4,
"height_rand_b": 5
},
"trunk_provider": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "minecraft:spruce_log",
"Properties": {
"axis": "y"
}
}
}
}
}
@@ -0,0 +1,64 @@
{
"type": "minecraft:tree",
"config": {
"below_trunk_provider": {
"type": "minecraft:rule_based_state_provider",
"rules": [
{
"if_true": {
"type": "minecraft:not",
"predicate": {
"type": "minecraft:matching_block_tag",
"tag": "minecraft:cannot_replace_below_tree_trunk"
}
},
"then": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "minecraft:dirt"
}
}
}
]
},
"decorators": [],
"foliage_placer": {
"type": "ageofthegods:spherical_foliage_placer",
"offset": 0,
"radius": 1
},
"foliage_provider": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "minecraft:birch_leaves",
"Properties": {
"distance": "7",
"persistent": "false",
"waterlogged": "false"
}
}
},
"ignore_vines": false,
"minimum_size": {
"type": "minecraft:two_layers_feature_size",
"limit": 3,
"lower_size": 1,
"upper_size": 3
},
"trunk_placer": {
"type": "ageofthegods:tall_twisty_trunk_placer",
"base_height": 15,
"height_rand_a": 10,
"height_rand_b": 10
},
"trunk_provider": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "minecraft:birch_log",
"Properties": {
"axis": "y"
}
}
}
}
}
@@ -0,0 +1,44 @@
{
"feature": "ageofthegods:pine_tree",
"placement": [
{
"type": "minecraft:count",
"count": 20
},
{
"type": "minecraft:rarity_filter",
"chance": 6
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "OCEAN_FLOOR"
},
{
"type": "minecraft:block_predicate_filter",
"predicate": {
"type": "minecraft:matching_blocks",
"blocks": [
"ageofthegods:shale_grass_block",
"minecraft:sandstone",
"ageofthegods:shale_block",
"ageofthegods:limestone_grass_block"
],
"offset": [
0,
-1,
0
]
}
},
{
"type": "minecraft:surface_water_depth_filter",
"max_water_depth": 0
},
{
"type": "minecraft:biome"
}
]
}
@@ -0,0 +1,44 @@
{
"feature": "ageofthegods:tall_thin_birch_tree",
"placement": [
{
"type": "minecraft:count",
"count": 15
},
{
"type": "minecraft:rarity_filter",
"chance": 6
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "OCEAN_FLOOR"
},
{
"type": "minecraft:block_predicate_filter",
"predicate": {
"type": "minecraft:matching_blocks",
"blocks": [
"ageofthegods:shale_grass_block",
"minecraft:sandstone",
"ageofthegods:shale_block",
"ageofthegods:limestone_grass_block"
],
"offset": [
0,
-1,
0
]
}
},
{
"type": "minecraft:surface_water_depth_filter",
"max_water_depth": 0
},
{
"type": "minecraft:biome"
}
]
}
@@ -3,11 +3,11 @@
"placement": [
{
"type": "minecraft:count",
"count": 7
"count": 15
},
{
"type": "minecraft:rarity_filter",
"chance": 10
"chance": 5
},
{
"type": "minecraft:in_square"
@@ -23,6 +23,7 @@
"blocks": [
"ageofthegods:shale_grass_block",
"minecraft:sandstone",
"minecraft:coarse_dirt",
"ageofthegods:shale_block",
"ageofthegods:limestone_grass_block"
],
@@ -12,7 +12,7 @@
"disable_mob_generation": false,
"legacy_random_source": false,
"noise": {
"height": 512,
"height": 384,
"min_y": -64,
"size_horizontal": 1,
"size_vertical": 2
@@ -1190,6 +1190,284 @@
]
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:biome",
"biome_is": [
"ageofthegods:pine_forest"
]
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:not",
"invert": {
"type": "minecraft:water",
"add_stone_depth": false,
"offset": -1,
"surface_depth_multiplier": 0
}
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:sandstone"
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"add_surface_depth": false,
"offset": 6,
"secondary_depth_range": 0,
"surface_type": "floor"
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"max_threshold": 0.15,
"min_threshold": 0.0,
"noise": "minecraft:patch"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:coarse_dirt"
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"add_surface_depth": false,
"offset": 0,
"secondary_depth_range": 0,
"surface_type": "floor"
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"max_threshold": -0.5,
"min_threshold": -1.0,
"noise": "minecraft:erosion_large"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "ageofthegods:limestone_grass_block"
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"add_surface_depth": false,
"offset": 0,
"secondary_depth_range": 0,
"surface_type": "floor"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "ageofthegods:shale_grass_block"
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"add_surface_depth": false,
"offset": 10,
"secondary_depth_range": 0,
"surface_type": "floor"
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"max_threshold": 1.7976931348623157E308,
"min_threshold": 0.1,
"noise": "ageofthegods:tiny_patchy_noise"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:granite"
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"add_surface_depth": false,
"offset": 10,
"secondary_depth_range": 0,
"surface_type": "floor"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "ageofthegods:shale_block"
}
}
}
]
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:biome",
"biome_is": [
"ageofthegods:mixed_forest"
]
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:not",
"invert": {
"type": "minecraft:water",
"add_stone_depth": false,
"offset": -1,
"surface_depth_multiplier": 0
}
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:sandstone"
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"add_surface_depth": false,
"offset": 6,
"secondary_depth_range": 0,
"surface_type": "floor"
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"max_threshold": 0.15,
"min_threshold": 0.0,
"noise": "minecraft:patch"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:coarse_dirt"
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"add_surface_depth": false,
"offset": 0,
"secondary_depth_range": 0,
"surface_type": "floor"
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"max_threshold": -0.5,
"min_threshold": -1.0,
"noise": "minecraft:erosion_large"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "ageofthegods:limestone_grass_block"
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"add_surface_depth": false,
"offset": 0,
"secondary_depth_range": 0,
"surface_type": "floor"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "ageofthegods:shale_grass_block"
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"add_surface_depth": false,
"offset": 10,
"secondary_depth_range": 0,
"surface_type": "floor"
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"max_threshold": 1.7976931348623157E308,
"min_threshold": 0.1,
"noise": "ageofthegods:tiny_patchy_noise"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:granite"
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"add_surface_depth": false,
"offset": 10,
"secondary_depth_range": 0,
"surface_type": "floor"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "ageofthegods:shale_block"
}
}
}
]
}
},
{
"type": "minecraft:sequence",
"sequence": [
@@ -0,0 +1,62 @@
package net.halbear.aotg.custom.WorldGen.GenerationFeatures;
import com.mojang.serialization.MapCodec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import net.halbear.aotg.registries.ModFoliagePlacers;
import net.minecraft.core.BlockPos;
import net.minecraft.util.RandomSource;
import net.minecraft.util.valueproviders.IntProvider;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.levelgen.feature.configurations.TreeConfiguration;
import net.minecraft.world.level.levelgen.feature.foliageplacers.FoliagePlacer;
import net.minecraft.world.level.levelgen.feature.foliageplacers.FoliagePlacerType;
public class PineTreeFoliagePlacer extends FoliagePlacer {
public static final MapCodec<PineTreeFoliagePlacer> CODEC = RecordCodecBuilder.mapCodec(instance ->
foliagePlacerParts(instance).apply(instance, PineTreeFoliagePlacer::new)
);
public PineTreeFoliagePlacer(IntProvider radius, IntProvider offset) {
super(radius, offset);
}
@Override
protected FoliagePlacerType<?> type() {
return ModFoliagePlacers.PINE_LEAVES_FOLIAGE_PLACER.get();
}
@Override
protected void createFoliage(WorldGenLevel worldGenLevel, FoliageSetter foliageSetter, RandomSource randomSource, TreeConfiguration treeConfiguration, int i, FoliageAttachment foliageAttachment, int foliageHeight, int radius, int offset) {
BlockPos center = foliageAttachment.pos().above(offset);
radius += foliageAttachment.radiusOffset();
for (int y = -1; y <= 1; y++) {
for (int x = -radius; x <= radius; x++) {
for (int z = -radius; z <= radius; z++) {
if(y == -1 && randomSource.nextFloat() < 0.45 || randomSource.nextFloat() < 0.85 && isPointInCircle(x,z,0,0,radius - 1)) tryPlaceLeaf(worldGenLevel, foliageSetter, randomSource, treeConfiguration, center.offset(x, y, z));
}
}
radius = Math.clamp(radius - 1, 1,radius);
}
}
public static boolean isPointInCircle(double pointX, double pointY, double circleX, double circleY, double radius) {
double deltaX = pointX - circleX;
double deltaY = pointY - circleY;
double squaredDistance = (deltaX * deltaX) + (deltaY * deltaY);
double squaredRadius = radius * radius;
return squaredDistance <= squaredRadius;
}
@Override
public int foliageHeight(RandomSource random, int height, TreeConfiguration config) {
return 0;
}
@Override
protected boolean shouldSkipLocation(RandomSource random, int localX, int localY, int localZ, int range, boolean large) {
return false;
}
}
@@ -11,6 +11,8 @@ import net.minecraft.world.level.levelgen.feature.configurations.TreeConfigurati
import net.minecraft.world.level.levelgen.feature.foliageplacers.FoliagePlacer;
import net.minecraft.world.level.levelgen.feature.trunkplacers.TrunkPlacer;
import net.minecraft.world.level.levelgen.feature.trunkplacers.TrunkPlacerType;
import org.joml.Vector2i;
import org.joml.Vector3f;
import java.util.ArrayList;
import java.util.List;
@@ -29,7 +31,7 @@ public class PineTreeTrunkPlacer extends TrunkPlacer {
@Override
protected TrunkPlacerType<?> type() {
return ModTreeGen.TALL_TWISTY_TRUNK_PLACER.get();
return ModTreeGen.PINE_TRUNK_PACER.get();
}
@Override
@@ -38,49 +40,35 @@ public class PineTreeTrunkPlacer extends TrunkPlacer {
List<FoliagePlacer.FoliageAttachment> leafNodes = new ArrayList<>();
int mainHeight = this.getTreeHeight(randomSource);
BlockPos currentPos = blockPos;
Vector2i Direction = new Vector2i(randomSource.nextIntBetweenInclusive(-1,1), randomSource.nextIntBetweenInclusive(-1,1));
for (int i = 0; i < mainHeight; i++) {
TRUNK_WIDTH = (int)Math.max(3 * (1.0-((i*0.75)/(double)mainHeight)),1);
for (int xOffset = 0; xOffset < TRUNK_WIDTH; xOffset++) {
for (int zOffset = 0; zOffset < TRUNK_WIDTH; zOffset++) {
BlockPos thickLogPos = currentPos.offset(xOffset, 0, zOffset);
if(i < 2 && randomSource.nextFloat() < 0.40f){
if(i < 2 && randomSource.nextFloat() < 0.70f){
generateRoots(worldGenLevel, biConsumer, randomSource, thickLogPos, treeConfiguration);
}
if ((randomSource.nextInt(10) < 9) || TRUNK_WIDTH < 3)
this.placeLog(worldGenLevel, biConsumer, randomSource, thickLogPos, treeConfiguration);
else if (randomSource.nextDouble() < 0.1)
leafNodes.add(new FoliagePlacer.FoliageAttachment(thickLogPos, randomSource.nextInt(2), false));
}
}
if (randomSource.nextFloat() < 0.6f && i > 1) {
currentPos = currentPos.offset(randomSource.nextInt(3) - 1, 0, randomSource.nextInt(3) - 1);
if (randomSource.nextFloat() < 0.3f && i > 2) {
currentPos = currentPos.offset(Direction.x, 0, Direction.y);
this.placeLog(worldGenLevel, biConsumer, randomSource, currentPos.below(), treeConfiguration);
}
if (i > 2 && randomSource.nextFloat() < 0.65) {
if (i > 5 && randomSource.nextFloat() < 0.75) {
BlockPos branchStart = currentPos.offset(randomSource.nextInt(TRUNK_WIDTH), 0, randomSource.nextInt(TRUNK_WIDTH));
BlockPos branchEnd = generateBranch(worldGenLevel, biConsumer, randomSource, branchStart, treeConfiguration,i, leafNodes);
BlockPos branchEnd = generateBranch(worldGenLevel, biConsumer, randomSource, branchStart, treeConfiguration,Math.min(mainHeight - i,6), leafNodes,new Vector2i(randomSource.nextIntBetweenInclusive(-1,1), randomSource.nextIntBetweenInclusive(-1,1)));
leafNodes.add(new FoliagePlacer.FoliageAttachment(branchEnd, randomSource.nextInt(2) + (Math.max((int)(i/(double)(mainHeight/1.25))*2,1)), false));
} else if(i > 2 && i == mainHeight - 1){
for(int l = 0; l < 2 + randomSource.nextInt(3); l++){
BlockPos branchStart = currentPos.offset(randomSource.nextInt(TRUNK_WIDTH), 0, randomSource.nextInt(TRUNK_WIDTH));
BlockPos branchEnd = generateBranch(worldGenLevel, biConsumer, randomSource, branchStart, treeConfiguration,i, leafNodes);
this.placeLog(worldGenLevel, biConsumer, randomSource, branchStart, treeConfiguration);
leafNodes.add(new FoliagePlacer.FoliageAttachment(branchEnd, randomSource.nextInt(2) + (Math.max((int)(i/(double)(mainHeight/1.25))*2,1)), false));
}
}
currentPos = currentPos.above();
}
for (int xOffset = 0; xOffset < TRUNK_WIDTH; xOffset++) {
for (int zOffset = 0; zOffset < TRUNK_WIDTH; zOffset++) {
leafNodes.add(new FoliagePlacer.FoliageAttachment(currentPos.offset(xOffset, 0, zOffset), 0, false));
}
}
leafNodes.add(new FoliagePlacer.FoliageAttachment(currentPos, 0, false));
return leafNodes;
}
@@ -102,22 +90,19 @@ public class PineTreeTrunkPlacer extends TrunkPlacer {
}
private BlockPos generateBranch(WorldGenLevel level, BiConsumer<BlockPos, BlockState> blockSetter,
RandomSource random, BlockPos branchStart, TreeConfiguration config, int CurrentTreeHeight,List<FoliagePlacer.FoliageAttachment> leafNodes) {
int dirX = random.nextBoolean() ? 1 : -1;
int dirZ = random.nextBoolean() ? 1 : -1;
int branchLength = 3 + random.nextInt(Math.min(CurrentTreeHeight,12));
RandomSource random, BlockPos branchStart, TreeConfiguration config, int BranchLength,List<FoliagePlacer.FoliageAttachment> leafNodes, Vector2i Direction) {
int dirX = Direction.x;
int dirZ = Direction.y;
int branchLength = BranchLength;
BlockPos bPos = branchStart;
for (int b = 0; b < branchLength; b++) {
int stepX = random.nextFloat() < 0.7f ? dirX : 0;
int stepZ = random.nextFloat() < 0.7f ? dirZ : 0;
int stepY = random.nextFloat() < 0.4f ? 1 : 0;
int stepY = random.nextFloat() < 0.4f ? -1 : 0;
bPos = bPos.offset(stepX, stepY, stepZ);
if(stepY == 1) this.placeLog(level, blockSetter, random, bPos.below(), config);
this.placeLog(level, blockSetter, random, bPos, config);
if (random.nextDouble() < 0.25) {
leafNodes.add(new FoliagePlacer.FoliageAttachment(bPos, random.nextInt(2), false));
}
leafNodes.add(new FoliagePlacer.FoliageAttachment(bPos, Math.min(random.nextInt(branchLength - b),2), false));
}
return bPos;
}
@@ -1,6 +1,7 @@
package net.halbear.aotg.custom.WorldGen;
import net.halbear.aotg.AgeoftheGods;
import net.halbear.aotg.registries.ModBiomes;
import net.halbear.aotg.registries.ModBlocks;
import net.halbear.aotg.utility.DataGenerators.AgeOfTheGodsDataGeneration;
import net.minecraft.core.RegistrySetBuilder;
@@ -21,12 +22,6 @@ public class ModNoiseSettings {
public static SurfaceRules.RuleSource makeRules(BootstrapContext<NoiseGeneratorSettings> context) {
ResourceKey<net.minecraft.world.level.biome.Biome> garrigueKey =
ResourceKey.create(Registries.BIOME, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "garrigue"));
ResourceKey<net.minecraft.world.level.biome.Biome> maquisKey =
ResourceKey.create(Registries.BIOME, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "maquis_shrubland"));
ResourceKey<net.minecraft.world.level.biome.Biome> MediterraneanKey =
ResourceKey.create(Registries.BIOME, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "mediterranean_forest"));
SurfaceRules.ConditionSource isGarrigueGrassSection = SurfaceRules.noiseCondition(Noises.POWDER_SNOW, 0);
SurfaceRules.ConditionSource isGarrigueGrassPatch = SurfaceRules.noiseCondition(AgeOfTheGodsDataGeneration.TINY_PATCHY_NOISE, 0.0);
@@ -224,11 +219,46 @@ public class ModNoiseSettings {
SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(10, false, 0, CaveSurface.FLOOR),
SurfaceRules.state(ModBlocks.SHALE_BLOCK.get().defaultBlockState()))
);
SurfaceRules.RuleSource PineForestModifier = SurfaceRules.sequence(
SurfaceRules.ifTrue(
SurfaceRules.not(SurfaceRules.waterBlockCheck(-1,0)),
SurfaceRules.state(Blocks.SANDSTONE.defaultBlockState())
),
SurfaceRules.ifTrue(
SurfaceRules.stoneDepthCheck(6, false, 0, CaveSurface.FLOOR),
SurfaceRules.ifTrue(
isGraniteSurfacePatch,
SurfaceRules.state(Blocks.COARSE_DIRT.defaultBlockState())
)
),
SurfaceRules.ifTrue(
SurfaceRules.stoneDepthCheck(0, false, 0, CaveSurface.FLOOR),
SurfaceRules.ifTrue(
isPath,
SurfaceRules.state(ModBlocks.LIMESTONE_GRASS_BLOCK.get().defaultBlockState())
)
),
SurfaceRules.ifTrue(
SurfaceRules.stoneDepthCheck(0, false, 0, CaveSurface.FLOOR),
SurfaceRules.state(ModBlocks.SHALE_GRASS_BLOCK.get().defaultBlockState())
),
SurfaceRules.ifTrue(
SurfaceRules.stoneDepthCheck(10, false, 0, CaveSurface.FLOOR),
SurfaceRules.ifTrue(
isGranite,
SurfaceRules.state(Blocks.GRANITE.defaultBlockState())
)
),
SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(10, false, 0, CaveSurface.FLOOR),
SurfaceRules.state(ModBlocks.SHALE_BLOCK.get().defaultBlockState()))
);
return SurfaceRules.sequence(
SurfaceRules.ifTrue(SurfaceRules.isBiome(garrigueKey), garrigueSurface),
SurfaceRules.ifTrue(SurfaceRules.isBiome(maquisKey), maquisSurface),
SurfaceRules.ifTrue(SurfaceRules.isBiome(MediterraneanKey), MediterraneanSurface),
SurfaceRules.ifTrue(SurfaceRules.isBiome(ModBiomes.GARRIGUE), garrigueSurface),
SurfaceRules.ifTrue(SurfaceRules.isBiome(ModBiomes.MAQUIS_SHRUBLAND), maquisSurface),
SurfaceRules.ifTrue(SurfaceRules.isBiome(ModBiomes.MEDITERRANEAN_FOREST), MediterraneanSurface),
SurfaceRules.ifTrue(SurfaceRules.isBiome(ModBiomes.PINE_FOREST), PineForestModifier),
SurfaceRules.ifTrue(SurfaceRules.isBiome(ModBiomes.MIXED_FOREST), PineForestModifier),
SurfaceRuleData.overworld()
);
}
@@ -18,6 +18,10 @@ import net.neoforged.neoforge.registries.NeoForgeRegistries;
import static net.halbear.aotg.registries.ModPlacedFeatures.*;
public class ModBiomeModifiers {
public static final ResourceKey<BiomeModifier> ADD_PINE_TREE =
ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "add_pine_tree"));
public static final ResourceKey<BiomeModifier> ADD_TALL_BIRCH_TREE =
ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "add_tall_birch_tree"));
public static final ResourceKey<BiomeModifier> ADD_TWISTY_TREE =
ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "add_twisty_tree"));
public static final ResourceKey<BiomeModifier> ADD_SHORT_TWISTY_TREE =
@@ -79,7 +83,7 @@ public class ModBiomeModifiers {
GenerationStep.Decoration.VEGETAL_DECORATION
);
context.register(GRAVEL_BOULDER_BIOME_MODIFIER, modifier);
targetBiomes = HolderSet.direct(biomes.getOrThrow(ModBiomes.GARRIGUE), biomes.getOrThrow(ModBiomes.MEDITERRANEAN_FOREST));
targetBiomes = HolderSet.direct(biomes.getOrThrow(ModBiomes.GARRIGUE),biomes.getOrThrow(ModBiomes.MIXED_FOREST), biomes.getOrThrow(ModBiomes.MEDITERRANEAN_FOREST));
placedHolder = placedLookup.getOrThrow(LIMESTONE_BOULDER_PLACED);
modifier = new BiomeModifiers.AddFeaturesBiomeModifier(
@@ -105,13 +109,6 @@ public class ModBiomeModifiers {
GenerationStep.Decoration.VEGETAL_DECORATION
));
placedTreeHolder = placedFeatures.getOrThrow(TWISTY_TREE_PLACED_KEY);
context.register(ADD_TWISTY_TREE, new BiomeModifiers.AddFeaturesBiomeModifier(
targetBiomes,
HolderSet.direct(placedTreeHolder),
GenerationStep.Decoration.VEGETAL_DECORATION
));
placedTreeHolder = placedFeatures.getOrThrow(SHORT_THIN_TWISTY_TREE_PLACED_KEY);
context.register(ADD_SHORT_THIN_TWISTY_TREE, new BiomeModifiers.AddFeaturesBiomeModifier(
@@ -120,5 +117,34 @@ public class ModBiomeModifiers {
GenerationStep.Decoration.VEGETAL_DECORATION
));
targetBiomes = HolderSet.direct(biomes.getOrThrow(ModBiomes.MIXED_FOREST),biomes.getOrThrow(ModBiomes.PINE_FOREST));
placedTreeHolder = placedFeatures.getOrThrow(PINE_TREE_PLACED);
context.register(ADD_PINE_TREE, new BiomeModifiers.AddFeaturesBiomeModifier(
targetBiomes,
HolderSet.direct(placedTreeHolder),
GenerationStep.Decoration.VEGETAL_DECORATION
));
placedTreeHolder = placedFeatures.getOrThrow(TALL_THIN_BIRCH_TREE_PLACED);
targetBiomes = HolderSet.direct(biomes.getOrThrow(ModBiomes.MIXED_FOREST));
context.register(ADD_TALL_BIRCH_TREE, new BiomeModifiers.AddFeaturesBiomeModifier(
targetBiomes,
HolderSet.direct(placedTreeHolder),
GenerationStep.Decoration.VEGETAL_DECORATION
));
targetBiomes = HolderSet.direct(biomes.getOrThrow(ModBiomes.MEDITERRANEAN_FOREST),biomes.getOrThrow(ModBiomes.MIXED_FOREST));
placedTreeHolder = placedFeatures.getOrThrow(TWISTY_TREE_PLACED_KEY);
context.register(ADD_TWISTY_TREE, new BiomeModifiers.AddFeaturesBiomeModifier(
targetBiomes,
HolderSet.direct(placedTreeHolder),
GenerationStep.Decoration.VEGETAL_DECORATION
));
}
}
@@ -20,4 +20,6 @@ public class ModBiomes {
public static final ResourceKey<Biome> MAQUIS_SHRUBLAND = ResourceKey.create(Registries.BIOME, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "maquis_shrubland"));
public static final ResourceKey<Biome> GARRIGUE = ResourceKey.create(Registries.BIOME, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "garrigue"));
public static final ResourceKey<Biome> MEDITERRANEAN_FOREST = ResourceKey.create(Registries.BIOME, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "mediterranean_forest"));
public static final ResourceKey<Biome> PINE_FOREST = ResourceKey.create(Registries.BIOME, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "pine_forest"));
public static final ResourceKey<Biome> MIXED_FOREST = ResourceKey.create(Registries.BIOME, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "mixed_forest"));
}
@@ -19,6 +19,8 @@ import net.minecraft.world.level.levelgen.feature.stateproviders.BlockStateProvi
import net.neoforged.fml.common.Mod;
public class ModConfiguredFeatures {
public static final ResourceKey<ConfiguredFeature<?, ?>> PINE_TREE =
ResourceKey.create(Registries.CONFIGURED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "pine_tree"));
public static final ResourceKey<ConfiguredFeature<?, ?>> TWISTY_TREE_KEY =
ResourceKey.create(Registries.CONFIGURED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "maquis_tall_twisty_tree"));
public static final ResourceKey<ConfiguredFeature<?, ?>> MAQUIS_SHORT_TWISTY_TREE_KEY =
@@ -27,6 +29,8 @@ public class ModConfiguredFeatures {
ResourceKey.create(Registries.CONFIGURED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "garrigue_short_twisty_tree"));
public static final ResourceKey<ConfiguredFeature<?, ?>> TALL_THIN_TWISTY_TREE =
ResourceKey.create(Registries.CONFIGURED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "tall_thin_twisty_tree"));
public static final ResourceKey<ConfiguredFeature<?, ?>> TALL_THIN_BIRCH_TREE =
ResourceKey.create(Registries.CONFIGURED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "tall_thin_birch_tree"));
public static final ResourceKey<ConfiguredFeature<?, ?>> SHORT_THIN_TWISTY_TREE =
ResourceKey.create(Registries.CONFIGURED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "short_thin_twisty_tree"));
public static final ResourceKey<ConfiguredFeature<?, ?>> GRANITE_BOULDER = ResourceKey.create(
@@ -39,6 +43,16 @@ public class ModConfiguredFeatures {
Registries.CONFIGURED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "limestone_boulder"));
public static void bootstrap(BootstrapContext<ConfiguredFeature<?, ?>> context) {
context.register(PINE_TREE, new ConfiguredFeature<>(
Feature.TREE,
new TreeConfiguration.TreeConfigurationBuilder(
BlockStateProvider.simple(Blocks.SPRUCE_LOG.defaultBlockState()),
new PineTreeTrunkPlacer(21, 4, 5),
BlockStateProvider.simple(Blocks.SPRUCE_LEAVES.defaultBlockState()),
new PineTreeFoliagePlacer(ConstantInt.of(1),ConstantInt.of(0)),
new TwoLayersFeatureSize(3, 1, 3)
).build()
));
context.register(SHORT_THIN_TWISTY_TREE, new ConfiguredFeature<>(
Feature.TREE,
new TreeConfiguration.TreeConfigurationBuilder(
@@ -49,6 +63,16 @@ public class ModConfiguredFeatures {
new TwoLayersFeatureSize(3, 1, 3)
).build()
));
context.register(TALL_THIN_BIRCH_TREE, new ConfiguredFeature<>(
Feature.TREE,
new TreeConfiguration.TreeConfigurationBuilder(
BlockStateProvider.simple(Blocks.BIRCH_LOG.defaultBlockState()),
new ThinTwistyBranchingTrunkPlacer(15, 10, 10),
BlockStateProvider.simple(Blocks.BIRCH_LEAVES.defaultBlockState()),
new LeafBunchFoliagePlacer(ConstantInt.of(1),ConstantInt.of(0)),
new TwoLayersFeatureSize(3, 1, 3)
).build()
));
context.register(TALL_THIN_TWISTY_TREE, new ConfiguredFeature<>(
Feature.TREE,
new TreeConfiguration.TreeConfigurationBuilder(
@@ -2,6 +2,7 @@ package net.halbear.aotg.registries;
import net.halbear.aotg.AgeoftheGods;
import net.halbear.aotg.custom.WorldGen.GenerationFeatures.LeafBunchFoliagePlacer;
import net.halbear.aotg.custom.WorldGen.GenerationFeatures.PineTreeFoliagePlacer;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.level.levelgen.feature.foliageplacers.FoliagePlacerType;
import net.neoforged.bus.api.IEventBus;
@@ -16,6 +17,9 @@ public class ModFoliagePlacers {
public static final DeferredHolder<FoliagePlacerType<?>, FoliagePlacerType<LeafBunchFoliagePlacer>> LEAF_BUNCH_FOLIAGE_PLACER =
FOLIAGE_PLACERS.register("spherical_foliage_placer", () -> new FoliagePlacerType<>(LeafBunchFoliagePlacer.CODEC));
public static final DeferredHolder<FoliagePlacerType<?>, FoliagePlacerType<PineTreeFoliagePlacer>> PINE_LEAVES_FOLIAGE_PLACER =
FOLIAGE_PLACERS.register("pine_leaves_foliage_placer", () -> new FoliagePlacerType<>(PineTreeFoliagePlacer.CODEC));
public static void register(IEventBus eventBus) {
FOLIAGE_PLACERS.register(eventBus);
}
@@ -19,6 +19,10 @@ import java.util.List;
import static net.halbear.aotg.registries.ModConfiguredFeatures.*;
public class ModPlacedFeatures {
public static final ResourceKey<PlacedFeature> PINE_TREE_PLACED =
ResourceKey.create(Registries.PLACED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "pine_tree_placed"));
public static final ResourceKey<PlacedFeature> TALL_THIN_BIRCH_TREE_PLACED =
ResourceKey.create(Registries.PLACED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "tall_thin_birch_tree_placed"));
public static final ResourceKey<PlacedFeature> TWISTY_TREE_PLACED_KEY =
ResourceKey.create(Registries.PLACED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "twisty_tree_placed"));
public static final ResourceKey<PlacedFeature> SHORT_TWISTY_TREE_PLACED_KEY =
@@ -42,7 +46,51 @@ public class ModPlacedFeatures {
public static void bootstrap(BootstrapContext<PlacedFeature> context) {
HolderGetter<ConfiguredFeature<?, ?>> configuredFeatures = context.lookup(Registries.CONFIGURED_FEATURE);
var configuredTreeHolder = configuredFeatures.getOrThrow(TALL_THIN_TWISTY_TREE);
var configuredTreeHolder = configuredFeatures.getOrThrow(PINE_TREE);
context.register(PINE_TREE_PLACED, new PlacedFeature(
configuredTreeHolder,
List.of(
CountPlacement.of(20),
RarityFilter.onAverageOnceEvery(6),
InSquarePlacement.spread(),
PlacementUtils.HEIGHTMAP_OCEAN_FLOOR,
BlockPredicateFilter.forPredicate(
BlockPredicate.matchesBlocks(
new BlockPos(0, -1, 0),
ModBlocks.SHALE_GRASS_BLOCK.get(),
Blocks.SANDSTONE,
ModBlocks.SHALE_BLOCK.get(),
ModBlocks.LIMESTONE_GRASS_BLOCK.get()
)
),
SurfaceWaterDepthFilter.forMaxDepth(0),
BiomeFilter.biome()
)
));
configuredTreeHolder = configuredFeatures.getOrThrow(TALL_THIN_BIRCH_TREE);
context.register(TALL_THIN_BIRCH_TREE_PLACED, new PlacedFeature(
configuredTreeHolder,
List.of(
CountPlacement.of(15),
RarityFilter.onAverageOnceEvery(6),
InSquarePlacement.spread(),
PlacementUtils.HEIGHTMAP_OCEAN_FLOOR,
BlockPredicateFilter.forPredicate(
BlockPredicate.matchesBlocks(
new BlockPos(0, -1, 0),
ModBlocks.SHALE_GRASS_BLOCK.get(),
Blocks.SANDSTONE,
ModBlocks.SHALE_BLOCK.get(),
ModBlocks.LIMESTONE_GRASS_BLOCK.get()
)
),
SurfaceWaterDepthFilter.forMaxDepth(0),
BiomeFilter.biome()
)
));
configuredTreeHolder = configuredFeatures.getOrThrow(TALL_THIN_TWISTY_TREE);
context.register(TALL_THIN_TWISTY_TREE_PLACED_KEY, new PlacedFeature(
configuredTreeHolder,
@@ -90,8 +138,8 @@ public class ModPlacedFeatures {
context.register(TWISTY_TREE_PLACED_KEY, new PlacedFeature(
configuredTreeHolder,
List.of(
CountPlacement.of(7),
RarityFilter.onAverageOnceEvery(10),
CountPlacement.of(15),
RarityFilter.onAverageOnceEvery(5),
InSquarePlacement.spread(),
PlacementUtils.HEIGHTMAP_OCEAN_FLOOR,
BlockPredicateFilter.forPredicate(
@@ -99,6 +147,7 @@ public class ModPlacedFeatures {
new BlockPos(0, -1, 0),
ModBlocks.SHALE_GRASS_BLOCK.get(),
Blocks.SANDSTONE,
Blocks.COARSE_DIRT,
ModBlocks.SHALE_BLOCK.get(),
ModBlocks.LIMESTONE_GRASS_BLOCK.get()
)
@@ -2,6 +2,7 @@ package net.halbear.aotg.registries;
import net.halbear.aotg.AgeoftheGods;
import net.halbear.aotg.custom.WorldGen.GenerationFeatures.BushTwistyBranchingTrunkPlacer;
import net.halbear.aotg.custom.WorldGen.GenerationFeatures.PineTreeTrunkPlacer;
import net.halbear.aotg.custom.WorldGen.GenerationFeatures.ThinTwistyBranchingTrunkPlacer;
import net.halbear.aotg.custom.WorldGen.GenerationFeatures.TwistyBranchingTrunkPlacer;
import net.minecraft.core.registries.Registries;
@@ -14,6 +15,10 @@ public class ModTreeGen {
public static final DeferredRegister<TrunkPlacerType<?>> TRUNK_PLACERS =
DeferredRegister.create(Registries.TRUNK_PLACER_TYPE, AgeoftheGods.MODID);
public static final DeferredHolder<TrunkPlacerType<?>, TrunkPlacerType<PineTreeTrunkPlacer>> PINE_TRUNK_PACER =
TRUNK_PLACERS.register("pine_trunk_pacer", () -> new TrunkPlacerType<>(PineTreeTrunkPlacer.CODEC));
public static final DeferredHolder<TrunkPlacerType<?>, TrunkPlacerType<TwistyBranchingTrunkPlacer>> TWISTY_TRUNK_PLACER =
TRUNK_PLACERS.register("twisty_trunk_placer", () -> new TrunkPlacerType<>(TwistyBranchingTrunkPlacer.CODEC));
@@ -0,0 +1,64 @@
{
"has_precipitation": true,
"temperature": 0.7,
"downfall": 0.8,
"temperature_modifier": "none",
"effects": {
"water_color": 4311792,
"grass_color": 13162858,
"foliage_color": 9226315,
"ambient_loop_sound": "minecraft:ambient.cave",
"mood_sound": {
"sound": "minecraft:ambient.cave",
"tick_delay": 6000,
"block_search_extent": 8,
"offset": 2.0
}
},
"attributes": {
"minecraft:visual/sky_color": 8906751,
"minecraft:visual/fog_color": 16777215,
"minecraft:visual/water_fog_color": 329011
},
"carvers": [
"minecraft:cave",
"minecraft:canyon"
],
"features": [
[],
[ "minecraft:lake_lava_underground", "minecraft:lake_lava_surface" ],
[ "minecraft:amethyst_geode" ],
[],
[],
[],
[
"minecraft:ore_dirt",
"minecraft:ore_coal_upper",
"minecraft:ore_coal_lower",
"minecraft:ore_iron_upper",
"minecraft:ore_iron_middle",
"minecraft:ore_iron_small",
"minecraft:ore_diamond"
],
[],
[],
[ "minecraft:patch_grass_plain", "minecraft:brown_mushroom_normal" ],
[ ]
],
"creature_spawn_probability": 0.07,
"spawners": {
"monster": [
{ "type": "minecraft:spider", "weight": 100, "minCount": 4, "maxCount": 4 },
{ "type": "minecraft:zombie", "weight": 95, "minCount": 4, "maxCount": 4 }
],
"creature": [
{ "type": "minecraft:wolf", "weight": 5, "minCount": 4, "maxCount": 4 }
],
"ambient": [],
"water_creature": [],
"underground_water_creature": [],
"water_ambient": [],
"axolotls": []
},
"spawn_costs": {}
}
@@ -0,0 +1,64 @@
{
"has_precipitation": true,
"temperature": 0.7,
"downfall": 0.8,
"temperature_modifier": "none",
"effects": {
"water_color": 4311792,
"grass_color": 13162858,
"foliage_color": 9226315,
"ambient_loop_sound": "minecraft:ambient.cave",
"mood_sound": {
"sound": "minecraft:ambient.cave",
"tick_delay": 6000,
"block_search_extent": 8,
"offset": 2.0
}
},
"attributes": {
"minecraft:visual/sky_color": 8906751,
"minecraft:visual/fog_color": 16777215,
"minecraft:visual/water_fog_color": 329011
},
"carvers": [
"minecraft:cave",
"minecraft:canyon"
],
"features": [
[],
[ "minecraft:lake_lava_underground", "minecraft:lake_lava_surface" ],
[ "minecraft:amethyst_geode" ],
[],
[],
[],
[
"minecraft:ore_dirt",
"minecraft:ore_coal_upper",
"minecraft:ore_coal_lower",
"minecraft:ore_iron_upper",
"minecraft:ore_iron_middle",
"minecraft:ore_iron_small",
"minecraft:ore_diamond"
],
[],
[],
[ "minecraft:patch_grass_plain", "minecraft:brown_mushroom_normal" ],
[ ]
],
"creature_spawn_probability": 0.07,
"spawners": {
"monster": [
{ "type": "minecraft:spider", "weight": 100, "minCount": 4, "maxCount": 4 },
{ "type": "minecraft:zombie", "weight": 95, "minCount": 4, "maxCount": 4 }
],
"creature": [
{ "type": "minecraft:wolf", "weight": 5, "minCount": 4, "maxCount": 4 }
],
"ambient": [],
"water_creature": [],
"underground_water_creature": [],
"water_ambient": [],
"axolotls": []
},
"spawn_costs": {}
}
@@ -18,14 +18,38 @@
"offset": 0.0
}
},
{
"biome": "ageofthegods:pine_forest",
"parameters": {
"temperature": [-1.0, 1.0],
"humidity": [-1.0, 0.0],
"continentalness": [0.25, 1.0],
"erosion": [-1.0, 0.0],
"weirdness": [-1.0, 1.0],
"depth": 0.0,
"offset": 0.0
}
},
{
"biome": "ageofthegods:mixed_forest",
"parameters": {
"temperature": [-1.0, 1.0],
"humidity": [-1.0, 0.0],
"continentalness": [0.35, 0.9],
"erosion": [-0.25, 0.75],
"weirdness": [-0.5, 1.0],
"depth": 0.0,
"offset": 0.0
}
},
{
"biome": "ageofthegods:maquis_shrubland",
"parameters": {
"temperature": [-1.0, 1.0],
"humidity": [-1.0, 0.0],
"continentalness": [0.15, 1.0],
"erosion": [-1.0, 0.0],
"weirdness": [-1.0, 1.0],
"erosion": [-0.85, 0.0],
"weirdness": [-0.5, 0.5],
"depth": 0.0,
"offset": 0.0
}