This is an old revision of the document!
Changes from 1.16.1
- Biomes have become immutable data classes
- Instead of using Biome objects, you now have to use
RegistryKey<Biome>
for most operations, since it will be stable even across world and datapack reloads- This means that any custom data you previously attached to your Biome subclass can no longer be attached directly to Biome objects, since Vanilla will serialize and deserialize Biome objects to copy them using their codecs, you could in theory attach custom data by extending the Codec, but this would mean this data would be attached to every Biome.
- What you can do instead is maintain an
IdentityHashMap<RegistryKey<Biome>, YourCustomData>
in your mod, and query the custom data based on the biome's key. - The key of a biome must be obtained via the
DynamicRegistryManager
of the current world,ClientWorld
andServerWorld
offer a convenience method for this calledmethod_31081
(currently unnamed), which retrieves the key of the biome at a givenBlockPos
, although you can also do this yourself viaworld.getRegistryManager().get(Registry.BIOME_KEY).getKey(<the_biome_variable>)
.
FabricBiomes#addSpawnBiome
was removed, since this is now a property that can be set via Vanilla'sBiome.Builder
(seeSpawnSettings.Builder#playerSpawnFriendly
).- Parent Biomes are gone and now hardcoded in
AddHillsLayer#field_26727
based on their raw ids. Since the mapping is from unmodified biome → modified biome, there's no real point in exposing this to mods, because there can only be _one_ modified biome for each unmodified one.
Worldgen Registered Objects
The following diagram shows various objects that participate in defining world generation, and where they are registered/defined.
The general rule of thumb is that Registry
will contain objects that contain some form of custom code, while BuiltInRegistry contains built-in data objects that mostly reference code objects from an associate Registry by ID and sometimes add configuration data.
To illustrate this:
* Vanilla registers an instance of the class OreFeature
under the ID minecraft:ore
in Registry.Feature
.
* Vanilla then registers 21 configured features in BuiltInRegistry.CONFIGURED_FEATURE
that reference minecraft:ore
, and configure it differently (for example minecraft:ore_iron
to place iron ore)