Commit Graph
8 Commits
Author SHA1 Message Date
DaniD3v fe56d32463 Renamed block_size to block_bit_size for readability 2024-08-28 12:52:07 +02:00
DaniD3v 33ec123148 Added BlockIdentifierNotFound Error to differentiate from BlockStateIdNotFound 2024-08-28 12:52:07 +02:00
DaniD3v 43164ee4f1 Added abstraction for BlockId
`i32` is really ambiguous and it is not immediately obvious what it is supposed to represent.
`BlockId` is much more readable.

Changed internal type to u16 because we currently have ~30k/64k block states.
(and i32 doesn't make a lot of sense for an Id, except when replicating mojang behavior)
2024-08-28 12:52:07 +02:00
DaniD3v 5a21a687d8 Block structs refractor + added comments
renamed a few fields for clarity.
added examples for fields that might not immediately be obvious.
removed some `Option`s that are not necessary.

renamed `BlockElement` to `BlockType` because you could mistake
`BlockElement` for the main way to represent a Block (e.g. in Chunks).
2024-08-28 12:52:07 +02:00
DaniD3v 03fcdc2e32 Imported serde::Deserialize to avoid spelling it out frequently. 2024-08-28 12:52:07 +02:00
DaniD3v a0260acd8b WORLD_Y_START_AT refactor
Renamed `WORLD_Y_START_AT` to `WORLD_LOWEST_Y`.
Added `WORLD_Y_END_AT`.
Changed the type to i16 for ergonomics.
Moved the constants under the use statements for readability.
2024-08-28 12:51:43 +02:00
DaniD3v be98a730b0 Added abstraction for coordinates.
These ensure that there aren't any out of bound values
and make the code significantly more readable
2024-08-28 12:38:22 +02:00
DaniD3v 60bb30a883 use rustls instead of system openssl to make compilation easier 2024-08-22 21:11:00 +02:00