permission for help command

This commit is contained in:
2022-12-31 15:03:09 +01:00
parent 78504ee097
commit 7ada9eab29
2 changed files with 11 additions and 0 deletions
@@ -10,6 +10,12 @@ import org.bukkit.command.CommandSender;
public class HelpCommand {
public static void help(CommandSender sender, String[] args) {
Bukkit.getScheduler().runTaskAsynchronously(PreventStabby.getPlugin(), () -> {
if (!PreventStabbyPermission.COMMAND_HELP.doesCommandSenderHave(sender)) {
PluginMessages.sendMessage(sender, PreventStabby.getPlugin().getConfigCache().getNo_permission());
return;
}
Component helpComponent = PluginMessages.MINIMESSAGE
.deserialize("<aqua><strikethrough> </strikethrough> PreventStabby Help <strikethrough> </strikethrough>")
.append(Component.newline())