Supports the ability for commands to be registered internally (#12520)
This commit is contained in:
@@ -172,7 +172,7 @@
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -359,26 +_,120 @@
|
||||
@@ -359,26 +_,121 @@
|
||||
}
|
||||
|
||||
public void sendCommands(ServerPlayer player) {
|
||||
@@ -252,6 +252,7 @@
|
||||
+ }
|
||||
+ // Paper end - Brigadier API
|
||||
+ if (!org.spigotmc.SpigotConfig.sendNamespaced && commandNode.getName().contains(":")) continue; // Spigot
|
||||
+ if (commandNode.wrappedCached != null && commandNode.wrappedCached.apiCommandMeta != null && commandNode.wrappedCached.apiCommandMeta.serverSideOnly()) continue; // Paper
|
||||
if (commandNode.canUse(source)) {
|
||||
ArgumentBuilder<SharedSuggestionProvider, ?> argumentBuilder = (ArgumentBuilder) commandNode.createBuilder();
|
||||
+ // Paper start
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
--- a/net/minecraft/server/ReloadableServerResources.java
|
||||
+++ b/net/minecraft/server/ReloadableServerResources.java
|
||||
@@ -38,7 +_,8 @@
|
||||
@@ -38,7 +_,9 @@
|
||||
this.fullRegistryHolder = new ReloadableServerRegistries.Holder(registryAccess.compositeAccess());
|
||||
this.postponedTags = postponedTags;
|
||||
this.recipes = new RecipeManager(registries);
|
||||
- this.commands = new Commands(commandSelection, CommandBuildContext.simple(registries, enabledFeatures));
|
||||
+ this.commands = new Commands(commandSelection, CommandBuildContext.simple(registries, enabledFeatures), true); // Paper - Brigadier Command API - use modern alias registration
|
||||
+ io.papermc.paper.command.brigadier.PaperCommands.INSTANCE.setDispatcher(this.commands, CommandBuildContext.simple(registries, enabledFeatures)); // Paper - Brigadier Command API
|
||||
+ io.papermc.paper.command.PaperCommands.registerCommands(); // Paper
|
||||
this.advancements = new ServerAdvancementManager(registries);
|
||||
this.functionLibrary = new ServerFunctionLibrary(functionCompilationLevel, this.commands.getDispatcher());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user