diff --git a/src/com/sekwah/advancedportals/AdvancedPortalsCommand.java b/src/com/sekwah/advancedportals/AdvancedPortalsCommand.java index c6b1f435..0696dab4 100644 --- a/src/com/sekwah/advancedportals/AdvancedPortalsCommand.java +++ b/src/com/sekwah/advancedportals/AdvancedPortalsCommand.java @@ -42,6 +42,10 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter { public boolean onCommand(CommandSender sender, Command cmd, String command, String[] args) { ConfigAccessor config = new ConfigAccessor(plugin, "config.yml"); ConfigAccessor portalConfig = new ConfigAccessor(plugin, "portals.yml"); + if(!(sender instanceof Player)) { + sender.sendMessage(PluginMessages.customPrefixFail + " You cannot use commands with the console."); + return true; + } Player player = (Player) sender; PlayerInventory inventory = player.getInventory(); diff --git a/src/com/sekwah/advancedportals/destinations/DestinationCommand.java b/src/com/sekwah/advancedportals/destinations/DestinationCommand.java index 75ed647a..46b1c01a 100644 --- a/src/com/sekwah/advancedportals/destinations/DestinationCommand.java +++ b/src/com/sekwah/advancedportals/destinations/DestinationCommand.java @@ -27,6 +27,10 @@ public class DestinationCommand implements CommandExecutor, TabCompleter { @Override public boolean onCommand(CommandSender sender, Command cmd, String command, String[] args) { + if(!(sender instanceof Player)) { + sender.sendMessage(PluginMessages.customPrefixFail + " You cannot use commands with the console."); + return true; + } ConfigAccessor config = new ConfigAccessor(plugin, "destinations.yml"); if (args.length > 0) { switch (args[0].toLowerCase()) { case "create":