package top.r3944realms.lib39.platform;

import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import net.minecraft.commands.CommandBuildContext;
import net.minecraft.commands.CommandSourceStack;
import net.neoforged.neoforge.common.NeoForge;
import top.r3944realms.lib39.api.event.RegisterCommandHelpEvent;
import top.r3944realms.lib39.core.command.ICommandHelpManager;
import top.r3944realms.lib39.platform.services.IHelpCommandHook;

/**
 * The enum Forge help command hook.
 */
public enum NeoForgeHelpCommandHook implements IHelpCommandHook {
    /**
     * Instance forge help command hook.
     */
    INSTANCE;

    @Override
    public void onRegister(LiteralArgumentBuilder<CommandSourceStack> tree, ICommandHelpManager manager, CommandBuildContext context) {
        RegisterCommandHelpEvent registerHelpCommandEvent = new RegisterCommandHelpEvent(tree, manager, context);
        NeoForge.EVENT_BUS.post(registerHelpCommandEvent);
    }
}
