mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-09 12:10:56 +01:00
Speed 0 when not logged!
This commit is contained in:
parent
dc35d768aa
commit
b427d14bcb
@ -486,6 +486,10 @@ public class AdminCommand implements CommandExecutor {
|
||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(sched.runTaskAsynchronously(plugin, new MessageTask(plugin, name, m.send("reg_msg"), interval)));
|
||||
if (Settings.applyBlindEffect)
|
||||
target.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, Settings.getRegistrationTimeout * 20, 2));
|
||||
if (!Settings.isMovementAllowed) {
|
||||
target.setWalkSpeed(0.0f);
|
||||
target.setFlySpeed(0.0f);
|
||||
}
|
||||
m.send(target, "unregistered");
|
||||
}
|
||||
}
|
||||
|
@ -109,6 +109,10 @@ public class UnregisterCommand implements CommandExecutor {
|
||||
}
|
||||
if (Settings.applyBlindEffect)
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, Settings.getRegistrationTimeout * 20, 2));
|
||||
if (!Settings.isMovementAllowed) {
|
||||
player.setWalkSpeed(0.0f);
|
||||
player.setFlySpeed(0.0f);
|
||||
}
|
||||
m.send(player, "unregistered");
|
||||
ConsoleLogger.info(player.getDisplayName() + " unregistered himself");
|
||||
if (Settings.isTeleportToSpawnEnabled && !Settings.noTeleport) {
|
||||
|
@ -235,6 +235,10 @@ public class AsyncronousJoin {
|
||||
player.performCommand("motd");
|
||||
if (Settings.applyBlindEffect)
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, Settings.getRegistrationTimeout * 20, 2));
|
||||
if (!Settings.isMovementAllowed) {
|
||||
player.setWalkSpeed(0.0f);
|
||||
player.setFlySpeed(0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -186,6 +186,10 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
|
||||
|
||||
if (Settings.applyBlindEffect)
|
||||
player.removePotionEffect(PotionEffectType.BLINDNESS);
|
||||
if (!Settings.isMovementAllowed) {
|
||||
player.setWalkSpeed(0.2f);
|
||||
player.setFlySpeed(0.4f);
|
||||
}
|
||||
|
||||
// The Loginevent now fires (as intended) after everything is processed
|
||||
Bukkit.getServer().getPluginManager().callEvent(new LoginEvent(player, true));
|
||||
|
@ -54,6 +54,8 @@ public class ProcessSyncronousPlayerLogout implements Runnable {
|
||||
if (!Settings.isMovementAllowed) {
|
||||
player.setAllowFlight(true);
|
||||
player.setFlying(true);
|
||||
player.setFlySpeed(0.0f);
|
||||
player.setWalkSpeed(0.0f);
|
||||
}
|
||||
// Player is now logout... Time to fire event !
|
||||
Bukkit.getServer().getPluginManager().callEvent(new LogoutEvent(player));
|
||||
|
@ -119,6 +119,10 @@ public class ProcessSyncronousPasswordRegister implements Runnable {
|
||||
}
|
||||
if (Settings.applyBlindEffect)
|
||||
player.removePotionEffect(PotionEffectType.BLINDNESS);
|
||||
if (!Settings.isMovementAllowed) {
|
||||
player.setWalkSpeed(0.2f);
|
||||
player.setFlySpeed(0.4f);
|
||||
}
|
||||
// The Loginevent now fires (as intended) after everything is processed
|
||||
Bukkit.getServer().getPluginManager().callEvent(new LoginEvent(player, true));
|
||||
player.saveData();
|
||||
|
Loading…
Reference in New Issue
Block a user