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:
@@ -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());
|
||||
|
Reference in New Issue
Block a user