use enum for permissions

This commit is contained in:
2022-05-14 12:28:50 +02:00
parent 0ff0177f0b
commit 6fd3e4b671
6 changed files with 54 additions and 23 deletions
@@ -1,6 +1,7 @@
package me.youhavetrouble.preventstabby.commands;
import me.youhavetrouble.preventstabby.PreventStabby;
import me.youhavetrouble.preventstabby.config.PreventStabbyPermission;
import me.youhavetrouble.preventstabby.util.PluginMessages;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
@@ -14,7 +15,7 @@ public class HelpCommand {
List<String> helpPage = new ArrayList<>();
helpPage.add(PluginMessages.parseMessage("&b&m &bPreventStabby Help&b&m "));
helpPage.add(PluginMessages.parseMessage("&9/pvp &b&lhelp &f- shows this message"));
if (sender.hasPermission("preventstabby.command.toggle")) {
if (PreventStabbyPermission.COMMAND_TOGGLE.doesCommandSenderHave(sender)) {
helpPage.add(PluginMessages.parseMessage("&9/pvp &b&l[on/off] &f- enables or disables PvP"));
helpPage.add(PluginMessages.parseMessage("&9/pvp &b&ltoggle &f- toggles PvP status"));
}