diff --git a/src/com/lishid/openinv/commands/AnyChestPluginCommand.java b/src/com/lishid/openinv/commands/AnyChestPluginCommand.java index 03c80cb..a434666 100644 --- a/src/com/lishid/openinv/commands/AnyChestPluginCommand.java +++ b/src/com/lishid/openinv/commands/AnyChestPluginCommand.java @@ -23,22 +23,18 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import com.lishid.openinv.OpenInv; -import com.lishid.openinv.Permissions; public class AnyChestPluginCommand implements CommandExecutor { public AnyChestPluginCommand(OpenInv plugin) { } + @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (!(sender instanceof Player)) { sender.sendMessage(ChatColor.RED + "You can't use this from the console."); 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[0].equalsIgnoreCase("check")) { diff --git a/src/com/lishid/openinv/commands/OpenEnderPluginCommand.java b/src/com/lishid/openinv/commands/OpenEnderPluginCommand.java index b00fc07..5994112 100644 --- a/src/com/lishid/openinv/commands/OpenEnderPluginCommand.java +++ b/src/com/lishid/openinv/commands/OpenEnderPluginCommand.java @@ -49,11 +49,6 @@ public class OpenEnderPluginCommand implements CommandExecutor { 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("?")) { OpenInv.ShowHelp((Player) sender); return true; diff --git a/src/com/lishid/openinv/commands/OpenInvPluginCommand.java b/src/com/lishid/openinv/commands/OpenInvPluginCommand.java index 108e0dc..b47c54a 100644 --- a/src/com/lishid/openinv/commands/OpenInvPluginCommand.java +++ b/src/com/lishid/openinv/commands/OpenInvPluginCommand.java @@ -48,10 +48,6 @@ public class OpenInvPluginCommand implements CommandExecutor { sender.sendMessage(ChatColor.RED + "You can't use this from the console."); 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("?")) { OpenInv.ShowHelp((Player) sender); diff --git a/src/com/lishid/openinv/commands/SearchInvPluginCommand.java b/src/com/lishid/openinv/commands/SearchInvPluginCommand.java index 0e75a08..d390ab7 100644 --- a/src/com/lishid/openinv/commands/SearchInvPluginCommand.java +++ b/src/com/lishid/openinv/commands/SearchInvPluginCommand.java @@ -24,22 +24,13 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.lishid.openinv.OpenInv; -import com.lishid.openinv.Permissions; - public class SearchInvPluginCommand implements CommandExecutor { public SearchInvPluginCommand() { } + @Override 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 = ""; Material material = null; diff --git a/src/com/lishid/openinv/commands/SilentChestPluginCommand.java b/src/com/lishid/openinv/commands/SilentChestPluginCommand.java index 4dfbb7f..992dce7 100644 --- a/src/com/lishid/openinv/commands/SilentChestPluginCommand.java +++ b/src/com/lishid/openinv/commands/SilentChestPluginCommand.java @@ -23,22 +23,18 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import com.lishid.openinv.OpenInv; -import com.lishid.openinv.Permissions; public class SilentChestPluginCommand implements CommandExecutor { public SilentChestPluginCommand(OpenInv plugin) { } + @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (!(sender instanceof Player)) { sender.sendMessage(ChatColor.RED + "You can't use this from the console."); 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[0].equalsIgnoreCase("check")) { diff --git a/src/com/lishid/openinv/commands/ToggleOpenInvPluginCommand.java b/src/com/lishid/openinv/commands/ToggleOpenInvPluginCommand.java index 005239f..d85861d 100644 --- a/src/com/lishid/openinv/commands/ToggleOpenInvPluginCommand.java +++ b/src/com/lishid/openinv/commands/ToggleOpenInvPluginCommand.java @@ -24,19 +24,15 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import com.lishid.openinv.OpenInv; -import com.lishid.openinv.Permissions; public class ToggleOpenInvPluginCommand implements CommandExecutor { + @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (!(sender instanceof Player)) { sender.sendMessage(ChatColor.RED + "You can't use this from the console."); 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; if (args.length > 0) { diff --git a/src/com/lishid/openinv/internal/v1_8_R3/SpecialPlayerInventory.java b/src/com/lishid/openinv/internal/v1_8_R3/SpecialPlayerInventory.java index 5464d0b..813834b 100644 --- a/src/com/lishid/openinv/internal/v1_8_R3/SpecialPlayerInventory.java +++ b/src/com/lishid/openinv/internal/v1_8_R3/SpecialPlayerInventory.java @@ -147,7 +147,7 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP return itemstack; } else { - itemstack = is[i].a(j); + itemstack = is[i].cloneAndSubtract(j); if (is[i].count == 0) { is[i] = null; } diff --git a/src/plugin.yml b/src/plugin.yml index 88cfd0f..50f943e 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -8,31 +8,37 @@ commands: openinv: aliases: [oi, inv, open] description: Open a player's inventory + permission: OpenInv.openinv usage: | / - Open last person's inventory / - Open a player's inventory openender: aliases: [oe] description: Opens the enderchest of a player + permission: OpenInv.openender usage: | / - Opens a player's enderchest searchinv: aliases: [si] description: Search and list players having a specific item + permission: OpenInv.search usage: | / [MinAmount] - Item can be the Item ID or the CraftBukkit Item Name, MinAmount is the minimum amount to be considered. toggleopeninv: aliases: [toi, toggleoi, toggleinv] description: Toggle item openinv function + permission: OpenInv.openinv usage: | / [Check] - Checks whether item openinv is enabled silentchest: aliases: [sc, silent] description: Toggle silent chest function, which hides the animation of a chest when opened or closed, and suppresses the sound. + permission: OpenInv.silent usage: | / [Check] - Checks whether silent chest is enabled anychest: aliases: [ac] description: Toggle anychest function, which allows opening of blocked chests. + permission: OpenInv.anychest usage: | / [Check] - Checks whether anychest is enabled