-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Add an option to WorldCreator to avoid spawn location computation on world creation #13407
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
base: main
Are you sure you want to change the base?
Conversation
…world creation This reduces world creation for vanilla worlds from ~1 second to 20ms.
Malfrador
left a comment
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.
Very happy this finally gets added to WorldCreator itself. LGTM, I only have a minor Javadocs suggestion.
| try { | ||
| - setInitialSpawn(serverLevel, serverLevelData, worldOptions.generateBonusChest(), isDebugWorld, this.levelLoadListener); | ||
| + setInitialSpawn(serverLevel, serverLevelData, worldOptions.generateBonusChest(), isDebugWorld, serverLevel.levelLoadListener); // Paper - per world level load listener | ||
| + if (computeSpawnLocation) setInitialSpawn(serverLevel, serverLevelData, worldOptions.generateBonusChest(), isDebugWorld, serverLevel.levelLoadListener); // Paper - per world level load listener & rework world loading process |
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.
I think we are gonna run into issues just completely skipping this call to setInitialSpawn. There's a bunch of other stuff in there which still needs to happen.
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.
For example, it skips calling setSpawn on the level data leading it to all worlds having the default which includes a GlobalPos to 0, 0, 0 in the overworld, not their specific world.
Also, it skips calling getFixedSpawnLocation on custom chunk generators.
And it skips placing the bonus chest.
And idk if this affects anything, but it skips running the LevelLoadListener.
This reduces world creation for vanilla worlds from ~1 second to 20ms.