Fix command-execute flag.

This commit is contained in:
bloodshot 2019-12-18 20:38:17 -05:00
parent f2a13b9539
commit d81c21955c

View File

@ -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;