Skip to content

Commit

Permalink
✨ add permission node
Browse files Browse the repository at this point in the history
  • Loading branch information
XiYang6666 committed Jun 7, 2024
1 parent e760fea commit 2eeb928
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/kotlin/xyz/xasmc/hashbook/command/HashBookCommand.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package xyz.xasmc.hashbook.command

import dev.jorel.commandapi.CommandAPICommand
import dev.jorel.commandapi.CommandPermission
import dev.jorel.commandapi.arguments.StringArgument
import dev.jorel.commandapi.executors.CommandExecutor
import org.bukkit.Bukkit
Expand All @@ -21,7 +20,7 @@ object HashBookCommand {
val msgTitle = "<dark_aqua>[HashBook]</dark_aqua>"

val reloadCommand = CommandAPICommand("reload")
.withPermission(CommandPermission.OP)
.withPermission("xasmc.hashbook.command.reload")
.executes(CommandExecutor { sender, _ ->
sender.sendMiniMessage("$msgTitle <dark_green>重新加载中")
HashBook.load()
Expand All @@ -38,7 +37,7 @@ object HashBookCommand {
})

val setHashCommand = CommandAPICommand("setHash")
.withPermission(CommandPermission.OP)
.withPermission("xasmc.hashbook.command.sethash")
.withArguments(StringArgument("hash"))
.executes(CommandExecutor { sender, args ->
val player = checkPlayer(sender) ?: return@CommandExecutor
Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ depend:
- CommandAPI
softdepend:
- NBTAPI

permissions:
xasmc.hashbook.command.sethash:
default: op
xasmc.hashbook.command.reload:
default: op

0 comments on commit 2eeb928

Please sign in to comment.