228f31c568
Move resource module to a separate crate
...
The resource module does not depend on any other part of MinedMap.
2023-08-20 17:00:10 +02:00
248a641035
Restructure crates
...
Get rid of the arbitrary bin/lib split and instead move as much as
possible into the bin crate, which becomes the main crate again.
The types and NBT handling are moved into separate crates, so they can
be reused by nbtdump and regiondump.
2023-08-20 17:00:10 +02:00
05a8056cbf
Add documentation comments for all items
2023-08-20 11:21:29 +02:00
ba86dc8c06
resource: use serde feature of enumflags2 crate
2023-08-19 16:01:51 +02:00
fb712cd2f5
Store per-region biome list in IndexSet
...
Index into the biome list instead of duplicating the biome data for each
coordinate. This reduces the size of the processed data and speeds up
encoding/decoding.
2023-08-03 23:07:16 +02:00
0a485343a0
resource: do not require Biome to get color for all block types
...
Only grass, foliage and water have biome-dependent colors.
2023-08-03 18:28:57 +02:00
b66bdf5ce1
resource: implement water/foliage/grass color computation
2023-05-04 23:18:04 +02:00
25710bb1ed
Move block_color() to new module
2023-05-04 22:18:15 +02:00
524b1b1913
resource: add biome data
2023-04-07 09:34:56 +02:00
e462e17ee2
resource: rename BlockColor to Color
...
The same struct will be used for biomes.
2023-04-05 20:05:59 +02:00
46802116d9
resource: change BlockColor into an array
2023-03-04 21:32:15 +01:00
ed5fb9a6cf
resource: remove LEGACY_BLOCK_TYPES reexport
...
As the array is only used internally now, we can also remove the
"minecraft:" prefix from the entries.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2023-03-02 00:41:39 +01:00
89af4aaee2
resource: extend BlockTypes with legacy block type data
...
Allow to directly map from id/data values to BlockType.
2023-03-02 00:24:56 +01:00
4c2fd6c1a9
resource: rename BlockTypeMap to BlockTypes
...
The block_types() function it turned into a Default implementation.
2023-03-01 23:59:27 +01:00
95e4e45974
resource: remove "minecraft:" prefix from hash keys
...
Shorter keys mean less data to hash.
2023-03-01 22:03:09 +01:00
cbbc6d8f35
resource: make BlockTypeMap return BlockType without reference
2023-03-01 21:58:29 +01:00
551056803d
Add Serialize/Deserialize impls to various types
...
We want to be able to store this data to disk temporarily.
2023-02-26 00:46:50 +01:00
339e0b6a05
resource: add BlockType::is() method to check for flags
2023-02-15 00:34:59 +01:00
2a941e5283
resource: add BlockTypeMap type for convenience
2023-02-15 00:34:59 +01:00
db289bc077
resource: rename BlockFlags to BlockFlag
...
The enum only holds a single flag at a time.
2023-02-15 00:34:59 +01:00
9f8446885e
treewide: remove get_ prefix from function names
...
Follow the conventions of the std library.
2023-02-12 23:36:58 +01:00
3cee4a4247
resource: port legacy block type mapping from old implementation
2023-02-12 23:03:57 +01:00
718ecf5909
resource: update block type code generator for Rust
2023-02-07 22:18:44 +01:00