#838 Fix force spawn on join setting
- Add call to teleport service after login and logout
This commit is contained in:
@@ -43,10 +43,7 @@ public class AsynchronousLogout implements AsynchronousProcess {
|
||||
PlayerAuth auth = playerCache.getAuth(name);
|
||||
database.updateSession(auth);
|
||||
if (service.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION)) {
|
||||
auth.setQuitLocX(player.getLocation().getX());
|
||||
auth.setQuitLocY(player.getLocation().getY());
|
||||
auth.setQuitLocZ(player.getLocation().getZ());
|
||||
auth.setWorld(player.getWorld().getName());
|
||||
auth.setQuitLocation(player.getLocation());
|
||||
database.updateQuitLoc(auth);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import fr.xephi.authme.settings.properties.RegistrationSettings;
|
||||
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
||||
import fr.xephi.authme.task.PlayerDataTaskManager;
|
||||
import fr.xephi.authme.util.BukkitService;
|
||||
import fr.xephi.authme.util.TeleportationService;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
@@ -45,6 +46,9 @@ public class ProcessSynchronousPlayerLogout implements SynchronousProcess {
|
||||
@Inject
|
||||
private SessionManager sessionManager;
|
||||
|
||||
@Inject
|
||||
private TeleportationService teleportationService;
|
||||
|
||||
ProcessSynchronousPlayerLogout() {
|
||||
}
|
||||
|
||||
@@ -84,6 +88,7 @@ public class ProcessSynchronousPlayerLogout implements SynchronousProcess {
|
||||
private void applyLogoutEffect(Player player) {
|
||||
// dismount player
|
||||
player.leaveVehicle();
|
||||
teleportationService.teleportOnJoin(player);
|
||||
|
||||
// Apply Blindness effect
|
||||
final int timeout = service.getProperty(RestrictionSettings.TIMEOUT) * TICKS_PER_SECOND;
|
||||
|
||||
Reference in New Issue
Block a user