Try this way to fix quitloc

This commit is contained in:
Xephi59 2015-07-31 14:39:49 +02:00
parent 84a1227afd
commit 4ecbd7b526

View File

@ -46,16 +46,13 @@ public class AsyncronousQuit {
return; return;
} }
Location loc = player.getLocation();
String ip = plugin.getIP(player); String ip = plugin.getIP(player);
if (PlayerCache.getInstance().isAuthenticated(name) && !player.isDead()) { if (PlayerCache.getInstance().isAuthenticated(name) && !player.isDead()) {
if (Settings.isSaveQuitLocationEnabled && database.isAuthAvailable(name)) { if (Settings.isSaveQuitLocationEnabled && database.isAuthAvailable(name)) {
final PlayerAuth auth = new PlayerAuth(name, loc.getX(), loc.getY(), loc.getZ(), loc.getWorld().getName(), player.getName()); Location loc = player.getLocation();
try { PlayerAuth auth = new PlayerAuth(name, loc.getX(), loc.getY(), loc.getZ(), loc.getWorld().getName(), player.getName());
database.updateQuitLoc(auth); database.updateQuitLoc(auth);
} catch (NullPointerException npe) {
}
} }
PlayerAuth auth = new PlayerAuth(name, ip, System.currentTimeMillis(), player.getName()); PlayerAuth auth = new PlayerAuth(name, ip, System.currentTimeMillis(), player.getName());
database.updateSession(auth); database.updateSession(auth);