diff options
Diffstat (limited to 'patches/server/0439-Add-missing-default-perms-for-commands.patch')
-rw-r--r-- | patches/server/0439-Add-missing-default-perms-for-commands.patch | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/patches/server/0439-Add-missing-default-perms-for-commands.patch b/patches/server/0439-Add-missing-default-perms-for-commands.patch index d49628ee32..0ff16975d2 100644 --- a/patches/server/0439-Add-missing-default-perms-for-commands.patch +++ b/patches/server/0439-Add-missing-default-perms-for-commands.patch @@ -88,14 +88,20 @@ index a9ea2e38e4673686c9994a58c94ad19e59fd423c..52649f82351ab4f675c3cc3cd6640956 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..ca71c688b37ce2c8b712a4f9216cf872c8edf78e +index 0000000000000000000000000000000000000000..75ed5050f72c001d6eab117a2c0b352a413548bd --- /dev/null +++ b/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java -@@ -0,0 +1,82 @@ +@@ -0,0 +1,83 @@ +package io.papermc.paper.permissions; + +import com.mojang.brigadier.tree.CommandNode; +import com.mojang.brigadier.tree.RootCommandNode; ++import java.io.PrintStream; ++import java.util.HashSet; ++import java.util.LinkedHashSet; ++import java.util.List; ++import java.util.Set; ++import java.util.TreeSet; +import net.minecraft.commands.CommandBuildContext; +import net.minecraft.commands.CommandSourceStack; +import net.minecraft.commands.Commands; @@ -105,21 +111,16 @@ index 0000000000000000000000000000000000000000..ca71c688b37ce2c8b712a4f9216cf872 +import org.bukkit.craftbukkit.command.VanillaCommandWrapper; +import org.bukkit.craftbukkit.util.permissions.CraftDefaultPermissions; +import org.bukkit.permissions.Permission; -+import org.bukkit.support.AbstractTestingBase; ++import org.bukkit.support.RegistryHelper; ++import org.bukkit.support.environment.VanillaFeature; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + -+import java.io.PrintStream; -+import java.util.HashSet; -+import java.util.LinkedHashSet; -+import java.util.List; -+import java.util.Set; -+import java.util.TreeSet; -+ +import static org.junit.jupiter.api.Assertions.assertTrue; + -+public class MinecraftCommandPermissionsTest extends AbstractTestingBase { ++@VanillaFeature ++public class MinecraftCommandPermissionsTest { + + private static PrintStream old; + @BeforeAll @@ -133,7 +134,7 @@ index 0000000000000000000000000000000000000000..ca71c688b37ce2c8b712a4f9216cf872 + CraftDefaultPermissions.registerCorePermissions(); + Set<String> perms = collectMinecraftCommandPerms(); + -+ Commands commands = new Commands(Commands.CommandSelection.DEDICATED, CommandBuildContext.simple(AbstractTestingBase.REGISTRY_CUSTOM, FeatureFlags.VANILLA_SET)); ++ Commands commands = new Commands(Commands.CommandSelection.DEDICATED, CommandBuildContext.simple(RegistryHelper.getRegistry(), FeatureFlags.VANILLA_SET)); + RootCommandNode<CommandSourceStack> root = commands.getDispatcher().getRoot(); + Set<String> missing = new LinkedHashSet<>(); + Set<String> foundPerms = new HashSet<>(); |