c44f6ab859
io/storage: add JSON support
...
Bincode can't deal with a number of serde's features that would be
desirable if we're using the same Serialize impls for generating JSON
data for the viewer.
2024-01-10 22:56:27 +01:00
5d40d061a4
io/storage: split out inner part of read/write
...
Allow reusing the read/write logic without requiring control over the file
open.
2024-01-10 22:56:26 +01: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
80781c9c20
minedmap: skip generation steps when the inputs are unchanged
2023-07-31 00:23:06 +02:00
6077138292
Add version field to file metadata
2023-07-30 21:48:58 +02:00
628a702fd7
Store source modified timestamp with processed, lightmap and map tiles
...
Allows to check whether the source is newer than the last update of the
output files.
2023-07-30 21:19:24 +02:00
e18d4cea82
io/fs: do not replace files with unchanged contents
...
Do not update file timestamps when contents have not actually changed.
2023-07-30 20:31:40 +02:00
587db0464c
io/storage: use fs::create_with_tmpfile() helper
2023-06-01 23:10:47 +02:00
1abb260997
io/fs: add new module with filesystem access helpers
...
Wrappers around std::fs with error messages, as well as a
create_with_tmpfile() helper.
2023-06-01 22:59:19 +02:00
a4b726992a
io/storage: compress/decompress data in bulk
...
The bulk API is signifiantly faster than the stream API.
2023-03-03 20:58:35 +01:00
657d8af8a7
io/storage: add read() function
2023-03-03 19:20:56 +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
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
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
7c7e36f6be
io/region: avoid panic for invalid chunk lengths
2023-01-29 00:54:18 +01:00
da8ac506d9
io: remove a few unnecessary [..] for Vec -> slice deref
2023-01-28 01:15:00 +01:00
3cdafa7be9
Fix clippy warnings
2023-01-27 23:01:01 +01:00
daa188eb1d
io/region: use ChunkArray to parse region header
...
A layout of a ChunkArray::<u32> matches the binary format of the region
header.
2023-01-27 22:54:08 +01:00
28b22ce423
Introduce ChunkArray type
...
A generic array for per-chunk data, indexed by ChunkCoords.
2023-01-27 22:05:49 +01:00
48e03aa266
Introduce ChunkCoords type
2023-01-27 22:01:41 +01:00
0d8b989c10
io/region: remove count variable from Region::foreach_chunk()
2023-01-25 21:47:17 +01:00
5e96be3fda
Refactor logic from new dump tools into library crate
2023-01-25 21:42:16 +01:00