From 25e7f94c2a0b606755588b07aed1d18e7e32a9f5 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Sat, 27 Apr 2024 17:45:30 -0700 Subject: [PATCH] fix last test issue --- ...d-experimental-improved-give-command.patch | 28 +++++++++++++++++++ ...ve-checking-handled-tags-in-itemmeta.patch | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/patches/server/Add-experimental-improved-give-command.patch b/patches/server/Add-experimental-improved-give-command.patch index d66184fdd6..57f07cf799 100644 --- a/patches/server/Add-experimental-improved-give-command.patch +++ b/patches/server/Add-experimental-improved-give-command.patch @@ -225,3 +225,31 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } private static int giveItem(CommandSourceStack source, ItemInput item, Collection targets, int count) throws CommandSyntaxException { +diff --git a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java ++++ b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java +@@ -0,0 +0,0 @@ public final class VanillaCommandWrapper extends BukkitCommand { + } else { + commandName = vanillaCommand.getRedirect().getName(); + } ++ if ("pgive".equals(stripDefaultNamespace(commandName))) { ++ return "bukkit.command.paper.pgive"; ++ } + return "minecraft.command." + stripDefaultNamespace(commandName); + } + +diff --git a/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java b/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java ++++ b/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java +@@ -0,0 +0,0 @@ public class MinecraftCommandPermissionsTest extends AbstractTestingBase { + Set foundPerms = new HashSet<>(); + for (CommandNode child : root.getChildren()) { + final String vanillaPerm = VanillaCommandWrapper.getPermission(child); ++ if ("bukkit.command.paper.pgive".equals(vanillaPerm)) { // skip our custom give command ++ continue; ++ } + if (!perms.contains(vanillaPerm)) { + missing.add("Missing permission for " + child.getName() + " (" + vanillaPerm + ") command"); + } else { diff --git a/patches/server/improve-checking-handled-tags-in-itemmeta.patch b/patches/server/improve-checking-handled-tags-in-itemmeta.patch index bf9c01bf4b..7bbe181f42 100644 --- a/patches/server/improve-checking-handled-tags-in-itemmeta.patch +++ b/patches/server/improve-checking-handled-tags-in-itemmeta.patch @@ -756,7 +756,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + for (final ClassInfo subclass : subclasses) { + final Class clazz = subclass.loadClass(CraftMetaItem.class); + CraftMetaItem.getTopLevelHandledDcts(clazz); // load into map -+ assertTrue(CraftMetaItem.HANDLED_TAGS_PER_TYPE.containsKey(clazz), subclass.getName() + " not found in handled tags map"); ++ assertTrue(CraftMetaItem.HANDLED_DCTS_PER_TYPE.containsKey(clazz), subclass.getName() + " not found in handled tags map"); + } + } catch (Exception e) { + throw new RuntimeException(e);