-
-
Notifications
You must be signed in to change notification settings - Fork 237
[1.20.4] Improve NeoForge's chunk generator command #364
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
[1.20.4] Improve NeoForge's chunk generator command #364
Conversation
Special thanks to Jasmine and Gegy for allowing us to use their Fabric Chunk Pregenerator as a basis for this PR. https://github.com/jaskarth/fabric-chunkpregenerator/tree/master We will of course need some testing for this. New commands and changes are: - /neoforge generate <x> <y> <z> <chunkRadius> [progressBar] - Generates a square centered on the given position that is chunkRadius * 2 on each side. - /neoforge generate stop - Stops the current generation and displays progress that it had completed. - /neoforge generate status - Displays the progress completed for the currently running generation. - /neoforge generate help - Displays this message. - General tips: If running from a server console, you can run generate in different dimensions by using /execute in <dimension> neoforge generate...
Draft as there's some calculations we need to check out with the % as it goes to 101% before completion. Also, should we put a maximum limit on the chunk radius param? Maybe 1000000? |
…hicGrunt/NeoForge into pregenerator-improvement
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 said I would provide a review on a implementation provided.
Overall the implementation is decent.
There is things that could be improved to give it a decent speedup/control/usability.
But this patch isn't really focused on it.
The focus is to fix the previous implementation that was just bad.
There is a few things that should be addressed because I get these reports frequently enough that forge will be basically swamped with reports.
- First: Chunk Radius is great and it should be kept, but make sure to limit it to something reasonable so if someone types in 20000 and thinks 20000 blocks they are simply not generating for a Literal year.
After talking to the neoforge team, we came up that the best suitable max radius is 1024 chunks. - Second: Don't use public tickets. The likelihood of the pregenerator breaking a mods functionality or a mod breaking the pregenerator is just simply to likely to happen.
A Dedicated ticket should be provided. - Third: Why multiple help messages when minecrafts chat supports new line characters in chat?
Once the first two are addressed i think the commit is worthy of getting into neoforge.
Maybe not the best/fastest implementation, but good enough for the masses.
Edit:
If someone wants to follow the discussion about the review of this pullrequest.
It can be found here
src/main/java/net/neoforged/neoforge/server/command/GenerateCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/net/neoforged/neoforge/server/command/GenerateCommand.java
Show resolved
Hide resolved
src/main/java/net/neoforged/neoforge/server/command/generation/GenerationTask.java
Outdated
Show resolved
Hide resolved
src/main/java/net/neoforged/neoforge/server/command/generation/GenerationTask.java
Outdated
Show resolved
Hide resolved
Hold off on merge while I look into the queue a bit more. And also look into the memory issue some more |
Ok iterator issues should be folly resolved. There's a memory leak with vanilla POI system but that'll be best handled in a separate PR/work that will benefit this generate command as a big side bonus. For now, this generate command does what it says on the tin as its sole focus as external optimizations is out of scope of this PR. |
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, I don't see any problem with this implementation anymore.
All problems I have found are resolved with it.
Only thing that might should be considered with this patch should be maybe #356
Because this pregenerator might benefit from that too.
But that is not that important.
Overall I approve!
Added code to now skip already fully generated chunks. Special thanks to Gegy for suggesting this idea! New speed when in a large already-generated area: 2023-12-12.07-27-45.mp4Old speed when in a large already-generated area: 2023-12-12.07-30-08.1.mp4 |
Huh 2x improvement, didn't expect that. |
src/main/java/net/neoforged/neoforge/server/command/generation/GenerationTask.java
Outdated
Show resolved
Hide resolved
as a server owner now first seeing this in action on 1.21.1, this is very very nice and such a quality of life improvement, thank you all involved! |
Special thanks to Jasmine and Gegy for allowing us to use their Fabric Chunk Pregenerator as a basis for this PR. https://github.com/jaskarth/fabric-chunkpregenerator/tree/master
We will of course need some testing for this.
New commands and changes are:
/neoforge generate start <x> <y> <z> <chunkRadius> [progressBar] - Generates a square centered on the given position that is chunkRadius * 2 on each side.
/neoforge generate stop - Stops the current generation and displays progress that it had completed.
/neoforge generate status - Displays the progress completed for the currently running generation.
/neoforge generate help - Displays all the generate commands and the general tip.
General tips: If running from a server console, you can run generate in different dimensions by using /execute in neoforge generate...
Fixes: #331