Skip to content

Redesign Storage Builder/Creation Flow #24

Open
@marcus8448

Description

@marcus8448

StorageSpecs are currently created on init in static final fields (see the coal generator) which are then passed to the machine constructor.

This is not a particularly nice system - its extremely rigid as builders are only instantiated once. After loading it cannot be changed which poses issues for de-synchronized client/server configs.
To better handle runtime configuration changes, it needs to either grab values from the world context or be replaced with a new system.

Previous Systems
Storages registered via MachineTypes
Seemed cumbersome to have to externally register the storage data. Ideally, the information should stay in the class as it's where it is most likely to be used. This system still has the same sync issues, but it's possible to change the registration to a callback that will be run at world load.

Storages created via createXXStorage methods in the BlockEntity
This caused breakage when config values were updated at runtime (in-world).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions