Fix tests (again?)
This commit is contained in:
parent
57dfcdf4eb
commit
b3b63d3a02
2 changed files with 15 additions and 10 deletions
|
@ -5,10 +5,10 @@ Subject: [PATCH] Added missing default perms for commands
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java b/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java
|
||||
index ca30f9c590f792caa8f1b76d7219e9121d932673..045ebc5533de7486d1975efe9d51ab368969178a 100644
|
||||
index ca30f9c590f792caa8f1b76d7219e9121d932673..0467419fc8a06c241a46216c8f8c32abeb9fbc26 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java
|
||||
@@ -25,12 +25,68 @@ public final class CommandPermissions {
|
||||
@@ -25,12 +25,67 @@ public final class CommandPermissions {
|
||||
DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "list", "Allows the user to list all online players", PermissionDefault.OP, commands);
|
||||
DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "gamemode", "Allows the user to change the gamemode of another player", PermissionDefault.OP, commands);
|
||||
DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "xp", "Allows the user to give themselves or others arbitrary values of experience", PermissionDefault.OP, commands);
|
||||
|
@ -40,14 +40,12 @@ index ca30f9c590f792caa8f1b76d7219e9121d932673..045ebc5533de7486d1975efe9d51ab36
|
|||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "gamerule", "Allows a user to set or query a game rule value", PermissionDefault.OP, commands);
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "jfr", "Allows a user to use the vanilla Java FlightRecorder profiling system", PermissionDefault.OP, commands);
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "locate", "Allows the user to locate the closest structure", PermissionDefault.OP, commands);
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "locatebiome", "Allows the user to locate the closest biome", PermissionDefault.OP, commands);
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "loot", "Allows the user to drop items from an inventory slot onto the ground", PermissionDefault.OP, commands);
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "op", "Allows the user to grant operator status to a player", PermissionDefault.OP, commands);
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "pardon", "Allows the user to remove entries from the player ban list", PermissionDefault.OP, commands);
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "pardon-ip", "Allows the user to remove entries from the ip address ban list", PermissionDefault.OP, commands);
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "particle", "Allows the user to create particles", PermissionDefault.OP, commands);
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "perf", "Allows the user to start/stop the vanilla performance metrics capture", PermissionDefault.OP, commands);
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "placefeature", "Allows the user to place features with the command", PermissionDefault.OP, commands);
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "playsound", "Allows the user to play a sound", PermissionDefault.OP, commands);
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "recipe", "Allows the user to give or take recipes", PermissionDefault.OP, commands);
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "reload", "Allows the user to reload loot tables, advancements, and functions from disk", PermissionDefault.OP, commands);
|
||||
|
@ -74,22 +72,25 @@ index ca30f9c590f792caa8f1b76d7219e9121d932673..045ebc5533de7486d1975efe9d51ab36
|
|||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "weather", "Allows the user to set the weather", PermissionDefault.OP, commands);
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "whitelist", "Allows the user to manage the server whitelist", PermissionDefault.OP, commands);
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "worldborder", "Allows the user to manage the world border", PermissionDefault.OP, commands);
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "place", "Allows the user to place features and structures", PermissionDefault.OP, commands);
|
||||
+ // Paper end
|
||||
|
||||
DefaultPermissions.registerPermission("minecraft.admin.command_feedback", "Receive command broadcasts when sendCommandFeedback is true", PermissionDefault.OP, commands);
|
||||
|
||||
diff --git a/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java b/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..e80f8a32c82f89a2f898db1d869daadee735176f
|
||||
index 0000000000000000000000000000000000000000..da2eb57ea64403657744ea00eff40243ef51df58
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java
|
||||
@@ -0,0 +1,84 @@
|
||||
@@ -0,0 +1,86 @@
|
||||
+package io.papermc.paper.permissions;
|
||||
+
|
||||
+import com.mojang.brigadier.tree.CommandNode;
|
||||
+import com.mojang.brigadier.tree.RootCommandNode;
|
||||
+import net.minecraft.commands.CommandBuildContext;
|
||||
+import net.minecraft.commands.CommandSourceStack;
|
||||
+import net.minecraft.commands.Commands;
|
||||
+import net.minecraft.core.RegistryAccess;
|
||||
+import net.minecraft.server.Bootstrap;
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.craftbukkit.command.VanillaCommandWrapper;
|
||||
|
@ -123,7 +124,7 @@ index 0000000000000000000000000000000000000000..e80f8a32c82f89a2f898db1d869daade
|
|||
+ CraftDefaultPermissions.registerCorePermissions();
|
||||
+ Set<String> perms = collectMinecraftCommandPerms();
|
||||
+
|
||||
+ Commands commands = new Commands(Commands.CommandSelection.DEDICATED);
|
||||
+ Commands commands = new Commands(Commands.CommandSelection.DEDICATED, new CommandBuildContext(RegistryAccess.BUILTIN.get()));
|
||||
+ RootCommandNode<CommandSourceStack> root = commands.getDispatcher().getRoot();
|
||||
+ Set<String> missing = new LinkedHashSet<>();
|
||||
+ Set<String> foundPerms = new HashSet<>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue