Fix conflict with other inventory modification plugins (like JSNONAPI) i... #13
@@ -79,14 +79,12 @@ public class OpenInvPluginCommand implements CommandExecutor {
 | 
			
		||||
        target = this.plugin.getServer().getPlayer(name);
 | 
			
		||||
 | 
			
		||||
        if (target == null) {
 | 
			
		||||
            if (target == null) {
 | 
			
		||||
                // Try loading the player's data
 | 
			
		||||
                target = OpenInv.playerLoader.loadPlayer(name);
 | 
			
		||||
            // Try loading the player's data
 | 
			
		||||
            target = OpenInv.playerLoader.loadPlayer(name);
 | 
			
		||||
 | 
			
		||||
                if (target == null) {
 | 
			
		||||
                    sender.sendMessage(ChatColor.RED + "Player " + name + " not found!");
 | 
			
		||||
                    return true;
 | 
			
		||||
                }
 | 
			
		||||
            if (target == null) {
 | 
			
		||||
                sender.sendMessage(ChatColor.RED + "Player " + name + " not found!");
 | 
			
		||||
                return true;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -50,7 +50,8 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
 | 
			
		||||
    @Override
 | 
			
		||||
    public void InventoryRemovalCheck() {
 | 
			
		||||
        owner.saveData();
 | 
			
		||||
        if (transaction.isEmpty() && !playerOnline) {
 | 
			
		||||
        // Conflict with other Offline inventory modification plugins like JSONAPI
 | 
			
		||||
        if (transaction.isEmpty() || !playerOnline) {
 | 
			
		||||
            OpenInv.inventories.remove(owner.getName().toLowerCase());
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -50,7 +50,8 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
 | 
			
		||||
    @Override
 | 
			
		||||
    public void InventoryRemovalCheck() {
 | 
			
		||||
        owner.saveData();
 | 
			
		||||
        if (transaction.isEmpty() && !playerOnline) {
 | 
			
		||||
        // Conflict with other Offline inventory modification plugins like JSONAPI
 | 
			
		||||
        if (transaction.isEmpty() || !playerOnline) {
 | 
			
		||||
            OpenInv.inventories.remove(owner.getName().toLowerCase());
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -50,7 +50,8 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
 | 
			
		||||
    @Override
 | 
			
		||||
    public void InventoryRemovalCheck() {
 | 
			
		||||
        owner.saveData();
 | 
			
		||||
        if (transaction.isEmpty() && !playerOnline) {
 | 
			
		||||
        // Conflict with other Offline inventory modification plugins like JSONAPI
 | 
			
		||||
        if (transaction.isEmpty() || !playerOnline) {
 | 
			
		||||
            OpenInv.inventories.remove(owner.getName().toLowerCase());
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -50,7 +50,8 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
 | 
			
		||||
    @Override
 | 
			
		||||
    public void InventoryRemovalCheck() {
 | 
			
		||||
        owner.saveData();
 | 
			
		||||
        if (transaction.isEmpty() && !playerOnline) {
 | 
			
		||||
        // Conflict with other Offline inventory modification plugins like JSONAPI
 | 
			
		||||
        if (transaction.isEmpty() || !playerOnline) {
 | 
			
		||||
            OpenInv.inventories.remove(owner.getName().toLowerCase());
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user