Add world generation API - #8
Closed
Segually wants to merge 48 commits into
Closed
Conversation
Autobuildtest, neat.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
WorldGenManagerto the mod helper (modeled onInteractableManager) 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/WeightedCommonnessenums keep callers off raw game ids. The Everything Mod now usesInjectWeightedto scatter ice veins through the Snow biome in clusters of 1–2.My testing showed that this system works as intended.