-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Implement blocks ticking per world API #6204
base: minor-next
Are you sure you want to change the base?
Implement blocks ticking per world API #6204
Conversation
This comment was marked as spam.
This comment was marked as spam.
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 feel like the method names are too esoteric for anyone to ever actually use them. Can we simplify these names at all without losing the meaning?
The only names i see would be:
But we will need any docs to precise this is the number of block ticked inside each subchunk each tick. But for now, I don't see any shorter name. |
I feel like those are too ambiguous too. |
I can't think of any other name without losing the original meaning of the function. |
Co-authored-by: Dylan T. <[email protected]>
Perhaps the issue here is that we're exposing something that is too "internal". "Random tick speed" would be the most intuitive name, but the problem is that, because of its usage, the values don't map onto what users would expect. We could expose a random tick speed that is just this value divided by 3, but we'd probably have to make it a decimal value to allow the level of granularity that the current setting has. This then exposes all kinds of edge cases like what happens if somebody sets a tick speed of 1.5. We can't tick 4.5 blocks per tick without a lot more complexity. |
Introduction
We already support to change the random tick speed in server, however we can't control which world or change it at runtime. This PR fix that by providing an API and adding new configuration key.
Relevant issues
Changes
API changes
Adding the following functions to
World
:setTickedBlocksPerSubchunkPerTick
getTickedBlocksPerSubchunkPerTick
Adding a new event
WorldTickedBlocksChangeEvent
which is fired when the value of tickedBlocksPerSubchunkPerTick change (not at the initialisation).Backwards compatibility
No
Follow-up
Change the configuration nested the worlds per-tick and the default value under a
blocks-per-subchunk-per-tick