From 4f68589b7606ee4ef7b58f1a2ef6bebc385faa03 Mon Sep 17 00:00:00 2001 From: games647 Date: Mon, 11 Jul 2016 17:15:58 +0200 Subject: [PATCH] Fix restoring inventory on register (Related to #818) --- .../authme/process/login/ProcessSyncPlayerLogin.java | 12 ++++++------ .../register/ProcessSyncPasswordRegister.java | 9 --------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/main/java/fr/xephi/authme/process/login/ProcessSyncPlayerLogin.java b/src/main/java/fr/xephi/authme/process/login/ProcessSyncPlayerLogin.java index 0795ac16..1032bde9 100644 --- a/src/main/java/fr/xephi/authme/process/login/ProcessSyncPlayerLogin.java +++ b/src/main/java/fr/xephi/authme/process/login/ProcessSyncPlayerLogin.java @@ -85,14 +85,14 @@ public class ProcessSyncPlayerLogin implements SynchronousProcess { limboCache.deletePlayerData(player); // do we really need to use location from database for now? // because LimboCache#restoreData teleport player to last location. + } - if (RESTORE_COLLISIONS && !service.getProperty(KEEP_COLLISIONS_DISABLED)) { - player.setCollidable(true); - } + if (RESTORE_COLLISIONS && !service.getProperty(KEEP_COLLISIONS_DISABLED)) { + player.setCollidable(true); + } - if (service.getProperty(PROTECT_INVENTORY_BEFORE_LOGIN)) { - restoreInventory(player); - } + if (service.getProperty(PROTECT_INVENTORY_BEFORE_LOGIN)) { + restoreInventory(player); } final PlayerAuth auth = dataSource.getAuth(name); diff --git a/src/main/java/fr/xephi/authme/process/register/ProcessSyncPasswordRegister.java b/src/main/java/fr/xephi/authme/process/register/ProcessSyncPasswordRegister.java index ae40f681..55584351 100644 --- a/src/main/java/fr/xephi/authme/process/register/ProcessSyncPasswordRegister.java +++ b/src/main/java/fr/xephi/authme/process/register/ProcessSyncPasswordRegister.java @@ -6,7 +6,6 @@ import fr.xephi.authme.AuthMe; import fr.xephi.authme.ConsoleLogger; import fr.xephi.authme.cache.limbo.LimboCache; import fr.xephi.authme.events.LoginEvent; -import fr.xephi.authme.events.RestoreInventoryEvent; import fr.xephi.authme.output.MessageKey; import fr.xephi.authme.permission.AuthGroupType; import fr.xephi.authme.process.ProcessService; @@ -25,7 +24,6 @@ import org.bukkit.potion.PotionEffectType; import javax.inject.Inject; -import static fr.xephi.authme.settings.properties.RestrictionSettings.PROTECT_INVENTORY_BEFORE_LOGIN; /** */ @@ -88,13 +86,6 @@ public class ProcessSyncPasswordRegister implements SynchronousProcess { public void processPasswordRegister(Player player) { final String name = player.getName().toLowerCase(); if (limboCache.hasPlayerData(name)) { - if (service.getProperty(PROTECT_INVENTORY_BEFORE_LOGIN)) { - RestoreInventoryEvent event = new RestoreInventoryEvent(player); - bukkitService.callEvent(event); - if (!event.isCancelled()) { - player.updateInventory(); - } - } limboCache.restoreData(player); limboCache.deletePlayerData(player); }