Slimefun4
Slimefun4 copied to clipboard
fix: incorrect exp spending on unlocking research
Description
The amount of experience spending on unlocking researches is incorrect, since this process is done by Player.setLevel only.
Proposed changes
- Add some formula utils for calculating the proper value for unlocking
- Refactor the original setLevel to new utils
Related Issues (if applicable)
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.
- [x] I have made sure that the proposed changes do not break compatibility across the supported Minecraft versions (1.16.* - 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.
I feel like this should be a config option this has been this way for many years it would be weird to suddenly change this. Some addons would now also be easier to be unlocked for example I have uu matter set to 100 lvls taking in count that it’s actually levels
That's a point, I'll try to add a option for that.
The config option should be under the research
heading. And I'm not a big fan of the name? convert-level-cost-to-exp
? Not sure that's much better xD
Actually I put it in research at first, but looks like other options in research seems to be like some options that can alter by player on their own? That makes me feel a little bit weird, so I move it to option at last.
Also, I'm a pretty bad namer, so if anyone thought a better name, feel free to tell me, I can fix it right away.
use-legacy-xp-spending
?
hmm, I will prefer "vanilla" than "legacy", cause vanilla minecraft is still using this kind of formula on enchanting, or on command /xp.
I agree with schnn I think it should be legacy, we are talking about slimefun, not minecraft
From my experience on a few servers now it is generally considered to be unintuitive to players coming into slimefun blind but once known it actually becomes a mechanic that rewards forward thinking and/or the use of mechanics offered in addons/3rd party plugins to make the most of xp.
While I prefer the current system in the main, I'm all for the change so long as it's default-off like this.
Sorry for the lack of focusing on this PR, my tasks were finally done and dusted, it's been a nightmare last year :(