Update to 1.8.8, properly declare permissions in plugin.yml
This commit is contained in:
		@@ -23,22 +23,18 @@ import org.bukkit.command.CommandSender;
 | 
				
			|||||||
import org.bukkit.entity.Player;
 | 
					import org.bukkit.entity.Player;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.lishid.openinv.OpenInv;
 | 
					import com.lishid.openinv.OpenInv;
 | 
				
			||||||
import com.lishid.openinv.Permissions;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class AnyChestPluginCommand implements CommandExecutor {
 | 
					public class AnyChestPluginCommand implements CommandExecutor {
 | 
				
			||||||
    public AnyChestPluginCommand(OpenInv plugin) {
 | 
					    public AnyChestPluginCommand(OpenInv plugin) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
 | 
					    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
 | 
				
			||||||
        if (!(sender instanceof Player)) {
 | 
					        if (!(sender instanceof Player)) {
 | 
				
			||||||
            sender.sendMessage(ChatColor.RED + "You can't use this from the console.");
 | 
					            sender.sendMessage(ChatColor.RED + "You can't use this from the console.");
 | 
				
			||||||
            return true;
 | 
					            return true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (!OpenInv.hasPermission(sender, Permissions.PERM_ANYCHEST)) {
 | 
					 | 
				
			||||||
            sender.sendMessage(ChatColor.RED + "You do not have permission to use anychest.");
 | 
					 | 
				
			||||||
            return true;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (args.length > 0) {
 | 
					        if (args.length > 0) {
 | 
				
			||||||
            if (args[0].equalsIgnoreCase("check")) {
 | 
					            if (args[0].equalsIgnoreCase("check")) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -49,11 +49,6 @@ public class OpenEnderPluginCommand implements CommandExecutor {
 | 
				
			|||||||
            return true;
 | 
					            return true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (!OpenInv.hasPermission(sender, Permissions.PERM_ENDERCHEST)) {
 | 
					 | 
				
			||||||
            sender.sendMessage(ChatColor.RED + "You do not have permission to access player enderchest");
 | 
					 | 
				
			||||||
            return true;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (args.length > 0 && args[0].equalsIgnoreCase("?")) {
 | 
					        if (args.length > 0 && args[0].equalsIgnoreCase("?")) {
 | 
				
			||||||
            OpenInv.ShowHelp((Player) sender);
 | 
					            OpenInv.ShowHelp((Player) sender);
 | 
				
			||||||
            return true;
 | 
					            return true;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -48,10 +48,6 @@ public class OpenInvPluginCommand implements CommandExecutor {
 | 
				
			|||||||
            sender.sendMessage(ChatColor.RED + "You can't use this from the console.");
 | 
					            sender.sendMessage(ChatColor.RED + "You can't use this from the console.");
 | 
				
			||||||
            return true;
 | 
					            return true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (!OpenInv.hasPermission(sender, Permissions.PERM_OPENINV)) {
 | 
					 | 
				
			||||||
            sender.sendMessage(ChatColor.RED + "You do not have permission to access player inventories");
 | 
					 | 
				
			||||||
            return true;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (args.length > 0 && args[0].equalsIgnoreCase("?")) {
 | 
					        if (args.length > 0 && args[0].equalsIgnoreCase("?")) {
 | 
				
			||||||
            OpenInv.ShowHelp((Player) sender);
 | 
					            OpenInv.ShowHelp((Player) sender);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,22 +24,13 @@ import org.bukkit.command.CommandExecutor;
 | 
				
			|||||||
import org.bukkit.command.CommandSender;
 | 
					import org.bukkit.command.CommandSender;
 | 
				
			||||||
import org.bukkit.entity.Player;
 | 
					import org.bukkit.entity.Player;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.lishid.openinv.OpenInv;
 | 
					 | 
				
			||||||
import com.lishid.openinv.Permissions;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
public class SearchInvPluginCommand implements CommandExecutor {
 | 
					public class SearchInvPluginCommand implements CommandExecutor {
 | 
				
			||||||
    public SearchInvPluginCommand() {
 | 
					    public SearchInvPluginCommand() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
 | 
					    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
 | 
				
			||||||
        if (sender instanceof Player) {
 | 
					 | 
				
			||||||
            if (!OpenInv.hasPermission(sender, Permissions.PERM_SEARCH)) {
 | 
					 | 
				
			||||||
                sender.sendMessage(ChatColor.RED + "You do not have permission to access player inventories");
 | 
					 | 
				
			||||||
                return true;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        String PlayerList = "";
 | 
					        String PlayerList = "";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Material material = null;
 | 
					        Material material = null;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,22 +23,18 @@ import org.bukkit.command.CommandSender;
 | 
				
			|||||||
import org.bukkit.entity.Player;
 | 
					import org.bukkit.entity.Player;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.lishid.openinv.OpenInv;
 | 
					import com.lishid.openinv.OpenInv;
 | 
				
			||||||
import com.lishid.openinv.Permissions;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class SilentChestPluginCommand implements CommandExecutor {
 | 
					public class SilentChestPluginCommand implements CommandExecutor {
 | 
				
			||||||
    public SilentChestPluginCommand(OpenInv plugin) {
 | 
					    public SilentChestPluginCommand(OpenInv plugin) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
 | 
					    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
 | 
				
			||||||
        if (!(sender instanceof Player)) {
 | 
					        if (!(sender instanceof Player)) {
 | 
				
			||||||
            sender.sendMessage(ChatColor.RED + "You can't use this from the console.");
 | 
					            sender.sendMessage(ChatColor.RED + "You can't use this from the console.");
 | 
				
			||||||
            return true;
 | 
					            return true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (!OpenInv.hasPermission(sender, Permissions.PERM_SILENT)) {
 | 
					 | 
				
			||||||
            sender.sendMessage(ChatColor.RED + "You do not have permission to use silent chest.");
 | 
					 | 
				
			||||||
            return true;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (args.length > 0) {
 | 
					        if (args.length > 0) {
 | 
				
			||||||
            if (args[0].equalsIgnoreCase("check")) {
 | 
					            if (args[0].equalsIgnoreCase("check")) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,19 +24,15 @@ import org.bukkit.command.CommandSender;
 | 
				
			|||||||
import org.bukkit.entity.Player;
 | 
					import org.bukkit.entity.Player;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.lishid.openinv.OpenInv;
 | 
					import com.lishid.openinv.OpenInv;
 | 
				
			||||||
import com.lishid.openinv.Permissions;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class ToggleOpenInvPluginCommand implements CommandExecutor {
 | 
					public class ToggleOpenInvPluginCommand implements CommandExecutor {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
 | 
					    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
 | 
				
			||||||
        if (!(sender instanceof Player)) {
 | 
					        if (!(sender instanceof Player)) {
 | 
				
			||||||
            sender.sendMessage(ChatColor.RED + "You can't use this from the console.");
 | 
					            sender.sendMessage(ChatColor.RED + "You can't use this from the console.");
 | 
				
			||||||
            return true;
 | 
					            return true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (!OpenInv.hasPermission(sender, Permissions.PERM_OPENINV)) {
 | 
					 | 
				
			||||||
            sender.sendMessage(ChatColor.RED + "You do not have permission to access player inventories");
 | 
					 | 
				
			||||||
            return true;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Player player = (Player) sender;
 | 
					        Player player = (Player) sender;
 | 
				
			||||||
        if (args.length > 0) {
 | 
					        if (args.length > 0) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -147,7 +147,7 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
 | 
				
			|||||||
                return itemstack;
 | 
					                return itemstack;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else {
 | 
					            else {
 | 
				
			||||||
                itemstack = is[i].a(j);
 | 
					                itemstack = is[i].cloneAndSubtract(j);
 | 
				
			||||||
                if (is[i].count == 0) {
 | 
					                if (is[i].count == 0) {
 | 
				
			||||||
                    is[i] = null;
 | 
					                    is[i] = null;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,31 +8,37 @@ commands:
 | 
				
			|||||||
  openinv:
 | 
					  openinv:
 | 
				
			||||||
    aliases: [oi, inv, open]
 | 
					    aliases: [oi, inv, open]
 | 
				
			||||||
    description: Open a player's inventory
 | 
					    description: Open a player's inventory
 | 
				
			||||||
 | 
					    permission: OpenInv.openinv
 | 
				
			||||||
    usage: |
 | 
					    usage: |
 | 
				
			||||||
           /<command> - Open last person's inventory
 | 
					           /<command> - Open last person's inventory
 | 
				
			||||||
           /<command> <Player> - Open a player's inventory
 | 
					           /<command> <Player> - Open a player's inventory
 | 
				
			||||||
  openender:
 | 
					  openender:
 | 
				
			||||||
    aliases: [oe]
 | 
					    aliases: [oe]
 | 
				
			||||||
    description: Opens the enderchest of a player
 | 
					    description: Opens the enderchest of a player
 | 
				
			||||||
 | 
					    permission: OpenInv.openender
 | 
				
			||||||
    usage: |
 | 
					    usage: |
 | 
				
			||||||
           /<command> <Player> - Opens a player's enderchest
 | 
					           /<command> <Player> - Opens a player's enderchest
 | 
				
			||||||
  searchinv:
 | 
					  searchinv:
 | 
				
			||||||
    aliases: [si]
 | 
					    aliases: [si]
 | 
				
			||||||
    description: Search and list players having a specific item
 | 
					    description: Search and list players having a specific item
 | 
				
			||||||
 | 
					    permission: OpenInv.search
 | 
				
			||||||
    usage: |
 | 
					    usage: |
 | 
				
			||||||
           /<command> <Item> [MinAmount] - Item can be the Item ID or the CraftBukkit Item Name, MinAmount is the minimum amount to be considered.
 | 
					           /<command> <Item> [MinAmount] - Item can be the Item ID or the CraftBukkit Item Name, MinAmount is the minimum amount to be considered.
 | 
				
			||||||
  toggleopeninv:
 | 
					  toggleopeninv:
 | 
				
			||||||
    aliases: [toi, toggleoi, toggleinv]
 | 
					    aliases: [toi, toggleoi, toggleinv]
 | 
				
			||||||
    description: Toggle item openinv function
 | 
					    description: Toggle item openinv function
 | 
				
			||||||
 | 
					    permission: OpenInv.openinv
 | 
				
			||||||
    usage: |
 | 
					    usage: |
 | 
				
			||||||
           /<command> [Check] - Checks whether item openinv is enabled
 | 
					           /<command> [Check] - Checks whether item openinv is enabled
 | 
				
			||||||
  silentchest:
 | 
					  silentchest:
 | 
				
			||||||
    aliases: [sc, silent]
 | 
					    aliases: [sc, silent]
 | 
				
			||||||
    description: Toggle silent chest function, which hides the animation of a chest when opened or closed, and suppresses the sound.
 | 
					    description: Toggle silent chest function, which hides the animation of a chest when opened or closed, and suppresses the sound.
 | 
				
			||||||
 | 
					    permission: OpenInv.silent
 | 
				
			||||||
    usage: |
 | 
					    usage: |
 | 
				
			||||||
           /<command> [Check] - Checks whether silent chest is enabled
 | 
					           /<command> [Check] - Checks whether silent chest is enabled
 | 
				
			||||||
  anychest:
 | 
					  anychest:
 | 
				
			||||||
    aliases: [ac]
 | 
					    aliases: [ac]
 | 
				
			||||||
    description: Toggle anychest function, which allows opening of blocked chests.
 | 
					    description: Toggle anychest function, which allows opening of blocked chests.
 | 
				
			||||||
 | 
					    permission: OpenInv.anychest
 | 
				
			||||||
    usage: |
 | 
					    usage: |
 | 
				
			||||||
           /<command> [Check] - Checks whether anychest is enabled
 | 
					           /<command> [Check] - Checks whether anychest is enabled
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user