Some optimizations

As suggested by @bm01 in issue #19:
- Pass PlayerProfile and current time to monitorSkills
- Pass PlayerProfile and current time to watchCooldowns

Testing with only one player seems to indicate a near-negligible increase in performance, but could be useful with more users online.
This commit is contained in:
NuclearW
2012-01-28 21:13:40 -05:00
parent fded7cad96
commit 3fef87923a
2 changed files with 99 additions and 103 deletions

View File

@ -37,6 +37,7 @@ public class mcTimer implements Runnable
public void run()
{
long curTime = System.currentTimeMillis();
for(Player player : plugin.getServer().getOnlinePlayers())
{
if(player == null)
@ -49,12 +50,12 @@ public class mcTimer implements Runnable
/*
* MONITOR SKILLS
*/
Skills.monitorSkills(player);
Skills.monitorSkills(player, PP, curTime);
/*
* COOLDOWN MONITORING
*/
Skills.watchCooldowns(player);
Skills.watchCooldowns(player, PP, curTime);
/*
* PLAYER BLEED MONITORING