Changed advancedportals.warp to effect the command and not destinations

This commit is contained in:
sekwah 2018-03-07 17:37:45 +00:00
parent a8521b3998
commit 5c4cbaa127
3 changed files with 5 additions and 5 deletions

View File

@ -51,4 +51,4 @@ permissions:
default: op
advancedportals.warp.*:
description: Access to all warps (not really used tbh)
default: true
default: op

View File

@ -101,10 +101,6 @@ public class Destination {
}
public static boolean warp(Player player, String name) {
if (!(player.hasPermission("advancedportals.warp.*") || player.hasPermission("advancedportals.warp." + name))) {
player.sendMessage(PluginMessages.customPrefixFail + " You don't have permission to warp to " + name + "!");
return false;
}
ConfigAccessor config = new ConfigAccessor(plugin, "destinations.yml");
if (config.getConfig().getString(name + ".world") != null) {
Location loc = player.getLocation();

View File

@ -90,6 +90,10 @@ public class DestinationCommand implements CommandExecutor, TabCompleter {
sender.sendMessage("\u00A7e\u00A7m----------------------------");
break;
case "warp":
if (!(sender.hasPermission("advancedportals.warp.*") || sender.hasPermission("advancedportals.warp." + args[1]))) {
sender.sendMessage(PluginMessages.customPrefixFail + " You don't have permission to warp to " + args[1] + "!");
return false;
}
if(args.length >= 2){
Destination.warp((Player) sender, args[1]);
}