aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2024-04-27 17:45:30 -0700
committerJake Potrebic <[email protected]>2024-04-27 17:45:37 -0700
commitd964c15e15bff629b4999fbf3df09c5b1e6e2049 (patch)
treee2acb7f233669affa70136179e9b32324544700b
parent7e3d5b569d6ccc0273dc2d6a2ecc731b0694157b (diff)
downloadPaper-d964c15e15bff629b4999fbf3df09c5b1e6e2049.tar.gz
Paper-d964c15e15bff629b4999fbf3df09c5b1e6e2049.zip
fix last test issue
-rw-r--r--patches/server/1039-Add-experimental-improved-give-command.patch28
-rw-r--r--patches/server/1044-improve-checking-handled-tags-in-itemmeta.patch4
2 files changed, 30 insertions, 2 deletions
diff --git a/patches/server/1039-Add-experimental-improved-give-command.patch b/patches/server/1039-Add-experimental-improved-give-command.patch
index aaadb56694..4ff1984b05 100644
--- a/patches/server/1039-Add-experimental-improved-give-command.patch
+++ b/patches/server/1039-Add-experimental-improved-give-command.patch
@@ -225,3 +225,31 @@ index 0d9de4c61c7b26a6ff37c12fde629161fd0c3d5a..47355158e5e762540a10dc67b23092a0
}
private static int giveItem(CommandSourceStack source, ItemInput item, Collection<ServerPlayer> 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 61115db85b81e627d11a0de21691a2ca69aafe2c..ba2a2ca0c36e61cb3cc00fafc7a5dd9f7050388f 100644
+--- a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
++++ b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
+@@ -98,6 +98,9 @@ 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 ca71c688b37ce2c8b712a4f9216cf872c8edf78e..2f3ff50bf3f70b6b404d02d5ffcc079162a63bc1 100644
+--- a/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java
++++ b/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java
+@@ -45,6 +45,9 @@ public class MinecraftCommandPermissionsTest extends AbstractTestingBase {
+ Set<String> foundPerms = new HashSet<>();
+ for (CommandNode<CommandSourceStack> 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/1044-improve-checking-handled-tags-in-itemmeta.patch b/patches/server/1044-improve-checking-handled-tags-in-itemmeta.patch
index 632a50688f..a8054bfc09 100644
--- a/patches/server/1044-improve-checking-handled-tags-in-itemmeta.patch
+++ b/patches/server/1044-improve-checking-handled-tags-in-itemmeta.patch
@@ -729,7 +729,7 @@ index 100e9b72b1dac2deb956753b9a8097ba917236fa..0b11d5ea89539decd2f6c60c5b581bbd
@Test
diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/MetaHandledTagsTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/MetaHandledTagsTest.java
new file mode 100644
-index 0000000000000000000000000000000000000000..63218eeaded04157ed740a7b45ff6f2e7b533b98
+index 0000000000000000000000000000000000000000..7dc898d1d383aef8a913059e4f5695b5cdc719de
--- /dev/null
+++ b/src/test/java/org/bukkit/craftbukkit/inventory/MetaHandledTagsTest.java
@@ -0,0 +1,30 @@
@@ -756,7 +756,7 @@ index 0000000000000000000000000000000000000000..63218eeaded04157ed740a7b45ff6f2e
+ for (final ClassInfo subclass : subclasses) {
+ final Class<CraftMetaItem> 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);