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

Fix various world loading problems (Issue #265) #269

Merged
merged 10 commits into from
Jun 22, 2020
Merged

Fix various world loading problems (Issue #265) #269

merged 10 commits into from
Jun 22, 2020

Conversation

Schuwi
Copy link
Member

@Schuwi Schuwi commented Jun 16, 2020

This PR aims to fix a few issues I encoutered when trying to load a vanilla world. Mainly this fixes the format of heightmaps in chunk data.
This is basically ready to merge, just needs a little polish. Namely:

  • Remove panics from packed_u9.
    (I just can't figure out how to return an error from serialize or deserialize. I thought serde::ser::Error::custom("my error") would do the trick but rustc says nope.)
  • Complete the test implementation for packed_u9/Heightmaps::packed_i64_vec.
  • Run cargo fmt and check cargo clippy.

Resolves #265.

@Schuwi Schuwi marked this pull request as ready for review June 16, 2020 22:18
@Schuwi
Copy link
Member Author

Schuwi commented Jun 16, 2020

I spent waaaay to much time on those packed u9 heightmap arrays. Finally everything works, tests are implemented and deserializing a vanilla chunk gives sensible heightmap data.
This should now be ready for merge and allow for some sweet vanilla world loading once again.

@Schuwi
Copy link
Member Author

Schuwi commented Jun 17, 2020

Huh, I just can't replicate that clippy warning. Even running explicitely with cargo clippy -- -D clippy::inconsistent-digit-grouping executes without warnings. I'll just add a #[allow(clippy::inconsistent-digit-grouping)] because the digit grouping makes sense here.

Sorry but I can't replicate this warning locally, so I can only rely on CI to tell me whether I fixed the clippy warning
I swear I ran cargo fmt like a thousand times already but yeah okay
Copy link
Member

@caelunshun caelunshun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is great work!

core/anvil/src/entity.rs Outdated Show resolved Hide resolved
core/anvil/src/region/mod.rs Outdated Show resolved Hide resolved
core/anvil/src/region/mod.rs Outdated Show resolved Hide resolved
core/anvil/src/region/mod.rs Show resolved Hide resolved
core/anvil/src/region/mod.rs Show resolved Hide resolved
core/anvil/src/region/mod.rs Outdated Show resolved Hide resolved
core/chunk/src/lib.rs Outdated Show resolved Hide resolved
@Schuwi
Copy link
Member Author

Schuwi commented Jun 17, 2020

Thanks for all the comments! I'm sorry there had to be so many. I got a bit sloppy in the end and just wanted to be done with it. This turned into a way bigger thing than I thought it would.
But now that PistonDevelopers/hematite_nbt#52 is merged I can fully concentrate on this and I'll take a look at your comments tomorrow with a clear head :)

@Schuwi Schuwi requested a review from caelunshun June 19, 2020 19:37
@Schuwi
Copy link
Member Author

Schuwi commented Jun 20, 2020

Alright, so I have actually implemented serde serialization for chunk data in my local working copy now and everything works. I am not sure whether to include it in this PR or put it into a separate one. That would also fix the server panicking when failing to save a chunk and put out a warning instead.

@caelunshun
Copy link
Member

Alright, so I have actually implemented serde serialization for chunk data in my local working copy now and everything works. I am not sure whether to include it in this PR or put it into a separate one. That would also fix the server panicking when failing to save a chunk and put out a warning instead.

Nice, thanks for that! I think the new serialization probably belongs in another PR—this PR is pretty much ready to merge.

@Schuwi
Copy link
Member Author

Schuwi commented Jun 20, 2020

Alright, then everything else would be for another PR so this would be ready to merge from my side.

@caelunshun
Copy link
Member

Great, thank you!

@caelunshun caelunshun merged commit 2b9d106 into feather-rs:develop Jun 22, 2020
@Schuwi Schuwi deleted the fix-world-loading branch July 15, 2020 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't load vanilla world
2 participants