Commit graph

418 commits

Author SHA1 Message Date
a2ba7e4738
main: build processed_dir path outside of RegionProcessor::new() 2023-03-01 19:17:50 +01:00
ea604b88f2
main: rename regiondir variable to region_dir
For consistency with other _dir variables.
2023-03-01 19:17:04 +01:00
ca6afa0cf9
main: return list of region coordinates from process_region_dir() 2023-03-01 19:16:09 +01:00
194715ad09
main: store processed region data 2023-03-01 00:13:06 +01:00
e02a1fc0c9
main: collect processed chunks in array 2023-03-01 00:11:42 +01:00
18cecb947e
main: factor out process_chunk() method 2023-03-01 00:09:11 +01:00
d77dcce778
main: print message when processing region 2023-03-01 00:06:48 +01:00
447a9482fe
main: create output directory for processed data files 2023-03-01 00:02:23 +01:00
04ab8c321f
main: fix formatting
rustfmt still doesn't handle let-else...
2023-03-01 00:00:40 +01:00
b68f04496c
main: introduce RegionCoords type alias 2023-02-28 23:57:48 +01:00
768ab13205
main: rename savedir argument to input_dir 2023-02-28 23:54:21 +01:00
21fd3a42ca
io: add storage helper
Use bincode+zstd to serialize data structures for temporary storage.
2023-02-28 21:59:45 +01:00
f47b38b2ca
world/layer: return boxed BlockInfoArray from top_layer()
Avoid copying around large structures, and allow creating
arrays of BlockInfoArrays without overflowing the stack.
2023-02-27 19:17:17 +01:00
fd0c9fbf1b
main: improve process_region() error handling 2023-02-26 01:11:59 +01:00
b2d849081d
io/region: allow stopping foreach_chunk early
Errors returned from the callback stop the loop early.
2023-02-26 01:01:37 +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
2d0f2fb865
main: iterate over regions of a Minecraft save dir 2023-02-25 17:46:00 +01:00
f3a6711458
Update dependencies 2023-02-25 13:30:58 +01:00
f48aa877d2
world: implement top_layer function
Implement one of the core functions of MinedMap: finding the topmost
visible block at each coordinate.
2023-02-18 11:51:24 +01:00
2530a557a9
types: fix dangling doc reference 2023-02-18 11:08:45 +01:00
decb5c67a6
world/section: to not use u128 type
Getting the block index for unaligned blocks can be done just fine with
only u64.
2023-02-18 10:57:11 +01:00
3ef48783b7
types: introduce LayerBlockArray
A LayerBlockArray is a generic array of data stored for each block of a
chunk layer. It provides the same methods as a ChunkArray.
2023-02-15 00:49:07 +01:00
789a4002c7
types: add Clone + Debug to ChunkArray iterators
Added for consistency with LayerBlockArray.
2023-02-15 00:48:30 +01:00
921a218d56
types: split BlockCoords into SectionBlockCoords and LayerBlockCoords 2023-02-15 00:35:18 +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
102baa9197
types: add iter() associated function to coordinate newtypes 2023-02-15 00:34:53 +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
96736bd7ed
Replace DivRem trait with num-integer crate 2023-02-12 23:08:53 +01:00
1049aad03d
Update dependencies 2023-02-12 23:03:58 +01:00
9146c06bec
treewide: rename "old" data structures to "v0"
"v0" doesn't refer to a specific version of Minecraft; it is just the
oldest data format supported by MinedMap.
2023-02-12 23:03:58 +01:00
493608ebc8
treewide: add more documentation 2023-02-12 23:03:58 +01:00
5ee114ed0a
types: slightly simplify DivRev trait 2023-02-12 23:03:58 +01:00
c34f531546
world/section: temporarily rename PaletteSectionBiomes fields
These fields are unused for now. Add an underscore to supress linter
warnings.
2023-02-12 23:03:58 +01:00
65c39ea153
types: make CHUNKS_PER_REGION and BLOCKS_PER_CHUNK usize
Having these as usize is more convenient.
2023-02-12 23:03:58 +01:00
b918ff6106
world/section: add method to get block ID at coordinate 2023-02-12 23:03:58 +01:00
3cee4a4247
resource: port legacy block type mapping from old implementation 2023-02-12 23:03:57 +01:00
8add7679a3
types: add Eq to coordinate types 2023-02-12 23:03:57 +01:00
c130f3cdae
world: add section iterator
An (empty for now) trait is introduced to abstract over the two section
types.
2023-02-12 23:03:57 +01:00
2d782f25b1
world: add types to wrap common parts of section data 2023-02-12 23:03:57 +01:00
b040a635ed
types: add types for block and section coordinates 2023-02-12 23:03:57 +01:00
357ef46731
types: add helper for division + remainder
We frequently require these operations together when converting between
bit and byte offsets, or similar purposes.
2023-02-12 23:03:57 +01:00
a174d627cd
Cargo.toml: change license to MIT
The copy of the license text in the repository is dropped.
2023-02-12 23:03:12 +01:00
718ecf5909
resource: update block type code generator for Rust 2023-02-07 22:18:44 +01:00
6379472282
world/de: new module for deserialization data structures
The new structures contain only the fields that MinedMap needs.
2023-02-07 18:32:01 +01:00
8c34f74952
io/region: return sorted Vec instead of HashMap from parse_header()
Instead of counting and looking up indices in the HashMap, we can just
iterate over all offsets in the returned Vec.
2023-01-30 19:08:51 +01:00
6186a0d916
io/region: accept incomplete block for final chunk 2023-01-30 00:45:05 +01:00
92a9bb3bb3
io/region: add chunk coords to error descriptions 2023-01-29 17:08:39 +01:00
1d126ba771
io/region: remove error handling for impossible cases from decode_chunk() 2023-01-29 17:04:28 +01:00