New permission node for openself.
This commit is contained in:
		@@ -12,4 +12,5 @@ public class Permissions
 | 
			
		||||
    public static final String PERM_SEARCH = "OpenInv.search";
 | 
			
		||||
    public static final String PERM_EDITINV = "OpenInv.editinv";
 | 
			
		||||
    public static final String PERM_EDITENDER = "OpenInv.editender";
 | 
			
		||||
    public static final String PERM_OPENSELF = "OpenInv.openself";
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -166,12 +166,20 @@ public class OpenInvPluginCommand implements CommandExecutor
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        // Crosswork check
 | 
			
		||||
        if ((!player.hasPermission(Permissions.PERM_CROSSWORLD) && !player.hasPermission(Permissions.PERM_OVERRIDE)) && target.getWorld() != player.getWorld())
 | 
			
		||||
        {
 | 
			
		||||
            sender.sendMessage(ChatColor.RED + target.getDisplayName() + " is not in your world!");
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        // Self-open check
 | 
			
		||||
        if (!player.hasPermission(Permissions.PERM_OPENSELF) && target.equals(player))
 | 
			
		||||
        {
 | 
			
		||||
            sender.sendMessage(ChatColor.RED + "You're not allowed to openinv yourself.");
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        // Record the target
 | 
			
		||||
        history = target.getName();
 | 
			
		||||
        openInvHistory.put(player, history);
 | 
			
		||||
 
 | 
			
		||||
@@ -57,7 +57,7 @@ public class OpenInvPlayerInventory extends PlayerInventory
 | 
			
		||||
    
 | 
			
		||||
    public void PlayerGoOnline(CraftPlayer p)
 | 
			
		||||
    {
 | 
			
		||||
        if(!playerOnline)
 | 
			
		||||
        if (!playerOnline)
 | 
			
		||||
        {
 | 
			
		||||
            p.getHandle().inventory.items = this.items;
 | 
			
		||||
            p.getHandle().inventory.armor = this.armor;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
name: OpenInv
 | 
			
		||||
main: lishid.openinv.OpenInv
 | 
			
		||||
version: 1.8.7
 | 
			
		||||
version: 1.8.8
 | 
			
		||||
author: lishid
 | 
			
		||||
website: http://forums.bukkit.org/threads/15379/
 | 
			
		||||
description: >
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user