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.network.chat.Component;

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

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

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

        return Command.SINGLE_SUCCESS;
    }
}
