From cb9b94e7d7cb6bc129777333239f2562f9178112 Mon Sep 17 00:00:00 2001 From: xDec0de_ Date: Sat, 2 Nov 2024 08:07:18 +0100 Subject: [PATCH] Fix SubCommandHandler access check --- .../main/java/net/codersky/mcutils/cmd/SubCommandHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/src/main/java/net/codersky/mcutils/cmd/SubCommandHandler.java b/shared/src/main/java/net/codersky/mcutils/cmd/SubCommandHandler.java index 11507d2..612ceee 100644 --- a/shared/src/main/java/net/codersky/mcutils/cmd/SubCommandHandler.java +++ b/shared/src/main/java/net/codersky/mcutils/cmd/SubCommandHandler.java @@ -23,7 +23,7 @@ private String[] removeFirstArgument(@NotNull String[] args) { private T onUsedCommand(@NotNull MCCommand mainCmd, @NotNull S sender, @NotNull String[] args, @NotNull BiFunction, String[], T> action, @NotNull T def, boolean message) { - if (mainCmd.hasAccess(sender, message)) + if (!mainCmd.hasAccess(sender, message)) return def; if (args.length == 0) return action.apply(mainCmd, args);