Worldgen 1.19 and later - TeamPneumatic/pnc-repressurized GitHub Wiki
In Minecraft 1.19, world generation is very much data-driven, with nearly everything defined in JSON files. PneumaticCraft oil lake generation is no exception to this, and is almost completely controlled by datapack and JSON files. This page explains how oil lake generation can be configured and modified.
See https://minecraft.wiki/w/Configured_feature for more information on configured features.
This file defines Oil lakes as a configured feature, using the generation code from minecraft:lake
, and can be found in data/pneumaticcraft/worldgen/configured_feature/oil_lake.json
:
Click to show JSON
{
"type": "minecraft:lake",
"config": {
"barrier": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "minecraft:air"
}
},
"fluid": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "pneumaticcraft:oil",
"Properties": {
"level": "0"
}
}
}
}
}
See https://minecraft.wiki/w/Placed_feature for more information on placed features.
PneumaticCraft adds two separate placed features for oil lakes: one for surface generation, and one for underground generation. The purpose of this is to allow separate configuration of the frequency of surface and underground oil lakes. Default frequencies are the same as for vanilla surface and underground lava lakes (attempt once every 6 chunks to generate an underground lake, and once every 25 chunks to generate a surface lake)
Default surface placed feature (data/pneumaticcraft/worldgen/placed_feature/oil_lake_surface.json
):
Click to show JSON
{
"feature": "pneumaticcraft:oil_lake",
"placement": [
{
"type": "minecraft:rarity_filter",
"chance": 25
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "WORLD_SURFACE_WG"
},
{
"type": "minecraft:biome"
},
{
"type": "pneumaticcraft:oil_lake_filter"
}
]
}
Default underground placed feature (data/pneumaticcraft/worldgen/placed_feature/oil_lake_underground.json
):
Click to show JSON
{
"feature": "pneumaticcraft:oil_lake",
"placement": [
{
"type": "minecraft:rarity_filter",
"chance": 6
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:height_range",
"height": {
"type": "minecraft:uniform",
"max_inclusive": {
"below_top": 0
},
"min_inclusive": {
"absolute": 0
}
}
},
{
"type": "minecraft:environment_scan",
"direction_of_search": "down",
"max_steps": 32,
"target_condition": {
"type": "minecraft:all_of",
"predicates": [
{
"type": "minecraft:not",
"predicate": {
"type": "minecraft:matching_blocks",
"blocks": "minecraft:air"
}
},
{
"type": "minecraft:inside_world_bounds",
"offset": [
0,
-5,
0
]
}
]
}
},
{
"type": "minecraft:surface_relative_threshold_filter",
"heightmap": "OCEAN_FLOOR_WG",
"max_inclusive": -5
},
{
"type": "minecraft:biome"
},
{
"type": "pneumaticcraft:oil_lake_filter"
}
]
}
The most likely change you would want to make here is to edit the rarity of oil lakes, via the minecraft:rarity_filter
field.
You may have noticed in the placed feature JSONs above that a custom placement filter is used: pneumaticcraft:oil_lake_filter
. This filter serves two purposes:
- Config-driven whitelisting/blacklisting of oil lakes by dimension
- Prevention of placement of oil lakes within certain structures (by default, any village).
There are two config settings in pneumaticcraft-common.toml
(Worldgen section) which control which dimensions may include oil lakes. Both are empty by default, allowing oil lake gen to occur in any dimension (although generation by default is limited to overworld biomes - see next section for more information on that).
[Worldgen]
#Oil worldgen blacklist by dimension ID: add dimension ID's to this list if you don't want oil lake worldgen to happen there. You can wildcard this; e.g 'modid:*' blacklists ALL dimensions of namespace 'modid'.
oil_world_gen_dimension_blacklist = []
#Oil worldgen whitelist by dimension ID: add dimension ID's to this list if you want oil lake worldgen to happen ONLY in those dimensions. You can wildcard the path; e.g 'modid:*' whitelists ALL dimensions of namespace 'modid'. If this is empty, it is ignored, and 'oil_world_gen_dimension_blacklist' will be checked instead.
oil_world_gen_dimension_whitelist = []
Note that a non-empty whitelist will cause the blacklist setting to be ignored; lake generation will only happen in whitelisted dimensions in that case.
Oil lakes will not generate within villages by default. This is controlled by the structure tag pneumaticcraft:no_oil_lakes
- which is modifiable in data/pneumaticcraft/tags/worldgen/structure/no_oil_lakes.json
:
Click to show JSON
{
"values": [
"#minecraft:village"
]
}
The default value prevents lake generation in any structure in the vanilla #minecraft:village
tag, which is the five biome-specific villages (plains, desert, taiga, savanna and snowy). Other vanilla structure ID's and tags are available, e.g. #minecraft:mineshaft
, #minecraft:shipwreck
, etc., and mods may add further structure ID's and tags if they add custom structures.
Biome Modifiers are a new Forge mechanism (added in 1.19) to allow mods to add features to biomes, remove features from biomes, and more. They are the standard data-driven way to add modded features to worlds as of 1.19. See https://forge.gemwire.uk/wiki/Biome_Modifiers for more information.
PneumaticCraft adds two biome modifiers: data/pneumaticcraft/forge/biome_modifier/oil_lake_surface.json
and data/pneumaticcraft/forge/biome_modifier/oil_lake_underground.json
:
Click to show oil_lake_surface.json
{
"type": "forge:add_features",
"biomes": "#pneumaticcraft:has_surface_oil_lakes",
"features": "pneumaticcraft:oil_lake_surface",
"step": "lakes"
}
Click to show oil_lake_underground.json
{
"type": "forge:add_features",
"biomes": "#pneumaticcraft:has_underground_oil_lakes",
"features": "pneumaticcraft:oil_lake_underground",
"step": "lakes"
}
There are two likely reasons to override either of these files:
- To disable oil lake generation entirely; override the biome modifier with
"type": "forge:none"
. - To change the biomes in which oil lakes can appear; see following section...
In the above two biome modifier JSONs, you will notice use of the #pneumaticcraft:has_surface_oil_lakes
and #pneumaticcraft:has_underground_oil_lakes
biome tags. By default, these biome tags (data/pneumaticcraft/tags/worldgen/biome/has_surface_oil_lakes.json
and .../has_underground_oil_lakes.json
) look like this:
{
"values": [
"#minecraft:is_overworld"
]
}
in other words, any overworld biome allows oil lakes. You can override this with either specific biomes, or any other biome tag.
See:
- https://minecraft.wiki/w/Biome#Biome_IDs for a list of all default (vanilla) Biome IDs
- https://minecraft.wiki/w/Tag#Biomes for a list of all default Biome tags
- https://github.com/MinecraftForge/MinecraftForge/tree/1.19.x/src/generated/resources/data/forge/tags/worldgen/biome for all the extra tags added by Forge (1.19/1.20)
- https://github.com/neoforged/NeoForge/tree/1.21.x/src/generated/resources/data/c/tags/worldgen/biome for all the extra tags added by NeoForge (1.21+)
Mods may of course add many more biomes and tags.