1
0
mirror of https://github.com/lucko/LuckPerms.git synced 2025-08-22 22:22:56 +02:00

Fix Fabric command manager mixin (#3791)

This commit is contained in:
Luck
2023-12-12 18:57:44 +00:00
parent 5f87de3569
commit 754283c053

View File

@@ -32,14 +32,14 @@ import net.minecraft.server.command.ServerCommandSource;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(CommandManager.class)
public class CommandManagerMixin {
@Inject(at = @At("HEAD"), method = "execute", cancellable = true)
private void commandExecuteCallback(ParseResults<ServerCommandSource> parseResults, String command, CallbackInfoReturnable<Integer> info) {
private void commandExecuteCallback(ParseResults<ServerCommandSource> parseResults, String command, CallbackInfo ci) {
if (!PreExecuteCommandCallback.EVENT.invoker().onPreExecuteCommand(parseResults.getContext().getSource(), command)) {
info.setReturnValue(0);
ci.cancel();
}
}
}