Skip to content

feat: Chunk & Block API v2 #34

Description

@Zffu

The block system has become way too complex for absolutely no reason besides me trying to save memory usage.

Currently, a chunk, in it's lowest state will consume 65536 bits for raw chunk data, we can however drastically reduce it by implementing a new system.

Block API changes

  • Changing the purpose of BlockType from an actual block type but more as an material info container
  • Removal of ComplexBlock
  • Removal of chunk_block_data_t and block_data_t
  • Reduce size of block_id_t to uint8_t

Chunk API changes

  • Every block getting function will now be uniform and will return a block type block_id_t
  • Add an emhash7::HashMap<size_t, void*> inside Chunk in order to store pointers pointing to block data objects with the key representing the index
  • Add a block_data_container class base which is purely here to represent every block data class
  • Add an get_data function on Chunk

Final Note

The following changes will both be incredibly important and useful in terms of development speed for the server, it also will give us great performance improvements in both ram and file size!

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