package com.zivilon.cinder_loe.items;

import com.zivilon.cinder_loe.LoECreativeTabs;
import lotr.common.item.LOTRItemPolearmLong;
import lotr.common.item.LOTRItemSword;
import lotr.common.item.LOTRMaterial;
import lotr.common.item.LOTRWeaponStats;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.EnumAction;

public class LoEGreatSword extends LOTRItemSword {
    public Item repair_item;

    public LoEGreatSword(LOTRMaterial material) {
        this(material, (Item) null);
    }
    public LoEGreatSword(LOTRMaterial material, Block repair_block) {
        this(material, Item.getItemFromBlock(repair_block));
    }
    public LoEGreatSword(LOTRMaterial material, Item item) {
        super(material);
        repair_item = item;
        setCreativeTab(LoECreativeTabs.tabCombatLoE);
        addWeaponDamage(1.0f);
    }

    public LoEGreatSword setWeaponDamage(float damage) {
        this.lotrWeaponDamage = damage;
        return this;
    }

    @Override
    public boolean getIsRepairable(ItemStack item, ItemStack repair_material) {
        if (repair_material.getItem() == repair_item) {
            return true;
        }
        return false;
    }

    public EnumAction getItemUseAction(ItemStack itemstack) {
        return EnumAction.none;
    }

    static {
        LOTRWeaponStats.registerMeleeSpeed(LoEGreatSword.class, 0.83f);
        LOTRWeaponStats.registerMeleeReach(LoEGreatSword.class, 1.15f);
    }
}
