Skip to content

Commit

Permalink
chore: 给calc命令添加权限
Browse files Browse the repository at this point in the history
  • Loading branch information
mcchampions committed Nov 8, 2024
1 parent 7ef1506 commit 9e107b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/me/qscbm/slimefun4/commands/CalcCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public void onExecute(CommandSender sender, String[] args) {
return;
}

if (!sender.hasPermission("slimefun.command.calc")) {
Slimefun.getLocalization().sendMessage(sender, "messages.no-permission", true);
return;
}

reqItem = args[1];

if (args.length == 2) {
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ permissions:
slimefun.command.open_guide:
description: Allows you to open the SF guide without the book
default: true
slimefun.command.calc:
description: Allows you to do /sf calc
default: true
slimefun.command.id:
description: Allows you to do /sf itemid
default: op
Expand Down

0 comments on commit 9e107b0

Please sign in to comment.