diff --git a/src/main/java/fr/xephi/authme/AuthMe.java b/src/main/java/fr/xephi/authme/AuthMe.java index 850bd2ed2..47fd24aa2 100644 --- a/src/main/java/fr/xephi/authme/AuthMe.java +++ b/src/main/java/fr/xephi/authme/AuthMe.java @@ -7,7 +7,6 @@ import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.auth.PlayerCache; import fr.xephi.authme.cache.backup.PlayerDataStorage; import fr.xephi.authme.cache.limbo.LimboCache; -import fr.xephi.authme.cache.limbo.PlayerData; import fr.xephi.authme.command.CommandHandler; import fr.xephi.authme.datasource.CacheDataSource; import fr.xephi.authme.datasource.DataSource; @@ -442,8 +441,8 @@ public class AuthMe extends JavaPlugin { //returns only the async takss for (BukkitWorker pendingTask : getServer().getScheduler().getActiveWorkers()) { if (pendingTask.getOwner().equals(AuthMe.this) - //it's not a peridic task - && !getServer().getScheduler().isQueued(pendingTask.getTaskId())) { + //it's not a peridic task + && !getServer().getScheduler().isQueued(pendingTask.getTaskId())) { pendingTasks.add(pendingTask.getTaskId()); } } @@ -466,7 +465,7 @@ public class AuthMe extends JavaPlugin { break; } - for (Iterator iterator = pendingTasks.iterator(); iterator.hasNext();) { + for (Iterator iterator = pendingTasks.iterator(); iterator.hasNext(); ) { int taskId = iterator.next(); if (!getServer().getScheduler().isCurrentlyRunning(taskId)) { iterator.remove(); @@ -565,19 +564,8 @@ public class AuthMe extends JavaPlugin { } String name = player.getName().toLowerCase(); if (limboCache.hasPlayerData(name)) { - PlayerData limbo = limboCache.getPlayerData(name); - if (!newSettings.getProperty(RestrictionSettings.NO_TELEPORT)) { - player.teleport(limbo.getLoc()); - } - Utils.addNormal(player, limbo.getGroup()); - player.setOp(limbo.isOperator()); - player.setAllowFlight(limbo.isCanFly()); - player.setWalkSpeed(limbo.getWalkSpeed()); - if (newSettings.getProperty(RestrictionSettings.TELEPORT_UNAUTHED_TO_SPAWN)) { - limboCache.removePlayerData(player); - } else { - limboCache.deletePlayerData(player); - } + limboCache.restoreData(player); + limboCache.removeFromCache(player); } else { if (newSettings.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION)) { Location loc = spawnLoader.getPlayerLocationOrSpawn(player); diff --git a/src/main/java/fr/xephi/authme/cache/backup/PlayerDataStorage.java b/src/main/java/fr/xephi/authme/cache/backup/PlayerDataStorage.java index 73fa9b2ea..e2a94da53 100644 --- a/src/main/java/fr/xephi/authme/cache/backup/PlayerDataStorage.java +++ b/src/main/java/fr/xephi/authme/cache/backup/PlayerDataStorage.java @@ -189,7 +189,7 @@ public class PlayerDataStorage { JsonObject obj = new JsonObject(); obj.addProperty("group", playerData.getGroup()); - Location loc = playerData.getLoc(); + Location loc = playerData.getLocation(); JsonObject obj2 = new JsonObject(); obj2.addProperty("world", loc.getWorld().getName()); obj2.addProperty("x", loc.getX()); diff --git a/src/main/java/fr/xephi/authme/cache/limbo/LimboCache.java b/src/main/java/fr/xephi/authme/cache/limbo/LimboCache.java index 0db44aa23..6bdc67232 100644 --- a/src/main/java/fr/xephi/authme/cache/limbo/LimboCache.java +++ b/src/main/java/fr/xephi/authme/cache/limbo/LimboCache.java @@ -2,7 +2,11 @@ package fr.xephi.authme.cache.limbo; import fr.xephi.authme.cache.backup.PlayerDataStorage; import fr.xephi.authme.permission.PermissionsManager; +import fr.xephi.authme.settings.NewSetting; 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.StringUtils; import org.bukkit.Location; import org.bukkit.entity.Player; @@ -19,18 +23,21 @@ public class LimboCache { private final ConcurrentHashMap cache = new ConcurrentHashMap<>(); private PlayerDataStorage playerDataStorage; + private NewSetting settings; private PermissionsManager permissionsManager; private SpawnLoader spawnLoader; @Inject - LimboCache(PermissionsManager permissionsManager, SpawnLoader spawnLoader, PlayerDataStorage playerDataStorage) { + LimboCache(NewSetting settings, PermissionsManager permissionsManager, + SpawnLoader spawnLoader, PlayerDataStorage playerDataStorage) { + this.settings = settings; this.permissionsManager = permissionsManager; this.spawnLoader = spawnLoader; this.playerDataStorage = playerDataStorage; } /** - * Add a limbo player. + * Load player data if exist, otherwise current player's data will be stored. * * @param player Player instance to add. */ @@ -49,7 +56,7 @@ public class LimboCache { if (playerDataStorage.hasData(player)) { PlayerData cache = playerDataStorage.readData(player); if (cache != null) { - location = cache.getLoc(); + location = cache.getLocation(); playerGroup = cache.getGroup(); operator = cache.isOperator(); flyEnabled = cache.isCanFly(); @@ -64,21 +71,42 @@ public class LimboCache { } /** - * Remove PlayerData and delete cache.json from disk. + * Restore player's data to player if exist. + * + * @param player Player instance to restore + */ + public void restoreData(Player player) { + String lowerName = player.getName().toLowerCase(); + if (cache.containsKey(lowerName)) { + PlayerData data = cache.get(lowerName); + player.setOp(data.isOperator()); + player.setAllowFlight(data.isCanFly()); + player.setWalkSpeed(data.getWalkSpeed()); + player.setFlySpeed(data.getFlySpeed()); + restoreGroup(player, data.getGroup()); + if (!settings.getProperty(RestrictionSettings.NO_TELEPORT)) { + player.teleport(data.getLocation()); + } + data.clearTasks(); + } + } + + /** + * Remove PlayerData from cache and disk. * * @param player Player player to remove. */ public void deletePlayerData(Player player) { - removePlayerData(player); + removeFromCache(player); playerDataStorage.removeData(player); } /** - * Remove PlayerData from cache, without deleting cache.json file. + * Remove PlayerData from cache. * - * @param player Player player to remove. + * @param player player to remove. */ - public void removePlayerData(Player player) { + public void removeFromCache(Player player) { String name = player.getName().toLowerCase(); PlayerData cachedPlayer = cache.remove(name); if (cachedPlayer != null) { @@ -117,7 +145,15 @@ public class LimboCache { */ public void updatePlayerData(Player player) { checkNotNull(player); - removePlayerData(player); + removeFromCache(player); addPlayerData(player); } + + private void restoreGroup(Player player, String group) { + if (!settings.getProperty(PluginSettings.ENABLE_PERMISSION_CHECK) + || !permissionsManager.hasGroupSupport() || StringUtils.isEmpty(group)) { + return; + } + permissionsManager.setGroup(player, group); + } } diff --git a/src/main/java/fr/xephi/authme/cache/limbo/PlayerData.java b/src/main/java/fr/xephi/authme/cache/limbo/PlayerData.java index ba7ee382d..36e641fd8 100644 --- a/src/main/java/fr/xephi/authme/cache/limbo/PlayerData.java +++ b/src/main/java/fr/xephi/authme/cache/limbo/PlayerData.java @@ -33,7 +33,7 @@ public class PlayerData { * * @return The player's location */ - public Location getLoc() { + public Location getLocation() { return loc; } diff --git a/src/main/java/fr/xephi/authme/permission/AuthGroupHandler.java b/src/main/java/fr/xephi/authme/permission/AuthGroupHandler.java index ecbb6d263..836249b0d 100644 --- a/src/main/java/fr/xephi/authme/permission/AuthGroupHandler.java +++ b/src/main/java/fr/xephi/authme/permission/AuthGroupHandler.java @@ -66,14 +66,14 @@ public class AuthGroupHandler { return permissionsManager.addGroup(player, settings.getProperty(SecuritySettings.UNLOGGEDIN_GROUP)); case LOGGED_IN: - // Get the limbo player data - PlayerData limbo = limboCache.getPlayerData(player.getName().toLowerCase()); - if (limbo == null) { + // Get the player data + PlayerData data = limboCache.getPlayerData(player.getName().toLowerCase()); + if (data == null) { return false; } // Get the players group - String realGroup = limbo.getGroup(); + String realGroup = data.getGroup(); // Remove the other group types groups, set the real group permissionsManager.removeGroups(player, diff --git a/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java b/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java index 85299bb2f..4ed006801 100644 --- a/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java +++ b/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java @@ -115,11 +115,11 @@ public class AsynchronousJoin implements AsynchronousProcess { return; } - limboCache.updatePlayerData(player); final boolean isAuthAvailable = database.isAuthAvailable(name); if (isAuthAvailable) { + limboCache.addPlayerData(player); service.setGroup(player, AuthGroupType.NOT_LOGGED_IN); // Protect inventory @@ -150,7 +150,9 @@ public class AsynchronousJoin implements AsynchronousProcess { } } } else { - // Not Registered + // Not Registered. Delete old data, load default one. + limboCache.deletePlayerData(player); + limboCache.addPlayerData(player); // Groups logic service.setGroup(player, AuthGroupType.UNREGISTERED); diff --git a/src/main/java/fr/xephi/authme/process/login/ProcessSyncPlayerLogin.java b/src/main/java/fr/xephi/authme/process/login/ProcessSyncPlayerLogin.java index 8099b04df..0ac3ff2c8 100644 --- a/src/main/java/fr/xephi/authme/process/login/ProcessSyncPlayerLogin.java +++ b/src/main/java/fr/xephi/authme/process/login/ProcessSyncPlayerLogin.java @@ -3,20 +3,16 @@ package fr.xephi.authme.process.login; import com.google.common.io.ByteArrayDataOutput; import com.google.common.io.ByteStreams; import fr.xephi.authme.AuthMe; -import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.limbo.LimboCache; -import fr.xephi.authme.cache.limbo.PlayerData; import fr.xephi.authme.datasource.DataSource; import fr.xephi.authme.events.LoginEvent; import fr.xephi.authme.events.RestoreInventoryEvent; import fr.xephi.authme.listener.AuthMePlayerListener; import fr.xephi.authme.listener.protocollib.ProtocolLibService; -import fr.xephi.authme.permission.AuthGroupType; import fr.xephi.authme.process.ProcessService; import fr.xephi.authme.process.SynchronousProcess; import fr.xephi.authme.settings.properties.HooksSettings; import fr.xephi.authme.settings.properties.RegistrationSettings; -import fr.xephi.authme.settings.properties.RestrictionSettings; import fr.xephi.authme.util.BukkitService; import fr.xephi.authme.util.TeleportationService; import org.apache.commons.lang.reflect.MethodUtils; @@ -60,7 +56,8 @@ public class ProcessSyncPlayerLogin implements SynchronousProcess { @Inject private TeleportationService teleportationService; - ProcessSyncPlayerLogin() { } + ProcessSyncPlayerLogin() { + } private void restoreInventory(Player player) { RestoreInventoryEvent event = new RestoreInventoryEvent(player); @@ -83,26 +80,12 @@ public class ProcessSyncPlayerLogin implements SynchronousProcess { public void processPlayerLogin(Player player) { final String name = player.getName().toLowerCase(); // Limbo contains the State of the Player before /login - final PlayerData limbo = limboCache.getPlayerData(name); - final PlayerAuth auth = dataSource.getAuth(name); - - if (limbo != null) { - // Restore Op state and Permission Group - player.setOp(limbo.isOperator()); - // Restore primary group - service.setGroup(player, AuthGroupType.LOGGED_IN); - // Restore can-fly state - player.setAllowFlight(limbo.isCanFly()); - - // Restore speed - if (!service.getProperty(RestrictionSettings.ALLOW_UNAUTHED_MOVEMENT) - && service.getProperty(RestrictionSettings.REMOVE_SPEED)) { - player.setWalkSpeed(limbo.getWalkSpeed()); - player.setFlySpeed(0.2F); - } - - teleportationService.teleportOnLogin(player, auth, limbo); - + if (limboCache.hasPlayerData(name)) { + limboCache.restoreData(player); + limboCache.deletePlayerData(player); + // do we really need to use location from database for now? + // because LimboCache#restoreData teleport player to last location. + //teleportationService.teleportOnLogin(player, auth, limbo); if (RESTORE_COLLISIONS && !service.getProperty(KEEP_COLLISIONS_DISABLED)) { player.setCollidable(true); } @@ -110,9 +93,6 @@ public class ProcessSyncPlayerLogin implements SynchronousProcess { if (service.getProperty(PROTECT_INVENTORY_BEFORE_LOGIN)) { restoreInventory(player); } - - // Clean up no longer used temporary data - limboCache.deletePlayerData(player); } // We can now display the join message (if delayed) @@ -157,10 +137,10 @@ public class ProcessSyncPlayerLogin implements SynchronousProcess { } private void sendTo(Player player) { - if(!service.getProperty(HooksSettings.BUNGEECORD)) { + if (!service.getProperty(HooksSettings.BUNGEECORD)) { return; } - if(service.getProperty(HooksSettings.BUNGEECORD_SERVER).isEmpty()) { + if (service.getProperty(HooksSettings.BUNGEECORD_SERVER).isEmpty()) { return; } @@ -171,7 +151,7 @@ public class ProcessSyncPlayerLogin implements SynchronousProcess { } private void sendBungeeMessage(Player player) { - if(!service.getProperty(HooksSettings.BUNGEECORD)) { + if (!service.getProperty(HooksSettings.BUNGEECORD)) { return; } diff --git a/src/main/java/fr/xephi/authme/process/logout/AsynchronousLogout.java b/src/main/java/fr/xephi/authme/process/logout/AsynchronousLogout.java index 5d75ce700..209ec480c 100644 --- a/src/main/java/fr/xephi/authme/process/logout/AsynchronousLogout.java +++ b/src/main/java/fr/xephi/authme/process/logout/AsynchronousLogout.java @@ -50,7 +50,7 @@ public class AsynchronousLogout implements AsynchronousProcess { database.updateQuitLoc(auth); } - limboCache.updatePlayerData(player); + limboCache.addPlayerData(player); playerCache.removePlayer(name); database.setUnlogged(name); syncProcessManager.processSyncPlayerLogout(player); diff --git a/src/main/java/fr/xephi/authme/process/logout/ProcessSynchronousPlayerLogout.java b/src/main/java/fr/xephi/authme/process/logout/ProcessSynchronousPlayerLogout.java index 07d4a8f57..9db73b0db 100644 --- a/src/main/java/fr/xephi/authme/process/logout/ProcessSynchronousPlayerLogout.java +++ b/src/main/java/fr/xephi/authme/process/logout/ProcessSynchronousPlayerLogout.java @@ -45,7 +45,8 @@ public class ProcessSynchronousPlayerLogout implements SynchronousProcess { @Inject private SessionManager sessionManager; - ProcessSynchronousPlayerLogout() { } + ProcessSynchronousPlayerLogout() { + } private void sendBungeeMessage(Player player) { @@ -82,9 +83,7 @@ public class ProcessSynchronousPlayerLogout implements SynchronousProcess { private void applyLogoutEffect(Player player) { // dismount player - if (player.isInsideVehicle() && player.getVehicle() != null) { - player.getVehicle().eject(); - } + player.leaveVehicle(); // Apply Blindness effect final int timeout = service.getProperty(RestrictionSettings.TIMEOUT) * TICKS_PER_SECOND; diff --git a/src/main/java/fr/xephi/authme/process/quit/ProcessSyncronousPlayerQuit.java b/src/main/java/fr/xephi/authme/process/quit/ProcessSyncronousPlayerQuit.java index 46e7fd999..d36b737d9 100644 --- a/src/main/java/fr/xephi/authme/process/quit/ProcessSyncronousPlayerQuit.java +++ b/src/main/java/fr/xephi/authme/process/quit/ProcessSyncronousPlayerQuit.java @@ -2,12 +2,8 @@ package fr.xephi.authme.process.quit; import fr.xephi.authme.cache.backup.PlayerDataStorage; import fr.xephi.authme.cache.limbo.LimboCache; -import fr.xephi.authme.cache.limbo.PlayerData; import fr.xephi.authme.process.ProcessService; import fr.xephi.authme.process.SynchronousProcess; -import fr.xephi.authme.settings.properties.RestrictionSettings; -import fr.xephi.authme.util.StringUtils; -import fr.xephi.authme.util.Utils; import org.bukkit.entity.Player; import javax.inject.Inject; @@ -25,27 +21,12 @@ public class ProcessSyncronousPlayerQuit implements SynchronousProcess { private LimboCache limboCache; public void processSyncQuit(Player player) { - PlayerData limbo = limboCache.getPlayerData(player.getName().toLowerCase()); - if (limbo != null) { // it mean player is not authenticated - // Only delete if we don't need player's last location - if (service.getProperty(RestrictionSettings.TELEPORT_UNAUTHED_TO_SPAWN)) { - limboCache.removePlayerData(player); - } else { - // Restore data if its about to delete PlayerData - if (!StringUtils.isEmpty(limbo.getGroup())) { - Utils.addNormal(player, limbo.getGroup()); - } - player.setOp(limbo.isOperator()); - player.setAllowFlight(limbo.isCanFly()); - player.setWalkSpeed(limbo.getWalkSpeed()); - limboCache.deletePlayerData(player); - } + if (limboCache.hasPlayerData(player.getName().toLowerCase())) { // it mean player is not authenticated + limboCache.removeFromCache(player); } else { - // Write player's location, so we could retrieve it later on player next join - if (service.getProperty(RestrictionSettings.TELEPORT_UNAUTHED_TO_SPAWN)) { - if (!playerDataStorage.hasData(player)) { - playerDataStorage.saveData(player); - } + // Save player's data, so we could retrieve it later on player next join + if (!playerDataStorage.hasData(player)) { + playerDataStorage.saveData(player); } } diff --git a/src/main/java/fr/xephi/authme/process/register/ProcessSyncPasswordRegister.java b/src/main/java/fr/xephi/authme/process/register/ProcessSyncPasswordRegister.java index a4944aac6..9da6f4bd0 100644 --- a/src/main/java/fr/xephi/authme/process/register/ProcessSyncPasswordRegister.java +++ b/src/main/java/fr/xephi/authme/process/register/ProcessSyncPasswordRegister.java @@ -5,7 +5,6 @@ import com.google.common.io.ByteStreams; import fr.xephi.authme.AuthMe; import fr.xephi.authme.ConsoleLogger; import fr.xephi.authme.cache.limbo.LimboCache; -import fr.xephi.authme.cache.limbo.PlayerData; import fr.xephi.authme.events.LoginEvent; import fr.xephi.authme.events.RestoreInventoryEvent; import fr.xephi.authme.listener.protocollib.ProtocolLibService; @@ -20,6 +19,7 @@ import fr.xephi.authme.settings.properties.RegistrationSettings; import fr.xephi.authme.settings.properties.SecuritySettings; import fr.xephi.authme.task.PlayerDataTaskManager; import fr.xephi.authme.util.BukkitService; +import fr.xephi.authme.util.TeleportationService; import fr.xephi.authme.util.Utils; import org.bukkit.Bukkit; import org.bukkit.entity.Player; @@ -35,23 +35,21 @@ public class ProcessSyncPasswordRegister implements SynchronousProcess { @Inject private AuthMe plugin; - @Inject private ProcessService service; - @Inject private BukkitService bukkitService; - @Inject private ProtocolLibService protocolLibService; - @Inject private LimboCache limboCache; - @Inject private PlayerDataTaskManager playerDataTaskManager; + @Inject + private TeleportationService teleportationService; - ProcessSyncPasswordRegister() { } + ProcessSyncPasswordRegister() { + } private void sendBungeeMessage(Player player) { @@ -69,7 +67,7 @@ public class ProcessSyncPasswordRegister implements SynchronousProcess { } for (String command : service.getProperty(RegistrationSettings.FORCE_REGISTER_COMMANDS_AS_CONSOLE)) { Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), - command.replace("%p", player.getName())); + command.replace("%p", player.getName())); } } @@ -93,10 +91,8 @@ public class ProcessSyncPasswordRegister implements SynchronousProcess { public void processPasswordRegister(Player player) { final String name = player.getName().toLowerCase(); - PlayerData limbo = limboCache.getPlayerData(name); - if (limbo != null) { - Utils.teleportToSpawn(player); - + if (limboCache.hasPlayerData(name)) { + teleportationService.teleportOnJoin(player); if (service.getProperty(PROTECT_INVENTORY_BEFORE_LOGIN)) { RestoreInventoryEvent event = new RestoreInventoryEvent(player); bukkitService.callEvent(event); @@ -104,7 +100,7 @@ public class ProcessSyncPasswordRegister implements SynchronousProcess { player.updateInventory(); } } - + limboCache.restoreData(player); limboCache.deletePlayerData(player); } diff --git a/src/main/java/fr/xephi/authme/process/unregister/AsynchronousUnregister.java b/src/main/java/fr/xephi/authme/process/unregister/AsynchronousUnregister.java index b6147f81e..8341b3e71 100644 --- a/src/main/java/fr/xephi/authme/process/unregister/AsynchronousUnregister.java +++ b/src/main/java/fr/xephi/authme/process/unregister/AsynchronousUnregister.java @@ -62,6 +62,7 @@ public class AsynchronousUnregister implements AsynchronousProcess { if (!Settings.getRegisteredGroup.isEmpty()) { service.setGroup(player, AuthGroupType.UNREGISTERED); } + limboCache.deletePlayerData(player); limboCache.addPlayerData(player); playerDataTaskManager.registerTimeoutTask(player); playerDataTaskManager.registerMessageTask(name, false); diff --git a/src/main/java/fr/xephi/authme/util/TeleportationService.java b/src/main/java/fr/xephi/authme/util/TeleportationService.java index 90748dd52..f0e088835 100644 --- a/src/main/java/fr/xephi/authme/util/TeleportationService.java +++ b/src/main/java/fr/xephi/authme/util/TeleportationService.java @@ -102,7 +102,7 @@ public class TeleportationService implements Reloadable { } // The world in PlayerData is from where the player comes, before any teleportation by AuthMe - String worldName = limbo.getLoc().getWorld().getName(); + String worldName = limbo.getLocation().getWorld().getName(); if (mustForceSpawnAfterLogin(worldName)) { teleportToSpawn(player, true); } else if (settings.getProperty(TELEPORT_UNAUTHED_TO_SPAWN)) { @@ -110,7 +110,7 @@ public class TeleportationService implements Reloadable { Location location = buildLocationFromAuth(player, auth); teleportBackFromSpawn(player, location); } else { - teleportBackFromSpawn(player, limbo.getLoc()); + teleportBackFromSpawn(player, limbo.getLocation()); } } } diff --git a/src/test/java/fr/xephi/authme/util/TeleportationServiceTest.java b/src/test/java/fr/xephi/authme/util/TeleportationServiceTest.java index ea67a8874..dba157826 100644 --- a/src/test/java/fr/xephi/authme/util/TeleportationServiceTest.java +++ b/src/test/java/fr/xephi/authme/util/TeleportationServiceTest.java @@ -280,7 +280,7 @@ public class TeleportationServiceTest { PlayerData limbo = mock(PlayerData.class); Location limboLocation = mockLocation(); given(limboLocation.getWorld().getName()).willReturn("forced1"); - given(limbo.getLoc()).willReturn(limboLocation); + given(limbo.getLocation()).willReturn(limboLocation); // when teleportationService.teleportOnLogin(player, auth, limbo); @@ -304,7 +304,7 @@ public class TeleportationServiceTest { PlayerData limbo = mock(PlayerData.class); Location limboLocation = mockLocation(); given(limboLocation.getWorld().getName()).willReturn("Forced1"); // different case - given(limbo.getLoc()).willReturn(limboLocation); + given(limbo.getLocation()).willReturn(limboLocation); // when teleportationService.teleportOnLogin(player, auth, limbo); @@ -330,7 +330,7 @@ public class TeleportationServiceTest { given(player.isOnline()).willReturn(true); PlayerData limbo = mock(PlayerData.class); Location limboLocation = mockLocation(); - given(limbo.getLoc()).willReturn(limboLocation); + given(limbo.getLocation()).willReturn(limboLocation); // when teleportationService.teleportOnLogin(player, auth, limbo); @@ -359,7 +359,7 @@ public class TeleportationServiceTest { given(player.getWorld()).willReturn(world); PlayerData limbo = mock(PlayerData.class); Location limboLocation = mockLocation(); - given(limbo.getLoc()).willReturn(limboLocation); + given(limbo.getLocation()).willReturn(limboLocation); // when teleportationService.teleportOnLogin(player, auth, limbo); @@ -387,7 +387,7 @@ public class TeleportationServiceTest { given(player.getWorld()).willReturn(world); PlayerData limbo = mock(PlayerData.class); Location location = mockLocation(); - given(limbo.getLoc()).willReturn(location); + given(limbo.getLocation()).willReturn(location); // when teleportationService.teleportOnLogin(player, auth, limbo); @@ -412,7 +412,7 @@ public class TeleportationServiceTest { given(player.getWorld()).willReturn(world); PlayerData limbo = mock(PlayerData.class); Location location = mockLocation(); - given(limbo.getLoc()).willReturn(location); + given(limbo.getLocation()).willReturn(location); // when teleportationService.teleportOnLogin(player, auth, limbo);