-
Notifications
You must be signed in to change notification settings - Fork 3
Surface Rules
Each material rule to be added requires the dimension key of the target dimension, an identifier to specify the rules owner, and one or more material rules.
The namespace of the rules owner must match the namespace of the biome(s) to which the rule will apply in order to be compatible with TerraBlender. Otherwise, when TerraBlender is installed, the material rules may not be applied. Overriding the material rules of vanilla biomes is also not allowed by TerraBlender.
If more than one material rule with the same owner identifier is supplied, rules with identical owner id will be sequenced together by Biolith prior to injection.
Material rules specified in JSON datapacks must parse correctly using Mojang's material rule CODEC, or they may be silently discarded.
MaterialRule birchForest = condition(MaterialRules.biome(BiomeKeys.BIRCH_FOREST), block(Blocks.CALCITE));
MaterialRule crimsonForest = condition(MaterialRules.biome(BiomeKeys.CRIMSON_FOREST), sequence(
condition(STONE_DEPTH_FLOOR,
MaterialRules.sequence(
MaterialRules.condition(MaterialRules.noiseThreshold(NoiseParametersKeys.NETHER_WART, 1.17), block(Blocks.NETHER_WART_BLOCK)),
block(Blocks.CRIMSON_NYLIUM))),
block(Blocks.NETHERRACK)));
MaterialRule warpedForest = condition(MaterialRules.biome(BiomeKeys.WARPED_FOREST), sequence(
condition(STONE_DEPTH_FLOOR,
MaterialRules.sequence(
MaterialRules.condition(MaterialRules.noiseThreshold(NoiseParametersKeys.NETHER_WART, 1.17), block(Blocks.WARPED_WART_BLOCK)),
block(Blocks.WARPED_NYLIUM))),
block(Blocks.NETHERRACK)));
SurfaceGeneration.addOverworldSurfaceRules(Identifier.of("minecraft", "rules/overworld"), condition(surface(), sequence(birchForest, crimsonForest, warpedForest)));