Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add linear chunk format. #494

Merged
merged 35 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d5f3797
feat: add linear chunk format with zstd lib dependency
Jan 24, 2025
65f1904
fixing a typo
Jan 24, 2025
9517837
Merge remote-tracking branch 'upstream/master' into linear_chunk_format
Jan 24, 2025
a02003f
refactor: rename file handling methods for clarity and more lint fixes
Jan 24, 2025
9f85aa6
refactor: improve clarity on validation methods
Jan 25, 2025
28e1222
fix: invert version check in LinearFile header validation
Jan 25, 2025
c9f6a7e
fix: remove leading dot from file path formatting in LinearChunkFormat
Jan 25, 2025
a1cbe33
refactor: improve error handling and method naming in LinearFile oper…
Jan 25, 2025
f2d51fd
fix: ensure file is flushed after writing in LinearFile operations
Jan 25, 2025
2f8c589
fix: lints and warnings
Jan 25, 2025
63a73a9
fix: more lints
Jan 25, 2025
8f8ef47
refactor: streamline LinearFile structure and improve header management
Jan 25, 2025
21c46e4
refactor: change chunks_headers to use Box for improved memory manage…
Jan 25, 2025
9308469
refactor: update path parameter types to PathBuf for consistency and …
Jan 25, 2025
48a2883
refactor: update path parameter types to Path avoiding uknown changes…
Jan 25, 2025
7563a81
fix: avoid using the same path for different tests
Jan 26, 2025
34604ea
fix: fix some bytes sizes for the header based on the spec
Jan 26, 2025
c14ee64
refactor: enable file truncation when opening for writing and simplif…
Jan 26, 2025
f5405b2
fix: removing IoSlices for windows issues.
Jan 26, 2025
0ca59aa
fix: clippy lints
Jan 26, 2025
fc543cf
refactor: improve incompatible files cheking, some documentation and …
Jan 27, 2025
3612b71
feat: add file_format to ChunkConfig and implement format handling in…
Jan 27, 2025
9340bbc
Merge branch 'master' into linear_chunk_format
Mili-ssm Jan 27, 2025
3404700
feat: add error logging for invalid file headers and data size checks…
Jan 28, 2025
1953773
feat: implement file locking mechanism for concurrent chunk read/writ…
Jan 29, 2025
c89bbc7
fix: bug at desserializing the chunks headers.
Jan 29, 2025
5bc194e
Merge branch 'master' into linear_chunk_format
Mili-ssm Feb 2, 2025
e692c72
Refactor chunk file locking mechanism to use DashMap for improved con…
Feb 2, 2025
020573c
docs: Update documentation for LinearVersion enum with format references
Feb 2, 2025
a40808c
Merge branch 'Pumpkin-MC:master' into linear_chunk_format
Mili-ssm Feb 3, 2025
02488aa
re-check workflows
Feb 3, 2025
cb9bf10
re-check lints 2
Feb 3, 2025
839190a
Merge branch 'master' into pr/494
Snowiiii Feb 5, 2025
bee3c6f
rename config values
Snowiiii Feb 5, 2025
caa87fc
Some doc improvements
Snowiiii Feb 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pumpkin-config/src/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use serde::{Deserialize, Serialize};
#[serde(default)]
pub struct ChunkConfig {
pub compression: ChunkCompression,
pub file_format: ChunkFormat,
}

#[derive(Deserialize, Serialize)]
Expand Down Expand Up @@ -35,3 +36,11 @@ pub enum Compression {
/// Custom compression algorithm (since 24w05a)
Custom,
}

#[derive(Deserialize, Serialize, Clone, Default)]
#[repr(u8)]
pub enum ChunkFormat {
#[default]
Anvil,
Linear,
}
2 changes: 2 additions & 0 deletions pumpkin-world/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ num-traits = "0.2"
# Compression
flate2 = "1.0"
lz4 = "1.28.1"
zstd = "0.13.2"


file-guard = "0.2.0"
indexmap = "2.7.1"
Expand Down
4 changes: 2 additions & 2 deletions pumpkin-world/src/chunk/anvil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,8 @@ mod tests {
fn test_writing() {
let generator = get_world_gen(Seed(0));
let level_folder = LevelFolder {
root_folder: PathBuf::from("./tmp"),
region_folder: PathBuf::from("./tmp/region"),
root_folder: PathBuf::from("./tmp_Anvil"),
region_folder: PathBuf::from("./tmp_Anvil/region"),
};
if fs::exists(&level_folder.root_folder).unwrap() {
fs::remove_dir_all(&level_folder.root_folder).expect("Could not delete directory");
Expand Down
Loading