mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
fix last test issue
This commit is contained in:
parent
08a94f6ebd
commit
25e7f94c2a
2 changed files with 29 additions and 1 deletions
|
@ -225,3 +225,31 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int giveItem(CommandSourceStack source, ItemInput item, Collection<ServerPlayer> targets, int count) throws CommandSyntaxException {
|
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 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<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 {
|
||||||
|
|
|
@ -756,7 +756,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ for (final ClassInfo subclass : subclasses) {
|
+ for (final ClassInfo subclass : subclasses) {
|
||||||
+ final Class<CraftMetaItem> clazz = subclass.loadClass(CraftMetaItem.class);
|
+ final Class<CraftMetaItem> clazz = subclass.loadClass(CraftMetaItem.class);
|
||||||
+ CraftMetaItem.getTopLevelHandledDcts(clazz); // load into map
|
+ 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) {
|
+ } catch (Exception e) {
|
||||||
+ throw new RuntimeException(e);
|
+ throw new RuntimeException(e);
|
||||||
|
|
Loading…
Reference in a new issue