From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: MrHua269 Date: Wed, 8 Jul 2026 23:45:12 +0800 Subject: [PATCH] Force disable builtin spark plugin diff --git a/src/main/java/io/papermc/paper/plugin/provider/source/FileProviderSource.java b/src/main/java/io/papermc/paper/plugin/provider/source/FileProviderSource.java index 9661f033bbb2c00073f1c891e1411c2a9943a37a..70fccec55edb67c24c7ecbf3687682de41c73eed 100644 --- a/src/main/java/io/papermc/paper/plugin/provider/source/FileProviderSource.java +++ b/src/main/java/io/papermc/paper/plugin/provider/source/FileProviderSource.java @@ -76,7 +76,7 @@ public class FileProviderSource implements ProviderSource { } final PluginMeta config = type.getConfig(file); - if ((config.getName().equals("spark") && config.getMainClass().equals("me.lucko.spark.bukkit.BukkitSparkPlugin")) && !SparksFly.isPluginPreferred()) { + if ((config.getName().equals("spark") && config.getMainClass().equals("me.lucko.spark.bukkit.BukkitSparkPlugin")) && !SparksFly.isPluginPreferred() && false) { // Shiroha - Force disable builtin spark LOGGER.info("The spark plugin will not be loaded as this server bundles the spark profiler."); return; } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 9968f5064571b0917c8897c23fe06a148c63a305..3c46e2cc23ac57df52996e3d2c5ae416a9633a67 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -302,7 +302,7 @@ public final class CraftServer implements Server { public static Exception excessiveVelEx; private final io.papermc.paper.logging.SysoutCatcher sysoutCatcher = new io.papermc.paper.logging.SysoutCatcher(); private final io.papermc.paper.potion.PaperPotionBrewer potionBrewer; - public final io.papermc.paper.SparksFly spark; + public io.papermc.paper.SparksFly spark; // Paper - spark // Shiroha - Force disable builtin spark private final ServerConfiguration serverConfig = new PaperServerConfiguration(); // Paper start - Folia region threading API @@ -478,7 +478,7 @@ public final class CraftServer implements Server { } this.potionBrewer = new io.papermc.paper.potion.PaperPotionBrewer(console); // Paper - custom potion mixes datapackManager = new io.papermc.paper.datapack.PaperDatapackManager(console.getPackRepository()); // Paper - this.spark = new io.papermc.paper.SparksFly(this); // Paper - spark + if (false) this.spark = new io.papermc.paper.SparksFly(this); // Paper - spark // Shiroha - Force disable builtin spark } public boolean getCommandBlockOverride(String command) { @@ -1050,7 +1050,7 @@ public final class CraftServer implements Server { this.reloadData(); org.spigotmc.SpigotConfig.registerCommands(); // Spigot io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper - this.spark.registerCommandBeforePlugins(this); // Paper - spark + if (false) this.spark.registerCommandBeforePlugins(this); // Paper - spark // Shiroha - Force disable builtin spark this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*"); this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions"); @@ -1079,7 +1079,7 @@ public final class CraftServer implements Server { this.loadPlugins(); this.enablePlugins(PluginLoadOrder.STARTUP); this.enablePlugins(PluginLoadOrder.POSTWORLD); - this.spark.registerCommandAfterPlugins(this); // Paper - spark + if (false) this.spark.registerCommandAfterPlugins(this); // Paper - spark // Shiroha - Force disable builtin spark // Paper start - brigadier command API io.papermc.paper.command.brigadier.PaperCommands.INSTANCE.setValid(); // to clear invalid state for event fire below io.papermc.paper.plugin.lifecycle.event.LifecycleEventRunner.INSTANCE.callReloadableRegistrarEvent(io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents.COMMANDS, io.papermc.paper.command.brigadier.PaperCommands.INSTANCE, org.bukkit.plugin.Plugin.class, io.papermc.paper.plugin.lifecycle.event.registrar.ReloadableRegistrarEvent.Cause.RELOAD); // call commands event for regular plugins