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

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