mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-05 02:22:12 +01:00
6dafeceebd
Fixes permission checks for vanilla commands which don't have a requirement, as well as for namespaced vanilla commands. == AT == public-f com.mojang.brigadier.tree.CommandNode requirement
21 lines
968 B
Diff
21 lines
968 B
Diff
--- a/com/mojang/brigadier/builder/ArgumentBuilder.java
|
|
+++ b/com/mojang/brigadier/builder/ArgumentBuilder.java
|
|
@@ -14,9 +14,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;
|