From 5636cd26c1dcd42329c9aef3b667bce705358ae7 Mon Sep 17 00:00:00 2001 From: lishid Date: Sat, 18 Feb 2012 01:46:39 -0500 Subject: [PATCH] Removed console error. Removed silentChest message. --- src/lishid/openinv/OpenInvPlayerListener.java | 2 +- .../openinv/commands/AnyChestPluginCommand.java | 5 +++++ .../openinv/commands/OpenInvPluginCommand.java | 5 +++++ .../openinv/commands/SearchInvPluginCommand.java | 13 +++++++++---- .../openinv/commands/SilentChestPluginCommand.java | 5 +++++ .../commands/ToggleOpenInvPluginCommand.java | 5 +++++ src/plugin.yml | 2 +- 7 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/lishid/openinv/OpenInvPlayerListener.java b/src/lishid/openinv/OpenInvPlayerListener.java index 16154e7..64e8d92 100644 --- a/src/lishid/openinv/OpenInvPlayerListener.java +++ b/src/lishid/openinv/OpenInvPlayerListener.java @@ -144,7 +144,7 @@ public class OpenInvPlayerListener implements Listener{ player.activeContainer = new SilentContainerChest(player.inventory, ((IInventory)chest)); player.activeContainer.windowId = id; player.activeContainer.a((ICrafting)player); - event.getPlayer().sendMessage("You are opening a chest silently."); + //event.getPlayer().sendMessage("You are opening a chest silently."); event.setUseInteractedBlock(Result.DENY); event.setCancelled(true); } diff --git a/src/lishid/openinv/commands/AnyChestPluginCommand.java b/src/lishid/openinv/commands/AnyChestPluginCommand.java index 4e4ffb5..e2502c3 100644 --- a/src/lishid/openinv/commands/AnyChestPluginCommand.java +++ b/src/lishid/openinv/commands/AnyChestPluginCommand.java @@ -15,6 +15,11 @@ public class AnyChestPluginCommand implements CommandExecutor { } 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 (!PermissionRelay.hasPermission((Player) sender, "anychest")) { sender.sendMessage(ChatColor.RED + "You do not have permission to use anychest."); return true; diff --git a/src/lishid/openinv/commands/OpenInvPluginCommand.java b/src/lishid/openinv/commands/OpenInvPluginCommand.java index 0c7abed..efa5a11 100644 --- a/src/lishid/openinv/commands/OpenInvPluginCommand.java +++ b/src/lishid/openinv/commands/OpenInvPluginCommand.java @@ -29,6 +29,11 @@ public class OpenInvPluginCommand implements CommandExecutor { } 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 (!PermissionRelay.hasPermission((Player)sender, "openinv")) { sender.sendMessage(ChatColor.RED + "You do not have permission to access player inventories"); return true; diff --git a/src/lishid/openinv/commands/SearchInvPluginCommand.java b/src/lishid/openinv/commands/SearchInvPluginCommand.java index bf48457..150b899 100644 --- a/src/lishid/openinv/commands/SearchInvPluginCommand.java +++ b/src/lishid/openinv/commands/SearchInvPluginCommand.java @@ -17,10 +17,15 @@ public class SearchInvPluginCommand implements CommandExecutor { } public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!PermissionRelay.hasPermission((Player) sender, "search")) { - sender.sendMessage(ChatColor.RED + "You do not have permission to access player inventories"); - return true; - } + + if(sender instanceof Player) + { + if (!PermissionRelay.hasPermission((Player) sender, "search")) { + sender.sendMessage(ChatColor.RED + "You do not have permission to access player inventories"); + return true; + } + } + String PlayerList = ""; diff --git a/src/lishid/openinv/commands/SilentChestPluginCommand.java b/src/lishid/openinv/commands/SilentChestPluginCommand.java index cdbf488..d42b466 100644 --- a/src/lishid/openinv/commands/SilentChestPluginCommand.java +++ b/src/lishid/openinv/commands/SilentChestPluginCommand.java @@ -15,6 +15,11 @@ public class SilentChestPluginCommand implements CommandExecutor { } 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 (!PermissionRelay.hasPermission((Player) sender, "silent")) { sender.sendMessage(ChatColor.RED + "You do not have permission to use silent chest."); return true; diff --git a/src/lishid/openinv/commands/ToggleOpenInvPluginCommand.java b/src/lishid/openinv/commands/ToggleOpenInvPluginCommand.java index 6906490..62dead8 100644 --- a/src/lishid/openinv/commands/ToggleOpenInvPluginCommand.java +++ b/src/lishid/openinv/commands/ToggleOpenInvPluginCommand.java @@ -13,6 +13,11 @@ import org.bukkit.entity.Player; public class ToggleOpenInvPluginCommand implements CommandExecutor { 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 (!PermissionRelay.hasPermission((Player)sender, "openinv")) { sender.sendMessage(ChatColor.RED + "You do not have permission to access player inventories"); return true; diff --git a/src/plugin.yml b/src/plugin.yml index dbb4d76..0248ab9 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: OpenInv main: lishid.openinv.OpenInv -version: 1.7.5 +version: 1.7.6 author: lishid website: http://forums.bukkit.org/threads/15379/ description: >