2022-08-02 04:50:34 +02:00
--- a/net/minecraft/server/ReloadableServerResources.java
+++ b/net/minecraft/server/ReloadableServerResources.java
2024-12-14 04:12:33 +01:00
@@ -39,6 +_,7 @@
this.postponedTags = postponedTags;
2022-08-02 04:50:34 +02:00
this.recipes = new RecipeManager(registries);
2024-12-14 04:12:33 +01:00
this.commands = new Commands(commandSelection, CommandBuildContext.simple(registries, enabledFeatures));
2022-08-02 04:50:34 +02:00
+ io.papermc.paper.command.brigadier.PaperCommands.INSTANCE.setDispatcher(this.commands, CommandBuildContext.simple(registries, enabledFeatures)); // Paper - Brigadier Command API
this.advancements = new ServerAdvancementManager(registries);
2024-12-14 04:12:33 +01:00
this.functionLibrary = new ServerFunctionLibrary(functionCompilationLevel, this.commands.getDispatcher());
2022-08-02 04:50:34 +02:00
}
2024-12-14 04:12:33 +01:00
@@ -83,6 +_,14 @@
2022-08-02 04:50:34 +02:00
ReloadableServerResources reloadableServerResources = new ReloadableServerResources(
2024-12-14 04:12:33 +01:00
loadResult.layers(), loadResult.lookupWithUpdatedTags(), enabledFeatures, commandSelection, postponedTags, functionCompilationLevel
2022-08-02 04:50:34 +02:00
);
+ // Paper start - call commands event for bootstraps
+ //noinspection ConstantValue
+ 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,
+ io.papermc.paper.plugin.bootstrap.BootstrapContext.class,
+ MinecraftServer.getServer() == null ? io.papermc.paper.plugin.lifecycle.event.registrar.ReloadableRegistrarEvent.Cause.INITIAL : io.papermc.paper.plugin.lifecycle.event.registrar.ReloadableRegistrarEvent.Cause.RELOAD);
+ // Paper end - call commands event
return SimpleReloadInstance.create(
resourceManager,
reloadableServerResources.listeners(),