BetterBiomes:Addons
Since 1.5.0 Better Biomes can be extended by addons: separate mods that add their own biomes, caves and world features on top of Better Biomes. Two first addons are in development, a mushroom forest and a deep cave overhaul.
For players
- Put the addon into the same
modsfolder as Better Biomes and Utility Biome. An addon needs Better Biomes. - The Better Biomes settings also apply to the addon:
Features,Structures,FeatureChanceandDisabledFeaturescover its features,DisabledBiomescovers its biomes (written with the addon's prefix, for exampleBBDeepCaves_). - An addon can replace Better Biomes biomes. While the addon is installed, those biomes no longer generate; the addon's content takes their place.
- As with Better Biomes itself, everything only affects newly generated chunks.
Server log
At startup Better Biomes lists the installed addons, for example:
BetterBiomes: 1 addons: betterbiomesdeepcaves 0.1.0 BetterBiomes: Addon betterbiomesdeepcaves 0.1.0 registered (prefix BBDeepCaves_), 0 biomes disabled, 1 replaced BetterBiomes 1.7.0 ready (API 1.0.0)
Entries in DisabledBiomes that match neither a Better Biomes biome nor an addon biome are reported as a warning, as are biomes an addon wants to replace that don't exist.
For addon developers
An addon is an ordinary Hytale mod with a manifest dependency on com.cyberpiratepenguin:betterbiomes. It talks to Better Biomes through two parts:
| Part | Used | Version |
|---|---|---|
Runtime API com.cyberpiratepenguin.betterbiomes.api |
in game, in the addon's setup() |
BetterBiomesAPI.API_VERSION = 1.0.0
|
Build-time SDK betterbiomes-sdk (com.cyberpiratepenguin.betterbiomes.sdk) |
only in generateBiomes and tests, never in the jar |
BetterBiomesSdk.SDK_VERSION = 1.2.0
|
Both are versioned independently of the mod version (SemVer).
Runtime API
// in the addon's setup()
BetterBiomesAddon addon = BetterBiomesAPI.addon(this, "BBDeepCaves_")
.supersedes("Zone1_Tier1/Custom.BetterBiomes_Meadow")
.register();
addon.registerFeature(ChunkFeature.named("betterbiomesdeepcaves:crystals")
.inBiomes("Zone1_Tier*")
.order(BetterBiomesAPI.ADDON_ORDER)
.placer(new CrystalPlacer()));
BetterBiomesAPI.addon(plugin, prefix)starts the registration,register()completes it. Call it insetup(); it fails if Better Biomes is not ready yet (BetterBiomesAPI.isReady()) or if the name or prefix is already taken.- The prefix (form
Name_) marks all biome files, seeds and asset IDs of the addon. It must not overlapBetterBiomes_. - The feature ID namespace is the addon's lower-case manifest
Name.registerFeaturerejects IDs outside it.registerStructuredoes the same for structures, which theStructuresswitch also controls. A feature that the config turns off is not registered. supersedes(...)takes Better Biomes biomes in theDisabledBiomesformat (Cherry_GroveorZone1_Tier2/Custom.BetterBiomes_Cherry_Grove).BetterBiomesAPI.ADDON_ORDER(200) is the feature order addons start from; Better Biomes uses 0–199.BetterBiomesAPI.addons()lists all registered addons,runtimeVersion()gives the running Better Biomes version.
Build-time SDK
The SDK hands the generator building blocks Better Biomes uses for itself to an addon's content pack:
| Class | Contents |
|---|---|
BetterBiomesRegions |
region grids of the large biomes with the slot table; hands out the free share to addons |
CaveOverhaul |
Warrens, Titan Vault, Rift, Great Hollow, Wormways, Crawlways, underground lakes, Sinter Halls, Moss Gardens, Umbral Depths, ore lodes, each with the rock and style of a zone |
Landforms |
sinkholes and mountain caves |
Groves, Features |
groves with soft edges and clearings, flower patches, covers and prefab entries |
WoodSets |
the Better Biomes wood sets and tree prefabs an addon may reference |
Names, seeds and paths come from the addon's own Mod, so CaveOverhaul.of(mod).wormways(...) creates the cave type <Mod>_Wormways with the seed <Mod>-Cave-Wormways.
New addon project
The Better Biomes repository has a script that sets up a new addon project from the mod template, with Better Biomes as a git submodule:
scripts/new-addon.sh <Name> <Prefix> [TargetDir] scripts/new-addon.sh DeepCaves BBDeepCaves_
Name is CamelCase without "BetterBiomes" (DeepCaves becomes the mod BetterBiomesDeepCaves), Prefix has the form Name_. By default the project lands next to the Better Biomes repository. Then run ./gradlew build, add biomes to AddonContent.java and run ./gradlew generateBiomes.