Skip to content

Add an inventory system #397

@patowen

Description

@patowen

As a first step to adding actual gameplay, the player should be able to obtain, organize, and use resources, so to allow that, we will need to give the player an inventory. Implementing this is somewhat involved, as it has several moving parts:

  • Some way to track the items a player is holding
  • A GUI for the inventory that allows a player to move items around
  • A way to select materials to place
  • A server-authoritative inventory (at least for what items are in there, but likely for how they're organized as well to be able to know if the inventory is full)
  • Serialization of the player inventory for saving
  • Atomic modifications to the save file for placing and breaking blocks (to avoid item loss or duplication)

To avoid needing to implement "item entities" or an equivalent feature, breaking blocks should immediately put them in the player's inventory. This might also be a good quality-of-life feature in general to keep long-term. However, for now, if the player's inventory is full, the fallback should be the simplest to implement: The block should be erased from existence.

It shouldn't matter exactly what the inventory controls are or how certain selections are made, as long as the code is written in such a way that tweaks are feasible. Just having this feature exist at all should be the priority.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions