From cdeaa6ce00becd77315b4edc27dde3a9d06c962e Mon Sep 17 00:00:00 2001 From: LogGits Date: Thu, 12 Mar 2020 13:17:06 +1000 Subject: [PATCH 1/2] update permission handling These changes will help with improperly showing tabcomplete suggestions to clients without admin perm. --- .../java/net/buycraft/plugin/bungeecord/BuycraftCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bungeecord/src/main/java/net/buycraft/plugin/bungeecord/BuycraftCommand.java b/bungeecord/src/main/java/net/buycraft/plugin/bungeecord/BuycraftCommand.java index 74a48ac2..79b0eae1 100644 --- a/bungeecord/src/main/java/net/buycraft/plugin/bungeecord/BuycraftCommand.java +++ b/bungeecord/src/main/java/net/buycraft/plugin/bungeecord/BuycraftCommand.java @@ -14,13 +14,13 @@ public class BuycraftCommand extends Command { private final BuycraftPlugin plugin; public BuycraftCommand(BuycraftPlugin plugin) { - super("tebex", null, "buycraft"); + super("tebex", "buycraft.admin", "buycraft"); this.plugin = plugin; } @Override public void execute(CommandSender sender, String[] args) { - if (!sender.hasPermission("buycraft.admin")) { + if (!sender.hasPermission(this.getPermission())) { sender.sendMessage(ChatColor.RED + plugin.getI18n().get("no_permission")); return; } From b24ddfcbedb8704197c8eeda35ac792eb4f21f80 Mon Sep 17 00:00:00 2001 From: LogGits Date: Thu, 12 Mar 2020 13:20:58 +1000 Subject: [PATCH 2/2] Update post 1.13 tabcomplete handling Resolves issue whereby non administrator users (without `buycraft.admin` permission) get the tabcomplete suggestions. --- bukkit-post-1.13/src/main/resources/plugin.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bukkit-post-1.13/src/main/resources/plugin.yml b/bukkit-post-1.13/src/main/resources/plugin.yml index 1e900a24..7c3df1cc 100644 --- a/bukkit-post-1.13/src/main/resources/plugin.yml +++ b/bukkit-post-1.13/src/main/resources/plugin.yml @@ -6,4 +6,5 @@ api-version: "1.13" commands: tebex: aliases: [buycraft] - description: Main command for the Tebex plugin. \ No newline at end of file + permission: buycraft.admin + description: Main command for the Tebex plugin.