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

Fixed Exception when doing /sf stats

This commit is contained in:
TheBusyBiscuit 2019-08-30 12:00:28 +02:00
parent 4cd9628786
commit 5793508144
3 changed files with 3 additions and 2 deletions

View File

@ -2254,6 +2254,7 @@ public final class SlimefunSetup {
if (SlimefunManager.isItemSimiliar(item, SlimefunItems.FLASK_OF_KNOWLEDGE, true) && p.getLevel() >= 1) {
if (e.getClickedBlock() == null || !(e.getClickedBlock().getState() instanceof Container)) {
p.setLevel(p.getLevel() - 1);
e.setCancelled(true);
p.getInventory().addItem(new CustomItem(Material.EXPERIENCE_BOTTLE, "&aFlask of Knowledge"));
p.playSound(p.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1F, 0.5F);

View File

@ -227,7 +227,7 @@ public class BlockStorage {
if (changes == 0) return;
System.out.println("[Slimefun] Saving Blocks for World \"" + world.getName() + "\" (" + changes + " Changes queued)");
System.out.println("[Slimefun] Saving Blocks for World \"" + world.getName() + "\" (" + changes + " Change(s) queued)");
Map<String, Config> cache = new HashMap<>(cache_blocks);

View File

@ -163,7 +163,7 @@ public final class PlayerProfile {
public String getTitle() {
List<String> titles = SlimefunStartup.instance.getSettings().RESEARCHES_TITLES;
int index = Math.round(Float.valueOf(String.valueOf(Math.round(((researches.size() * 100.0F) / titles.size())))));
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--;
return titles.get(index);
}