PaperMC/paper-server/patches/sources/com/mojang/brigadier/builder/ArgumentBuilder.java.patch
2024-12-13 11:02:13 -05:00

21 lines
967 B
Diff

--- a/com/mojang/brigadier/builder/ArgumentBuilder.java
+++ b/com/mojang/brigadier/builder/ArgumentBuilder.java
@@ -14,9 +_,17 @@
import java.util.function.Predicate;
public abstract class ArgumentBuilder<S, T extends ArgumentBuilder<S, T>> {
+ // Paper start - Vanilla command permission fixes
+ private static final Predicate<Object> DEFAULT_REQUIREMENT = s -> true;
+
+ @SuppressWarnings("unchecked")
+ public static <S> Predicate<S> defaultRequirement() {
+ return (Predicate<S>) DEFAULT_REQUIREMENT;
+ }
+ // Paper end - Vanilla command permission fixes
private final RootCommandNode<S> arguments = new RootCommandNode<>();
private Command<S> command;
- private Predicate<S> requirement = s -> true;
+ private Predicate<S> requirement = defaultRequirement(); // Paper - Vanilla command permission fixes
private CommandNode<S> target;
private RedirectModifier<S> modifier = null;
private boolean forks;