1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Fixed the getTitle method.

This commit is contained in:
Niek Wilting 2019-11-24 14:11:34 +01:00
parent 7ad4d92a14
commit 1f9cbc0b13

View File

@ -186,8 +186,9 @@ public final class PlayerProfile {
public String getTitle() {
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();
if (index > 0) index--;
float fraction = (float) researches.size() / Research.list().size();
int index = (int) (fraction * (titles.size() -1));
return titles.get(index);
}