mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 11:45:51 +00:00
Merge pull request #1258 from NiekWilting/fix-titles
Fixed the getTitle method.
This commit is contained in:
commit
85227f0814
@ -186,8 +186,9 @@ public final class PlayerProfile {
|
|||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
List<String> titles = SlimefunPlugin.getSettings().researchesTitles;
|
List<String> titles = SlimefunPlugin.getSettings().researchesTitles;
|
||||||
|
|
||||||
int index = Math.round(Float.valueOf(String.valueOf(Math.round(((researches.size() * 100.0F) / Research.list().size()) * 100.0F) / 100.0F)) / 100.0F) * titles.size();
|
float fraction = (float) researches.size() / Research.list().size();
|
||||||
if (index > 0) index--;
|
int index = (int) (fraction * (titles.size() -1));
|
||||||
|
|
||||||
return titles.get(index);
|
return titles.get(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user