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

Split World and Dimension into their own classes #1611

Merged
merged 4 commits into from
Aug 10, 2023

Conversation

NotStirred
Copy link
Member

@NotStirred NotStirred commented Aug 2, 2023

Split the concepts of Dimension and World into their own class,
World handles per-world data, and loading Dimensions
Dimension handles regions, chunks, loading chunks, and any per-dimension data.

There is no API for detecting the format of a world or dimensions within it, hopefully that can come in the next PR

This PR properly loads a world with one or more vanilla dimensions, and one or more CubicChunks dimensions (previously the entire world was either vanilla or CubicChunks)

World handles per-world data, and loading Dimensions

Dimension handles regions, chunks, loading chunks, and any per-dimension data.

This commit fails to run without commenting out all of the CubicChunks classes
@NotStirred NotStirred requested a review from leMaik August 2, 2023 03:47
@NotStirred
Copy link
Member Author

This PR has some reasonable change of breaking plugin api actually
many of the listeners ChunkDeletionListener, ChunkTopographyListener, ChunkUpdateListener are now registered on Dimension instead of World. I'll add a deprecated method to World that just redirects to the current loaded dimension

Copy link
Member

@leMaik leMaik left a comment

Choose a reason for hiding this comment

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

Mostly nit-picking (remove abbreviations like pos, change getters/setters to Java convention).

Everything else looks good, I like the split of Worlds and Dimensions. 👏

chunky/src/java/se/llbit/chunky/world/Dimension.java Outdated Show resolved Hide resolved
chunky/src/java/se/llbit/chunky/world/Dimension.java Outdated Show resolved Hide resolved
chunky/src/java/se/llbit/chunky/world/Dimension.java Outdated Show resolved Hide resolved
chunky/src/java/se/llbit/chunky/world/Dimension.java Outdated Show resolved Hide resolved
chunky/src/java/se/llbit/chunky/world/Dimension.java Outdated Show resolved Hide resolved
chunky/src/java/se/llbit/chunky/world/Dimension.java Outdated Show resolved Hide resolved
chunky/src/java/se/llbit/chunky/world/World.java Outdated Show resolved Hide resolved
@NotStirred
Copy link
Member Author

(force push to drop redundant plugin api commit)

@leMaik leMaik merged commit 9aa7374 into chunky-dev:master Aug 10, 2023
1 check passed
@NotStirred NotStirred deleted the feature/world_dimensions branch August 10, 2023 08:36
leMaik pushed a commit to leMaik/chunky that referenced this pull request Sep 9, 2023
* Split the concepts of Dimension and World into their own class.

World handles per-world data, and loading Dimensions

Dimension handles regions, chunks, loading chunks, and any per-dimension data.

This commit fails to run without commenting out all of the CubicChunks classes

* Properly handle loading cubic dimensions

* Don't reload world when switching dimensions, only load the new dimension

* Correct following project naming conventions
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.

2 participants