Fix restoring inventory on register (Related to #818)
This commit is contained in:
parent
a6d885e0bb
commit
4f68589b76
@ -85,14 +85,14 @@ public class ProcessSyncPlayerLogin implements SynchronousProcess {
|
|||||||
limboCache.deletePlayerData(player);
|
limboCache.deletePlayerData(player);
|
||||||
// do we really need to use location from database for now?
|
// do we really need to use location from database for now?
|
||||||
// because LimboCache#restoreData teleport player to last location.
|
// because LimboCache#restoreData teleport player to last location.
|
||||||
|
}
|
||||||
|
|
||||||
if (RESTORE_COLLISIONS && !service.getProperty(KEEP_COLLISIONS_DISABLED)) {
|
if (RESTORE_COLLISIONS && !service.getProperty(KEEP_COLLISIONS_DISABLED)) {
|
||||||
player.setCollidable(true);
|
player.setCollidable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (service.getProperty(PROTECT_INVENTORY_BEFORE_LOGIN)) {
|
if (service.getProperty(PROTECT_INVENTORY_BEFORE_LOGIN)) {
|
||||||
restoreInventory(player);
|
restoreInventory(player);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final PlayerAuth auth = dataSource.getAuth(name);
|
final PlayerAuth auth = dataSource.getAuth(name);
|
||||||
|
|||||||
@ -6,7 +6,6 @@ import fr.xephi.authme.AuthMe;
|
|||||||
import fr.xephi.authme.ConsoleLogger;
|
import fr.xephi.authme.ConsoleLogger;
|
||||||
import fr.xephi.authme.cache.limbo.LimboCache;
|
import fr.xephi.authme.cache.limbo.LimboCache;
|
||||||
import fr.xephi.authme.events.LoginEvent;
|
import fr.xephi.authme.events.LoginEvent;
|
||||||
import fr.xephi.authme.events.RestoreInventoryEvent;
|
|
||||||
import fr.xephi.authme.output.MessageKey;
|
import fr.xephi.authme.output.MessageKey;
|
||||||
import fr.xephi.authme.permission.AuthGroupType;
|
import fr.xephi.authme.permission.AuthGroupType;
|
||||||
import fr.xephi.authme.process.ProcessService;
|
import fr.xephi.authme.process.ProcessService;
|
||||||
@ -25,7 +24,6 @@ import org.bukkit.potion.PotionEffectType;
|
|||||||
|
|
||||||
import javax.inject.Inject;
|
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) {
|
public void processPasswordRegister(Player player) {
|
||||||
final String name = player.getName().toLowerCase();
|
final String name = player.getName().toLowerCase();
|
||||||
if (limboCache.hasPlayerData(name)) {
|
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.restoreData(player);
|
||||||
limboCache.deletePlayerData(player);
|
limboCache.deletePlayerData(player);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user