mirror of
https://github.com/YouHaveTrouble/PreventStabby.git
synced 2026-05-11 21:06:55 +00:00
permission for help command
This commit is contained in:
@@ -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())
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user