diff --git a/src/main/java/com/gmail/nossr50/commands/mc/McrankCommand.java b/src/main/java/com/gmail/nossr50/commands/mc/McrankCommand.java index cb9902b78..0d705bcb3 100644 --- a/src/main/java/com/gmail/nossr50/commands/mc/McrankCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/mc/McrankCommand.java @@ -12,7 +12,6 @@ import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.runnables.mcRankAsync; import com.gmail.nossr50.util.Leaderboard; -import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Skills; public class McrankCommand implements CommandExecutor { diff --git a/src/main/java/com/gmail/nossr50/util/Leaderboard.java b/src/main/java/com/gmail/nossr50/util/Leaderboard.java index 0a8146cfb..84689cde1 100644 --- a/src/main/java/com/gmail/nossr50/util/Leaderboard.java +++ b/src/main/java/com/gmail/nossr50/util/Leaderboard.java @@ -16,11 +16,18 @@ public class Leaderboard { private static mcMMO plugin = mcMMO.p; private final static String location = mcMMO.getUsersFile(); private static HashMap> playerStatHash = new HashMap>(); + private static long lastUpdate = 0; /** * Update the leader boards. */ public static void updateLeaderboards() { + if(System.currentTimeMillis() < lastUpdate + 600000) { + return; //Only update FFS leaderboards every 10 minutes.. this puts a lot of strain on the server (depending on the size of the database) and should not be done frequently + } + + lastUpdate = System.currentTimeMillis(); //Log when the last update was run + //Initialize lists List mining, woodcutting, herbalism, excavation, acrobatics, repair, swords, axes, archery, unarmed, taming, fishing, powerlevel;