    001package co.aikar.commands.contexts;
    002
    003import co.aikar.commands.CommandManager;
    004import co.aikar.commands.SpongeCommandOperationContext;
    005import org.spongepowered.api.command.CommandResult;
    006
    007import java.util.function.Consumer;
    008
    009public class CommandResultSupplier implements Consumer<CommandResult> {
    010
    011    public CommandResultSupplier() {
    012    }
    013
    014    @Override
    015    public void accept(CommandResult commandResult) {
    016        SpongeCommandOperationContext context = (SpongeCommandOperationContext) CommandManager.getCurrentCommandOperationContext();
    017        context.setResult(commandResult);
    018    }
    019}