Skip to content

Add a safe tool for editing cache inventory sizes #3

Description

@PrettyPrincessPotato

Description

Add a focused utility for modifying inventory definitions directly in the game cache, with bank capacity as the primary use case.

The bank capacity is stored in the cache inventory definition for ID 95. The project already has the necessary decoder, encoder, and cache-writing logic, but no simple tool for changing an inventory's length.

Requirements

  • Accept a cache path, inventory ID, and new capacity.
  • Read the existing inventory definition.
  • Update only its length.
  • Encode and write the definition back to the cache.
  • Preserve all existing inventory data and configuration.
  • Validate the requested size and report errors clearly.
  • Provide a dry-run or confirmation option before overwriting the cache.
  • Document usage, including the bank inventory ID (95).
  • Keep the bank UI interaction range consistent with the new capacity.
  • Handle existing player saves whose bank arrays use the previous capacity.

Relevant code

  • cache/src/main/kotlin/world/gregs/voidps/cache/config/decoder/InventoryDecoder.kt
  • cache/src/main/kotlin/world/gregs/voidps/cache/config/encoder/InventoryEncoder.kt
  • tools/src/main/kotlin/world/gregs/voidps/tools/InventoryDefinitions.kt
  • tools/src/main/kotlin/world/gregs/voidps/tools/convert/InventoryConverter.kt
  • data/entity/player/bank/bank.invs.toml
  • game/src/main/kotlin/content/entity/player/bank/BankOpen.kt

Acceptance criteria

A cache administrator can run one documented script to change the bank inventory capacity, verify the new length, and start the server without manually editing cache files.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions