package com.zivilon.cinder_loe.lotr;

import lotr.common.world.structure.LOTRChestContents;
import net.minecraft.util.WeightedRandomChestContent;
import lotr.common.LOTRMod;
import com.zivilon.cinder_loe.CinderLoE;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import lotr.common.item.LOTRItemConquestHorn;
import lotr.common.world.spawning.LOTRInvasions;

public class ChestContentsOverride {
    public static void replace_chest_contents() {
        change_pyramid_drops();
    }

    private static void change_pyramid_drops() {
        LOTRChestContents.NEAR_HARAD_PYRAMID = new LOTRChestContents(8, 10,
        new WeightedRandomChestContent[]{new WeightedRandomChestContent(new ItemStack(LOTRMod.helmetNearHarad), 1, 1, 5),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.bodyNearHarad), 1, 1, 5),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.legsNearHarad), 1, 1, 5),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.bootsNearHarad), 1, 1, 5),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.scimitarNearHarad), 1, 1, 25),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.daggerNearHarad), 1, 1, 5),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.spearNearHarad), 1, 1, 5),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.poleaxeNearHarad), 1, 1, 5),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.maceNearHarad), 1, 1, 5),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.pikeNearHarad), 1, 1, 5),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.helmetGulfHarad), 1, 1, 5),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.bodyGulfHarad), 1, 1, 5),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.legsGulfHarad), 1, 1, 5),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.bootsGulfHarad), 1, 1, 5),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.swordGulfHarad), 1, 1, 25),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.daggerHarad), 1, 1, 5),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.swordHarad), 1, 1, 5),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.spearHarad), 1, 1, 5),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.pikeHarad), 1, 1, 5),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.nearHaradBow), 1, 1, 25),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.silverCoin, 1, 0), 1, 40, 100),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.silverCoin, 1, 1), 1, 15, 25),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.silverCoin, 1, 2), 1, 2, 10),
            new WeightedRandomChestContent(new ItemStack(Items.gold_ingot), 1, 8, 100),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.silver), 1, 8, 100),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.bronze), 1, 8, 100),
            new WeightedRandomChestContent(new ItemStack(Items.iron_ingot), 1, 8, 100),
            new WeightedRandomChestContent(new ItemStack(Items.dye, 1, 4), 1, 8, 50),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.mithrilNugget), 1, 3, 10),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.diamond), 1, 2, 10),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.emerald), 1, 3, 15),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.ruby), 1, 3, 20),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.sapphire), 1, 3, 20),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.topaz), 1, 4, 20),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.amber), 1, 4, 20),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.goldRing), 1, 2, 25),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.silverRing), 1, 2, 25),
            new WeightedRandomChestContent(new ItemStack(Items.skull), 1, 1, 50),
            new WeightedRandomChestContent(new ItemStack(Items.bone), 1, 3, 100),
            new WeightedRandomChestContent(new ItemStack(Items.rotten_flesh), 1, 3, 100),
            new WeightedRandomChestContent(LOTRItemConquestHorn.createHorn(LOTRInvasions.NEAR_HARAD_COAST), 1, 1, 1),
            new WeightedRandomChestContent(LOTRItemConquestHorn.createHorn(LOTRInvasions.NEAR_HARAD_UMBAR), 1, 1, 1),
            new WeightedRandomChestContent(LOTRItemConquestHorn.createHorn(LOTRInvasions.NEAR_HARAD_HARNEDOR), 1, 1, 1),
            new WeightedRandomChestContent(LOTRItemConquestHorn.createHorn(LOTRInvasions.NEAR_HARAD_GULF), 1, 1, 1),
            new WeightedRandomChestContent(LOTRItemConquestHorn.createHorn(LOTRInvasions.NEAR_HARAD_NOMAD), 1, 1, 1),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.daggerAncientHarad), 1, 1, 50),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.helmetBlackNumenorean), 1, 1, 20),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.bodyBlackNumenorean), 1, 1, 20),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.legsBlackNumenorean), 1, 1, 20),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.bootsBlackNumenorean), 1, 1, 20),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.swordBlackNumenorean), 1, 1, 20),
            new WeightedRandomChestContent(new ItemStack(CinderLoE.greatswordNumenor), 1, 1, 20),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.daggerBlackNumenorean), 1, 1, 20),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.spearBlackNumenorean), 1, 1, 20),
            new WeightedRandomChestContent(new ItemStack(LOTRMod.maceBlackNumenorean), 1, 1, 20)});
            System.out.println("Is greatsword null: " + (CinderLoE.greatswordNumenor == null));
    }

}
