Skip to content

Add world generation API - #8

Closed
Segually wants to merge 48 commits into
eris-webserv:mainfrom
Segually:worldgen
Closed

Add world generation API#8
Segually wants to merge 48 commits into
eris-webserv:mainfrom
Segually:worldgen

Conversation

@Segually

Copy link
Copy Markdown
Contributor

Adds a WorldGenManager to the mod helper (modeled on InteractableManager) that lets any mod inject objects into world generation. Supports four operations:

  • InjectWeighted — spawn an object in a biome using the game's native weighting/clumping.
  • InjectSpecial — rare per-chunk clustered spawn (titanium-chest style).
  • InjectCustom — full-control callback per generated chunk.
  • RemoveFromBiome — stop an object (vanilla or modded) from spawning in a biome.

Clean Biome / WeightedCommonness enums keep callers off raw game ids. The Everything Mod now uses InjectWeighted to scatter ice veins through the Snow biome in clusters of 1–2.

My testing showed that this system works as intended.

eris-webserv and others added 18 commits March 11, 2026 01:59
Initialize and wire up two new item systems. Base.GamePlugin now initializes WorldPrefabManager and CraftingInjectionManager (with startup timing logs). Added CraftingInjectionManager which lets mods inject items into vanilla crafting lists via a Harmony postfix on inventory_ctr.GetCraftList; insertions are idempotent and support inserting after a specific item. Added WorldPrefabManager which allows registering AssetBundle prefabs for world-placeable items (keyed by item id or World_obj_path) and patches both overloads of ResourceControl.AsyncInstantiateWorldObjectPrefab to supply mod prefabs, instantiating cached assets safely. Includes simple reset/initialize helpers and Harmony patches to integrate with the game.
Add world prefab and crafting injection managers
This file implements the world generation system for Hybrid Animals, including biome definitions, weighted commonness, and world generation registration. It also includes Harmony patches for integrating custom generation logic.
Added using directive for WorldGenManager and initialized it.
@Segually Segually closed this by deleting the head repository Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants