Fixed /ecoenchants randomenchant permission

This commit is contained in:
Auxilor 2021-07-16 14:22:47 +02:00
parent 4b2e3ba533
commit 86301252f8

View File

@ -38,7 +38,7 @@ public class CommandRandomenchant extends Subcommand {
return (sender, args) -> {
Player player;
if ((args.isEmpty() && sender instanceof Player) || !sender.hasPermission("ecoenchants.randomenchant.others")) {
if ((args.isEmpty() && sender instanceof Player) || !sender.hasPermission("ecoenchants.command.randomenchant.others")) {
player = (Player) sender;
} else {
player = Bukkit.getServer().getPlayer(args.get(0));
@ -88,7 +88,7 @@ public class CommandRandomenchant extends Subcommand {
}
}
if (this.getPlugin().getConfigYml().getBool("anvil.hard-cap.enabled")
&& !player.hasPermission("ecoenchants.randomenchant.bypasshardcap")
&& !player.hasPermission("ecoenchants.command.randomenchant.bypasshardcap")
&& onItem.size() >= this.getPlugin().getConfigYml().getInt("anvil.hard-cap.cap")) {
conflicts = true;
}
@ -127,7 +127,7 @@ public class CommandRandomenchant extends Subcommand {
List<String> playerNames = Bukkit.getOnlinePlayers().stream().map(Player::getName).collect(Collectors.toList());
if (args.isEmpty() || !sender.hasPermission("ecoenchants.randomenchant.others")) {
if (args.isEmpty() || !sender.hasPermission("ecoenchants.command.randomenchant.others")) {
// Currently, this case is not ever reached
return playerNames;
}