Moves permission nodes and command names to an enum to reduce redundancy

Also fixes some cases where tab completions are provided even if all arguments have been supplied
This commit is contained in:
2022-06-01 19:26:47 +02:00
parent 8ff099147b
commit 34d4714625
11 changed files with 122 additions and 30 deletions

View File

@@ -3,6 +3,7 @@ package net.knarcraft.stargatecommand.command;
import net.TheDgtl.Stargate.network.RegistryAPI;
import net.TheDgtl.Stargate.network.portal.Portal;
import net.TheDgtl.Stargate.network.portal.PortalFlag;
import net.knarcraft.stargatecommand.property.StargateCommandCommand;
import net.knarcraft.stargatecommand.util.PortalFinderHelper;
import org.apache.commons.lang.StringUtils;
import org.bukkit.Bukkit;
@@ -40,7 +41,7 @@ public class TabCommandInfo implements TabExecutor {
commandSender.sendMessage("This command can only be used by a player");
return true;
}
if (!player.hasPermission("stargate.command.info")) {
if (!player.hasPermission(StargateCommandCommand.INFO.getPermissionNode())) {
player.sendMessage("Permission Denied");
return true;
}