package jesse.keeblarcraft.AttributeMgr.AttributeNodes;

import java.util.HashMap;
import java.util.List;

import jesse.keeblarcraft.Keeblarcraft;
import jesse.keeblarcraft.Armor.MetalJacketArmor;
import jesse.keeblarcraft.CustomItems.ItemManager;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.Item;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;

public final class AttributeMetalJacket extends AbstractNode {
    // This is the custom armor set that players will receive if no armor is on & attribute is equipped
    public final Item jacketHelm = new ArmorItem(MetalJacketArmor.INSTANCE, ArmorItem.Type.HELMET, new Item.Settings());
    public final Item jacketChest = new ArmorItem(MetalJacketArmor.INSTANCE, ArmorItem.Type.CHESTPLATE, new Item.Settings());
    public final Item jacketLegs = new ArmorItem(MetalJacketArmor.INSTANCE, ArmorItem.Type.LEGGINGS, new Item.Settings());
    public final Item jacketBoots = new ArmorItem(MetalJacketArmor.INSTANCE, ArmorItem.Type.BOOTS, new Item.Settings());

    public AttributeMetalJacket() {
        // Finally register items with game
        Keeblarcraft.LOGGER.debug("Registering metaljackets");
        ItemManager.RegisterItem("metaljacket_helmet", jacketHelm);
        ItemManager.RegisterItem("metaljacket_chestplate", jacketChest);
        ItemManager.RegisterItem("metaljacket_leggings", jacketLegs);
        ItemManager.RegisterItem("metaljacket_boots", jacketBoots);
    }

    @Override
    public String GetNodeTitle() {
        return "MetalJacket";
    }

    // Short description of node on hover-event in GUI
    @Override
    public String GetNodeDescription() {
        return "MetalJacket affects armor value modifiers or gives player base armor when none is worn";
    }

    // Detailed description of node on click-event in GUI
    @Override
    public HashMap<String, List<String>> GetDetails() {
        HashMap<String, List<String>> ret = new HashMap<String, List<String>>();

        // Filling out description item stuff here
        ret.put("durability", List.of   (
                                        "Gives player a base armor set with 3 protection and resistance",
                                        "If armor is being worn, this attribute multiplies each pieces armor value by 120% (rounding up to nearest integer)"
                                        ));

        return ret;
    }

    @Override
    public void RegisterCallbacks() {
    }
}
