mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-11-25 03:55:23 +01:00
Stop use of commands with console causing crash reports
This commit is contained in:
parent
b29d7f35c5
commit
3551066e21
@ -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();
|
||||
|
||||
|
@ -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":
|
||||
|
Loading…
Reference in New Issue
Block a user