S9SourceNine Labs / CMAPI Docs 1.0
CMAPI / Migrations

Migrate from 0.9

Update a CMAPI 0.9 mod for the 0.10 API.

View source ↗
CMAPI 1.0.0Standalone runtimeWindows x64Tested with Planet Crafter 2.008

Migrate a CMAPI 0.9.x mod to 0.10.0

CMAPI 0.10.0 retains the complete 0.9.x public surface. Existing player, placement, gameplay, notification, weather, world-state, environment, planet, and command code does not need a source change.

Keep the old minimum version if the mod uses only old members. Set:

JSON
"MinimumApiVersion": "0.10.0"

only when the mod uses helper.Recipes, helper.Unlocks, helper.PlayerInventory, or helper.Events.World.

New helper members

  • IRecipeManager returns current recipe outputs, collapsed ingredient quantities, content kind, and crafting-station IDs.
  • IUnlockManager returns static blueprint/progression/planet rules plus live unlocked/current-planet state.
  • IPlayerInventoryManager returns local backpack/equipment snapshots and an owner-scoped native add/remove event.
  • IWorldEvents adds world entry/exit, completed planet travel, completed save, and observed weather start/end boundaries.

These are additive read-only contracts. Do not replace existing host-safe item grants with raw inventory mutation, and do not infer authority from an unlock or recipe snapshot.

Lifecycle adjustment

Use WorldEntered for work which requires both a local player and a loaded planet. LocalPlayerStarted remains correct when only the player is needed. Use Saved instead of assuming a save request has finished. Re-query recipes, unlock state, and inventories after the relevant lifecycle event instead of caching a main-menu snapshot.

See CONTENT-AND-LIFECYCLE-API.md for event ordering, availability rules, examples, and console equivalents.