Configuration to disable saving of offline players, bugfixing
Edits made to online players will still work. Edits made to offline players will work if they log in before the ISpecialPlayerInventory is unloaded (currently before the plugin unloads). Closes #6 Refactored IPlayerDataManager to PlayerDataManager, it's no longer an interface. Fixed a bug with players' online state initially being inverted
This commit is contained in:
@@ -107,7 +107,9 @@ public class OpenEnderPluginCommand implements CommandExecutor {
|
||||
private void openInventory(Player player, OfflinePlayer target) {
|
||||
|
||||
Player onlineTarget;
|
||||
if (!target.isOnline()) {
|
||||
boolean online = target.isOnline();
|
||||
|
||||
if (!online) {
|
||||
// Try loading the player's data
|
||||
onlineTarget = plugin.getPlayerLoader().loadPlayer(target);
|
||||
|
||||
@@ -129,7 +131,7 @@ public class OpenEnderPluginCommand implements CommandExecutor {
|
||||
openEnderHistory.put(player, onlineTarget.getName());
|
||||
|
||||
// Create the inventory
|
||||
ISpecialEnderChest chest = plugin.getOrCreateEnderChestFor(onlineTarget, !target.isOnline());
|
||||
ISpecialEnderChest chest = plugin.getOrCreateEnderChestFor(onlineTarget, online);
|
||||
|
||||
// Open the inventory
|
||||
player.openInventory(chest.getBukkitInventory());
|
||||
|
Reference in New Issue
Block a user