-
Notifications
You must be signed in to change notification settings - Fork 9
Untangle world initialization and only create one IChunkProvider instead of several. #91
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
Open
RecursivePineapple
wants to merge
13
commits into
master
Choose a base branch
from
untangle-provider-init
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
38f46b0
Untangle world initialization and only create one IChunkProvider inst…
RecursivePineapple 361d640
Fix comments
RecursivePineapple d2df0d6
Merge branch 'master' into untangle-provider-init
RecursivePineapple 471ad11
spotlessApply (#92)
github-actions[bot] f156a00
Convert Overwrite to Inject + cancel
RecursivePineapple 93b8084
Spotless
RecursivePineapple af1d7e2
Move initCubicWorldServer into implicit <init> block and clean up fie…
RecursivePineapple 3de8203
Convert WorldServer back to World for ICubicWorldType fn params
RecursivePineapple cd989f1
Add cc prefix for DeferInit mixin field
RecursivePineapple 75a863d
Fix dummy worlds by making most vanilla shims work without CC chunkPr…
RecursivePineapple 969dbfe
Populate height range for clients + simplify logic
RecursivePineapple 81dc6dd
Merge branch 'master' into untangle-provider-init
RecursivePineapple bff2e82
sa
RecursivePineapple File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
33 changes: 30 additions & 3 deletions
33
src/main/java/com/cardinalstar/cubicchunks/api/world/ICubicWorldProvider.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,43 @@ | ||
| package com.cardinalstar.cubicchunks.api.world; | ||
|
|
||
| import net.minecraft.world.World; | ||
| import net.minecraft.world.chunk.IChunkProvider; | ||
|
|
||
| import org.jetbrains.annotations.NotNull; | ||
|
|
||
| import com.cardinalstar.cubicchunks.api.IntRange; | ||
| import com.cardinalstar.cubicchunks.api.worldgen.IWorldGenerator; | ||
|
|
||
| /// Implemented on a [WorldProvider] so that it can directly generate its cubes, instead of going through | ||
| /// [VanillaWorldGenerator]. | ||
| /// Implemented on a [WorldProvider]. This is primarily used by mods to make their dimensions cubic. [ICubicWorldType] | ||
| /// takes priority over this interface. When a [WorldProvider] does not implement this interface, | ||
| /// [WorldProvider#createChunkGenerator()] is called and the result is wrapped by a [VanillaWorldGenerator]. | ||
| public interface ICubicWorldProvider { | ||
|
|
||
| /// @deprecated New parameter: implement [#createCubeGenerator(IChunkProvider)] instead. | ||
| @Deprecated | ||
| @NotNull | ||
| IWorldGenerator createWorldGenerator(World world); | ||
| default IWorldGenerator createCubeGenerator() { | ||
| throw new UnsupportedOperationException(); | ||
| } | ||
|
|
||
| @NotNull | ||
| default IWorldGenerator createCubeGenerator(IChunkProvider chunkGenerator) { | ||
| return createCubeGenerator(); | ||
| } | ||
|
|
||
| /// @deprecated Renamed: implement [#getGenerationRange()] instead. | ||
| @Deprecated | ||
| default int getOriginalActualHeight() { | ||
| throw new UnsupportedOperationException(); | ||
| } | ||
|
|
||
| default IntRange getGenerationRange() { | ||
| return new IntRange(0, getOriginalActualHeight()); | ||
| } | ||
|
|
||
| /// @deprecated Pointless due to public field: safe to remove | ||
| @Deprecated | ||
| default World getWorld() { | ||
| return null; | ||
| } | ||
| } | ||
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.