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 class HelpCommand {
public static void help(CommandSender sender, String[] args) { public static void help(CommandSender sender, String[] args) {
Bukkit.getScheduler().runTaskAsynchronously(PreventStabby.getPlugin(), () -> { Bukkit.getScheduler().runTaskAsynchronously(PreventStabby.getPlugin(), () -> {
if (!PreventStabbyPermission.COMMAND_HELP.doesCommandSenderHave(sender)) {
PluginMessages.sendMessage(sender, PreventStabby.getPlugin().getConfigCache().getNo_permission());
return;
}
Component helpComponent = PluginMessages.MINIMESSAGE Component helpComponent = PluginMessages.MINIMESSAGE
.deserialize("<aqua><strikethrough> </strikethrough> PreventStabby Help <strikethrough> </strikethrough>") .deserialize("<aqua><strikethrough> </strikethrough> PreventStabby Help <strikethrough> </strikethrough>")
.append(Component.newline()) .append(Component.newline())
+5
View File
@@ -22,6 +22,11 @@ permissions:
preventstabby.command: preventstabby.command:
default: true default: true
description: Allows usage of /pvp command description: Allows usage of /pvp command
preventstabby.command.help:
default: true
description: Allows usage of /pvp help command
children:
preventstabby.command: true
preventstabby.command.toggle: preventstabby.command.toggle:
default: true default: true
description: Allows usage of /pvp <toggle/enable/disable> command description: Allows usage of /pvp <toggle/enable/disable> command