From 2e434a0663e78bf5e47f960f5552303969043579 Mon Sep 17 00:00:00 2001 From: NONPLAY <76615486+NONPLAYT@users.noreply.github.com> Date: Sat, 28 Sep 2024 18:27:16 +0300 Subject: [PATCH] fix permission problem --- .../ndailyrewards/managers/reward/ActionsExecutor.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/space/bxteam/ndailyrewards/managers/reward/ActionsExecutor.java b/src/main/java/space/bxteam/ndailyrewards/managers/reward/ActionsExecutor.java index 123a2ae..9eecef0 100644 --- a/src/main/java/space/bxteam/ndailyrewards/managers/reward/ActionsExecutor.java +++ b/src/main/java/space/bxteam/ndailyrewards/managers/reward/ActionsExecutor.java @@ -65,8 +65,12 @@ public void execute() { break; case PERMISSION: String[] permParts = coloredLine.split(" ", 2); - if (permParts.length == 2 && player.hasPermission(permParts[0])) { - Bukkit.dispatchCommand(Bukkit.getConsoleSender(), permParts[1].replace("", player.getName())); + if (permParts.length == 2) { + String permission = permParts[0].replace("{", "").replace("}", ""); + + if (player.hasPermission(permission)) { + Bukkit.dispatchCommand(Bukkit.getConsoleSender(), permParts[1].replace("", player.getName())); + } } break; case LUCK: