Fix bundled spark permission check (#11355)

This commit is contained in:
lucko 2024-09-06 20:41:54 +01:00
parent daecf055f5
commit 303dbb3695

View file

@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// Paper end - Remap reflection
+ // Paper start - spark
+ implementation("me.lucko:spark-api:0.1-20240720.200737-2")
+ implementation("me.lucko:spark-paper:1.10.99-SNAPSHOT")
+ implementation("me.lucko:spark-paper:1.10.100-SNAPSHOT")
+ // Paper end - spark
}
@ -32,6 +32,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import io.papermc.paper.plugin.provider.classloader.ConfiguredPluginClassLoader;
+import io.papermc.paper.plugin.provider.classloader.PaperClassLoaderStorage;
+import io.papermc.paper.util.MCUtil;
+import java.util.Collection;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
@ -167,7 +168,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ private void registerCommand(final Server server) {
+ server.getCommandMap().register(COMMAND_NAME, "paper", new CommandImpl(COMMAND_NAME));
+ server.getCommandMap().register(COMMAND_NAME, "paper", new CommandImpl(COMMAND_NAME, this.spark.getPermissions()));
+ }
+
+ public void tickStart() {
@ -199,9 +200,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ public static final class CommandImpl extends Command {
+ CommandImpl(final String name) {
+ CommandImpl(final String name, final Collection<String> permissions) {
+ super(name);
+ this.setPermission("spark");
+ this.setPermission(String.join(";", permissions));
+ }
+
+ @Override