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

Expand world saving API #12329

Closed
Strokkur424 opened this issue Mar 23, 2025 · 0 comments · Fixed by #12330
Closed

Expand world saving API #12329

Strokkur424 opened this issue Mar 23, 2025 · 0 comments · Fixed by #12330

Comments

@Strokkur424
Copy link
Contributor

Is your feature request related to a problem?

When dynamically creating worlds with the goal of an in-game map editor, saving a world does, by default, not flush the level data save. (World#save() calls ServerLevel#save(null, false, false). The first false declaring the flush variable). This makes subsequent file copy operations on the world folder unreliable, as not all chunks have been saved yet.

Describe the solution you'd like.

I would like to expose another function, World#save(boolean flush), which allows an API user to directly set the flush parameter without relying on internals.

Describe alternatives you've considered.

Currently, the only way to achieve this is with the use of internals. More specifically:

final World world = ...;
((CraftWorld) world).getHandle().save(null, true, false);

Other

None 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant