package com.zivilon.cinder_loe.command;

import com.zivilon.cinder_loe.CinderLoE_Config;

import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.util.ChatComponentText;

import java.util.UUID;

public class CommandUnitConversion extends CommandBase {

    @Override
    public String getCommandName() {
        return "unit_conversion";
    }

    @Override
    public String getCommandUsage(ICommandSender sender) {
        return "/unit_conversion <on/off/status>";
    }

    @Override
    public int getRequiredPermissionLevel() {
        return 4;
    }

    @Override
    public void processCommand(ICommandSender sender, String[] args) {
        if(args.length < 1) {
            sender.addChatMessage(new ChatComponentText("Incorrect arguments. Usage: " + getCommandUsage(sender)));
            return;
        }

        String action = args[0];
        if (action.equals("on")) {
            CinderLoE_Config.unit_conversion_enabled = true;
            sender.addChatMessage(new ChatComponentText("Unit conversion enabled."));
        } else if (action.equals("off")) {
            CinderLoE_Config.unit_conversion_enabled = false;
            sender.addChatMessage(new ChatComponentText("Unit conversion disabled."));
        } else if (action.equals("status")) {
            sender.addChatMessage(new ChatComponentText("Unit conversion status: " + CinderLoE_Config.unit_conversion_enabled));
        }
    }
}
