package com.zivilon.cinder_loe.entity.npc.good_human;

import com.zivilon.cinder_loe.CinderLoE;

import lotr.common.LOTRMod;
import lotr.common.entity.npc.LOTREntityBreeGuard;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.util.MovingObjectPosition;

public class BreeSoldier extends LOTREntityBreeGuard {
    private static ItemStack[] guardWeapons = new ItemStack[]{new ItemStack(CinderLoE.swordBree), new ItemStack(CinderLoE.swordBree), new ItemStack(LOTRMod.pikeIron)};

    public BreeSoldier(World world) {
        super(world);
        this.spawnRidingHorse = false;
    }

    @Override
    public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
        data = super.onSpawnWithEgg(data);
        int i = (rand.nextInt(guardWeapons.length));
        this.npcItemsInv.setMeleeWeapon(guardWeapons[i].copy());
        this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon());
        setCurrentItemOrArmor(1, new ItemStack(CinderLoE.bootsBree));
        setCurrentItemOrArmor(2, new ItemStack(CinderLoE.legsBree));
        setCurrentItemOrArmor(3, new ItemStack(CinderLoE.bodyBree));
        setCurrentItemOrArmor(4, new ItemStack(CinderLoE.helmetBree));
        return data;
    }
    @Override
    public ItemStack getPickedResult(MovingObjectPosition target) {
        return new ItemStack(CinderLoE.spawnEgg, 1, 19);
    }
}
