package land.chipmunk.chipmunkmod.commands;

import com.mojang.brigadier.Command;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.context.CommandContext;
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.text.Text;

import static land.chipmunk.chipmunkmod.command.CommandManager.literal;

public class TestCommand {
    public static void register (final CommandDispatcher<FabricClientCommandSource> dispatcher) {
        dispatcher.register(
                literal("test")
                        .executes(c -> helloWorld(c))
        );
    }

    public static int helloWorld (final CommandContext<FabricClientCommandSource> context) {
        final FabricClientCommandSource source = context.getSource();
        source.sendFeedback(Text.literal("Hello, world!"));

        return Command.SINGLE_SUCCESS;
    }
}
