Untangle world initialization and only create one IChunkProvider instead of several. - #91
Open
RecursivePineapple wants to merge 6 commits into
Open
Untangle world initialization and only create one IChunkProvider instead of several.#91RecursivePineapple wants to merge 6 commits into
RecursivePineapple wants to merge 6 commits into
Conversation
Contributor
Co-authored-by: GitHub GTNH Actions <>
Cardinalstars
left a comment
Collaborator
There was a problem hiding this comment.
Can we just remove all the deprecated stuff instead of having it throw?
| public interface ICubicWorldProvider { | ||
|
|
||
| /// @deprecated New parameter: implement [#createCubeGenerator(IChunkProvider)] instead. | ||
| @Deprecated |
Collaborator
There was a problem hiding this comment.
Why even have this method at this point? Any reason to leave it deprecated instead of removing?
Collaborator
Author
There was a problem hiding this comment.
Yeah, there are a few projects that use these. Galaxia in specific uses this interface and I don't want it breaking randomly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This makes the world initialization more exact and avoids the creation of several IChunkProvider instances. Previously,
WorldProvider.createChunkGenerator()was called in various locations. This should only be called once per world. This broke Twilight Forest's feature detection, because one instance was generating the world and another was being used as the 'source of truth' for what features existed in which location. The world reference in the latter instance was always null, which led to NPEs whenever a survival player broke blocks or killed mobs in the TF.This PR also deprecates several old and poorly defined methods in favour of direct replacements. All are renames or have parameter differences. Old methods still function but are deprecated - the handful of consumers can be ported trivially.
Additionally, there were two interfaces with the same name but in different packages. One was completely unused, so I removed it and moved the other one to its location (since the package was under api, it was a more appropriate location). I kept a stubbed interface in the same location to avoid API/ABI breakage.
fixes: #88
Checklist