Slimefun4 icon indicating copy to clipboard operation
Slimefun4 copied to clipboard

fix: incorrect exp spending on unlocking research

Open kingdom84521 opened this issue 1 year ago • 9 comments

Description

The amount of experience spending on unlocking researches is incorrect, since this process is done by Player.setLevel only.

Proposed changes

  1. Add some formula utils for calculating the proper value for unlocking
  2. 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 and Nullable annotations to my methods to indicate their behaviour for null values
  • [ ] I added sufficient Unit Tests to cover my code.

kingdom84521 avatar Apr 28 '23 17:04 kingdom84521

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

J3fftw1 avatar Apr 28 '23 18:04 J3fftw1

That's a point, I'll try to add a option for that.

kingdom84521 avatar Apr 28 '23 18:04 kingdom84521

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

Sefiraat avatar Apr 28 '23 18:04 Sefiraat

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.

kingdom84521 avatar Apr 29 '23 03:04 kingdom84521

use-legacy-xp-spending?

SchnTgaiSpock avatar Apr 29 '23 04:04 SchnTgaiSpock

hmm, I will prefer "vanilla" than "legacy", cause vanilla minecraft is still using this kind of formula on enchanting, or on command /xp.

kingdom84521 avatar Apr 29 '23 04:04 kingdom84521

I agree with schnn I think it should be legacy, we are talking about slimefun, not minecraft

JustAHuman-xD avatar Apr 29 '23 05:04 JustAHuman-xD

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.

Sefiraat avatar Apr 29 '23 15:04 Sefiraat

Sorry for the lack of focusing on this PR, my tasks were finally done and dusted, it's been a nightmare last year :(

kingdom84521 avatar Apr 26 '24 13:04 kingdom84521