Fix restoring inventory on register (Related to #818)

This commit is contained in:
games647 2016-07-11 17:15:58 +02:00
parent a6d885e0bb
commit 4f68589b76
2 changed files with 6 additions and 15 deletions

View File

@ -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);

View File

@ -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);
}