Slimefun4
Slimefun4 copied to clipboard
Adjust ticker times to show correct time on config changes for custom-ticker-delay
Description
This PR adjust the tick rate based on the config value for custom-ticker-delay. It will try to keep the tickers execution at a similar speed as to when the default value is used.
I also adjust the displayed time based on the difference of execution time.
Proposed changes
Changed CraftingOperation to take into account the new ticks config. Normalize the value to the default one of one operation per 10 ticks.
Changed NumberUtils. Added logic that calculates the time new changes will take to finish the operation.
Related Issues (if applicable)
Not sure if there is na issue open.
Here is how to reproduce the issue:
- Adjust custom-ticker-delay to 20.
- Run a ticker ingame.
- The display timer will be wrong the execution slows down by 1/2 so the secounds and minutes are not synced to the actual values.
Checklist
- [x] I have fully tested the proposed changes and promise that they will not break everything into chaos.
- [ ] I have also tested the proposed changes in combination with various popular addons and can confirm my changes do not break them.
- [ ] I have made sure that the proposed changes do not break compatibility across the supported Minecraft versions (1.14.* - 1.19.*).
- [x] I followed the existing code standards and didn't mess up the formatting.
- [x] I did my best to add documentation to any public classes or methods I added.
- [x] I have added
Nonnull
andNullable
annotations to my methods to indicate their behaviour for null values - [ ] I added sufficient Unit Tests to cover my code.
Your Pull Request was automatically labelled as: "🧹 Chores" Thank you for contributing to this project! ❤️
Slimefun preview build
A Slimefun preview build is available for testing! Commit: 40fa170e
https://preview-builds.walshy.dev/download/Slimefun/3927/40fa170e
Note: This is not a supported build and is only here for the purposes of testing. Do not run this on a live server and do not report bugs anywhere but this PR!
This should probably be addressed in MachineRecipe
instead of CraftingOperation