AuthMe 3.4

This commit is contained in:
Xephi
2014-06-13 05:56:59 +02:00
parent ff9ec22041
commit 2638007ada
52 changed files with 504 additions and 383 deletions
@@ -132,36 +132,24 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
player.setGameMode(GameMode.SURVIVAL);
}
// Teleport the player
if(Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName())) {
// If we have force the spawn location on join
teleportToSpawn();
} else {
if (Settings.isTeleportToSpawnEnabled) {
// If and only if teleport unauthed to spawn is activate
teleportBackFromSpawn();
} else {
if (Settings.isSaveQuitLocationEnabled && auth.getQuitLocY() != 0) {
// Teleport the player on the saved location
packQuitLocation();
} else {
// Do not move the player from his position
}
}
}
// Teleport
if (Settings.isTeleportToSpawnEnabled && !Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName())) {
if (Settings.isSaveQuitLocationEnabled && auth.getQuitLocY() != 0) {
packQuitLocation();
if (!Settings.noTeleport) {
// Teleport the player
if(Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName())) {
// If we have force the spawn location on join
teleportToSpawn();
} else {
teleportBackFromSpawn();
if (Settings.isTeleportToSpawnEnabled) {
// If and only if teleport unauthed to spawn is activate
teleportBackFromSpawn();
} else {
if (Settings.isSaveQuitLocationEnabled && auth.getQuitLocY() != 0) {
// Teleport the player on the saved location
packQuitLocation();
} else {
// Do not move the player from his position
}
}
}
} else if (Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName())) {
teleportToSpawn();
} else if (Settings.isSaveQuitLocationEnabled && auth.getQuitLocY() != 0) {
packQuitLocation();
} else {
teleportBackFromSpawn();
}
// Re-Force Survival GameMode if we need due to world change specification
@@ -46,7 +46,7 @@ public class ProcessSyncronousEmailRegister implements Runnable {
int nwMsg = Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new MessageTask(plugin, name, m._("login_msg"), msgInterval));
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(nwMsg);
if (Settings.isTeleportToSpawnEnabled) {
if (Settings.isTeleportToSpawnEnabled && !Settings.noTeleport) {
Location loca = plugin.getSpawnLocation(player);
RegisterTeleportEvent tpEvent = new RegisterTeleportEvent(player, loca);
plugin.getServer().getPluginManager().callEvent(tpEvent);
@@ -42,7 +42,7 @@ public class ProcessSyncronousPasswordRegister implements Runnable {
}
protected void forceLogin(Player player) {
if (Settings.isTeleportToSpawnEnabled) {
if (Settings.isTeleportToSpawnEnabled && !Settings.noTeleport) {
Location spawnLoc = plugin.getSpawnLocation(player);
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, spawnLoc);
plugin.getServer().getPluginManager().callEvent(tpEvent);
@@ -78,7 +78,7 @@ public class ProcessSyncronousPasswordRegister implements Runnable {
LimboPlayer limbo = LimboCache.getInstance().getLimboPlayer(name);
if (limbo != null) {
player.setGameMode(limbo.getGameMode());
if (Settings.isTeleportToSpawnEnabled) {
if (Settings.isTeleportToSpawnEnabled && !Settings.noTeleport) {
Location loca = plugin.getSpawnLocation(player);
RegisterTeleportEvent tpEvent = new RegisterTeleportEvent(player, loca);
plugin.getServer().getPluginManager().callEvent(tpEvent);