From d81c21955c70a08739453265ea4d79ea40050fbc Mon Sep 17 00:00:00 2001 From: bloodshot Date: Wed, 18 Dec 2019 20:38:17 -0500 Subject: [PATCH] Fix command-execute flag. --- .../griefdefender/listener/PlayerEventHandler.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sponge/src/main/java/com/griefdefender/listener/PlayerEventHandler.java b/sponge/src/main/java/com/griefdefender/listener/PlayerEventHandler.java index a4a5457..9ece929 100644 --- a/sponge/src/main/java/com/griefdefender/listener/PlayerEventHandler.java +++ b/sponge/src/main/java/com/griefdefender/listener/PlayerEventHandler.java @@ -281,16 +281,18 @@ public void onPlayerCommand(SendCommandEvent event, @First Player player) { GDTimings.PLAYER_COMMAND_EVENT.stopTimingIfSync(); return; } - String commandPermission = pluginId + "." + command; + + String commandTarget = pluginId + ":" + command; // first check the args - String argument = ""; for (String arg : args) { - argument = argument + "." + arg; + if (!arg.isEmpty()) { + commandTarget = commandTarget + "." + arg; + } } - if (GDFlags.COMMAND_EXECUTE && !commandExecuteSourceBlacklisted && !GriefDefenderPlugin.isTargetIdBlacklisted(Flags.COMMAND_EXECUTE.getName(), commandPermission + argument, player.getWorld().getProperties())) { - final Tristate result = GDPermissionManager.getInstance().getFinalPermission(event, player.getLocation(), claim, GDPermissions.COMMAND_EXECUTE, event.getSource(), commandPermission + argument, player); + if (GDFlags.COMMAND_EXECUTE && !commandExecuteSourceBlacklisted) { + final Tristate result = GDPermissionManager.getInstance().getFinalPermission(event, player.getLocation(), claim, GDPermissions.COMMAND_EXECUTE, event.getSource(), commandTarget, player); if (result == Tristate.TRUE) { GDTimings.PLAYER_COMMAND_EVENT.stopTimingIfSync(); return;