Remove gamemode and flying switching

Fixes Xephi/AuthMeReloaded#355
Fixes Xephi/AuthMeReloaded#320
Fixes Xephi/AuthMeReloaded#258
Fixes Xephi/AuthMeReloaded#246
This commit is contained in:
games647
2015-12-22 11:05:35 +01:00
parent 1ded09b5ab
commit 8c1eef3f59
16 changed files with 14 additions and 231 deletions
@@ -6,7 +6,6 @@ import fr.xephi.authme.cache.auth.PlayerCache;
import fr.xephi.authme.cache.limbo.LimboCache;
import fr.xephi.authme.cache.limbo.LimboPlayer;
import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.listener.AuthMePlayerListener;
import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.util.Utils;
import org.bukkit.Bukkit;
@@ -23,7 +22,6 @@ public class AsynchronousQuit {
protected final Player player;
private final String name;
private boolean isOp = false;
private boolean isFlying = false;
private boolean needToChange = false;
private boolean isKick = false;
@@ -69,7 +67,6 @@ public class AsynchronousQuit {
Utils.addNormal(player, limbo.getGroup());
needToChange = true;
isOp = limbo.getOperator();
isFlying = limbo.isFlying();
if (limbo.getTimeoutTaskId() != null)
limbo.getTimeoutTaskId().cancel();
if (limbo.getMessageTaskId() != null)
@@ -96,7 +93,6 @@ public class AsynchronousQuit {
database.setUnlogged(name);
}
AuthMePlayerListener.gameMode.remove(name);
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new ProcessSyncronousPlayerQuit(plugin, player, isOp, isFlying, needToChange));
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new ProcessSyncronousPlayerQuit(plugin, player, isOp, needToChange));
}
}
@@ -1,8 +1,6 @@
package fr.xephi.authme.process.quit;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.settings.Settings;
import org.bukkit.GameMode;
import org.bukkit.entity.Player;
/**
@@ -12,7 +10,6 @@ public class ProcessSyncronousPlayerQuit implements Runnable {
protected final AuthMe plugin;
protected final Player player;
protected final boolean isOp;
protected final boolean isFlying;
protected final boolean needToChange;
/**
@@ -21,16 +18,13 @@ public class ProcessSyncronousPlayerQuit implements Runnable {
* @param plugin AuthMe
* @param player Player
* @param isOp boolean
* @param isFlying boolean
* @param needToChange boolean
*/
public ProcessSyncronousPlayerQuit(AuthMe plugin, Player player
, boolean isOp, boolean isFlying
, boolean needToChange) {
, boolean isOp, boolean needToChange) {
this.plugin = plugin;
this.player = player;
this.isOp = isOp;
this.isFlying = isFlying;
this.needToChange = needToChange;
}
@@ -41,13 +35,8 @@ public class ProcessSyncronousPlayerQuit implements Runnable {
*/
@Override
public void run() {
if (needToChange) {
player.setOp(isOp);
if (player.getGameMode() != GameMode.CREATIVE && !Settings.isMovementAllowed) {
player.setAllowFlight(isFlying);
player.setFlying(isFlying);
}
}
try {
player.getVehicle().eject();