let registerRecipeTypes = (/** @type {Registry.Recipe_Type} */ event) => {
    event.create("greenhouse")
        .category("gregitas")
        .setEUIO("in")
        .setMaxIOSize(3, 4, 1, 0)
        .setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, FillDirection.LEFT_TO_RIGHT)
        .setSound(GTSoundEntries.BATH)

    event.create('improved_coke_oven')
        .category('gregitas')
        .setEUIO('in')
        .setMaxIOSize(1, 1, 0, 1)
        .setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, FillDirection.LEFT_TO_RIGHT)
        .setSound(GTSoundEntries.FIRE); 

    event.create("gas_centrifuge")
        .category("gregitas")
        .setEUIO("in")
        .setMaxIOSize(0, 3, 1, 6)
        .setProgressBar(GuiTextures.PROGRESS_BAR_EXTRACT, FillDirection.LEFT_TO_RIGHT)
        .setSound(GTSoundEntries.CENTRIFUGE)

    event.create("plasma_centrifuge")
        .category("gregitas")
        .setEUIO("in")
        .setMaxIOSize(0, 0, 1, 6)
        .setProgressBar(GuiTextures.PROGRESS_BAR_EXTRACT, FillDirection.LEFT_TO_RIGHT)
        .setSound(GTSoundEntries.CENTRIFUGE)

    event.create("chemical_vapor_deposition")
        .category("gregitas")
        .setEUIO("in")
        .setMaxIOSize(2, 1, 2, 0)
        .setProgressBar(GuiTextures.PROGRESS_BAR_ARROW_MULTIPLE, FillDirection.LEFT_TO_RIGHT)
        .setSound(GTSoundEntries.CHEMICAL)

}

let registerMachines = (/** @type {Registry.Machine} */ event) => {
    event.create("greenhouse", "multiblock")
        .rotationState(RotationState.NON_Y_AXIS)
        .recipeType("greenhouse")
        .appearanceBlock(GTBlocks.CASING_STEEL_SOLID)
        .recipeModifier(GTRecipeModifiers.PARALLEL_HATCH.apply(OverclockingLogic.NON_PERFECT_OVERCLOCK, GTRecipeModifiers.ELECTRIC_OVERCLOCK))
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("FFF", "CCC", "CGC", "CGC", "CLC", "CCC")
            .aisle("FFF", "CMC", "GSG", "G#G", "LIL", "COC")
            .aisle("FFF", "CKC", "CGC", "CGC", "CLC", "CNC")
            .where("K", Predicates.controller(Predicates.blocks(definition.get())))
            .where("L", Predicates.blocks(GTBlocks.CASING_GRATE.get()))
            .where("C", Predicates.blocks(GTBlocks.CASING_STEEL_SOLID.get())
                .or(Predicates.autoAbilities(definition.getRecipeTypes()))
                .or(Predicates.abilities(PartAbility.PARALLEL_HATCH))
            )
            .where("O", Predicates.abilities(PartAbility.MUFFLER))
            .where("N", Predicates.abilities(PartAbility.MAINTENANCE))
            .where("I", Predicates.blocks("glowstone"))
            .where("F", Predicates.blocks("gtceu:steel_frame"))
            .where("#", Predicates.air())
            .where("M", Predicates.blocks("tfc:dirt/loam")
                .or(Predicates.blocks("tfc:dirt/sandy_loam"))
                .or(Predicates.blocks("tfc:dirt/silt"))
                .or(Predicates.blocks("tfc:dirt/silty_loam"))
                .or(Predicates.blocks("tfc:grass/loam"))
                .or(Predicates.blocks("tfc:grass/sandy_loam"))
                .or(Predicates.blocks("tfc:grass/silt"))
                .or(Predicates.blocks("tfc:grass/silty_loam"))
            )
            .where("S", Predicates.blocks("tfc:wood/sapling/acacia")
                .or(Predicates.blocks("tfc:wood/sapling/ash"))
                .or(Predicates.blocks("tfc:wood/sapling/aspen"))
                .or(Predicates.blocks("tfc:wood/sapling/birch"))
                .or(Predicates.blocks("tfc:wood/sapling/blackwood"))
                .or(Predicates.blocks("tfc:wood/sapling/chestnut"))
                .or(Predicates.blocks("tfc:wood/sapling/douglas_fir"))
                .or(Predicates.blocks("tfc:wood/sapling/hickory"))
                .or(Predicates.blocks("tfc:wood/sapling/kapok"))
                .or(Predicates.blocks("tfc:wood/sapling/mangrove"))
                .or(Predicates.blocks("tfc:wood/sapling/maple"))
                .or(Predicates.blocks("tfc:wood/sapling/oak"))
                .or(Predicates.blocks("tfc:wood/sapling/palm"))
                .or(Predicates.blocks("tfc:wood/sapling/pine"))
                .or(Predicates.blocks("tfc:wood/sapling/rosewood"))
                .or(Predicates.blocks("tfc:wood/sapling/sequoia"))
                .or(Predicates.blocks("tfc:wood/sapling/spruce"))
                .or(Predicates.blocks("tfc:wood/sapling/sycamore"))
                .or(Predicates.blocks("tfc:wood/sapling/white_cedar"))
                .or(Predicates.blocks("tfc:wood/sapling/willow"))
            )
            .where("G", Predicates.blocks("ae2:quartz_glass"))
            .build())
        .workableCasingRenderer(
            "gtceu:block/casings/solid/machine_casing_solid_steel",
            "gtceu:block/multiblock/implosion_compressor",
            false
        )

        event.create('improved_coke_oven', 'multiblock')
        .rotationState(RotationState.NON_Y_AXIS)
        .recipeType('improved_coke_oven')
        .pattern(definition => FactoryBlockPattern.start()
            .aisle('bbb', 'ccc', 'bbb')
            .aisle('bbb', 'c c', 'bbb')
            .aisle('bkb', 'ccc', 'bbb')
            .where('k', Predicates.controller(Predicates.blocks(definition.get())))
            .where('c', Predicates.blocks(GTBlocks.COIL_CUPRONICKEL.get()))
            .where(' ', Predicates.any())
            .where('b', Predicates.blocks('gregitas:bronze_plated_bricks')
                .or(Predicates.autoAbilities(definition.getRecipeTypes()))
                .or(Predicates.abilities(PartAbility.MUFFLER).setExactLimit(1))
            )
            .build())
        .workableCasingRenderer(
            "kubejs:block/casings/bronze_plated_bricks",
            "gtceu:block/multiblock/coke_oven",
            false
        )

    event.create('advanced_large_chemical_reactor', 'multiblock')
        .rotationState(RotationState.NON_Y_AXIS)
        .appearanceBlock(GTBlocks.CASING_PTFE_INERT)
        .recipeTypes('large_chemical_reactor')
        .recipeModifier(GTRecipeModifiers.PARALLEL_HATCH.apply(OverclockingLogic.PERFECT_OVERCLOCK, GTRecipeModifiers.ELECTRIC_OVERCLOCK))
        .pattern(definition => FactoryBlockPattern.start()
            .aisle('c   c', 'ccccc', 'c   c', 'ccccc', 'c   c')
            .aisle('ccccc', 'cpppc', 'cwwwc', 'cpppc', 'ccccc')
            .aisle('c   c', 'cwwwc', 'cpppc', 'cwwwc', 'c   c')
            .aisle('ccccc', 'cpppc', 'cwwwc', 'cpppc', 'ccccc')
            .aisle('c   c', 'kcccc', 'c   c', 'ccccc', 'c   c')
            .where('k', Predicates.controller(Predicates.blocks(definition.get())))
            .where('w', Predicates.blocks(GTBlocks.COIL_TUNGSTENSTEEL.get())
                .or(Predicates.blocks(GTBlocks.CASING_POLYTETRAFLUOROETHYLENE_PIPE.get()))
            )
            .where('p', Predicates.blocks(GTBlocks.CASING_POLYTETRAFLUOROETHYLENE_PIPE.get())
                .or(Predicates.blocks(GTBlocks.COIL_TUNGSTENSTEEL.get()))
            )
            .where(' ', Predicates.any())
            .where('c', Predicates.blocks(GTBlocks.CASING_PTFE_INERT.get())
                .or(Predicates.autoAbilities(definition.getRecipeTypes()))
                .or(Predicates.abilities(PartAbility.MAINTENANCE).setExactLimit(1))
                .or(Predicates.abilities(PartAbility.PARALLEL_HATCH).setMaxGlobalLimited(1))
            )
        .build())
        .shapeInfo(controller => MultiblockShapeInfo.builder()
            .aisle('e   e', 'ccccc', 'c   c', 'ccccc', 'c   c')
            .aisle('ccccc', 'fpppc', 'cwwwc', 'fpppc', 'ccccc')
            .aisle('c   c', 'cwwwc', 'cpppi', 'cwwwc', 'c   c')
            .aisle('ccccc', 'fpppc', 'cwwwc', 'fpppc', 'ccccc')
            .aisle('c   c', 'kcPcm', 'c   c', 'cIcFc', 'c   c')
            .where('k', controller, Direction.SOUTH)
            .where('c', GTBlocks.CASING_PTFE_INERT.get())
            .where('w', GTBlocks.COIL_TUNGSTENSTEEL.get())
            .where('p', GTBlocks.CASING_POLYTETRAFLUOROETHYLENE_PIPE.get())
            .where(' ', Block.getBlock('minecraft:air'))
            .where('e', GTMachines.ENERGY_INPUT_HATCH[5], Direction.NORTH)
            ["where(char,net.minecraft.world.level.block.state.BlockState)"]('m', 
                Block.getBlock('gtceu:maintenance_hatch').defaultBlockState().setValue(BlockProperties.FACING, Direction.SOUTH))
            ["where(char,net.minecraft.world.level.block.state.BlockState)"]('P', 
                Block.getBlock('gtceu:iv_parallel_hatch').defaultBlockState().setValue(BlockProperties.FACING, Direction.SOUTH))
            .where('f', GTMachines.FLUID_IMPORT_HATCH[5], Direction.WEST)
            .where('i', GTMachines.ITEM_IMPORT_BUS[5], Direction.EAST)
            .where('F', GTMachines.FLUID_EXPORT_HATCH[5], Direction.SOUTH)
            .where('I', GTMachines.ITEM_EXPORT_BUS[5], Direction.SOUTH)
        .build())
        .workableCasingRenderer(
            "gtceu:block/casings/solid/machine_casing_inert_ptfe",
            "gtceu:block/multiblock/large_chemical_reactor",
            false
        )

    event.create("gas_centrifuge", "simple", 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)
        .rotationState(RotationState.NON_Y_AXIS)
        ['recipeType(com.gregtechceu.gtceu.api.recipe.GTRecipeType,boolean,boolean)']("gas_centrifuge", true, true)
        .tankScalingFunction(tier => tier * 3200)
        .workableTieredHullRenderer(GTCEu.id("block/machines/gas_centrifuge"))

    event.create("plasma_centrifuge", "simple", 7, 8, 9, 10, 11, 12, 13)
        .rotationState(RotationState.NON_Y_AXIS)
        ['recipeType(com.gregtechceu.gtceu.api.recipe.GTRecipeType,boolean,boolean)']("plasma_centrifuge", true, true)
        .tankScalingFunction(tier => tier * 3200)
        .workableTieredHullRenderer(GTCEu.id("block/machines/plasma_centrifuge"))
    
    event.create("chemical_vapor_depositor", "simple", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)
        .rotationState(RotationState.NON_Y_AXIS)
        ['recipeType(com.gregtechceu.gtceu.api.recipe.GTRecipeType,boolean,boolean)']("chemical_vapor_deposition", true, true)
        .tankScalingFunction(tier => tier * 4800)
        .workableTieredHullRenderer(GTCEu.id("block/machines/chemical_vapor_depositor"))
}