package net.Chipperfluff.chipi.item;

import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.minecraft.item.*;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;

import net.Chipperfluff.chipi.ChipiMod;
import net.Chipperfluff.chipi.block.ModBlocks;
import net.Chipperfluff.chipi.entity.ModEntities;
import net.Chipperfluff.chipi.item.armor.ChipperArmorMaterial;
import net.Chipperfluff.chipi.item.tool.ChipperToolMaterial;

public class ModItems {

    // ===== BLOCK ITEMS =====

    public static final Item VOID_BLOCK = Registry.register(
        Registries.ITEM,
        new Identifier(ChipiMod.MOD_ID, "void_block"),
        new BlockItem(ModBlocks.VOID_BLOCK, new FabricItemSettings())
    );

    public static final Item CHIPPER_FRAME = Registry.register(
        Registries.ITEM,
        new Identifier(ChipiMod.MOD_ID, "chipper_frame"),
        new BlockItem(ModBlocks.CHIPPER_FRAME, new FabricItemSettings())
    );

    public static final Item CHIPPER_PORTAL = Registry.register(
        Registries.ITEM,
        new Identifier(ChipiMod.MOD_ID, "chipper_portal"),
        new BlockItem(ModBlocks.CHIPPER_PORTAL, new FabricItemSettings())
    );

    public static final Item CHIPPER_ORE = Registry.register(
        Registries.ITEM,
        new Identifier(ChipiMod.MOD_ID, "chipper_ore"),
        new BlockItem(ModBlocks.CHIPPER_ORE, new FabricItemSettings())
    );

    public static final Item CHIPPER_ALLOY_BLOCK = Registry.register(
        Registries.ITEM,
        new Identifier(ChipiMod.MOD_ID, "chipper_alloy_block"),
        new BlockItem(ModBlocks.CHIPPER_ALLOY_BLOCK, new FabricItemSettings())
    );

    public static final Item JINGLE_BLOCK = Registry.register(
        Registries.ITEM,
        new Identifier(ChipiMod.MOD_ID, "jingle_block"),
        new BlockItem(ModBlocks.JINGLE_BLOCK, new FabricItemSettings())
    );

    // ===== ENTITY ITEMS =====

    public static final Item MEP_SPAWN_EGG = Registry.register(
        Registries.ITEM,
        new Identifier(ChipiMod.MOD_ID, "mep_spawn_egg"),
        new SpawnEggItem(ModEntities.MEP, 0x1E3A5F, 0x6BB6FF, new Item.Settings())
    );

    // ===== NORMAL ITEMS =====

    public static final Item RAW_CHIPPER_ORE = Registry.register(
        Registries.ITEM,
        new Identifier(ChipiMod.MOD_ID, "raw_chipper_ore"),
        new Item(new FabricItemSettings())
    );

    public static final Item CHIPPER_INGOT = Registry.register(
        Registries.ITEM,
        new Identifier(ChipiMod.MOD_ID, "chipper_ingot"),
        new Item(new FabricItemSettings())
    );

    public static final Item CHIPPER_ALLOY = Registry.register(
        Registries.ITEM,
        new Identifier(ChipiMod.MOD_ID, "chipper_alloy"),
        new Item(new FabricItemSettings())
    );

    // ===== FOOD ITEMS =====

    public static final Item NUT = Registry.register(
        Registries.ITEM,
        new Identifier(ChipiMod.MOD_ID, "nut"),
        new Item(new FabricItemSettings().food(ModFoodComponents.NUT))
    );

    public static final Item MEP_MILK = Registry.register(
        Registries.ITEM,
        new Identifier(ChipiMod.MOD_ID, "mep_milk"),
        new MepMilkItem(new Item.Settings().maxCount(1).recipeRemainder(Items.BUCKET).food(ModFoodComponents.MEP_MILK))
    );

    public static final Item PLAYER_MILK = Registry.register(
        Registries.ITEM,
        new Identifier(ChipiMod.MOD_ID, "player_milk"),
        new PlayerMilkItem(
            new Item.Settings()
                .maxCount(1)
                .recipeRemainder(Items.BUCKET)
                .food(ModFoodComponents.PLAYER_MILK)
        )
    );

    // ===== ARMOR =====

    public static final Item CHIPPER_HELMET = Registry.register(
        Registries.ITEM,
        new Identifier(ChipiMod.MOD_ID, "chipper_helmet"),
        new ArmorItem(ChipperArmorMaterial.INSTANCE, ArmorItem.Type.HELMET, new Item.Settings())
    );

    public static final Item CHIPPER_CHESTPLATE = Registry.register(
        Registries.ITEM,
        new Identifier(ChipiMod.MOD_ID, "chipper_chestplate"),
        new ArmorItem(ChipperArmorMaterial.INSTANCE, ArmorItem.Type.CHESTPLATE, new Item.Settings())
    );

    public static final Item CHIPPER_LEGGINGS = Registry.register(
        Registries.ITEM,
        new Identifier(ChipiMod.MOD_ID, "chipper_leggings"),
        new ArmorItem(ChipperArmorMaterial.INSTANCE, ArmorItem.Type.LEGGINGS, new Item.Settings())
    );

    public static final Item CHIPPER_BOOTS = Registry.register(
        Registries.ITEM,
        new Identifier(ChipiMod.MOD_ID, "chipper_boots"),
        new ArmorItem(ChipperArmorMaterial.INSTANCE, ArmorItem.Type.BOOTS, new Item.Settings())
    );

    // ===== TOOLS =====

    public static final Item CHIPPER_SWORD = Registry.register(
        Registries.ITEM,
        new Identifier(ChipiMod.MOD_ID, "chipper_sword"),
        new SwordItem(ChipperToolMaterial.INSTANCE, 3, -2.4f, new Item.Settings())
    );

    public static final Item CHIPPER_PICKAXE = Registry.register(
        Registries.ITEM,
        new Identifier(ChipiMod.MOD_ID, "chipper_pickaxe"),
        new PickaxeItem(ChipperToolMaterial.INSTANCE, 1, -2.8f, new Item.Settings())
    );

    public static final Item CHIPPER_AXE = Registry.register(
        Registries.ITEM,
        new Identifier(ChipiMod.MOD_ID, "chipper_axe"),
        new AxeItem(ChipperToolMaterial.INSTANCE, 5, -3.0f, new Item.Settings())
    );

    public static final Item CHIPPER_SHOVEL = Registry.register(
        Registries.ITEM,
        new Identifier(ChipiMod.MOD_ID, "chipper_shovel"),
        new ShovelItem(ChipperToolMaterial.INSTANCE, 1.5f, -3.0f, new Item.Settings())
    );

    public static final Item CHIPPER_HOE = Registry.register(
        Registries.ITEM,
        new Identifier(ChipiMod.MOD_ID, "chipper_hoe"),
        new HoeItem(ChipperToolMaterial.INSTANCE, -3, 0.0f, new Item.Settings())
    );

    public static void register() {}
}
