From 30be45065f058d74342df224c224e2ed7063f17f Mon Sep 17 00:00:00 2001 From: Anthony Debucquoy Date: Sun, 4 Feb 2024 21:27:53 +0100 Subject: [PATCH] Need thevoidmanager.score to execute /void score --- .../herisson/thevoidroad/VoidCommands.java | 20 ++++++++++--------- TheVoidRoad/src/main/resources/plugin.yml | 3 +++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/TheVoidRoad/src/main/java/ovh/herisson/thevoidroad/VoidCommands.java b/TheVoidRoad/src/main/java/ovh/herisson/thevoidroad/VoidCommands.java index 6b39b88..83b92be 100644 --- a/TheVoidRoad/src/main/java/ovh/herisson/thevoidroad/VoidCommands.java +++ b/TheVoidRoad/src/main/java/ovh/herisson/thevoidroad/VoidCommands.java @@ -14,10 +14,6 @@ import org.bukkit.command.TabCompleter; import org.bukkit.entity.Player; import net.kyori.adventure.text.Component; -import ovh.herisson.thevoidroad.DatabaseManager; -import ovh.herisson.thevoidroad.TheVoidRoad; -import ovh.herisson.thevoidroad.Voids; -import ovh.herisson.thevoidroad.Merchand; public class VoidCommands implements CommandExecutor, TabCompleter{ private final Merchand m = Merchand.getInstance(); @@ -36,10 +32,13 @@ public class VoidCommands implements CommandExecutor, TabCompleter{ } switch (args[0]) { case "score": - Voids.scoreboard().forEach((p, a) -> { - sender.sendMessage(p + " : " + a); - }); - return true; + if(!sender.hasPermission("void.score")){ + Voids.scoreboard().forEach((p, a) -> { + sender.sendMessage(p + " : " + a); + }); + return true; + } + return false; case "give": if(args.length < 2) return false; Player target = Bukkit.getPlayer(args[1]); @@ -117,10 +116,13 @@ public class VoidCommands implements CommandExecutor, TabCompleter{ ArrayList list = new ArrayList<>(); if(args.length == 1){ - list.addAll(List.of("give","event", "score")); + list.addAll(List.of("give","event")); if(sender.hasPermission("void.manage")){ list.add("manage"); } + if(sender.hasPermission("void.score")){ + list.add("score"); + } } if(args.length >= 2){ switch (args[0]) { diff --git a/TheVoidRoad/src/main/resources/plugin.yml b/TheVoidRoad/src/main/resources/plugin.yml index b43ddea..9f4e095 100644 --- a/TheVoidRoad/src/main/resources/plugin.yml +++ b/TheVoidRoad/src/main/resources/plugin.yml @@ -16,6 +16,9 @@ permissions: void.manage: description: "GameMaster's command" default: op + void.score: + description: "score the voids" + default: op void.balance: description: "User of thevoidroad" default: not op