Custom biome API, mappings, and generated Bedrock visuals - #6658
darkcupid412 wants to merge 18 commits into
Conversation
|
Overall looks pretty clean, definitely better than my attempt at implementing this. A few questions though: What's the reason for not using the Why not implement the |
Water fog: Java's start defaults to -8 and isn't range-limited like the end is, and vanilla Bedrock always uses 0 for water, so there's nothing worth mapping. Air fog: Bedrock's air/weather fog is render-distance relative, Java's is absolute blocks, so mapping it means going fixed and losing the scaling. It's on my follow-up list with cloud color and grass color modifier. |
By default Bedrock uses 0 for water, but you can adjust it as well, including into the negative range. Im not sure im following why there is nothing worth mapping, unless we're only looking at vanilla biomes, rather than custom biomes.
Fair enough, thought that would be the case ^^. |
Okay. I'll add water fog to the follow-up list ;p |
…block component, toast api lovely protocol bump in the end
* Update Cloudburst protocol * Fix codec processor * Fix registry populators
Addresses #3645.
This PR adds two ways to register custom biomes: through
GeyserDefineCustomBiomesEventfrom an extension, or through abiomessection in a custom mappings file.Mappings use the same
effectsandattributeskeys as Java data pack biomes, so most existing biome JSON copies straight over. Bedrock-specific values go undergeyser, which takes priority when both define the same value.A mappings file can also reference a manually provided resource pack using a top-level
pack_uuidnext toformat_version. Biomes from that file are styled by the referenced pack instead of Geyser's generated one, so appearance values are rejected. Geyser also warns at startup if no registered pack matches the UUID.When
bedrock_identifieris omitted, Geyser derives one. Java identifiers that are already valid on Bedrock are reused as-is. Anything else gets a digest-based identifier, since Java allows characters such as/and simply flattening them can cause collisions.Example
{ "format_version": 1, "biomes": { "my_datapack:cave/crystal_caves": { "effects": { "water_color": "#3F76E4", "grass_color": "#5F9F45", "foliage_color": "#4F8F3F" }, "attributes": { "minecraft:visual/sky_color": "#78A7FF", "minecraft:visual/fog_color": "#C0D8FF", "minecraft:visual/water_fog_color": "#050533", "minecraft:visual/water_fog_end_distance": 48.0 }, "geyser": { "water_surface_opacity": 0.55, "precipitation": { "type": "blue_spores", "density": 0.25 } } } } }The same biome registered through the API:
Custom definitions are appended to the vanilla
BiomeDefinitionListPacketwith sequential IDs starting at 30000, Bedrock's custom biome range.Climate values come from the live Java registry. When no grass or foliage color is provided, Bedrock's colormap tint stays within 1/255 of Java's.
Colors and fog require a resource pack on Bedrock, so Geyser generates a small
custom_biomes.mcpackfrom the registered appearances.Limitations
Vibrant Visuals still ignores or reinterprets several fields as of Bedrock 1.26.44:
The classic renderer supports all of these fields.
Testing
Tested on Bedrock 1.26.44 against Paper 1.26.2 using both the classic and Vibrant Visuals renderers:
This PR also changes the shared
NodeReader.ofEnumandNodeReader.ofMaphelpers to useLocale.ROOTfor case conversion. With a default locale such as Turkish, keys containingiotherwise fail to parse, including this PR'swhite_ashprecipitation type.