Skip to content

Commit

Permalink
🐛 fix command permission
Browse files Browse the repository at this point in the history
  • Loading branch information
XiYang6666 committed Jun 7, 2024
1 parent 2c35070 commit e760fea
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
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 net.kyori.adventure.text.minimessage.MiniMessage
import org.bukkit.Bukkit
import org.bukkit.Material
import org.bukkit.command.CommandSender
Expand All @@ -21,6 +21,7 @@ object HashBookCommand {
val msgTitle = "<dark_aqua>[HashBook]</dark_aqua>"

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

val setHashCommand = CommandAPICommand("setHash")
.withPermission(CommandPermission.OP)
.withArguments(StringArgument("hash"))
.executes(CommandExecutor { sender, args ->
val player = checkPlayer(sender) ?: return@CommandExecutor
Expand Down

0 comments on commit e760fea

Please sign in to comment.