Revert "Always save quit location and fixes #2769 issue 1"

This reverts commit c1eee8e139.
This commit is contained in:
HaHaWTH
2024-05-22 23:48:28 +08:00
parent cb76ae01e1
commit 8c4da6288e
2 changed files with 13 additions and 14 deletions
@@ -12,6 +12,7 @@ import fr.xephi.authme.service.SessionService;
import fr.xephi.authme.service.ValidationService;
import fr.xephi.authme.settings.SpawnLoader;
import fr.xephi.authme.settings.properties.PluginSettings;
import fr.xephi.authme.settings.properties.RestrictionSettings;
import fr.xephi.authme.util.PlayerUtils;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@@ -67,16 +68,13 @@ public class AsynchronousQuit implements AsynchronousProcess {
boolean wasLoggedIn = playerCache.isAuthenticated(name);
if (wasLoggedIn) {
//if (service.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION)) {
// AuthMeReReloaded - Always save quit location on quit
Location loc = spawnLoader.getPlayerLocationOrSpawn(player);
PlayerAuth authLoc = PlayerAuth.builder()
.name(name).location(loc)
.realName(player.getName()).build();
database.updateQuitLoc(authLoc);
// AuthMeReReloaded - Fix AuthMe#2769 -1
//}
if (service.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION)) {
Location loc = spawnLoader.getPlayerLocationOrSpawn(player);
PlayerAuth auth = PlayerAuth.builder()
.name(name).location(loc)
.realName(player.getName()).build();
database.updateQuitLoc(auth);
}
String ip = PlayerUtils.getPlayerIp(player);
PlayerAuth auth = PlayerAuth.builder()