package com.zivilon.cinder_loe.mixins;

import com.zivilon.cinder_loe.entity.npc.orc.trader.*;
import lotr.common.entity.npc.LOTREntityDolGuldurOrcTrader;
import lotr.common.entity.npc.LOTREntityMordorOrcTrader;
import lotr.common.entity.npc.LOTREntityNPC;
import lotr.common.world.structure2.LOTRWorldGenDolGuldurCamp;
import lotr.common.world.structure2.LOTRWorldGenMordorCamp;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;

import java.util.Random;

@Mixin(LOTRWorldGenMordorCamp.class)
public class MixinLOTRWorldGenMordorCamp {

    /**
     * @author KeyLime17
     * @reason Made orc camps select trader from multiple options
     */
    @Overwrite(remap = false)
    protected LOTREntityNPC getCampCaptain(World world, Random random) {
        int pick = random.nextInt(5);
        switch (pick) {
            case 1:
                return new MordorOrcBrewer(world);
            case 2:
                return new MordorOrcButcher(world);
            case 3:
                return new MordorOrcSmith(world);
            case 4:
                return new LOTREntityMordorOrcTrader(world);
            default:
                return null;
        }
    }
}
