/**
 * Material Registry for ores.
 */

GTCEuStartupEvents.registry("gtceu:material", event => {

    // Snowchestite is part of harder Naquadah Processing
    if (doHarderProcessing) {
        event.create("snowchestite")
            .dust().ore()
            .color(0x274c9f).iconSet("shiny")
            .flags(GTMaterialFlags.DISABLE_DECOMPOSITION)
            .components("3x naquadah_oxide", "pyromorphite")
            .addOreByproducts("chalcopyrite", "vanadium_magnetite", "naquadah_hydroxide")
    }

    // Earth
    event.create("azurite")
        .dust().ore(2, 3)
        .iconSet(GTMaterialIconSet.SHINY)
        .color(0x162eba).secondaryColor(0x053f2b)
        .components(GTMaterials.Copper.multiply(3), GTMaterials.Carbon.multiply(2), GTMaterials.Oxygen.multiply(8), GTMaterials.Hydrogen.multiply(2))
        .formula("Cu3(CO3)2(OH)2")
        .addOreByproducts(GTMaterials.Calcite, GTMaterials.CalciumHydroxide, GTMaterials.Barite, GTMaterials.Malachite)
        .washedIn(GTMaterials.NitricAcid)
        .oreSmeltInto(GTMaterials.Copper)
        .flags(GTMaterialFlags.DISABLE_DECOMPOSITION)

    // Moon
    event.create("dilithium")
        .gem().ore(2, 1)
        .iconSet("dilithium")
        .color(0xfdd2df).secondaryColor(0xfa52b5)
        .element(GTElements.get("dilithium"))
        .addOreByproducts(GTMaterials.Lithium, GTMaterials.Cobalt, GTMaterials.Platinum)

    event.create("fluorite")
        .gem().ore()
        .iconSet(GTMaterialIconSet.DIAMOND)
        .color(0x0c9949)
        .components(GTMaterials.Calcium.multiply(1), GTMaterials.Fluorine.multiply(2))
        .addOreByproducts(GTMaterials.Calcite, GTMaterials.Barite)

    event.create("anorthite")
        .gem().ore(2, 2)
        .iconSet(GTMaterialIconSet.GEM_VERTICAL)
        .color(0xddd4af).secondaryColor(0x575d60)
        .components(GTMaterials.Calcium.multiply(1), GTMaterials.Aluminium.multiply(2), GTMaterials.Silicon.multiply(2), GTMaterials.Oxygen.multiply(8))
        .addOreByproducts(GTMaterials.Sodium, GTMaterials.Sodium, GTMaterials.Aluminium)
        .washedIn(GTMaterials.NitricAcid)

    // Mars
    event.create("columbite")
        .dust().ore(2, 2)
        .iconSet(GTMaterialIconSet.METALLIC)
        .color(0x304868).secondaryColor(0x161a1e)
        .components(GTMaterials.Iron.multiply(1), GTMaterials.Niobium.multiply(2), GTMaterials.Oxygen.multiply(6))
        .addOreByproducts(GTMaterials.Manganese, GTMaterials.Tantalum, GTMaterials.Niobium)
        .washedIn(GTMaterials.NitricAcid)

    event.create("arsenopyrite")
        .dust().ore(2, 2)
        .iconSet(GTMaterialIconSet.ROUGH)
        .color(0xced89c).secondaryColor(0x375944)
        .components(GTMaterials.Iron.multiply(1), GTMaterials.Arsenic.multiply(1), GTMaterials.Sulfur.multiply(1))
        .addOreByproducts(GTMaterials.Sulfur, GTMaterials.Cobalt, GTMaterials.Sulfur)
        .washedIn(GTMaterials.NitricAcid)

    event.create("carnotite")
        .dust().ore(2, 2)
        .iconSet(GTMaterialIconSet.METALLIC)
        .color(0xe8de29).secondaryColor(0xb58c34)
        .components(GTMaterials.Potassium.multiply(2), GTMaterials.Uraninite.multiply(6), GTMaterials.Vanadium.multiply(2), GTMaterials.Oxygen.multiply(8), GTMaterials.Water.multiply(9))
        .formula("K2(UO2)2(VO4)2(H2O)3")
        .addOreByproducts(GTMaterials.Uraninite, GTMaterials.Potassium, GTMaterials.Vanadium)
        .washedIn(GTMaterials.NitricAcid)
        .flags(GTMaterialFlags.DISABLE_DECOMPOSITION)

    // Venus
    event.create("cuprorhodsite")
        .dust().ore()
        .iconSet(GTMaterialIconSet.BRIGHT)
        .color(0xc1aa82)
        .components(GTMaterials.Copper.multiply(1), GTMaterials.Iron.multiply(1), GTMaterials.Rhodium.multiply(4), GTMaterials.Sulfur.multiply(8))
        .addOreByproducts(GTMaterials.Chalcocite, GTMaterials.Platinum, GTMaterials.Ruthenium)

    event.create("argentite")
        .dust().ore(2, 2)
        .iconSet(GTMaterialIconSet.ROUGH)
        .color(0xc6c6b8).secondaryColor(0x1c1c28)
        .components(GTMaterials.Silver.multiply(2), GTMaterials.Sulfur.multiply(1))
        .addOreByproducts(GTMaterials.Lead, GTMaterials.Sulfur, GTMaterials.Zinc)
        .washedIn(GTMaterials.NitricAcid)
        .oreSmeltInto(GTMaterials.Silver)

    event.create("titanite")
        .gem().ore(2, 2)
        .iconSet(GTMaterialIconSet.GEM_HORIZONTAL)
        .color(0xa3ba3d).secondaryColor(0x355b30)
        .components(GTMaterials.Calcium.multiply(1), GTMaterials.Titanium.multiply(1), GTMaterials.Silicon.multiply(1), GTMaterials.Oxygen.multiply(5))
        .addOreByproducts(GTMaterials.Calcium, GTMaterials.Rutile, GTMaterials.get("fluorite"), GTMaterials.RareEarth)
        .washedIn(GTMaterials.NitricAcid)
        .flags(GTMaterialFlags.DISABLE_DECOMPOSITION)

    event.create("xenotime")
        .gem().ore(1, 2)
        .color(0xaa802a).secondaryColor(0x211a14)
        .components(GTMaterials.Yttrium.multiply(1), GTMaterials.Phosphate.multiply(1))
        .addOreByproducts(GTMaterials.Yttrium, GTMaterials.RareEarth, GTMaterials.Samarium)
        .washedIn(GTMaterials.NitricAcid)

    event.create("gallite")
        .dust().ore(1, 2)
        .color(0xedb376).secondaryColor(0x5b5563)
        .components(GTMaterials.Copper.multiply(1), GTMaterials.Gallium.multiply(1), GTMaterials.Sulfur.multiply(2))
        .addOreByproducts(GTMaterials.Chalcopyrite, GTMaterials.Gallium, GTMaterials.Gallium, GTMaterials.get("germanium_disulfide"))
        .washedIn(GTMaterials.NitricAcid)

    event.create("briartite")
        .dust().ore()
        .color(0xc4bf60).secondaryColor(0xa5a598)
        .components(GTMaterials.Chalcocite.multiply(3), GTMaterials.Sphalerite.multiply(2), "3x germanium_disulfide")
        .addOreByproducts(GTMaterials.Copper, GTMaterials.Sphalerite, GTMaterials.get("germanium_disulfide"))
        .washedIn(GTMaterials.Mercury)
        .flags(GTMaterialFlags.DECOMPOSITION_BY_CENTRIFUGING)

    // Mercury
    event.create("laurite")
        .dust().ore()
        .iconSet(GTMaterialIconSet.DIAMOND)
        .color(0x6f2c23)
        .components("ruthenium", "2x sulfur")
        .addOreByproducts("pyrite", "ruthenium", "rhodium")

    event.create("wolframite")
        .dust().ore(2, 2)
        .color(0xa0734e).secondaryColor(0x405275)
        .components(GTMaterials.Iron.multiply(1), GTMaterials.Manganese.multiply(1), GTMaterials.Tungsten.multiply(2), GTMaterials.Oxygen.multiply(8))
        .formula("(Fe,Mn)(WO3)O")
        .addOreByproducts(GTMaterials.Iron, GTMaterials.Manganese, GTMaterials.get("fluorite"))
        .washedIn(GTMaterials.NitricAcid)
        .separatedInto(GTMaterials.Iron)
        .flags(GTMaterialFlags.DISABLE_DECOMPOSITION)

    event.create("bismite")
        .dust().ore(2, 2)
        .color(0xd3e298).secondaryColor(0x43dbad)
        .components(GTMaterials.Bismuth.multiply(2), GTMaterials.Oxygen.multiply(3))
        .addOreByproducts(GTMaterials.Tin, GTMaterials.Bismuth)
        .washedIn(GTMaterials.NitricAcid)

    event.create("sperrylite")
        .gem().ore(2, 2)
        .color(0xaaa399).secondaryColor(0x37474F)
        .components(GTMaterials.Platinum.multiply(1), GTMaterials.Arsenic.multiply(2))
        .addOreByproducts(GTMaterials.Platinum, GTMaterials.Nickel, GTMaterials.Palladium)
        .washedIn(GTMaterials.NitricAcid)

    // Glacio
    event.create("iridosmine")
        .dust().ore()
        .iconSet(GTMaterialIconSet.METALLIC)
        .color(0x54afff).secondaryColor(0x1b5651)
        .components("2x osmium", "1x iridium")
        .addOreByproducts("osmium", "iridium", "rhodium")

    event.create("kaemanite")
        .dust().ore()
        .iconSet(GTMaterialIconSet.BRIGHT)
        .color(0xe7413c)
        .components("trinium", "tantalum", "4x oxygen")
        .addOreByproducts("niobium", "trinium_sulfide", "trinium")

    event.create("stolzite")
        .gem().ore(2, 3)
        .color(0xa5591f).secondaryColor(0x564517)
        .components(GTMaterials.Lead.multiply(1), GTMaterials.Tungsten.multiply(1), GTMaterials.Oxygen.multiply(4))
        .formula("Pb(WO3)O")
        .addOreByproducts(GTMaterials.Lead, GTMaterials.Manganese, GTMaterials.Molybdenum)
        .washedIn(GTMaterials.NitricAcid)
        .flags(GTMaterialFlags.DISABLE_DECOMPOSITION, GTMaterialFlags.CRYSTALLIZABLE, GTMaterialFlags.GENERATE_LENS)

    // MM-Exclusive
    event.create("darmstadtite")
        .dust().ore(2, 1)
        .iconSet(GTMaterialIconSet.DULL)
        .color(0x99AA87)
        .components(GTMaterials.Darmstadtium.multiply(2), GTMaterials.Sulfur.multiply(3))
        .addOreByproducts(GTMaterials.RhodiumSulfate, GTMaterials.RareEarth, GTMaterials.Darmstadtium)

    event.create("dulysite")
        .gem().ore(2, 1)
        .iconSet(GTMaterialIconSet.DIAMOND)
        .color(0xF5EFC0)
        .components(GTMaterials.Duranium, GTMaterials.Chlorine.multiply(3))
        .addOreByproducts(GTMaterials.Sphalerite, GTMaterials.Duranium, GTMaterials.Europium)
})
