mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-01-08 07:27:39 +01:00
Fixed "Player must be online" error when player logs out
This commit is contained in:
parent
892936714a
commit
ddd6a994ce
@ -100,19 +100,21 @@ public class PlayerData {
|
|||||||
private void load(FileConfiguration config) {
|
private void load(FileConfiguration config) {
|
||||||
if (config.contains("crafting-queue"))
|
if (config.contains("crafting-queue"))
|
||||||
craftingStatus.load(this, config.getConfigurationSection("crafting-queue"));
|
craftingStatus.load(this, config.getConfigurationSection("crafting-queue"));
|
||||||
}
|
|
||||||
|
|
||||||
public void save() {
|
if (MMOItems.plugin.hasPermissions() && config.contains("permissions-from-items")) {
|
||||||
if (MMOItems.plugin.hasPermissions()) {
|
|
||||||
Permission perms = MMOItems.plugin.getVault().getPermissions();
|
Permission perms = MMOItems.plugin.getVault().getPermissions();
|
||||||
permissions.forEach(perm -> {
|
config.getStringList("permissions-from-items").forEach(perm -> {
|
||||||
if (perms.has(getPlayer(), perm)) perms.playerRemove(getPlayer(), perm);
|
if (perms.has(getPlayer(), perm)) perms.playerRemove(getPlayer(), perm);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void save() {
|
||||||
cancelRunnables();
|
cancelRunnables();
|
||||||
|
|
||||||
ConfigFile config = new ConfigFile("/userdata", getUniqueId().toString());
|
ConfigFile config = new ConfigFile("/userdata", getUniqueId().toString());
|
||||||
config.getConfig().createSection("crafting-queue");
|
config.getConfig().createSection("crafting-queue");
|
||||||
|
config.getConfig().set("permissions-from-items", new ArrayList<>(permissions));
|
||||||
craftingStatus.save(config.getConfig().getConfigurationSection("crafting-queue"));
|
craftingStatus.save(config.getConfig().getConfigurationSection("crafting-queue"));
|
||||||
config.save();
|
config.save();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user