fix: make research placeholder use same math logic as stats
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
NonnullandNullableannotations to my methods to indicate their behaviour for null values - [ ] I added sufficient Unit Tests to cover my code.
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! ๐