new biome

This commit is contained in:
Halbear
2026-07-23 23:59:32 +01:00
parent 0dcf2b4a47
commit dcbaf1aaa1
36 changed files with 1484 additions and 45 deletions
@@ -0,0 +1,6 @@
{
"type": "neoforge:add_features",
"biomes": "ageofthegods:maquis_shrubland",
"features": "ageofthegods:granite_boulder_placed",
"step": "vegetal_decoration"
}
@@ -0,0 +1,6 @@
{
"type": "neoforge:add_features",
"biomes": "ageofthegods:maquis_shrubland",
"features": "ageofthegods:gravel_boulder_placed",
"step": "vegetal_decoration"
}
@@ -0,0 +1,6 @@
{
"type": "neoforge:add_features",
"biomes": "ageofthegods:maquis_shrubland",
"features": "ageofthegods:shale_boulder_placed",
"step": "vegetal_decoration"
}
@@ -0,0 +1,6 @@
{
"type": "neoforge:add_features",
"biomes": "ageofthegods:mediterranean_forest",
"features": "ageofthegods:tall_thin_twisty_tree_placed",
"step": "vegetal_decoration"
}
@@ -0,0 +1,9 @@
{
"type": "neoforge:add_features",
"biomes": [
"ageofthegods:garrigue",
"ageofthegods:mediterranean_forest"
],
"features": "ageofthegods:short_garrigue_twisty_tree_placed",
"step": "vegetal_decoration"
}
@@ -1,6 +1,6 @@
{
"type": "neoforge:add_features",
"biomes": "ageofthegods:maquis_shrubland",
"features": "ageofthegods:twisty_tree_placed",
"features": "ageofthegods:short_maquis_twisty_tree_placed",
"step": "vegetal_decoration"
}
@@ -0,0 +1,9 @@
{
"type": "neoforge:add_features",
"biomes": [
"ageofthegods:garrigue",
"ageofthegods:mediterranean_forest"
],
"features": "ageofthegods:limestone_boulder_placed",
"step": "vegetal_decoration"
}
@@ -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:oak_leaves",
"Properties": {
"distance": "7",
"persistent": "false",
"waterlogged": "false"
}
}
},
"ignore_vines": false,
"minimum_size": {
"type": "minecraft:two_layers_feature_size",
"limit": 5,
"lower_size": 3,
"upper_size": 5
},
"trunk_placer": {
"type": "ageofthegods:twisty_trunk_placer",
"base_height": 2,
"height_rand_a": 3,
"height_rand_b": 3
},
"trunk_provider": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "minecraft:oak_log",
"Properties": {
"axis": "y"
}
}
}
}
}
@@ -0,0 +1,22 @@
{
"type": "minecraft:block_blob",
"config": {
"can_place_on": {
"type": "minecraft:matching_blocks",
"blocks": [
"ageofthegods:shale_grass_block",
"minecraft:sandstone",
"ageofthegods:shale_block",
"ageofthegods:limestone_grass_block"
],
"offset": [
0,
-1,
0
]
},
"state": {
"Name": "minecraft:granite"
}
}
}
@@ -0,0 +1,22 @@
{
"type": "minecraft:block_blob",
"config": {
"can_place_on": {
"type": "minecraft:matching_blocks",
"blocks": [
"ageofthegods:shale_grass_block",
"minecraft:sandstone",
"ageofthegods:shale_block",
"ageofthegods:limestone_grass_block"
],
"offset": [
0,
-1,
0
]
},
"state": {
"Name": "minecraft:gravel"
}
}
}
@@ -0,0 +1,22 @@
{
"type": "minecraft:block_blob",
"config": {
"can_place_on": {
"type": "minecraft:matching_blocks",
"blocks": [
"ageofthegods:shale_grass_block",
"minecraft:sandstone",
"ageofthegods:shale_block",
"ageofthegods:limestone_grass_block"
],
"offset": [
0,
-1,
0
]
},
"state": {
"Name": "ageofthegods:limestone_block"
}
}
}
@@ -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:oak_leaves",
"Properties": {
"distance": "7",
"persistent": "false",
"waterlogged": "false"
}
}
},
"ignore_vines": false,
"minimum_size": {
"type": "minecraft:two_layers_feature_size",
"limit": 5,
"lower_size": 3,
"upper_size": 5
},
"trunk_placer": {
"type": "ageofthegods:twisty_trunk_placer",
"base_height": 3,
"height_rand_a": 3,
"height_rand_b": 3
},
"trunk_provider": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "minecraft:oak_log",
"Properties": {
"axis": "y"
}
}
}
}
}
@@ -48,8 +48,8 @@
"trunk_placer": {
"type": "ageofthegods:twisty_trunk_placer",
"base_height": 10,
"height_rand_a": 6,
"height_rand_b": 4
"height_rand_a": 10,
"height_rand_b": 10
},
"trunk_provider": {
"type": "minecraft:simple_state_provider",
@@ -0,0 +1,22 @@
{
"type": "minecraft:block_blob",
"config": {
"can_place_on": {
"type": "minecraft:matching_blocks",
"blocks": [
"ageofthegods:shale_grass_block",
"minecraft:sandstone",
"ageofthegods:shale_block",
"ageofthegods:limestone_grass_block"
],
"offset": [
0,
-1,
0
]
},
"state": {
"Name": "ageofthegods:shale_block"
}
}
}
@@ -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:oak_leaves",
"Properties": {
"distance": "7",
"persistent": "false",
"waterlogged": "false"
}
}
},
"ignore_vines": false,
"minimum_size": {
"type": "minecraft:two_layers_feature_size",
"limit": 4,
"lower_size": 3,
"upper_size": 4
},
"trunk_placer": {
"type": "ageofthegods:twisty_trunk_placer",
"base_height": 12,
"height_rand_a": 10,
"height_rand_b": 10
},
"trunk_provider": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "minecraft:oak_log",
"Properties": {
"axis": "y"
}
}
}
}
}
@@ -0,0 +1,31 @@
{
"feature": "ageofthegods:granite_boulder",
"placement": [
{
"type": "minecraft:count",
"count": 1
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "WORLD_SURFACE_WG"
},
{
"type": "minecraft:block_predicate_filter",
"predicate": {
"type": "minecraft:matching_blocks",
"blocks": "minecraft:granite",
"offset": [
0,
-1,
0
]
}
},
{
"type": "minecraft:biome"
}
]
}
@@ -0,0 +1,31 @@
{
"feature": "ageofthegods:gravel_boulder",
"placement": [
{
"type": "minecraft:count",
"count": 1
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "WORLD_SURFACE_WG"
},
{
"type": "minecraft:block_predicate_filter",
"predicate": {
"type": "minecraft:matching_blocks",
"blocks": "minecraft:granite",
"offset": [
0,
-1,
0
]
}
},
{
"type": "minecraft:biome"
}
]
}
@@ -0,0 +1,19 @@
{
"feature": "ageofthegods:limestone_boulder",
"placement": [
{
"type": "minecraft:count",
"count": 3
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "WORLD_SURFACE_WG"
},
{
"type": "minecraft:biome"
}
]
}
@@ -0,0 +1,19 @@
{
"feature": "ageofthegods:shale_boulder",
"placement": [
{
"type": "minecraft:count",
"count": 5
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "WORLD_SURFACE_WG"
},
{
"type": "minecraft:biome"
}
]
}
@@ -0,0 +1,47 @@
{
"feature": "ageofthegods:garrigue_short_twisty_tree",
"placement": [
{
"type": "minecraft:noise_threshold_count",
"above_noise": 10,
"below_noise": 3,
"noise_level": -0.2
},
{
"type": "minecraft:rarity_filter",
"chance": 10
},
{
"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",
"minecraft:sand"
],
"offset": [
0,
-1,
0
]
}
},
{
"type": "minecraft:surface_water_depth_filter",
"max_water_depth": 0
},
{
"type": "minecraft:biome"
}
]
}
@@ -0,0 +1,47 @@
{
"feature": "ageofthegods:maquis_short_twisty_tree",
"placement": [
{
"type": "minecraft:noise_threshold_count",
"above_noise": 10,
"below_noise": 3,
"noise_level": -0.1
},
{
"type": "minecraft:rarity_filter",
"chance": 10
},
{
"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",
"minecraft:granite",
"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,46 @@
{
"feature": "ageofthegods:tall_thin_twisty_tree",
"placement": [
{
"type": "minecraft:noise_threshold_count",
"above_noise": 10,
"below_noise": 3,
"noise_level": -0.2
},
{
"type": "minecraft:rarity_filter",
"chance": 10
},
{
"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"
}
]
}
@@ -1,9 +1,11 @@
{
"feature": "ageofthegods:twisty_tree",
"feature": "ageofthegods:maquis_tall_twisty_tree",
"placement": [
{
"type": "minecraft:count",
"count": 10
"type": "minecraft:noise_threshold_count",
"above_noise": 10,
"below_noise": 3,
"noise_level": -0.2
},
{
"type": "minecraft:rarity_filter",
@@ -454,6 +454,31 @@
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"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.15,
"min_threshold": 0.0,
"noise": "minecraft:patch"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:sand"
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
@@ -479,6 +504,31 @@
}
}
},
{
"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.0,
"noise": "minecraft:powder_snow"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "ageofthegods:limestone_block"
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
@@ -504,6 +554,31 @@
}
}
},
{
"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.0,
"noise": "ageofthegods:tiny_patchy_noise"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "ageofthegods:limestone_block"
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
@@ -520,6 +595,22 @@
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"add_surface_depth": false,
"offset": 4,
"secondary_depth_range": 0,
"surface_type": "floor"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:sandstone"
}
}
},
{
"type": "minecraft:condition",
"if_true": {
@@ -550,6 +641,56 @@
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"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:granite"
}
}
}
},
{
"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:shale_grass_block"
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
@@ -584,6 +725,22 @@
"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:stone_depth",
"add_surface_depth": false,
"offset": 10,
"secondary_depth_range": 0,
"surface_type": "floor"
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
@@ -600,6 +757,239 @@
}
}
},
{
"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:mediterranean_forest"
]
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"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.15,
"min_threshold": 0.0,
"noise": "minecraft:patch"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:air"
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"add_surface_depth": false,
"offset": 4,
"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:water",
"Properties": {
"level": "0"
}
}
}
}
},
{
"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": "ageofthegods:shale_block"
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"add_surface_depth": false,
"offset": 1,
"secondary_depth_range": 0,
"surface_type": "floor"
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"max_threshold": 0.2,
"min_threshold": -0.05,
"noise": "minecraft:patch"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:sand"
}
}
}
},
{
"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": 1.7976931348623157E308,
"min_threshold": 0.0,
"noise": "minecraft:powder_snow"
},
"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": 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.0,
"noise": "minecraft:powder_snow"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "ageofthegods:limestone_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:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"max_threshold": 1.7976931348623157E308,
"min_threshold": 0.0,
"noise": "ageofthegods:tiny_patchy_noise"
},
"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": 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.0,
"noise": "ageofthegods:tiny_patchy_noise"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "ageofthegods:limestone_block"
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
@@ -612,7 +1002,7 @@
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "ageofthegods:shale_block"
"Name": "ageofthegods:shale_grass_block"
}
}
},
@@ -621,23 +1011,14 @@
"if_true": {
"type": "minecraft:stone_depth",
"add_surface_depth": false,
"offset": 10,
"offset": 4,
"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"
}
"Name": "ageofthegods:shale_block"
}
}
},
@@ -653,7 +1034,7 @@
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "ageofthegods:shale_block"
"Name": "ageofthegods:limestone_block"
}
}
}
@@ -20,11 +20,22 @@ import java.util.List;
import java.util.function.BiConsumer;
public class TwistyBranchingTrunkPlacer extends TrunkPlacer {
private static final int BEGINNING_TRUNK_WIDTH = 5;
private int BEGINNING_TRUNK_WIDTH = 5;
private float BranchPossibility = 0.40f;
public TwistyBranchingTrunkPlacer(int baseHeight, int heightRandA, int heightRandB) {
super(baseHeight, heightRandA, heightRandB);
}
public TwistyBranchingTrunkPlacer SetTrunkWidth(int BEGINNING_TRUNK_WIDTH){
this.BEGINNING_TRUNK_WIDTH = BEGINNING_TRUNK_WIDTH;
return this;
}
public TwistyBranchingTrunkPlacer SetBranchPossibility(float BranchPossibility){
this.BranchPossibility = BranchPossibility;
return this;
}
public static final MapCodec<TwistyBranchingTrunkPlacer> CODEC = RecordCodecBuilder.mapCodec(instance ->
trunkPlacerParts(instance).apply(instance, TwistyBranchingTrunkPlacer::new)
);
@@ -63,13 +74,13 @@ public class TwistyBranchingTrunkPlacer extends TrunkPlacer {
currentPos = currentPos.offset(randomSource.nextInt(3) - 1, 0, randomSource.nextInt(3) - 1);
}
if (i > 2 && randomSource.nextFloat() < 0.40f) {
if (i > 2 && randomSource.nextFloat() < BranchPossibility) {
BlockPos branchStart = currentPos.offset(randomSource.nextInt(TRUNK_WIDTH), 0, randomSource.nextInt(TRUNK_WIDTH));
BlockPos branchEnd = generateBranch(worldGenLevel, biConsumer, randomSource, branchStart, treeConfiguration,i, leafNodes);
leafNodes.add(new FoliagePlacer.FoliageAttachment(branchEnd, randomSource.nextInt(2) + (Math.max((int)(i/(double)(mainHeight/1.25))*3,1)), false));
} else if(i > 2 && i == mainHeight - 1){
for(int l = 0; l < 1 + randomSource.nextInt(2); l++){
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);
@@ -24,14 +24,46 @@ public class ModNoiseSettings {
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);
SurfaceRules.ConditionSource isMaquisGrassPatch = SurfaceRules.noiseCondition(AgeOfTheGodsDataGeneration.TINY_PATCHY_NOISE, 0.0);
SurfaceRules.ConditionSource isGranite = SurfaceRules.noiseCondition(AgeOfTheGodsDataGeneration.TINY_PATCHY_NOISE, 0.1);
SurfaceRules.ConditionSource isGraniteSurfacePatch = SurfaceRules.noiseCondition(Noises.PATCH, 0.0,0.15);
SurfaceRules.ConditionSource isRiverBed = SurfaceRules.noiseCondition(Noises.PATCH, -0.05,0.2);
SurfaceRules.ConditionSource isPath = SurfaceRules.noiseCondition(Noises.EROSION_LARGE, -1.0,-0.5);
SurfaceRules.RuleSource garrigueSurface = SurfaceRules.sequence(
SurfaceRules.RuleSource MediterraneanSurface = SurfaceRules.sequence(
SurfaceRules.ifTrue(
SurfaceRules.stoneDepthCheck(0, false, 0, CaveSurface.FLOOR),
SurfaceRules.ifTrue(
isGraniteSurfacePatch,
SurfaceRules.state(Blocks.AIR.defaultBlockState())
)
),
SurfaceRules.ifTrue(
SurfaceRules.stoneDepthCheck(4, false, 0, CaveSurface.FLOOR),
SurfaceRules.ifTrue(
isGraniteSurfacePatch,
SurfaceRules.state(Blocks.WATER.defaultBlockState())
)
),
SurfaceRules.ifTrue(
SurfaceRules.stoneDepthCheck(6, false, 0, CaveSurface.FLOOR),
SurfaceRules.ifTrue(
isGraniteSurfacePatch,
SurfaceRules.state(ModBlocks.SHALE_BLOCK.get().defaultBlockState())
)
),
SurfaceRules.ifTrue(
SurfaceRules.stoneDepthCheck(1, false, 0, CaveSurface.FLOOR),
SurfaceRules.ifTrue(
isRiverBed,
SurfaceRules.state(Blocks.SAND.defaultBlockState())
)
),
SurfaceRules.ifTrue(
SurfaceRules.stoneDepthCheck(0, false, 0, CaveSurface.FLOOR),
SurfaceRules.ifTrue(
@@ -39,6 +71,12 @@ public class ModNoiseSettings {
SurfaceRules.state(ModBlocks.LIMESTONE_GRASS_BLOCK.get().defaultBlockState())
)
),
SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(10, false, 0, CaveSurface.FLOOR),
SurfaceRules.ifTrue(
isGarrigueGrassSection,
SurfaceRules.state(ModBlocks.LIMESTONE_BLOCK.get().defaultBlockState())
)
),
SurfaceRules.ifTrue(
SurfaceRules.stoneDepthCheck(0, false, 0, CaveSurface.FLOOR),
SurfaceRules.ifTrue(
@@ -46,8 +84,64 @@ public class ModNoiseSettings {
SurfaceRules.state(ModBlocks.LIMESTONE_GRASS_BLOCK.get().defaultBlockState())
)
),
SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(10, false, 0, CaveSurface.FLOOR),
SurfaceRules.ifTrue(
isGarrigueGrassPatch,
SurfaceRules.state(ModBlocks.LIMESTONE_BLOCK.get().defaultBlockState())
)
),
SurfaceRules.ifTrue(
SurfaceRules.stoneDepthCheck(0, false, 0, CaveSurface.FLOOR),
SurfaceRules.state(ModBlocks.SHALE_GRASS_BLOCK.get().defaultBlockState())
),
SurfaceRules.ifTrue(
SurfaceRules.stoneDepthCheck(4, false, 0, CaveSurface.FLOOR),
SurfaceRules.state(ModBlocks.SHALE_BLOCK.get().defaultBlockState())
),
SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(10, false, 0, CaveSurface.FLOOR),
SurfaceRules.state(ModBlocks.LIMESTONE_BLOCK.get().defaultBlockState()))
);
SurfaceRules.RuleSource garrigueSurface = SurfaceRules.sequence(
SurfaceRules.ifTrue(
SurfaceRules.stoneDepthCheck(0, false, 0, CaveSurface.FLOOR),
SurfaceRules.ifTrue(
isGraniteSurfacePatch,
SurfaceRules.state(Blocks.SAND.defaultBlockState())
)
),
SurfaceRules.ifTrue(
SurfaceRules.stoneDepthCheck(0, false, 0, CaveSurface.FLOOR),
SurfaceRules.ifTrue(
isGarrigueGrassSection,
SurfaceRules.state(ModBlocks.LIMESTONE_GRASS_BLOCK.get().defaultBlockState())
)
),
SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(10, false, 0, CaveSurface.FLOOR),
SurfaceRules.ifTrue(
isGarrigueGrassSection,
SurfaceRules.state(ModBlocks.LIMESTONE_BLOCK.get().defaultBlockState())
)
),
SurfaceRules.ifTrue(
SurfaceRules.stoneDepthCheck(0, false, 0, CaveSurface.FLOOR),
SurfaceRules.ifTrue(
isGarrigueGrassPatch,
SurfaceRules.state(ModBlocks.LIMESTONE_GRASS_BLOCK.get().defaultBlockState())
)
),
SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(10, false, 0, CaveSurface.FLOOR),
SurfaceRules.ifTrue(
isGarrigueGrassPatch,
SurfaceRules.state(ModBlocks.LIMESTONE_BLOCK.get().defaultBlockState())
)
),
SurfaceRules.ifTrue(
SurfaceRules.stoneDepthCheck(0, false, 0, CaveSurface.FLOOR),
SurfaceRules.state(Blocks.SANDSTONE.defaultBlockState())
),
SurfaceRules.ifTrue(
SurfaceRules.stoneDepthCheck(4, false, 0, CaveSurface.FLOOR),
SurfaceRules.state(Blocks.SANDSTONE.defaultBlockState())
),
SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(10, false, 0, CaveSurface.FLOOR),
@@ -55,20 +149,28 @@ public class ModNoiseSettings {
);
SurfaceRules.RuleSource maquisSurface = SurfaceRules.sequence(
SurfaceRules.ifTrue(
SurfaceRules.stoneDepthCheck(6, false, 0, CaveSurface.FLOOR),
SurfaceRules.ifTrue(
isGraniteSurfacePatch,
SurfaceRules.state(Blocks.GRANITE.defaultBlockState())
)
),
SurfaceRules.ifTrue(
SurfaceRules.stoneDepthCheck(0, false, 0, CaveSurface.FLOOR),
SurfaceRules.ifTrue(
isMaquisGrassPatch,
isPath,
SurfaceRules.state(ModBlocks.SHALE_GRASS_BLOCK.get().defaultBlockState())
)
),
SurfaceRules.ifTrue(
SurfaceRules.stoneDepthCheck(0, false, 0, CaveSurface.FLOOR),
SurfaceRules.ifTrue(
isGranite,
SurfaceRules.state(Blocks.GRANITE.defaultBlockState())
isMaquisGrassPatch,
SurfaceRules.state(ModBlocks.SHALE_GRASS_BLOCK.get().defaultBlockState())
)
),
SurfaceRules.ifTrue(
SurfaceRules.stoneDepthCheck(0, false, 0, CaveSurface.FLOOR),
SurfaceRules.state(ModBlocks.SHALE_BLOCK.get().defaultBlockState())
@@ -87,6 +189,7 @@ public class ModNoiseSettings {
return SurfaceRules.sequence(
SurfaceRules.ifTrue(SurfaceRules.isBiome(garrigueKey), garrigueSurface),
SurfaceRules.ifTrue(SurfaceRules.isBiome(maquisKey), maquisSurface),
SurfaceRules.ifTrue(SurfaceRules.isBiome(MediterraneanKey), MediterraneanSurface),
SurfaceRuleData.overworld()
);
}
@@ -0,0 +1,12 @@
package net.halbear.aotg.custom.WorldGen.Noise;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.BootstrapContext;
import net.minecraft.resources.Identifier;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.levelgen.DensityFunction;
import net.minecraft.world.level.levelgen.DensityFunctions;
public class NoiseDensityFunctions {
}
@@ -15,15 +15,30 @@ import net.neoforged.neoforge.common.world.BiomeModifier;
import net.neoforged.neoforge.common.world.BiomeModifiers;
import net.neoforged.neoforge.registries.NeoForgeRegistries;
import static net.halbear.aotg.registries.ModPlacedFeatures.*;
public class ModBiomeModifiers {
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_TWISTY_BUSH_TREE =
ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "add_twisty_bush_tree"));
public static final ResourceKey<BiomeModifier> ADD_TALL_THIN_TWISTY_TREE =
ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "add_tall_thin_twisty_tree"));
public static final ResourceKey<BiomeModifier> GRANITE_BOULDER_BIOME_MODIFIER = ResourceKey.create(
NeoForgeRegistries.Keys.BIOME_MODIFIERS, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "add_granite_boulder"));
public static final ResourceKey<BiomeModifier> GRAVEL_BOULDER_BIOME_MODIFIER = ResourceKey.create(
NeoForgeRegistries.Keys.BIOME_MODIFIERS, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "add_gravel_boulder"));
public static final ResourceKey<BiomeModifier> SHALE_BOULDER_BIOME_MODIFIER = ResourceKey.create(
NeoForgeRegistries.Keys.BIOME_MODIFIERS, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "add_shale_boulder"));
public static final ResourceKey<BiomeModifier> LIMESTONE_BOULDER_BIOME_MODIFIER = ResourceKey.create(
NeoForgeRegistries.Keys.BIOME_MODIFIERS, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "limestone_shale_boulder"));
public static void bootstrap(BootstrapContext<BiomeModifier> context) {
HolderGetter<PlacedFeature> placedFeatures = context.lookup(Registries.PLACED_FEATURE);
HolderGetter<Biome> biomes = context.lookup(Registries.BIOME);
var placedTreeHolder = placedFeatures.getOrThrow(ModPlacedFeatures.TWISTY_TREE_PLACED_KEY);
var placedTreeHolder = placedFeatures.getOrThrow(ModPlacedFeatures.SHORT_TWISTY_TREE_PLACED_KEY);
var targetBiomes = HolderSet.direct(biomes.getOrThrow(ModBiomes.MAQUIS_SHRUBLAND));
@@ -32,5 +47,58 @@ public class ModBiomeModifiers {
HolderSet.direct(placedTreeHolder),
GenerationStep.Decoration.VEGETAL_DECORATION
));
var placedLookup = context.lookup(Registries.PLACED_FEATURE);
var placedHolder = placedLookup.getOrThrow(GRANITE_BOULDER_PLACED);
var modifier = new BiomeModifiers.AddFeaturesBiomeModifier(
targetBiomes,
HolderSet.direct(placedHolder),
GenerationStep.Decoration.VEGETAL_DECORATION
);
context.register(GRANITE_BOULDER_BIOME_MODIFIER, modifier);
placedHolder = placedLookup.getOrThrow(SHALE_BOULDER_PLACED);
modifier = new BiomeModifiers.AddFeaturesBiomeModifier(
targetBiomes,
HolderSet.direct(placedHolder),
GenerationStep.Decoration.VEGETAL_DECORATION
);
context.register(SHALE_BOULDER_BIOME_MODIFIER, modifier);
placedHolder = placedLookup.getOrThrow(GRAVEL_BOULDER_PLACED);
modifier = new BiomeModifiers.AddFeaturesBiomeModifier(
targetBiomes,
HolderSet.direct(placedHolder),
GenerationStep.Decoration.VEGETAL_DECORATION
);
context.register(GRAVEL_BOULDER_BIOME_MODIFIER, modifier);
targetBiomes = HolderSet.direct(biomes.getOrThrow(ModBiomes.GARRIGUE), biomes.getOrThrow(ModBiomes.MEDITERRANEAN_FOREST));
placedHolder = placedLookup.getOrThrow(LIMESTONE_BOULDER_PLACED);
modifier = new BiomeModifiers.AddFeaturesBiomeModifier(
targetBiomes,
HolderSet.direct(placedHolder),
GenerationStep.Decoration.VEGETAL_DECORATION
);
context.register(LIMESTONE_BOULDER_BIOME_MODIFIER, modifier);
placedTreeHolder = placedFeatures.getOrThrow(SHORT_GARRIGUE_TWISTY_TREE_PLACED_KEY);
context.register(ADD_TWISTY_BUSH_TREE, new BiomeModifiers.AddFeaturesBiomeModifier(
targetBiomes,
HolderSet.direct(placedTreeHolder),
GenerationStep.Decoration.VEGETAL_DECORATION
));
placedTreeHolder = placedFeatures.getOrThrow(TALL_THIN_TWISTY_TREE_PLACED_KEY);
targetBiomes = HolderSet.direct(biomes.getOrThrow(ModBiomes.MEDITERRANEAN_FOREST));
context.register(ADD_TALL_THIN_TWISTY_TREE, new BiomeModifiers.AddFeaturesBiomeModifier(
targetBiomes,
HolderSet.direct(placedTreeHolder),
GenerationStep.Decoration.VEGETAL_DECORATION
));
}
}
@@ -19,4 +19,5 @@ 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"));
}
@@ -3,34 +3,132 @@ 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.TwistyBranchingTrunkPlacer;
import net.minecraft.core.BlockPos;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.BootstrapContext;
import net.minecraft.resources.Identifier;
import net.minecraft.resources.ResourceKey;
import net.minecraft.util.valueproviders.ConstantInt;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.levelgen.blockpredicates.BlockPredicate;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.feature.configurations.BlockBlobConfiguration;
import net.minecraft.world.level.levelgen.feature.configurations.TreeConfiguration;
import net.minecraft.world.level.levelgen.feature.featuresize.TwoLayersFeatureSize;
import net.minecraft.world.level.levelgen.feature.foliageplacers.BlobFoliagePlacer;
import net.minecraft.world.level.levelgen.feature.foliageplacers.CherryFoliagePlacer;
import net.minecraft.world.level.levelgen.feature.stateproviders.BlockStateProvider;
import net.minecraft.world.level.levelgen.placement.BlockPredicateFilter;
public class ModConfiguredFeatures {
public static final ResourceKey<ConfiguredFeature<?, ?>> TWISTY_TREE_KEY =
ResourceKey.create(Registries.CONFIGURED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "twisty_tree"));
ResourceKey.create(Registries.CONFIGURED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "maquis_tall_twisty_tree"));
public static final ResourceKey<ConfiguredFeature<?, ?>> MAQUIS_SHORT_TWISTY_TREE_KEY =
ResourceKey.create(Registries.CONFIGURED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "maquis_short_twisty_tree"));
public static final ResourceKey<ConfiguredFeature<?, ?>> GARRIGUE_TWISTY_TREE =
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<?, ?>> GRANITE_BOULDER = ResourceKey.create(
Registries.CONFIGURED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "granite_boulder"));
public static final ResourceKey<ConfiguredFeature<?, ?>> SHALE_BOULDER = ResourceKey.create(
Registries.CONFIGURED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "shale_boulder"));
public static final ResourceKey<ConfiguredFeature<?, ?>> GRAVEL_BOULDER = ResourceKey.create(
Registries.CONFIGURED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "gravel_boulder"));
public static final ResourceKey<ConfiguredFeature<?, ?>> LIMESTONE_BOULDER = ResourceKey.create(
Registries.CONFIGURED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "limestone_boulder"));
public static void bootstrap(BootstrapContext<ConfiguredFeature<?, ?>> context) {
context.register(TALL_THIN_TWISTY_TREE, new ConfiguredFeature<>(
Feature.TREE,
new TreeConfiguration.TreeConfigurationBuilder(
BlockStateProvider.simple(Blocks.OAK_LOG.defaultBlockState()),
new TwistyBranchingTrunkPlacer(12, 10, 10).SetTrunkWidth(3).SetBranchPossibility(0.65f),
BlockStateProvider.simple(Blocks.OAK_LEAVES.defaultBlockState()),
new LeafBunchFoliagePlacer(ConstantInt.of(1),ConstantInt.of(0)),
new TwoLayersFeatureSize(4, 3, 4)
).build()
));
context.register(TWISTY_TREE_KEY, new ConfiguredFeature<>(
Feature.TREE,
new TreeConfiguration.TreeConfigurationBuilder(
BlockStateProvider.simple(Blocks.OAK_LOG.defaultBlockState()),
new TwistyBranchingTrunkPlacer(10, 6, 4),
new TwistyBranchingTrunkPlacer(10, 10, 10),
BlockStateProvider.simple(Blocks.OAK_LEAVES.defaultBlockState()),
new LeafBunchFoliagePlacer(ConstantInt.of(1),ConstantInt.of(0)),
new TwoLayersFeatureSize(5, 3, 5)
).build()
));
context.register(GARRIGUE_TWISTY_TREE, new ConfiguredFeature<>(
Feature.TREE,
new TreeConfiguration.TreeConfigurationBuilder(
BlockStateProvider.simple(Blocks.OAK_LOG.defaultBlockState()),
new TwistyBranchingTrunkPlacer(2, 3, 3).SetTrunkWidth(2),
BlockStateProvider.simple(Blocks.OAK_LEAVES.defaultBlockState()),
new LeafBunchFoliagePlacer(ConstantInt.of(1),ConstantInt.of(0)),
new TwoLayersFeatureSize(5, 3, 5)
).build()
));
context.register(MAQUIS_SHORT_TWISTY_TREE_KEY, new ConfiguredFeature<>(
Feature.TREE,
new TreeConfiguration.TreeConfigurationBuilder(
BlockStateProvider.simple(Blocks.OAK_LOG.defaultBlockState()),
new TwistyBranchingTrunkPlacer(3, 3, 3),
BlockStateProvider.simple(Blocks.OAK_LEAVES.defaultBlockState()),
new LeafBunchFoliagePlacer(ConstantInt.of(1),ConstantInt.of(0)),
new TwoLayersFeatureSize(5, 3, 5)
).build()
));
BlockBlobConfiguration config = new BlockBlobConfiguration(
Blocks.GRANITE.defaultBlockState(),
BlockPredicate.matchesBlocks(
new BlockPos(0, -1, 0),
ModBlocks.SHALE_GRASS_BLOCK.get(),
Blocks.SANDSTONE,
ModBlocks.SHALE_BLOCK.get(),
ModBlocks.LIMESTONE_GRASS_BLOCK.get()
)
);
context.register(GRANITE_BOULDER, new ConfiguredFeature<>(Feature.BLOCK_BLOB, config));
config = new BlockBlobConfiguration(
ModBlocks.SHALE_BLOCK.get().defaultBlockState(),
BlockPredicate.matchesBlocks(
new BlockPos(0, -1, 0),
ModBlocks.SHALE_GRASS_BLOCK.get(),
Blocks.SANDSTONE,
ModBlocks.SHALE_BLOCK.get(),
ModBlocks.LIMESTONE_GRASS_BLOCK.get()
)
);
context.register(SHALE_BOULDER, new ConfiguredFeature<>(Feature.BLOCK_BLOB, config));
config = new BlockBlobConfiguration(
Blocks.GRAVEL.defaultBlockState(),
BlockPredicate.matchesBlocks(
new BlockPos(0, -1, 0),
ModBlocks.SHALE_GRASS_BLOCK.get(),
Blocks.SANDSTONE,
ModBlocks.SHALE_BLOCK.get(),
ModBlocks.LIMESTONE_GRASS_BLOCK.get()
)
);
context.register(GRAVEL_BOULDER, new ConfiguredFeature<>(Feature.BLOCK_BLOB, config));
config = new BlockBlobConfiguration(
ModBlocks.LIMESTONE_BLOCK.get().defaultBlockState(),
BlockPredicate.matchesBlocks(
new BlockPos(0, -1, 0),
ModBlocks.SHALE_GRASS_BLOCK.get(),
Blocks.SANDSTONE,
ModBlocks.SHALE_BLOCK.get(),
ModBlocks.LIMESTONE_GRASS_BLOCK.get()
)
);
context.register(LIMESTONE_BOULDER, new ConfiguredFeature<>(Feature.BLOCK_BLOB, config));
}
}
@@ -9,24 +9,43 @@ import net.minecraft.data.worldgen.placement.PlacementUtils;
import net.minecraft.resources.Identifier;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.levelgen.Heightmap;
import net.minecraft.world.level.levelgen.blockpredicates.BlockPredicate;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
import net.minecraft.world.level.levelgen.placement.*;
import java.util.List;
import static net.halbear.aotg.registries.ModConfiguredFeatures.*;
public class ModPlacedFeatures {
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 =
ResourceKey.create(Registries.PLACED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "short_maquis_twisty_tree_placed"));
public static final ResourceKey<PlacedFeature> SHORT_GARRIGUE_TWISTY_TREE_PLACED_KEY =
ResourceKey.create(Registries.PLACED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "short_garrigue_twisty_tree_placed"));
public static final ResourceKey<PlacedFeature> TALL_THIN_TWISTY_TREE_PLACED_KEY =
ResourceKey.create(Registries.PLACED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "tall_thin_twisty_tree_placed"));
public static final ResourceKey<PlacedFeature> GRANITE_BOULDER_PLACED = ResourceKey.create(
Registries.PLACED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "granite_boulder_placed"));
public static final ResourceKey<PlacedFeature> SHALE_BOULDER_PLACED = ResourceKey.create(
Registries.PLACED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "shale_boulder_placed"));
public static final ResourceKey<PlacedFeature> GRAVEL_BOULDER_PLACED = ResourceKey.create(
Registries.PLACED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "gravel_boulder_placed"));
public static final ResourceKey<PlacedFeature> LIMESTONE_BOULDER_PLACED = ResourceKey.create(
Registries.PLACED_FEATURE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "limestone_boulder_placed"));
public static void bootstrap(BootstrapContext<PlacedFeature> context) {
HolderGetter<ConfiguredFeature<?, ?>> configuredFeatures = context.lookup(Registries.CONFIGURED_FEATURE);
var configuredTreeHolder = configuredFeatures.getOrThrow(ModConfiguredFeatures.TWISTY_TREE_KEY);
var configuredTreeHolder = configuredFeatures.getOrThrow(TALL_THIN_TWISTY_TREE);
context.register(TWISTY_TREE_PLACED_KEY, new PlacedFeature(
context.register(TALL_THIN_TWISTY_TREE_PLACED_KEY, new PlacedFeature(
configuredTreeHolder,
List.of(
CountPlacement.of(10),
NoiseThresholdCountPlacement.of(-0.2D, 3, 10),
RarityFilter.onAverageOnceEvery(10),
InSquarePlacement.spread(),
PlacementUtils.HEIGHTMAP_OCEAN_FLOOR,
@@ -40,9 +59,109 @@ public class ModPlacedFeatures {
)
),
SurfaceWaterDepthFilter.forMaxDepth(0),
BiomeFilter.biome()
)
));
configuredTreeHolder = configuredFeatures.getOrThrow(ModConfiguredFeatures.TWISTY_TREE_KEY);
context.register(TWISTY_TREE_PLACED_KEY, new PlacedFeature(
configuredTreeHolder,
List.of(
NoiseThresholdCountPlacement.of(-0.2D, 3, 10),
RarityFilter.onAverageOnceEvery(10),
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(GARRIGUE_TWISTY_TREE);
context.register(SHORT_GARRIGUE_TWISTY_TREE_PLACED_KEY, new PlacedFeature(
configuredTreeHolder,
List.of(
NoiseThresholdCountPlacement.of(-0.2D, 3, 10),
RarityFilter.onAverageOnceEvery(10),
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(),
Blocks.SAND
)
),
SurfaceWaterDepthFilter.forMaxDepth(0),
BiomeFilter.biome()
)
));
configuredTreeHolder = configuredFeatures.getOrThrow(ModConfiguredFeatures.MAQUIS_SHORT_TWISTY_TREE_KEY);
context.register(SHORT_TWISTY_TREE_PLACED_KEY, new PlacedFeature(
configuredTreeHolder,
List.of(
NoiseThresholdCountPlacement.of(-0.1D, 3, 10),
RarityFilter.onAverageOnceEvery(10),
InSquarePlacement.spread(),
PlacementUtils.HEIGHTMAP_OCEAN_FLOOR,
BlockPredicateFilter.forPredicate(
BlockPredicate.matchesBlocks(
new BlockPos(0, -1, 0),
ModBlocks.SHALE_GRASS_BLOCK.get(),
Blocks.SANDSTONE,
Blocks.GRANITE,
ModBlocks.SHALE_BLOCK.get(),
ModBlocks.LIMESTONE_GRASS_BLOCK.get()
)
),
SurfaceWaterDepthFilter.forMaxDepth(0),
BiomeFilter.biome()
)
));
var configuredLookup = context.lookup(Registries.CONFIGURED_FEATURE);
var configuredHolder = configuredLookup.getOrThrow(GRANITE_BOULDER);
List<PlacementModifier> modifiers = List.of(
CountPlacement.of(1),
InSquarePlacement.spread(),
HeightmapPlacement.onHeightmap(Heightmap.Types.WORLD_SURFACE_WG),
BlockPredicateFilter.forPredicate(
BlockPredicate.matchesBlocks(
new BlockPos(0, -1, 0),
Blocks.GRANITE
)
),
BiomeFilter.biome()
);
context.register(GRANITE_BOULDER_PLACED, new PlacedFeature(configuredHolder, modifiers));
configuredHolder = configuredLookup.getOrThrow(GRAVEL_BOULDER);
context.register(GRAVEL_BOULDER_PLACED, new PlacedFeature(configuredHolder, modifiers));
configuredHolder = configuredLookup.getOrThrow(SHALE_BOULDER);
modifiers = List.of(
CountPlacement.of(5),
InSquarePlacement.spread(),
HeightmapPlacement.onHeightmap(Heightmap.Types.WORLD_SURFACE_WG),
BiomeFilter.biome()
);
context.register(SHALE_BOULDER_PLACED, new PlacedFeature(configuredHolder, modifiers));
configuredHolder = configuredLookup.getOrThrow(LIMESTONE_BOULDER);
modifiers = List.of(
CountPlacement.of(3),
InSquarePlacement.spread(),
HeightmapPlacement.onHeightmap(Heightmap.Types.WORLD_SURFACE_WG),
BiomeFilter.biome()
);
context.register(LIMESTONE_BOULDER_PLACED, new PlacedFeature(configuredHolder, modifiers));
}
}
@@ -152,13 +152,17 @@ public class SkyBoxRendering {
public static void renderCustomSun(RenderLevelStageEvent.AfterSky event, Identifier textureId) {
initBuffers();
SkyRenderState state = event.getLevelRenderState().skyRenderState;
render2DObjectInSkybox(event, textureId, "Sun",(float)Math.toRadians(-90F),state.sunAngle,new Vector3f(0,100.0f,0),new Vector3f(30.0F,-1.0F,30.0F),new Vector4f(1f,1f,1f,state.rainBrightness), sunBuffer,CUSTOM_SKYBOX_PIPELINE);//RenderPipelines.CELESTIAL);
render2DObjectInSkybox(event, textureId, "Sun",(float)Math.toRadians(-90F),state.sunAngle,new Vector3f(0,100.0f,0),new Vector3f(30.0F,-1.0F,30.0F),new Vector4f(1f,1f,1f,state.rainBrightness), sunBuffer,RenderPipelines.CELESTIAL);
}
public static void renderCustomMoon(RenderLevelStageEvent.AfterSky event, Identifier textureId) {
initBuffers();
SkyRenderState state = event.getLevelRenderState().skyRenderState;
render2DObjectInSkybox(event, textureId, "Moon",(float)Math.toRadians(-90F),state.moonAngle,new Vector3f(0,100.0f,0),new Vector3f(30.0F,-1.0F,30.0F),new Vector4f(1f,1f,1f,1f), moonBuffer,CUSTOM_SKYBOX_PIPELINE);//RenderPipelines.CELESTIAL);
Minecraft minecraft = Minecraft.getInstance();
long time = minecraft.level != null ? minecraft.level.getOverworldClockTime() % 24000 : 0;
float DayAlpha = DistantSkyObject.DayAlpha;
float NightAlpha = DistantSkyObject.NightAlpha;
render2DObjectInSkybox(event, textureId, "Moon",(float)Math.toRadians(-90F),state.moonAngle,new Vector3f(0,100.0f,0),new Vector3f(30.0F,-1.0F,30.0F),new Vector4f((float) (0.75 + (DayAlpha * 0.25f) + (NightAlpha * 0.25f)), (float) (0.35 + (DayAlpha * 0.65f) + (NightAlpha * 0.65f)), (float) (0.25 + (DayAlpha * 0.75f) + (NightAlpha * 0.75f)),1), moonBuffer,CUSTOM_SKYBOX_PIPELINE);//RenderPipelines.CELESTIAL);
}
public static float getNightAlpha(long dayTime) {
@@ -31,6 +31,8 @@ import static net.halbear.aotg.AgeoftheGods.MODID;
public class AgeOfTheGodsDataGeneration {
public static final ResourceKey<net.minecraft.world.level.levelgen.synth.NormalNoise.NoiseParameters> TINY_PATCHY_NOISE =
ResourceKey.create(Registries.NOISE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "tiny_patchy_noise"));
public static final ResourceKey<net.minecraft.world.level.levelgen.synth.NormalNoise.NoiseParameters> PATH_NOISE =
ResourceKey.create(Registries.NOISE, Identifier.fromNamespaceAndPath(AgeoftheGods.MODID, "path_noise"));
@SubscribeEvent
public static void gatherData(GatherDataEvent.Client event) {
@@ -8,8 +8,8 @@
"fog_color": 3060735,
"water_color": 4311792,
"water_fog_color": 4311792,
"grass_color": 16444553,
"foliage_color": 9429794,
"grass_color": 16772175,
"foliage_color": 11992832,
"ambient_loop_sound": "minecraft:ambient.cave",
"mood_sound": {
"sound": "minecraft:ambient.cave",
@@ -0,0 +1,64 @@
{
"has_precipitation": true,
"temperature": 0.5,
"downfall": 1.2,
"temperature_modifier": "none",
"effects": {
"water_color": 4311792,
"grass_color": 12844864,
"foliage_color": 14876480,
"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": {}
}
@@ -9,8 +9,8 @@
{
"biome": "ageofthegods:garrigue",
"parameters": {
"temperature": [-1.0, -0.1],
"humidity": [-1.0, 1.0],
"temperature": [0.0, 0.5],
"humidity": [-1.0, 0.0],
"continentalness": [-1.2, 1.0],
"erosion": [-1.0, 1.0],
"weirdness": [-1.0, 1.0],
@@ -21,14 +21,26 @@
{
"biome": "ageofthegods:maquis_shrubland",
"parameters": {
"temperature": [0.1, 1.0],
"humidity": [-1.0, 1.0],
"temperature": [0.5, 1.0],
"humidity": [-1.0, 0.0],
"continentalness": [-1.2, 1.0],
"erosion": [-1.0, 1.0],
"weirdness": [-1.0, 1.0],
"depth": 0.0,
"offset": 0.0
}
},
{
"biome": "ageofthegods:mediterranean_forest",
"parameters": {
"temperature": [-0.5, 0.0],
"humidity": [0.0, 1.0],
"continentalness": [-0.5, 0.9],
"erosion": [0.7, 1.0],
"weirdness": [0.0, 0.0],
"depth": 0.0,
"offset": 0.0
}
}
]
}