Slimefun4 icon indicating copy to clipboard operation
Slimefun4 copied to clipboard

fix: make research placeholder use same math logic as stats

Open DereC4 opened this issue 7 months ago โ€ข 1 comments

Description

The data displayed by the placeholder %slimefun_researches_percentage_researches_unlocked% displays data from all slimefun items (including the disabled ones) while the /sf stats displays data from all slimefun items (except the disabled ones).

Proposed changes

I'm not sure about style guide or how you wanted parity to happen, so I went with the more logical approach. Adjusted the placeholder calculation to remove disabled researches from the calculation, which matches what the /stats command does.

Made the countNonEmptyResearches public to access it from placeholder with our provided profile instance.

Related Issues (if applicable)

#4277

Checklist

  • [ ] 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.16.* - 1.20.*).
  • [ ] I followed the existing code standards and didn't mess up the formatting.
  • [ ] I did my best to add documentation to any public classes or methods I added.
  • [ ] 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.

DereC4 avatar May 17 '25 18:05 DereC4

Pro Tip! You can help us label your Pull Requests by using the following branch naming convention next time you create a pull request. โค๏ธ

Branch naming convention Label
feature/** ๐ŸŽˆ Feature
fix/** โœจ Fix
chore/** ๐Ÿงน Chores
api/** ๐Ÿ”ง API
performance/** ๐Ÿ’ก Performance Optimization
compatibility/** ๐Ÿค Compatibility

If your changes do not fall into any of these categories, don't worry. You can just ignore this message in that case! ๐Ÿ‘€

github-actions[bot] avatar May 17 '25 18:05 github-actions[bot]