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:
Jikoo
2016-04-18 14:37:05 -04:00
parent 7256494df3
commit a929eeeb69
56 changed files with 319 additions and 197 deletions

View File

@@ -108,8 +108,9 @@ public class OpenInvPluginCommand implements CommandExecutor {
Player onlineTarget;
boolean online = target.isOnline();
if (!target.isOnline()) {
if (!online) {
// Try loading the player's data
onlineTarget = plugin.getPlayerLoader().loadPlayer(target);
@@ -143,7 +144,7 @@ public class OpenInvPluginCommand implements CommandExecutor {
openInvHistory.put(player, onlineTarget.getName());
// Create the inventory
ISpecialPlayerInventory inv = plugin.getOrCreateInventoryFor(onlineTarget, !target.isOnline());
ISpecialPlayerInventory inv = plugin.getOrCreateInventoryFor(onlineTarget, online);
// Open the inventory
player.openInventory(inv.getBukkitInventory());