Skip to content

Untangle world initialization and only create one IChunkProvider instead of several. - #91

Open
RecursivePineapple wants to merge 6 commits into
masterfrom
untangle-provider-init
Open

Untangle world initialization and only create one IChunkProvider instead of several.#91
RecursivePineapple wants to merge 6 commits into
masterfrom
untangle-provider-init

Conversation

@RecursivePineapple

@RecursivePineapple RecursivePineapple commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

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

  • I have tested this PR in DevEnv
  • I have tested this PR in Fullpack
  • This PR is in compliance with the GTNH AI Policy
  • This PR requires another PR in order to merge

@RecursivePineapple
RecursivePineapple requested a review from a team July 21, 2026 19:43
@RecursivePineapple RecursivePineapple added Compatibility Improves compatibility between Cubic Chunks and another mod. Refactor For PRs rewriting a part of the code to have a nicer code overall. labels Jul 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

#92

github-actions Bot and others added 3 commits July 21, 2026 15:47

@Cardinalstars Cardinalstars left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we just remove all the deprecated stuff instead of having it throw?

public interface ICubicWorldProvider {

/// @deprecated New parameter: implement [#createCubeGenerator(IChunkProvider)] instead.
@Deprecated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why even have this method at this point? Any reason to leave it deprecated instead of removing?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, there are a few projects that use these. Galaxia in specific uses this interface and I don't want it breaking randomly.

@RecursivePineapple RecursivePineapple added 🚧 Testing on Zeta Do not merge yet, testing this PR on Zeta (experimental build) Affects Balance Change affecting balance. Requires admin approval before merging. Merge Into Prerelease PR will be added to -pre releases (via the dev branch). and removed 🚧 Testing on Zeta Do not merge yet, testing this PR on Zeta (experimental build) Affects Balance Change affecting balance. Requires admin approval before merging. labels Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Compatibility Improves compatibility between Cubic Chunks and another mod. Merge Into Prerelease PR will be added to -pre releases (via the dev branch). Refactor For PRs rewriting a part of the code to have a nicer code overall.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Breaking a block in the Twilight Forest in a server kick the player out

2 participants