// priority: 0
// Visit the wiki for more info - https://kubejs.com/
console.info('Hello, World! (Loaded CUSTOM MATERIALS.js)')


Java.loadClass('com.gregtechceu.gtceu.api.data.chemical.material.properties.PropertyKey');
Java.loadClass('com.gregtechceu.gtceu.api.data.chemical.material.properties.ToolProperty');
const Enchantments = Java.loadClass('net.minecraft.world.item.enchantment.Enchantments');

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

    // quartz_alloy
    event.create('quartz_alloy')
        .ingot()
        .components('2x nether_quartz', '1x iron')
        .color(0xe4e4e4).iconSet(GTMaterialIconSet.METALLIC)
        .flags(GTMaterialFlags.GENERATE_PLATE, GTMaterialFlags.GENERATE_GEAR, GTMaterialFlags.GENERATE_SMALL_GEAR)

    // forged_netherite
    event.create('forged_netherite')
        .ingot()
        .components('1x gold', '4x steel')
        .color(0x443a3b).secondaryColor(0x5a575a).iconSet(GTMaterialIconSet.METALLIC)
        .blastTemp(3600, "mid", GTValues.VA[GTValues.HV], 1600)
        .toolStats(
            ToolProperty.Builder.of(10.0, 4.0, 2032, 4,
                [
                    GTToolType.SWORD,
                    GTToolType.PICKAXE,
                    GTToolType.SHOVEL,
                    GTToolType.AXE,
                    GTToolType.HOE,
                    GTToolType.MINING_HAMMER,
                    GTToolType.SPADE,
                    GTToolType.SAW,
                    GTToolType.HARD_HAMMER,
                    GTToolType.WRENCH,
                    GTToolType.FILE,
                    GTToolType.CROWBAR,
                    GTToolType.SCREWDRIVER,
                    GTToolType.MORTAR,
                    GTToolType.WIRE_CUTTER,
                    GTToolType.SCYTHE,
                    GTToolType.KNIFE,
                    GTToolType.BUTCHERY_KNIFE,
                    GTToolType.DRILL_LV,
                    GTToolType.DRILL_MV,
                    GTToolType.DRILL_HV,
                    GTToolType.DRILL_EV,
                    GTToolType.DRILL_IV,
                    GTToolType.CHAINSAW_LV,
                    GTToolType.WRENCH_LV,
                    GTToolType.BUZZSAW,
                    GTToolType.SCREWDRIVER_LV,
                ]
            )
                .unbreakable()
                .build()
        )
        .flags(
            GTMaterialFlags.GENERATE_PLATE,
            GTMaterialFlags.GENERATE_ROD,
            GTMaterialFlags.GENERATE_BOLT_SCREW,
            GTMaterialFlags.GENERATE_FRAME,
            GTMaterialFlags.GENERATE_GEAR,
            GTMaterialFlags.GENERATE_LONG_ROD,
            GTMaterialFlags.GENERATE_FOIL,
            GTMaterialFlags.GENERATE_RING,
            GTMaterialFlags.GENERATE_SPRING,
            GTMaterialFlags.GENERATE_SPRING_SMALL,
            GTMaterialFlags.GENERATE_SMALL_GEAR,
            GTMaterialFlags.GENERATE_FINE_WIRE,
            GTMaterialFlags.GENERATE_ROTOR
        )

    // rough_concrete
    event.create('rough_concrete')
        .dust()
        .color(0xffffcc)

    // materialized_experience
    event.create('materialized_experience')
        .gem()
        .liquid()
        .color(0x009900).secondaryColor(0x004d00)

    // activated_lava
    event.create('activated_lava')
        .liquid(1300)
        .color(0xff2500).secondaryColor(0xff6600)

    // crystalized_water
    event.create('crystalized_water')
        .liquid()
        .color(0x2389da).secondaryColor(0x5abcd8)

    // titanobarium_electrotine
    event.create('titanobarium_electrotine')
        .ingot()
        .liquid(3700)
        .components('2x electrotine', '3x titanium', '1x barium')
        .blastTemp(3700, 'mid', GTValues.VA[GTValues.EV])
        .color(0x00e6e6).secondaryColor(0xccccff).iconSet(GTMaterialIconSet.METALLIC)
        .flags(GTMaterialFlags.GENERATE_PLATE, GTMaterialFlags.GENERATE_ROD, GTMaterialFlags.GENERATE_FRAME)

    // red_titanium
    event.create('red_titanium')
        .ingot()
        .liquid(3700)
        .components('1x rose_gold', '1x brass', '4x black_steel', '2x titanium')
        .blastTemp(3700, 'mid', GTValues.VA[GTValues.EV])
        .color(0x732626).secondaryColor(0xbf4040).iconSet(GTMaterialIconSet.METALLIC)
        .flags(GTMaterialFlags.GENERATE_PLATE, GTMaterialFlags.GENERATE_ROD, GTMaterialFlags.GENERATE_FRAME)


    // silky_quartz
    const SILK_TOUCH = Enchantments.SILK_TOUCH;

    event.create('silky_quartz')
        .ingot()
        .components('1x nether_quartz', '1x bronze')
        .color(0xffe6cc).secondaryColor(0xffce99).iconSet(GTMaterialIconSet.METALLIC)
        .toolStats(
            ToolProperty.Builder.of(2.0, 1.0, 576, 2,
                [
                    GTToolType.PICKAXE,
                    GTToolType.SHOVEL,
                    GTToolType.AXE,
                ]
            )
                .enchantment(SILK_TOUCH, 1)
                .build()
        )
        .flags(
            GTMaterialFlags.GENERATE_PLATE,
        );


    // // lv_credit
    // event.create('lv_credit')
    //     .ingot()
    //     .color(0x666666).secondaryColor(0xbfbfbf).iconSet(GTMaterialIconSet.METALLIC)
    //     .flags(GTMaterialFlags.DISABLE_MATERIAL_RECIPES, GTMaterialFlags.GENERATE_ROD, GTMaterialFlags.GENERATE_RING)

    // // mv_credit
    // event.create('mv_credit')
    //     .ingot()
    //     .color(0x00cccc).secondaryColor(0x99ffff).iconSet(GTMaterialIconSet.METALLIC)
    //     .flags(GTMaterialFlags.DISABLE_MATERIAL_RECIPES, GTMaterialFlags.GENERATE_ROD, GTMaterialFlags.GENERATE_RING)


    // fin //

})