Perf boost for boot (file and db modes).

This commit is contained in:
ryanhamshire 2015-02-16 20:14:47 -08:00
parent 25e28c482a
commit 6fcaf3ac7d

View File

@ -321,9 +321,8 @@ public class GriefPrevention extends JavaPlugin
{
try
{
String playerName = player.getName();
UUID playerID = player.getUniqueId();
if(playerName == null || playerID == null) continue;
if(playerID == null) continue;
long lastSeen = player.getLastPlayed();
//if the player has been seen in the last 30 days, cache his name/UUID pair
@ -331,6 +330,8 @@ public class GriefPrevention extends JavaPlugin
long daysDiff = diff / millisecondsPerDay;
if(daysDiff <= 30)
{
String playerName = player.getName();
if(playerName == null) continue;
this.playerNameToIDMap.put(playerName, playerID);
this.playerNameToIDMap.put(playerName.toLowerCase(), playerID);
playersCached++;