From ecf17dd347f4cd7533b5ed9c224acf250c758d96 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sun, 3 Sep 2023 20:17:52 +0200 Subject: [PATCH] Give Mods /mod permission Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/commands/ModCommand.java | 3 ++- src/de/steamwar/bungeecore/listeners/ConnectionListener.java | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/commands/ModCommand.java b/src/de/steamwar/bungeecore/commands/ModCommand.java index ed6bbd7..e82b1b4 100644 --- a/src/de/steamwar/bungeecore/commands/ModCommand.java +++ b/src/de/steamwar/bungeecore/commands/ModCommand.java @@ -24,6 +24,7 @@ import de.steamwar.bungeecore.inventory.SWInventory; import de.steamwar.bungeecore.inventory.SWItem; import de.steamwar.bungeecore.inventory.SWListInv; import de.steamwar.bungeecore.inventory.SWStreamInv; +import de.steamwar.bungeecore.listeners.ConnectionListener; import de.steamwar.command.SWCommand; import de.steamwar.sql.Mod; import net.md_5.bungee.api.chat.ClickEvent; @@ -36,7 +37,7 @@ import java.util.stream.Collectors; public class ModCommand extends SWCommand { public ModCommand() { - super("mod", "bungeecore.softreload", "mods"); + super("mod", ConnectionListener.MOD_PERMISSION, "mods"); } public static final Map playerFilterType = new HashMap<>(); diff --git a/src/de/steamwar/bungeecore/listeners/ConnectionListener.java b/src/de/steamwar/bungeecore/listeners/ConnectionListener.java index 8c2e519..032b52f 100644 --- a/src/de/steamwar/bungeecore/listeners/ConnectionListener.java +++ b/src/de/steamwar/bungeecore/listeners/ConnectionListener.java @@ -57,6 +57,7 @@ public class ConnectionListener extends BasicListener { public static final String POLLRESULT_PERMISSION = "bungeecore.pollresult"; public static final String SOFTRELOAD_PERMISSION = "bungeecore.softreload"; public static final String TEAMCHAT_PERMISSION = "bungeecore.teamchat"; + public static final String MOD_PERMISSION = "bungeecore.mod"; private static final Set newPlayers = new HashSet<>(); @@ -80,6 +81,7 @@ public class ConnectionListener extends BasicListener { player.setPermission(ALERT_PERMISSION, true); player.setPermission(KICK_PERMISSION, true); player.setPermission(POLLRESULT_PERMISSION, true); + player.setPermission(MOD_PERMISSION, true); } if(user.hasPerm(UserPerm.TEAM)) {