fabric: register forwards mapper with the BrigadierManager

fixes CommandSourceStack#getServer being null during permission checks for arguments with custom suggestions
This commit is contained in:
jmp 2021-02-05 18:05:21 -08:00 committed by Jason
parent 149ffffe8e
commit 96e08ab2ef
2 changed files with 2 additions and 1 deletions

View file

@ -50,7 +50,7 @@ dependencies {
modImplementation("net.fabricmc", "fabric-loader", Versions.fabricLoader)
modImplementation(fabricApi.module("fabric-command-api-v1", Versions.fabricApi))
modImplementation(include("me.lucko", "fabric-permissions-api", "0.1-SNAPSHOT"))
modApi(include("me.lucko", "fabric-permissions-api", "0.1-SNAPSHOT"))
api(include(project(":cloud-core"))!!)
api(include(project(":cloud-brigadier"))!!)

View file

@ -154,6 +154,7 @@ public abstract class FabricCommandManager<C, S extends CommandSource> extends C
this
));
this.brigadierManager.backwardsBrigadierSenderMapper(this.backwardsCommandSourceMapper);
this.brigadierManager.brigadierSenderMapper(this.commandSourceMapper);
this.registerNativeBrigadierMappings(this.brigadierManager);
this.setCaptionRegistry(new FabricCaptionRegistry<>());
this.registerCommandPreProcessor(new FabricCommandPreprocessor<>(this));