From feac0c6c49d541e78f98838e45f53a6d382ac293 Mon Sep 17 00:00:00 2001 From: games647 Date: Fri, 18 Dec 2015 18:27:42 +0100 Subject: [PATCH] Properly restore walk and flight speed (Fixes Xephi/AuthMeReloaded#356) --- .../process/login/ProcessSyncronousPlayerLogin.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/fr/xephi/authme/process/login/ProcessSyncronousPlayerLogin.java b/src/main/java/fr/xephi/authme/process/login/ProcessSyncronousPlayerLogin.java index 8c828074..b22c8f60 100644 --- a/src/main/java/fr/xephi/authme/process/login/ProcessSyncronousPlayerLogin.java +++ b/src/main/java/fr/xephi/authme/process/login/ProcessSyncronousPlayerLogin.java @@ -98,6 +98,13 @@ public class ProcessSyncronousPlayerLogin implements Runnable { } } + protected void restoreSpeedEffects() { + if (Settings.isRemoveSpeedEnabled) { + player.setWalkSpeed(0.2F); + player.setFlySpeed(0.1F); + } + } + protected void restoreInventory() { RestoreInventoryEvent event = new RestoreInventoryEvent(player); pm.callEvent(event); @@ -133,7 +140,6 @@ public class ProcessSyncronousPlayerLogin implements Runnable { public void run() { // Limbo contains the State of the Player before /login if (limbo != null) { - // Restore Op state and Permission Group restoreOpState(); Utils.setGroup(player, GroupType.LOGGEDIN); @@ -161,7 +167,6 @@ public class ProcessSyncronousPlayerLogin implements Runnable { } restoreFlyghtState(); - if (Settings.protectInventoryBeforeLogInEnabled) { restoreInventory(); } @@ -185,6 +190,7 @@ public class ProcessSyncronousPlayerLogin implements Runnable { AuthMePlayerListener.joinMessage.remove(name); } + restoreSpeedEffects(); if (Settings.applyBlindEffect) { player.removePotionEffect(PotionEffectType.BLINDNESS); }