Skip to content

Upgrading v2 to v3

gniftygnome edited this page Jun 24, 2024 · 1 revision

Upgrading from Biolith v2 to v3

Biolith v3 includes a number of breaking changes in the code and data APIs for sub-biome placement. Generally speaking, if you do not use any sub-biomes, you will not need to modify anything.

in code

Any references to the SubBiomeMatcher class itself should be changed to CriterionBuilder. The names of the factory methods have all changed. Any references to the class in method references should be changed to Criterion.

Examples of changes:

  • SubBiomeMatcher.BEACHSIDE -> CriterionBuilder.BEACHSIDE
  • SubBiomeMatcher.of(Criterion...) -> CriterionBuilder.allOf(Criterion...)
  • BiomePlacement.addSubOverworld(RegistryKey, RegistryKey, SubBiomeMatcher) -> BiomePlacement.addSubOverworld(RegistryKey, RegistryKey, Criterion)
  • The inverted field in Criterion has been removed. Invert criteria using CriterionBuilder.not.

as data

  • The matcher field has been replaced with criterion.
  • The criterion field can be a single criterion object or an array which will be wrapped with an all_of criterion.
  • All criterion type fields must have their ids prepended with biolith: (e.g. value -> biolith:value)
  • The inverted field in criteria has been removed. Invert criteria by wrapping them in a biolith:not criterion.
  • The distance criterion type has been renamed to biolith:deviation.

OLD: 👇

{
  "sub_biomes": [
    {
      "dimension": "minecraft:overworld",
      "target": "minecraft:desert",
      "biome": "minecraft:old_growth_pine_taiga",
      "matcher": {
        "criteria": [
          {
            "target": "center",
            "type": "ratio",
            "max": 0.2,
            "invert": true
          }
        ]
      }
    }
  ]
}

NEW: 👇

{
  "sub_biomes": [
    {
      "dimension": "minecraft:overworld",
      "target": "minecraft:desert",
      "biome": "minecraft:old_growth_pine_taiga",
      "criterion": {
        "type": "biolith:not",
        "criterion": {
          "type": "biolith:ratio",
          "target": "center",
          "max": 0.2
        }
      }
    }
  ]
}