/**
 * Multiblock Registry.
 * This is the place custom multiblock recipes (Like Discharging) are defined.
 * It is also where
 */
const Tags = Java.loadClass("dev.latvian.mods.kubejs.util.Tags")
const FusionReactorMachine = Java.loadClass("com.gregtechceu.gtceu.common.machine.multiblock.electric.FusionReactorMachine")
const CoilWorkableElectricMultiblockMachine = Java.loadClass("com.gregtechceu.gtceu.api.machine.multiblock.CoilWorkableElectricMultiblockMachine")

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

    // Normal mode-exclusive Multis
    if (doHNN) {
        // Simulation Supercomputer
        event.create("simulation_supercomputer")
            .category("multiblock")
            .setEUIO("in")
            .setMaxIOSize(2, 2, 0, 0)
            .setSlotOverlay(false, false, GuiTextures.SOLIDIFIER_OVERLAY)
            .setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, FillDirection.LEFT_TO_RIGHT)
            .setSound(GTSoundEntries.COMPUTATION)
            .setSound(GTSoundEntries.ASSEMBLER)

        // Loot Superfabricator
        event.create("loot_superfabricator")
            .category("multiblock")
            .setEUIO("in")
            .setMaxIOSize(2, 1, 0, 0)
            .setSlotOverlay(false, false, GuiTextures.SOLIDIFIER_OVERLAY)
            .setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, FillDirection.LEFT_TO_RIGHT)
            .setSound(GTSoundEntries.COMPUTATION)
    }


    // Hard mode-exclusive Multis

    // Actualization Chamber
    event.create("actualization_chamber")
        .category("multiblock")
        .setEUIO("in")
        .setMaxIOSize(2, 20, 0, 0)
        .setSlotOverlay(false, false, GuiTextures.SOLIDIFIER_OVERLAY)
        .setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, FillDirection.LEFT_TO_RIGHT)
        .setSound(GTSoundEntries.COOLING)

    // Universal Crystallizer
    event.create("universal_crystallizer")
        .category("multiblock")
        .setEUIO("in")
        .setMaxIOSize(9, 1, 1, 0)
        .setSlotOverlay(false, false, GuiTextures.SOLIDIFIER_OVERLAY)
        .setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, FillDirection.LEFT_TO_RIGHT)
        .setSound(GTSoundEntries.COMPUTATION)


    // Microverse Projector Recipe Type
    event.create("microverse")
        .category("multiblock")
        .setEUIO("in")
        .setMaxIOSize(9, 9, 3, 0)
        .setSlotOverlay(false, false, GuiTextures.SOLIDIFIER_OVERLAY)
        .setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, FillDirection.LEFT_TO_RIGHT)
        .setSound(GTSoundEntries.COOLING);

    // Naquadah Reactor I Recipe type
    event.create("naquadah_reactor")
        .category("multiblock")
        .setEUIO("out")
        .setMaxIOSize(1, 1, 0, 0)
        .setSlotOverlay(false, false, GuiTextures.SOLIDIFIER_OVERLAY)
        .setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, FillDirection.LEFT_TO_RIGHT)
        .setSound(GTSoundEntries.ARC);

    // Large Naquadah Reactor Recipe Type
    event.create("large_naquadah_reactor")
        .category("multiblock")
        .setEUIO("out")
        .setMaxIOSize(1, 1, 2, 2)
        .setSlotOverlay(false, false, GuiTextures.SOLIDIFIER_OVERLAY)
        .setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, FillDirection.LEFT_TO_RIGHT)
        .setSound(GTSoundEntries.ARC)

    // Naquadah Fuel Refinery
    event.create("naquadah_refinery")
        .category("multiblock")
        .setEUIO("in")
        .setMaxIOSize(6,0,4,1)
        .setSlotOverlay(false, false, GuiTextures.SOLIDIFIER_OVERLAY)
        .setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, FillDirection.LEFT_TO_RIGHT)
        .setSound(GTSoundEntries.COOLING)

    // Greenhouse
    event.create("greenhouse")
        .category("multiblock")
        .setEUIO("in")
        .setMaxIOSize(3, 6, 1, 0)
        .setSlotOverlay(false, false, GuiTextures.SOLIDIFIER_OVERLAY)
        .setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, FillDirection.LEFT_TO_RIGHT)
        .setSound(GTSoundEntries.TURBINE)

    // Subatomic Digital Assembler
    event.create("subatomic_digital_assembly")
        .category("multiblock")
        .setEUIO("in")
        .setMaxIOSize(2, 1, 0, 0)
        .setSlotOverlay(false, false, GuiTextures.SOLIDIFIER_OVERLAY)
        .setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, FillDirection.LEFT_TO_RIGHT)
        .setSound(GTSoundEntries.COOLING)

    // Omnic Forge
    event.create("omnic_forge")
        .category("multiblock")
        .setEUIO("in")
        .setMaxIOSize(6, 1, 0, 0)
        .setSlotOverlay(false, false, GuiTextures.SOLIDIFIER_OVERLAY)
        .setProgressBar(GuiTextures.PROGRESS_BAR_CRYSTALLIZATION, FillDirection.LEFT_TO_RIGHT)
        .setSound(GTSoundEntries.ARC)

    // Quintessence Infuser
    event.create("quintessence_infuser")
        .category("multiblock")
        .setEUIO("in")
        .setMaxIOSize(2, 2, 1, 0)
        .setSlotOverlay(false, false, GuiTextures.SOLIDIFIER_OVERLAY)
        .setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, FillDirection.LEFT_TO_RIGHT)
        .setSound(GTSoundEntries.CENTRIFUGE)

    // Rock Cycle Simulator
    event.create("rock_cycle_simulator")
        .category("multiblock")
        .setEUIO("in")
        .setMaxIOSize(1, 1, 0, 0)
        .setSlotOverlay(false, false, GuiTextures.SOLIDIFIER_OVERLAY)
        .setProgressBar(GuiTextures.PROGRESS_BAR_MACERATE, FillDirection.LEFT_TO_RIGHT)
        .setSound(GTSoundEntries.MINER)

    // Discharger
    event.create("discharger")
        .category("multiblock")
        .setEUIO("in")
        .setMaxIOSize(9, 1, 0, 0)
        .setSlotOverlay(false, false, GuiTextures.SOLIDIFIER_OVERLAY)
        .setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, FillDirection.LEFT_TO_RIGHT)
        .setSound(GTSoundEntries.ELECTROLYZER)

    // Charger
    event.create("charger")
        .category("multiblock")
        .setEUIO("in")
        .setMaxIOSize(3, 1, 0, 0)
        .setSlotOverlay(false, false, GuiTextures.SOLIDIFIER_OVERLAY)
        .setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, FillDirection.LEFT_TO_RIGHT)
        .setSound(GTSoundEntries.ELECTROLYZER)
})

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

    // EMI displays microverse projector tier
    GTRecipeTypes.get("microverse").addDataInfo((data) => ("Projector Tier: " + data.getByte("projector_tier")));   // todo: get Text.translatable to work

    // Normal mode-exclusive multis
    if (doHNN) {

        // Simulation Supercomputer
        event.create("simulation_supercomputer", "multiblock")
            .rotationState(RotationState.NON_Y_AXIS)
            .recipeTypes("simulation_supercomputer")
            .recipeModifiers([GTRecipeModifiers.PARALLEL_HATCH, GTRecipeModifiers.OC_NON_PERFECT])
            .appearanceBlock(GCYMBlocks.CASING_ATOMIC)
            .pattern(definition => FactoryBlockPattern.start()
                .aisle("CCCCC", "VEEEV", "VEEEV", "VEEEV", "CCCCC")
                .aisle("CCCCC", "QOOOQ", "VOOOV", "QOOOQ", "CCCCC")
                .aisle("CCCCC", "QOOOQ", "VO OV", "QOOOQ", "CCCCC")
                .aisle("CCCCC", "QOOOQ", "VOOOV", "QOOOQ", "CCCCC")
                .aisle("CC@CC", "VEQEV", "VQQQV", "VEQEV", "CCCCC")
                .where("@", Predicates.controller(Predicates.blocks(definition.get())))
                .where("V", Predicates.blocks(GCYMBlocks.CASING_VIBRATION_SAFE.get()))
                .where("E", Predicates.blocks("gtceu:enderium_block"))
                .where("O", Predicates.blocks("gtceu:omnium_block"))
                .where("Q", Predicates.blocks("ae2:quartz_vibrant_glass"))
                .where("G", Predicates.blocks(GTBlocks.CASING_TEMPERED_GLASS.get()))
                .where("C", Predicates.blocks(GCYMBlocks.CASING_ATOMIC.get()).setMinGlobalLimited(40)
                    .or(Predicates.autoAbilities(definition.getRecipeTypes()))
                    .or(Predicates.abilities(PartAbility.PARALLEL_HATCH).setMaxGlobalLimited(1))
                    .or(Predicates.abilities(PartAbility.MAINTENANCE).setExactLimit(1)))
                .where(" ", Predicates.air())
                .build())
            .workableCasingRenderer("gtceu:block/casings/gcym/atomic_casing",
                "gtceu:block/multiblock/fusion_reactor", false)

        // Loot Superfabricator
        event.create("loot_superfabricator", "multiblock")
            .rotationState(RotationState.NON_Y_AXIS)
            .recipeTypes("loot_superfabricator")
            .recipeModifiers([GTRecipeModifiers.PARALLEL_HATCH, GTRecipeModifiers.OC_NON_PERFECT])
            .appearanceBlock(GCYMBlocks.CASING_ATOMIC)
            .pattern(definition => FactoryBlockPattern.start()
                .aisle("CCCCC", "VEEEV", "VEEEV", "VEEEV", "CCCCC")
                .aisle("CCCCC", "QOOOQ", "VOOOV", "QOOOQ", "CCCCC")
                .aisle("CCCCC", "QOOOQ", "VO OV", "QOOOQ", "CCCCC")
                .aisle("CCCCC", "QOOOQ", "VOOOV", "QOOOQ", "CCCCC")
                .aisle("CC@CC", "VEQEV", "VQQQV", "VEQEV", "CCCCC")
                .where("@", Predicates.controller(Predicates.blocks(definition.get())))
                .where("V", Predicates.blocks(GCYMBlocks.CASING_SHOCK_PROOF.get()))
                .where("E", Predicates.blocks("gtceu:energetic_alloy_block"))
                .where("O", Predicates.blocks("gtceu:omnium_block"))
                .where("Q", Predicates.blocks("ae2:quartz_vibrant_glass"))
                .where("G", Predicates.blocks(GTBlocks.CASING_TEMPERED_GLASS.get()))
                .where("C", Predicates.blocks(GCYMBlocks.CASING_ATOMIC.get()).setMinGlobalLimited(40)
                    .or(Predicates.autoAbilities(definition.getRecipeTypes()))
                    .or(Predicates.abilities(PartAbility.PARALLEL_HATCH).setMaxGlobalLimited(1))
                    .or(Predicates.abilities(PartAbility.MAINTENANCE).setExactLimit(1)))
                .where(" ", Predicates.air())
                .build())
            .workableCasingRenderer("gtceu:block/casings/gcym/atomic_casing",
                "gtceu:block/multiblock/fusion_reactor", false)
    }

    // Universal Crystallizer
    event.create("universal_crystallizer", "multiblock")
        .rotationState(RotationState.NON_Y_AXIS)
        .recipeTypes("universal_crystallizer")
        .recipeModifiers([GTRecipeModifiers.PARALLEL_HATCH, GTRecipeModifiers.OC_NON_PERFECT])
        .appearanceBlock(GCYMBlocks.CASING_LASER_SAFE_ENGRAVING)
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("XXXXXXX", "XGGGGGX", "XGGGGGX", "XGGGGGX", "XGGGGGX", "XGGGGGX", "XXXXXXX")
            .aisle("XXXXXXX", "G     G", "G     G", "F     F", "G     G", "G     G", "XGGGGGX")
            .aisle("XXXXXXX", "G CCC G", "F C C F", "FTC CTF", "F C C F", "G CCC G", "XGGGGGX")
            .aisle("XXXXXXX", "F CCC F", "FT   TF", "FTBRBTF", "FT   TF", "F CCC F", "XGGGGGX")
            .aisle("XXXXXXX", "G CCC G", "F C C F", "FTC CTF", "F C C F", "G CCC G", "XGGGGGX")
            .aisle("XXXXXXX", "G     G", "G     G", "F     F", "G     G", "G     G", "XGGGGGX")
            .aisle("XXX@XXX", "XGGGGGX", "XGGGGGX", "XGGGGGX", "XGGGGGX", "XGGGGGX", "XXXXXXX")
            .where("@", Predicates.controller(Predicates.blocks(definition.get())))
            .where("X", Predicates.blocks(GCYMBlocks.CASING_LASER_SAFE_ENGRAVING.get()).setMinGlobalLimited(80)
                .or(Predicates.autoAbilities(definition.getRecipeTypes()))
                .or(Predicates.abilities(PartAbility.MAINTENANCE).setExactLimit(1))
                .or(Predicates.abilities(PartAbility.PARALLEL_HATCH).setMaxGlobalLimited(1)))
            .where("C", Predicates.blocks(GTBlocks.FUSION_COIL.get()))
            .where("F", Predicates.frames((doHarderProcessing ? GTMaterials.Berkelium : GTMaterials.Neutronium)))
            .where("G", Predicates.blocks(GTBlocks.FUSION_GLASS.get()))
            .where("T", Predicates.blocks((doStoneline ? "gtceu:taranium_block" : "gtceu:actinium_block")))
            .where("B", Predicates.blocks("kubejs:omnic_matrix_machine_casing"))
            .where("R", Predicates.blocks("kubejs:enderium_micro_miner_core"))
            .where(" ", Predicates.air())
            .build())
        .workableCasingRenderer("gtceu:block/casings/gcym/laser_safe_engraving_casing",
            "gtceu:block/multiblock/gcym/large_autoclave", false)

    // Helical Fusion Reactor
    event.create("helical_fusion_reactor", "multiblock")
        .machine((holder) => new FusionReactorMachine(holder, GTValues.UEV))
        .rotationState(RotationState.ALL)
        .recipeTypes(GTRecipeTypes.FUSION_RECIPES)
        .recipeModifiers([GTRecipeModifiers.PARALLEL_HATCH, MachineModifiers.FUSION_REACTOR])
        .appearanceBlock(GCYMBlocks.CASING_ATOMIC)
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("#######################", "#######################", "#######################", "###F##F#N#####N#F##F###", "###FNNFNN#####NNFNNF###", "###F##F#N#####N#F##F###", "#######################", "#######################", "#######################")
            .aisle("#######################", "###F##F###NNN###F##F###", "###F##F##N###N##F##F###", "###ECCBC#######CBCCE###", "###BBBBC#######CBBBB###", "###ECCBC#######CBCCE###", "###F##F##N###N##F##F###", "###F##F###NNN###F##F###", "#######################")
            .aisle("#######################", "###F##F##N###N##F##F###", "##DDDDDDD#####DDDDDDD##", "#CDTTTTTDCCCCCDTTTTTDC#", "#CDTTTTTDCGGGCDTTTTTDC#", "#CDTTTTTDCCCCCDTTTTTDC#", "##DDDDDDD#####DDDDDDD##", "###F##F##N###N##F##F###", "#######################")
            .aisle("###F##F#N#####N#F##F###", "###ECCBC#######CBCCE###", "#CDTTTTTDCCCCCDTTTTTDC#", "C                     C", "C                     C", "C                     C", "#CDTTTTTDCCCCCDTTTTTDC#", "###ECCBC#######CBCCE###", "###F##F#N#####N#F##F###")
            .aisle("###FNNFNN#####NNFNNF###", "###BBBBC#######CBBBB###", "#CDTTTTTDCGGGCDTTTTTDC#", "C                     C", "G                     G", "C                     C", "#CDTTTTTDCGGGCDTTTTTDC#", "###BBBBC#######CBBBB###", "###FNNFNN#####NNFNNF###")
            .aisle("###F##F#N#####N#F##F###", "###ECCBC#######CBCCE###", "#CDTTTTTDCCCCCDTTTTTDC#", "C                     C", "C                     C", "C                     C", "#CDTTTTTDCCCCCDTTTTTDC#", "###ECCBC#######CBCCE###", "###F##F#N#####N#F##F###")
            .aisle("#######################", "###F##F##N###N##F##F###", "##DDDDDDD#####DDDDDDD##", "#CDTTTTTDCC@CCDTTTTTDC#", "#CDTTTTTDCGGGCDTTTTTDC#", "#CDTTTTTDCCCCCDTTTTTDC#", "##DDDDDDD#####DDDDDDD##", "###F##F##N###N##F##F###", "#######################")
            .aisle("#######################", "###F##F###NNN###F##F###", "###F##F##N###N##F##F###", "###ECCBC#######CBCCE###", "###BBBBC#######CBBBB###", "###ECCBC#######CBCCE###", "###F##F##N###N##F##F###", "###F##F###NNN###F##F###", "#######################")
            .aisle("#######################", "#######################", "#######################", "###F##F#N#####N#F##F###", "###FNNFNN#####NNFNNF###", "###F##F#N#####N#F##F###", "#######################", "#######################", "#######################")
            .where("@", Predicates.controller(Predicates.blocks(definition.get())))
            .where("B", Predicates.blocks(GCYMBlocks.CASING_ATOMIC.get()))
            .where("G", Predicates.blocks(GTBlocks.FUSION_GLASS.get())
                .or(Predicates.blocks(GCYMBlocks.CASING_ATOMIC.get())))
            .where("E", Predicates.abilities(PartAbility.INPUT_ENERGY)
                .setMinGlobalLimited(1)
                .setMaxGlobalLimited(16)
                .setPreviewCount(16)
                .or(Predicates.blocks(GCYMBlocks.CASING_ATOMIC.get())))
            .where("C", Predicates.blocks(GCYMBlocks.CASING_ATOMIC.get()).setMinGlobalLimited(130)
                .or(Predicates.abilities(PartAbility.IMPORT_FLUIDS).setMinGlobalLimited(2))
                .or(Predicates.abilities(PartAbility.EXPORT_FLUIDS).setMinGlobalLimited(1))
                .or(Predicates.abilities(PartAbility.MAINTENANCE).setExactLimit(1))
                .or(Predicates.abilities(PartAbility.PARALLEL_HATCH).setMaxGlobalLimited(1)))
            .where("D", Predicates.blocks("kubejs:bioalloy_fusion_casing"))
            .where("F", Predicates.blocks("kubejs:omnic_matrix_coil_block"))
            .where("T", Predicates.blocks(GTBlocks.COIL_TRITANIUM.get()))
            .where("N", Predicates.frames(GTMaterials.get("activated_netherite")))
            .where(" ", Predicates.air())
            .where("#", Predicates.any())
            .build())
        .workableCasingRenderer("gtceu:block/casings/gcym/atomic_casing",
            "gtceu:block/multiblock/fusion_reactor", false)

    // Greenhouse
    event.create("greenhouse", "multiblock")
        .rotationState(RotationState.NON_Y_AXIS)
        .recipeTypes("greenhouse")
        .appearanceBlock(GTBlocks.CASING_STEEL_SOLID)
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("SSSSS", "UDDDU", "UDDDU", "UUGUU", "#UUU#")
            .aisle("SFFFS", "D###D", "D###D", "GO#OG", "#GEG#")
            .aisle("SFFFS", "D###D", "D###D", "GO#OG", "#GEG#")
            .aisle("SFFFS", "D###D", "D###D", "GO#OG", "#GEG#")
            .aisle("SFFFS", "D###D", "D###D", "GO#OG", "#GEG#")
            .aisle("SFFFS", "D###D", "D###D", "GO#OG", "#GEG#")
            .aisle("SS@SS", "UDDDU", "UDDDU", "UUGUU", "#UUU#")
            .where("@", Predicates.controller(Predicates.blocks(definition.get())))
            .where("S", Predicates.blocks(GTBlocks.CASING_STEEL_SOLID.get()).setMinGlobalLimited(8)
                .or(Predicates.autoAbilities(definition.getRecipeTypes())))
            .where("U", Predicates.blocks(GTBlocks.CASING_STEEL_SOLID.get()))
            .where("G", Predicates.blocks(GTBlocks.CASING_TEMPERED_GLASS.get()))
            .where("D", Predicates.blocks(GTBlocks.CASING_TEMPERED_GLASS.get())
                .or(Predicates.blockTag(Tags.block("minecraft:doors")).setMaxGlobalLimited(4)))
            .where("O", Predicates.blocks(GTBlocks.CASING_TEMPERED_GLASS.get())
                .or(Predicates.any()))
            .where("F", Predicates.blockTag(Tags.block("minecraft:dirt"))
                .or(Predicates.blocks("minecraft:farmland"))
                .or(Predicates.fluids("minecraft:water")))
            .where("E", Predicates.blocks(GTBlocks.CASING_TEMPERED_GLASS.get())
                .or(Predicates.blocks(GTBlocks.CASING_STEEL_SOLID.get()))
                .or(Predicates.blocks("minecraft:redstone_lamp")))
            .where("#", Predicates.any())
            .build())
        .workableCasingRenderer("gtceu:block/casings/solid/machine_casing_solid_steel",
            "gtceu:block/multiblock/implosion_compressor", false)

    // Rock Cycle Simulator
    event.create("rock_cycle_simulator", "multiblock")
        .rotationState(RotationState.NON_Y_AXIS)
        .recipeTypes("rock_cycle_simulator")
        .recipeModifiers([GTRecipeModifiers.PARALLEL_HATCH, GTRecipeModifiers.OC_NON_PERFECT])
        .appearanceBlock(GCYMBlocks.CASING_HIGH_TEMPERATURE_SMELTING)
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC")
            .aisle("CCCCCCC", "TMMOIIT", "TMCCCIT", "CCCCCCC")
            .aisle("CCC@CCC", "CTTTTTC", "CTCCCTC", "CCCCCCC")
            .where("@", Predicates.controller(Predicates.blocks(definition.get())))
            .where("I", Predicates.blocks("minecraft:blue_ice"))
            .where("M", Predicates.blocks("minecraft:magma_block"))
            .where("O", Predicates.blocks(GTBlocks.CASING_TITANIUM_PIPE.get()))
            .where("T", Predicates.blocks(GTBlocks.CASING_TEMPERED_GLASS.get()))
            .where("C", Predicates.blocks(GCYMBlocks.CASING_HIGH_TEMPERATURE_SMELTING.get()).setMinGlobalLimited(20)
                .or(Predicates.autoAbilities(definition.getRecipeTypes()))
                .or(Predicates.abilities(PartAbility.PARALLEL_HATCH).setMaxGlobalLimited(1))
                .or(Predicates.abilities(PartAbility.MAINTENANCE).setExactLimit(1))
            )
            .where("#", Predicates.any())
            .build())
        .workableCasingRenderer("gtceu:block/casings/gcym/high_temperature_smelting_casing",
            "gtceu:block/machines/rock_crusher", false)

    // Atmospheric Accumulator
    event.create("atmospheric_accumulator", "multiblock")
        .rotationState(RotationState.NON_Y_AXIS)
        .recipeTypes(GTRecipeTypes.GAS_COLLECTOR_RECIPES)
        .recipeModifiers([GTRecipeModifiers.PARALLEL_HATCH, GTRecipeModifiers.OC_NON_PERFECT])
        .appearanceBlock(GCYMBlocks.CASING_CORROSION_PROOF)
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("CCCCC", "C   C", "CCCCC", "C   C", "CCCCC", "C   C", "CCCCC")
            .aisle("CCCCC", " GIG ", "CGGGC", " GIG ", "CCCCC", " GIG ", "CIIIC")
            .aisle("CCCCC", " IOI ", "CGOGC", " IOI ", "CCOCC", " IOI ", "CIOIC")
            .aisle("CCCCC", " GIG ", "CGGGC", " GIG ", "CCCCC", " GIG ", "CIIIC")
            .aisle("CC@CC", "C   C", "CCCCC", "C   C", "CCCCC", "C   C", "CCCCC")
            .where("@", Predicates.controller(Predicates.blocks(definition.get())))
            .where("I", Predicates.blocks(GTBlocks.CASING_ENGINE_INTAKE.get()))
            .where("G", Predicates.blocks(GTBlocks.CASING_GRATE.get()))
            .where("O", Predicates.blocks(GTBlocks.CASING_TITANIUM_PIPE.get()))
            .where("C", Predicates.blocks(GCYMBlocks.CASING_CORROSION_PROOF.get()).setMinGlobalLimited(70)
                .or(Predicates.autoAbilities(definition.getRecipeTypes()))
                .or(Predicates.abilities(PartAbility.PARALLEL_HATCH).setMaxGlobalLimited(1))
                .or(Predicates.abilities(PartAbility.MAINTENANCE).setExactLimit(1))
            )
            .where(" ", Predicates.air())
            .build())
        .workableCasingRenderer("gtceu:block/casings/gcym/corrosion_proof_casing",
            "gtceu:block/machines/gas_collector", false)

    // Matter Alterator
    event.create("matter_alterator", "multiblock")
        .rotationState(RotationState.NON_Y_AXIS)
        .recipeTypes("atomic_reconstruction")
        .recipeModifiers([GTRecipeModifiers.PARALLEL_HATCH, GTRecipeModifiers.OC_NON_PERFECT])
        .appearanceBlock(GCYMBlocks.CASING_LASER_SAFE_ENGRAVING)
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("#CCC#######", "#CGC#######", "#CGC#######", "#CGC#######", "#CCC#######",)
            .aisle("CCCCC#F###F", "C   CCCCCCC", "C   CGGGGGC", "C   CCCCCCC", "CCCCC######",)
            .aisle("CCCCC######", "G CCCCCCCCC", "G F      PC", "G CCCGGGGGC", "CCCCC######",)
            .aisle("CCCCC#F###F", "C   CCCCCCC", "C   CGGGGGC", "C   CCCCCCC", "CCCCC######",)
            .aisle("#C@C#######", "#CGC#######", "#CGC#######", "#CGC#######", "#CCC#######",)
            .where("@", Predicates.controller(Predicates.blocks(definition.get())))
            .where("G", Predicates.blocks(GTBlocks.CASING_LAMINATED_GLASS.get()))
            .where("P", Predicates.blocks("gtceu:palis_block"))
            .where("F", Predicates.frames(GTMaterials.HastelloyC276))
            .where("C", Predicates.blocks(GCYMBlocks.CASING_LASER_SAFE_ENGRAVING.get()).setMinGlobalLimited(50)
                .or(Predicates.autoAbilities(definition.getRecipeTypes()))
                .or(Predicates.abilities(PartAbility.PARALLEL_HATCH).setMaxGlobalLimited(1))
                .or(Predicates.abilities(PartAbility.MAINTENANCE).setExactLimit(1))
            )
            .where(" ", Predicates.air())
            .where("#", Predicates.any())
            .build())
        .workableCasingRenderer("gtceu:block/casings/gcym/laser_safe_engraving_casing",
            "gtceu:block/machines/reconstructor", false)

    // Compression Imploder
    event.create("implosion_collider", "multiblock")
        .rotationState(RotationState.NON_Y_AXIS)
        .recipeTypes(GTRecipeTypes.IMPLOSION_RECIPES)
        .recipeModifiers([GTRecipeModifiers.PARALLEL_HATCH, GTRecipeModifiers.OC_NON_PERFECT])
        .appearanceBlock(GTBlocks.CASING_STEEL_SOLID)
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("#########", "####E####", "###EEE###", "####E####", "#########", "#########")
            .aisle("#########", "####E####", "###E2E###", "####E####", "#########", "#########")
            .aisle("###SES###", "###SES###", "##SE ES##", "###SES###", "###SES###", "#########")
            .aisle("##SSESS##", "##SOOOS##", "EEEO OEEE", "##SOOOS##", "##SSESS##", "#########")
            .aisle("##EEEEE##", "EEEOOOEEE", "E4     3E", "EEEOOOEEE", "##EEEEE##", "#########")
            .aisle("##SSESS##", "##SOOOS##", "EEEO OEEE", "##SOOOS##", "##SSESS##", "###SSS###")
            .aisle("###SES###", "##SSESS##", "##SE ES##", "##SS SS##", "###S S###", "###SMS###")
            .aisle("##F###F##", "##SSSSS##", "##SE1ES##", "###SSS###", "###SSS###", "###SSS###")
            .aisle("#########", "###SSS###", "###S@S###", "###SSS###", "#########", "#########")
            .where("@", Predicates.controller(Predicates.blocks(definition.get())))
            .where("S", Predicates.blocks(GTBlocks.CASING_STEEL_SOLID.get())
                .or(Predicates.autoAbilities(definition.getRecipeTypes()))
                .or(Predicates.abilities(PartAbility.PARALLEL_HATCH).setMaxGlobalLimited(1))
                .or(Predicates.abilities(PartAbility.MAINTENANCE).setExactLimit(1))
            )
            .where("O", Predicates.blocks("enderio:reinforced_obsidian_block"))
            .where("E", Predicates.blocks(GTBlocks.CASING_HSSE_STURDY.get()))
            .where("F", Predicates.frames(GTMaterials.BlackSteel))
            .where("M", Predicates.abilities(PartAbility.MUFFLER))
            .where("1", Predicates.blocks("minecraft:piston"))
            .where("2", Predicates.blocks("minecraft:piston"))
            .where("3", Predicates.blocks("minecraft:piston"))
            .where("4", Predicates.blocks("minecraft:piston"))
            .where(" ", Predicates.air())
            .where("#", Predicates.any())
            .build())
        .workableCasingRenderer("gtceu:block/casings/solid/machine_casing_solid_steel",
            "gtceu:block/multiblock/implosion_compressor", false)

    // Quintessence Infuser
    event.create("quintessence_infuser", "multiblock")
        .rotationState(RotationState.NON_Y_AXIS)
        .recipeTypes("quintessence_infuser")
        .recipeModifiers([GTRecipeModifiers.PARALLEL_HATCH, GTRecipeModifiers.OC_NON_PERFECT])
        .appearanceBlock(() => Block.getBlock("kubejs:dark_soularium_casing"))
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("#CCC#", "CCCCC", "HGGGH", "HGGGH", "HGGGH", "CCCCC", "#CCC#")
            .aisle("CCCCC", "COOOC", "G#O#G", "G#O#G", "G#O#G", "C#O#C", "CCCCC")
            .aisle("CCCCC", "COPOC", "GOPOG", "GOPOG", "GOPOG", "COPOC", "CCCCC")
            .aisle("CCCCC", "COOOC", "G#O#G", "G#O#G", "G#O#G", "C#O#C", "CCCCC")
            .aisle("#C@C#", "CCCCC", "HGGGH", "HGGGH", "HGGGH", "CCCCC", "#CCC#")
            .where("@", Predicates.controller(Predicates.blocks(definition.get())))
            .where("H", Predicates.blocks("enderio:ensouled_chassis"))
            .where("O", Predicates.frames(GTMaterials.Tungsten))
            .where("G", Predicates.blocks(GTBlocks.FUSION_GLASS.get()))
            .where("P", Predicates.blocks(GTBlocks.CASING_TUNGSTENSTEEL_PIPE.get()))
            .where("C", Predicates.blocks("kubejs:dark_soularium_casing").setMinGlobalLimited(40)
                .or(Predicates.autoAbilities(definition.getRecipeTypes()))
                .or(Predicates.abilities(PartAbility.PARALLEL_HATCH).setMaxGlobalLimited(1))
                .or(Predicates.abilities(PartAbility.MAINTENANCE).setExactLimit(1))
            )
            .where("#", Predicates.any())
            .build())
        .workableCasingRenderer("kubejs:block/soularium/casing",
            "gtceu:block/multiblock/implosion_compressor", false)

    // Subatomic Digital Assembler
    event.create("subatomic_digital_assembler", "multiblock")
        .rotationState(RotationState.NON_Y_AXIS)
        .recipeTypes("subatomic_digital_assembly")
        .noRecipeModifier()
        .appearanceBlock(GCYMBlocks.CASING_ATOMIC)
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("#CCCCC#", "#CCCCC#", "#CGGGC#", "#CGGGC#", "#CGGGC#", "#CGGGC#", "#CGGGC#", "#CCCCC#", "#CCCCC#")
            .aisle("CCCCCCC", "CHMMMHC", "CH   HC", "CH   HC", "CH   HC", "CH   HC", "CH   HC", "CHMMMHC", "CCCCCCC")
            .aisle("CCCCCCC", "CMXYXMC", "G XYX G", "G XYX G", "G XYX G", "G XYX G", "G XYX G", "CMXYXMC", "CCCCCCC")
            .aisle("CCCCCCC", "CMYYYMC", "G YYY G", "G YYY G", "G YYY G", "G YYY G", "G YYY G", "CMYYYMC", "CCCCCCC")
            .aisle("CCCCCCC", "CMXYXMC", "G XYX G", "G XYX G", "G XYX G", "G XYX G", "G XYX G", "CMXYXMC", "CCCCCCC")
            .aisle("CCCCCCC", "CHMMMHC", "CH   HC", "CH   HC", "CH   HC", "CH   HC", "CH   HC", "CHMMMHC", "CCCCCCC")
            .aisle("CCCCCCC", "CCCCCCC", "#CCCCC#", "#CCCCC#", "#CCCCC#", "#CCCCC#", "#CCCCC#", "CCCCCCC", "CCCCCCC")
            .aisle("CCCCCCC", "#CCCCC#", "#CCCCC#", "#CNNNC#", "###N###", "###N###", "###N###", "#CNNNC#", "CCCCCCC")
            .aisle("#CCCCC#", "##C@C##", "##CCC##", "#######", "#######", "#######", "#######", "#######", "#CCCCC#")
            .where("@", Predicates.controller(Predicates.blocks(definition.get())))
            .where("G", Predicates.blocks(GTBlocks.CLEANROOM_GLASS.get()))
            .where("H", Predicates.blocks(GTBlocks.HIGH_POWER_CASING.get()))
            .where("M", Predicates.frames(GTMaterials.get("crystal_matrix")))
            .where("N", Predicates.frames(GTMaterials.NaquadahAlloy))
            .where("X", Predicates.blocks(GTBlocks.COMPUTER_CASING.get()))
            .where("Y", Predicates.blocks(GTBlocks.ADVANCED_COMPUTER_CASING.get()))
            .where("C", Predicates.blocks(GCYMBlocks.CASING_ATOMIC.get()).setMinGlobalLimited(220)
                .or(Predicates.autoAbilities(definition.getRecipeTypes()))
                .or(Predicates.abilities(PartAbility.COMPUTATION_DATA_RECEPTION).setExactLimit(1))
            )
            .where(" ", Predicates.air())
            .where("#", Predicates.any())
            .build())
        .workableCasingRenderer("gtceu:block/casings/gcym/atomic_casing",
            "gtceu:block/multiblock/fusion_reactor", false)

    // Discharger
    event.create("discharger", "multiblock")
        .rotationState(RotationState.NON_Y_AXIS)
        .recipeTypes("discharger")
        .appearanceBlock(() => Block.getBlock("kubejs:cryolobus_casing"))
        .generator(true)
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("#CCCCC#", "#######", "#######", "#######", "#######", "#######", "#CCCCC#")
            .aisle("CCCCCCC", "#NGGGN#", "#NGGGN#", "#NNNNN#", "#NGGGN#", "#NGGGN#", "CCCCCCC")
            .aisle("CCCCCCC", "#G   G#", "#G   G#", "#NE EN#", "#G   G#", "#G   G#", "CCCCCCC")
            .aisle("CCCCCCC", "#G   G#", "#G   G#", "#N   N#", "#G   G#", "#G   G#", "CCCCCCC")
            .aisle("CCCCCCC", "#G   G#", "#G   G#", "#NE EN#", "#G   G#", "#G   G#", "CCCCCCC")
            .aisle("CCCCCCC", "#NGGGN#", "#NGGGN#", "#NNNNN#", "#NGGGN#", "#NGGGN#", "CCCCCCC")
            .aisle("#CC@CC#", "#######", "#######", "#######", "#######", "#######", "#CCCCC#")


            .where("@", Predicates.controller(Predicates.blocks(definition.get())))
            .where("C", Predicates.blocks("kubejs:cryolobus_casing").setMinGlobalLimited(85)
                .or(Predicates.autoAbilities(definition.getRecipeTypes()))
                .or(Predicates.abilities(PartAbility.MAINTENANCE).setExactLimit(1))
            )
            .where("c", Predicates.blocks("kubejs:cryolobus_casing"))
            .where("N", Predicates.blocks(GCYMBlocks.CASING_NONCONDUCTING.get()))
            .where("G", Predicates.blocks(GTBlocks.CASING_LAMINATED_GLASS.get()))
            .where("S", Predicates.blocks("minecraft:sculk"))
            .where("T", Predicates.blocks("minecraft:sculk_catalyst"))
            .where("L", Predicates.blocks("gtceu:black_lamp"))
            .where("E", Predicates.blocks(GCYMBlocks.ELECTROLYTIC_CELL.get()))
            .where(" ", Predicates.air())
            .where("#", Predicates.any())
            .build())
        .workableCasingRenderer("kubejs:block/cryolobus/cryolobus_casing",
            "gtceu:block/machines/electrolyzer", false)

    let getMicroverseRecipeModifiers = tier => [
        GTRecipeModifiers.OC_NON_PERFECT,
        (machine, recipe) => recipe.data.getLong("projector_tier") > tier ?
            ModifierFunction.NULL : ModifierFunction.IDENTITY
    ]

    // Basic Microverse Projector
    event.create("basic_microverse_projector", "multiblock")
        .rotationState(RotationState.NON_Y_AXIS)
        .recipeTypes("microverse")
        .recipeModifiers(getMicroverseRecipeModifiers(1))
        .appearanceBlock(() => Block.getBlock("kubejs:microverse_casing"))
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("CCC", "CVC", "CCC")
            .aisle("CCC", "GDG", "CCC")
            .aisle("C@C", "CGC", "CCC")
            .where("@", Predicates.controller(Predicates.blocks(definition.get())))
            .where("D", Predicates.blocks("kubejs:starry_diamond_block"))
            .where("C", Predicates.blocks("kubejs:microverse_casing").setMinGlobalLimited(12)
                .or(Predicates.autoAbilities(definition.getRecipeTypes())))
            .where("G", Predicates.blocks(GTBlocks.CASING_TEMPERED_GLASS.get()))
            .where("V", Predicates.blocks(GTBlocks.CASING_GRATE.get()))
            .build())
        .workableCasingRenderer("kubejs:block/microverse/casing",
            "gtceu:block/multiblock/implosion_compressor", false)

    // Advanced Microverse Projector
    event.create("advanced_microverse_projector", "multiblock")
        .rotationState(RotationState.NON_Y_AXIS)
        .recipeTypes("microverse")
        .recipeModifiers(getMicroverseRecipeModifiers(2))
        .appearanceBlock(() => Block.getBlock("kubejs:microverse_casing"))
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("CCCCC", "CGGGC", "CGGGC", "CGGGC", "CCCCC")
            .aisle("CVCVC", "GDDDG", "GDDDG", "GDDDG", "CVCVC")
            .aisle("CCCCC", "GDDDG", "GD DG", "GDDDG", "CCCCC")
            .aisle("CVCVC", "GDDDG", "GDDDG", "GDDDG", "CVCVC")
            .aisle("CC@CC", "CGGGC", "CGGGC", "CGGGC", "CCCCC")
            .where("@", Predicates.controller(Predicates.blocks(definition.get())))
            .where("D", Predicates.blocks("kubejs:starry_diamond_block"))
            .where("C", Predicates.blocks("kubejs:microverse_casing").setMinGlobalLimited(48)
                .or(Predicates.autoAbilities(definition.getRecipeTypes())))
            .where("G", Predicates.blocks(GTBlocks.CASING_TEMPERED_GLASS.get()))
            .where("V", Predicates.blocks(GTBlocks.CASING_GRATE.get()))
            .where(" ", Predicates.air())
            .build())
        .workableCasingRenderer("kubejs:block/microverse/casing",
            "gtceu:block/multiblock/implosion_compressor", false)

    // Advanced Microverse Projector II
    event.create("advanced_microverse_projector_ii", "multiblock")
        .rotationState(RotationState.NON_Y_AXIS)
        .recipeTypes("microverse")
        .recipeModifiers(getMicroverseRecipeModifiers(3))
        .appearanceBlock(() => Block.getBlock("kubejs:microverse_casing"))
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("#########", "#########", "##CCCCC##", "##CVCVC##", "##CCCCC##", "##CVCVC##", "##CCCCC##", "#########", "#########")
            .aisle("#########", "##CGGGC##", "#CDDDDDC#", "#CDDDDDC#", "#CDDDDDC#", "#CDDDDDC#", "#CDDDDDC#", "##CGGGC##", "#########")
            .aisle("##CCCCC##", "#CDDDDDC#", "CDDDDDDDC", "CDDDDDDDC", "CDDDDDDDC", "CDDDDDDDC", "CDDDDDDDC", "#CDDDDDC#", "##CCCCC##")
            .aisle("##CGGGC##", "#GDDDDDG#", "CDDDDDDDC", "GDD   DDG", "GDD   DDG", "GDD   DDG", "CDDDDDDDC", "#GDDDDDG#", "##CGGGC##")
            .aisle("##CGGGC##", "#GDDDDDG#", "CDDDDDDDC", "GDD   DDG", "GDD   DDG", "GDD   DDG", "CDDDDDDDC", "#GDDDDDG#", "##CGGGC##")
            .aisle("##CGGGC##", "#GDDDDDG#", "CDDDDDDDC", "GDD   DDG", "GDD   DDG", "GDD   DDG", "CDDDDDDDC", "#GDDDDDG#", "##CGGGC##")
            .aisle("##CCCCC##", "#CDDDDDC#", "CDDDDDDDC", "CDDDDDDDC", "CDDDDDDDC", "CDDDDDDDC", "CDDDDDDDC", "#CDDDDDC#", "##CCCCC##")
            .aisle("#########", "##CGGGC##", "#CDDDDDC#", "#CDDDDDC#", "#CDDDDDC#", "#CDDDDDC#", "#CDDDDDC#", "##CGGGC##", "#########")
            .aisle("#########", "#########", "##CC@CC##", "##CGGGC##", "##CGGGC##", "##CGGGC##", "##CCCCC##", "#########", "#########")
            .where("@", Predicates.controller(Predicates.blocks(definition.get())))
            .where("D", Predicates.blocks("kubejs:starry_diamond_block"))
            .where("C", Predicates.blocks("kubejs:microverse_casing").setMinGlobalLimited(128)
                .or(Predicates.autoAbilities(definition.getRecipeTypes())))
            .where("G", Predicates.blocks(GTBlocks.CASING_TEMPERED_GLASS.get()))
            .where("V", Predicates.blocks(GTBlocks.CASING_TITANIUM_PIPE.get()))
            .where(" ", Predicates.air())
            .where("#", Predicates.any())
            .build())
        .workableCasingRenderer("kubejs:block/microverse/casing",
            "gtceu:block/multiblock/implosion_compressor", false)

    // Microverse Projector III (Hyperbolic Microverse Projector)
    event.create("hyperbolic_microverse_projector", "multiblock")
        .rotationState(RotationState.NON_Y_AXIS)
        .recipeTypes("microverse")
        .recipeModifiers(
            [GTRecipeModifiers.PARALLEL_HATCH]
                .concat(getMicroverseRecipeModifiers(4))
        )
        .appearanceBlock(() => Block.getBlock("kubejs:microverse_casing"))
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("###CCCCC###", "###N###N###", "###N###N###", "###N###N###", "###N###N###", "###N###N###", "###N###N###", "###N###N###", "###N###N###", "###N###N###", "###CCCCC###")
            .aisle("#CCCCVCCCC#", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#CCCCVCCCC#")
            .aisle("#CVCCCCCVC#", "###CGGGC###", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###CGGGC###", "#CVCCCCCVC#")
            .aisle("CCCCCCCCCCC", "N#CCDDDCC#N", "N##CGGGC##N", "N#########N", "N#########N", "N#########N", "N#########N", "N#########N", "N##CGGGC##N", "N#CCDDDCC#N", "CCCCCCCCCCC")
            .aisle("CCCCCCCCCCC", "##GDDDDDG##", "###GYDYG###", "####YGY####", "####YGY####", "####YGY####", "####YGY####", "####YGY####", "###GYDYG###", "##GDDDDDG##", "CCCCCCCCCCC")
            .aisle("CVCCCWCCCVC", "##GDDDDDG##", "###GDDDG###", "####GDG####", "####GDG####", "####GDG####", "####GDG####", "####GDG####", "###GDDDG###", "##GDDDDDG##", "CVCCCWCCCVC")
            .aisle("CCCCCCCCCCC", "##GDDDDDG##", "###GYDYG###", "####YGY####", "####YGY####", "####YGY####", "####YGY####", "####YGY####", "###GYDYG###", "##GDDDDDG##", "CCCCCCCCCCC")
            .aisle("CCCCCCCCCCC", "N#CCDDDCC#N", "N##CGGGC##N", "N#########N", "N#########N", "N#########N", "N#########N", "N#########N", "N##CGGGC##N", "N#CCDDDCC#N", "CCCCCCCCCCC")
            .aisle("#CVCCCCCVC#", "###CGGGC###", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###CGGGC###", "#CVCCCCCVC#")
            .aisle("#CCCCVCCCC#", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#CCCCVCCCC#")
            .aisle("###CC@CC###", "###N###N###", "###N###N###", "###N###N###", "###N###N###", "###N###N###", "###N###N###", "###N###N###", "###N###N###", "###N###N###", "###CCCCC###")
            .where("@", Predicates.controller(Predicates.blocks(definition.get())))
            .where("D", Predicates.blocks("kubejs:starry_diamond_block"))
            .where("C", Predicates.blocks("kubejs:microverse_casing").setMinGlobalLimited(200)
                .or(Predicates.autoAbilities(definition.getRecipeTypes()))
                .or(Predicates.abilities(PartAbility.PARALLEL_HATCH).setMaxGlobalLimited(1))
            )
            .where("G", Predicates.blocks(GTBlocks.FUSION_GLASS.get()))
            .where("N", Predicates.frames(GTMaterials.get("sculk_bioalloy")))
            .where("V", Predicates.blocks("ae2:quartz_vibrant_glass"))
            .where("W", Predicates.blocks("kubejs:universal_warp_core"))
            .where("Y", Predicates.blocks("kubejs:dimensional_stabilization_netherite_casing"))
            .where("#", Predicates.any())
            .build())
        .workableCasingRenderer("kubejs:block/microverse/casing",
            "gtceu:block/multiblock/implosion_compressor", false)

    // Naquadah Reactor I
    event.create("naquadah_reactor", "multiblock")
        .rotationState(RotationState.NON_Y_AXIS)
        .recipeTypes("naquadah_reactor")
        .recipeModifiers([GTRecipeModifiers.PARALLEL_HATCH])    // Fix for generator "overclocking" as long as the actual hatch invalidates the structure
        .appearanceBlock(GCYMBlocks.CASING_REACTION_SAFE)
        .generator(true)
        .regressWhenWaiting(false)
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("CCC", "PGP", "PGP", "PGP", "PGP", "CCC")
            .aisle("CCC", "GNG", "GNG", "GNG", "GNG", "CCC")
            .aisle("C@C", "PGP", "PGP", "PGP", "PGP", "CCC")
            .where("@", Predicates.controller(Predicates.blocks(definition.get())))
            .where("G", Predicates.blocks(GTBlocks.FUSION_GLASS.get()))
            .where("C", Predicates.blocks(GCYMBlocks.CASING_REACTION_SAFE.get()).setMinGlobalLimited(12)
                .or(Predicates.autoAbilities(definition.getRecipeTypes())))
            .where("P", Predicates.blocks("ae2:spatial_pylon"))
            .where("N", Predicates.blocks("gtceu:trinium_coil_block"))
            .build())
        .workableCasingRenderer("gtceu:block/casings/gcym/reaction_safe_mixing_casing",
            "gtceu:block/multiblock/generator/large_steam_turbine", false)

    // Large Naquadah Reactor
    event.create("large_naquadah_reactor", "multiblock")
        .rotationState(RotationState.NON_Y_AXIS)
        .recipeTypes("large_naquadah_reactor")
        .recipeModifiers([GTRecipeModifiers.PARALLEL_HATCH])    // Fix for generator "overclocking" as long as the actual hatch invalidates the structure
        .regressWhenWaiting(false)
        .appearanceBlock(GCYMBlocks.CASING_ATOMIC)
        .generator(true)
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("##CCCCC##","##CGGGC##","##CCCCC##","#########","#########","#########","#########","#########","#########","#########","##CCCCC##")
            .aisle("#CCCCCCC#","#CC   CC#","#CCCCCCC#","#A#####A#","#A#####A#","#A#####A#","#A#####A#","#A#####A#","#A#####A#","#A#####A#","#CCCCCCC#")
            .aisle("CCCHHHCCC","CCN   NCC","CCCSSSCCC","##DGGGD##","##DGGGD##","##DGGGD##","##DGGGD##","##DGGGD##","##DGGGD##","##DGGGD##","CCCSSSCCC")
            .aisle("CCHCCCHCC","G  OOO  G","CCSOOOSCC","##GOOOG##","##GOOOG##","##GOOOG##","##GOOOG##","##GOOOG##","##GOOOG##","##GOOOG##","CCSHHHSCC")
            .aisle("CCHCCCHCC","G  OKO  G","CCSOKOSCC","##GOKOG##","##GOKOG##","##GOKOG##","##GOKOG##","##GOKOG##","##GOKOG##","##GOKOG##","CCSHHHSCC")
            .aisle("CCHCCCHCC","G  OOO  G","CCSOOOSCC","##GOOOG##","##GOOOG##","##GOOOG##","##GOOOG##","##GOOOG##","##GOOOG##","##GOOOG##","CCSHHHSCC")
            .aisle("CCCHHHCCC","CCN   NCC","CCCSSSCCC","##DGGGD##","##DGGGD##","##DGGGD##","##DGGGD##","##DGGGD##","##DGGGD##","##DGGGD##","CCCSSSCCC")
            .aisle("#CCCCCCC#","#CC   CC#","#CCCCCCC#","#A#####A#","#A#####A#","#A#####A#","#A#####A#","#A#####A#","#A#####A#","#A#####A#","#CCCCCCC#")
            .aisle("##CC@CC##","##CGGGC##","##CCCCC##","#########","#########","#########","#########","#########","#########","#########","##CCCCC##")
            .where("@", Predicates.controller(Predicates.blocks(definition.get())))
            .where("G", Predicates.blocks(GTBlocks.FUSION_GLASS.get()))
            .where("C", Predicates.blocks("gtceu:atomic_casing").setMinGlobalLimited(150)
                .or(Predicates.autoAbilities(definition.getRecipeTypes()))
                .or(Predicates.abilities(PartAbility.OUTPUT_LASER).setMaxGlobalLimited(1)))
            .where("H", Predicates.blocks("gtceu:heat_vent"))
            .where("K", Predicates.blocks("gtceu:fusion_coil"))
            .where("N", Predicates.blocks("gtceu:tungsten_frame"))
            .where("S", Predicates.blocks("ae2:spatial_pylon"))
            .where("O", Predicates.blocks("kubejs:omnic_matrix_coil_block"))
            .where("D", Predicates.blocks("gtceu:high_temperature_smelting_casing"))
            .where("A", Predicates.blocks("gtceu:naquadah_alloy_frame"))
            .where(" ", Predicates.air())
            .where("#", Predicates.any())
            .build())
        .workableCasingRenderer("gtceu:block/casings/gcym/atomic_casing",
            "gtceu:block/multiblock/generator/large_steam_turbine", false)

    // Naquadah Fuel Refinery
    if (doHarderNaqFuel) {
        event.create("naquadah_refinery", "multiblock")
            .rotationState(RotationState.NON_Y_AXIS)
            .recipeTypes("naquadah_refinery")
            .appearanceBlock(() => Block.getBlock("gtceu:stress_proof_casing"))
            .recipeModifiers([GTRecipeModifiers.ELECTRIC_OVERCLOCK.apply(OverclockingLogic.NON_PERFECT_OVERCLOCK)])
            .pattern(definition => FactoryBlockPattern.start()
                .aisle("##CCCCC##","##CCCCC##","#########","#########","#########","#########","#########","#########","#########","#########","#########")
                .aisle("#CCCCCCC#","#CC#P#CC#","####P####","####P####","###SSS###","###VVV###","###GGG###","###VVV###","###SSS###","#########","#########")
                .aisle("CCCCCCCCC","CCF###FCC","##F###F##","##FSSSF##","##S   S##","##V   V##","##G   G##","##V   V##","##S   S##","###SSS###","#########")
                .aisle("CCCCCCCCC","C##III##C","###SSS###","##SPPPS##","#S K K S#","#V K K V#","#G K K G#","#V K K V#","#S K K S#","##SPPPS##","###SSS###")
                .aisle("CCCCCCCCC","CP#III#PC","#P#SSS#P#","#PSPPPSP#","#S  E  S#","#V  E  V#","#G  E  G#","#V  E  V#","#S  E  S#","##SPPPS##","###SMS###")
                .aisle("CCCCCCCCC","C##III##C","###SSS###","##SPPPS##","#S K K S#","#V K K V#","#G K K G#","#V K K V#","#S K K S#","##SPPPS##","###SSS###")
                .aisle("CCCCCCCCC","CCF###FCC","##F###F##","##FSSSF##","##S   S##","##V   V##","##G   G##","##V   V##","##S   S##","###SSS###","#########")
                .aisle("#CCCCCCC#"," CC#P#CC ","####P####","####P####","###SSS###","###VVV###","###GGG###","###VVV###","###SSS###","#########","#########")
                .aisle("##CC@CC##","##CCCCC##","#########","#########","#########","#########","#########","#########","#########","#########","#########")
                .where("@", Predicates.controller(Predicates.blocks(definition.get())))
                .where("C", Predicates.blocks("gtceu:stress_proof_casing").setMinGlobalLimited(85)
                    .or(Predicates.autoAbilities(definition.getRecipeTypes()))
                    .or(Predicates.abilities(PartAbility.MAINTENANCE).setExactLimit(1)))
                .where("S", Predicates.blocks("gtceu:high_temperature_smelting_casing"))
                .where("I", Predicates.blocks("gtceu:extreme_engine_intake_casing"))
                .where("P", Predicates.blocks("gtceu:tungstensteel_pipe_casing"))
                .where("K", Predicates.blocks("gtceu:superconducting_coil"))
                .where("V", Predicates.blocks("gtceu:heat_vent"))
                .where("G", Predicates.blocks("gtceu:laminated_glass"))
                .where("E", Predicates.blocks("gtceu:ptfe_pipe_casing"))
                .where("F", Predicates.blocks("gtceu:tungsten_frame"))
                .where("M", Predicates.abilities(PartAbility.MUFFLER))
                .where(" ", Predicates.air())
                .where("#", Predicates.any())
                .build())
            .workableCasingRenderer("gtceu:block/casings/gcym/stress_proof_casing",
                "gtceu:block/multiblock/fusion_reactor", false)
    }

    // Omnic Forge
    event.create("omnic_forge", "multiblock")
        .rotationState(RotationState.NON_Y_AXIS)
        .recipeTypes("omnic_forge")
        .appearanceBlock(() => Block.getBlock("kubejs:omnic_matrix_machine_casing"))
        .recipeModifiers([GTRecipeModifiers.PARALLEL_HATCH, GTRecipeModifiers.OC_NON_PERFECT])
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("#########", "#########", "####O####", "###CCC###", "##OCCCO##", "###CCC###", "####O####", "#########", "#########")
            .aisle("#########", "####O####", "##GGOGG##", "##GODOG##", "#OODNDOO#", "##GODOG##", "##GGOGG##", "####O####", "#########")
            .aisle("####O####", "##GGOGG##", "#G     G#", "#G     G#", "OO  D  OO", "#G     G#", "#G     G#", "##GGOGG##", "####O####")
            .aisle("###CCC###", "##GODOG##", "#G     G#", "CO     OC", "CD  D  DC", "CO     OC", "#G     G#", "##GODOG##", "###CCC###")
            .aisle("##OCCCO##", "#OODNDOO#", "OO  D  OO", "CD  D  DC", "CNDDBDDNC", "CD  D  DC", "OO  D  OO", "#OODNDOO#", "##OCCCO##")
            .aisle("###CCC###", "##GODOG##", "#G     G#", "CO     OC", "CD  D  DC", "CO     OC", "#G     G#", "##GODOG##", "###CCC###")
            .aisle("####O####", "##GGOGG##", "#G     G#", "#G     G#", "OO  D  OO", "#G     G#", "#G     G#", "##GGOGG##", "####O####")
            .aisle("#########", "####O####", "##GGOGG##", "##GODOG##", "#OODNDOO#", "##GODOG##", "##GGOGG##", "####O####", "#########")
            .aisle("#########", "#########", "####O####", "###CCC###", "##OC@CO##", "###CCC###", "####O####", "#########", "#########")
            .where("@", Predicates.controller(Predicates.blocks(definition.get())))
            .where("B", Predicates.blocks("gtceu:crystal_matrix_block"))
            .where("N", Predicates.blocks("gtceu:sculk_superconductor_block"))
            .where("D", Predicates.frames(GTMaterials.get("cryolobus")))
            .where("G", Predicates.blocks(GTBlocks.FUSION_GLASS.get()))
            .where("O", Predicates.blocks("kubejs:omnic_matrix_machine_casing"))
            .where("C", Predicates.blocks("kubejs:omnic_matrix_machine_casing").setMinGlobalLimited(43)
                .or(Predicates.autoAbilities(definition.getRecipeTypes()))
                .or(Predicates.abilities(PartAbility.PARALLEL_HATCH).setMaxGlobalLimited(1))
            )
            .where(" ", Predicates.air())
            .where("#", Predicates.any())
            .build())
        .workableCasingRenderer(new ResourceLocation("kubejs", "block/omnium/casing"),
            "gtceu:block/machines/reconstructor", false)

    // Sculk Biocharger
    event.create("sculk_biocharger", "multiblock")
        .rotationState(RotationState.NON_Y_AXIS)
        .recipeTypes(["discharger", "charger"])
        .recipeModifiers([GTRecipeModifiers.PARALLEL_HATCH, GTRecipeModifiers.ELECTRIC_OVERCLOCK.apply(OverclockingLogic.PERFECT_OVERCLOCK)])
        .appearanceBlock(() => Block.getBlock("kubejs:bioalloy_casing"))
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("####CCC####", "####CCC####", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "####CCC####", "####CCC####")
            .aisle("##CCNNNCC##", "##CCcccCC##", "####GGG####", "####GGG####", "####GGG####", "####GGG####", "####GGG####", "####GGG####", "####GGG####", "##CCcccCC##", "##CCNNNCC##")
            .aisle("#CNNCNCNNC#", "#CNcScScNC#", "##NG c GN##", "##NG c GN##", "##NG   GN##", "##NG   GN##", "##NG   GN##", "##NG c GN##", "##NG c GN##", "#CNcScScNC#", "#CNNCNCNNC#")
            .aisle("#CNCCNCCNC#", "#CcSSSSScC#", "##G     G##", "##G     G##", "##G  E  G##", "##G     G##", "##G  E  G##", "##G     G##", "##G     G##", "#CcSSSSScC#", "#CNCCNCCNC#")
            .aisle("CNCCCNCCCNC", "CcSScNcSScC", "#G  cLc  G#", "#G       G#", "#G       G#", "#G       G#", "#G       G#", "#G       G#", "#G  cLc  G#", "CcSScNcSScC", "CNCCCNCCCNC")
            .aisle("CNNNNNNNNNC", "CccSNNNSccC", "#Gc LNL cG#", "#Gc  N  cG#", "#G E N E G#", "#G   T   G#", "#G E N E G#", "#Gc  N  cG#", "#Gc LNL cG#", "CccSNNNSccC", "CNNNNNNNNNC")
            .aisle("CNCCCNCCCNC", "CcSScNcSScC", "#G  cLc  G#", "#G       G#", "#G       G#", "#G       G#", "#G       G#", "#G       G#", "#G  cLc  G#", "CcSScNcSScC", "CNCCCNCCCNC")
            .aisle("#CNCCNCCNC#", "#CcSSSSScC#", "##G     G##", "##G     G##", "##G  E  G##", "##G     G##", "##G  E  G##", "##G     G##", "##G     G##", "#CcSSSSScC#", "#CNCCNCCNC#")
            .aisle("#CNNCNCNNC#", "#CNcScScNC#", "##NG c GN##", "##NG c GN##", "##NG   GN##", "##NG   GN##", "##NG   GN##", "##NG c GN##", "##NG c GN##", "#CNcScScNC#", "#CNNCNCNNC#")
            .aisle("##CCNNNCC##", "##CCcccCC##", "####GGG####", "####GGG####", "####GGG####", "####GGG####", "####GGG####", "####GGG####", "####GGG####", "##CCcccCC##", "##CCNNNCC##")
            .aisle("####CCC####", "####C@C####", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "####CCC####", "####CCC####")
            .where("@", Predicates.controller(Predicates.blocks(definition.get())))
            .where("C", Predicates.blocks("kubejs:bioalloy_casing").setMinGlobalLimited(150)
                .or(Predicates.autoAbilities(definition.getRecipeTypes()))
                .or(Predicates.abilities(PartAbility.MAINTENANCE).setExactLimit(1))
                .or(Predicates.abilities(PartAbility.PARALLEL_HATCH).setMaxGlobalLimited(1))
            )
            .where("c", Predicates.blocks("kubejs:bioalloy_casing"))
            .where("N", Predicates.blocks(GCYMBlocks.CASING_NONCONDUCTING.get()))
            .where("G", Predicates.blocks(GTBlocks.CASING_LAMINATED_GLASS.get()))
            .where("S", Predicates.blocks("minecraft:sculk"))
            .where("T", Predicates.blocks("minecraft:sculk_catalyst"))
            .where("L", Predicates.blocks("gtceu:black_lamp"))
            .where("E", Predicates.blocks(GCYMBlocks.ELECTROLYTIC_CELL.get()))
            .where(" ", Predicates.air())
            .where("#", Predicates.any())
            .build())
        .workableCasingRenderer("kubejs:block/bioalloy/casing",
            "gtceu:block/machines/electrolyzer", false)

    // Advanced Assembly line (Dimensional Superassembler)
    event.create("dimensional_superassembler", "multiblock")
        .rotationState(RotationState.ALL)
        .recipeTypes("assembly_line")
        .recipeModifiers([GTRecipeModifiers.PARALLEL_HATCH, GTRecipeModifiers.OC_PERFECT])
        .appearanceBlock(() => Block.getBlock("kubejs:dimensional_stabilization_netherite_casing"))
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("#########", "###CCC###", "##CCCCC##", "#CCCCCCC#", "#CCCCCCC#", "#CCCCCCC#", "##CCCCC##", "###CCC###", "#########")
            .aisle("##CCCCC##", "#CCCCCCC#", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", "#CCCCCCC#", "##CCCCC##")
            .aisle("#########", "#I#####I#", "##LLOLL##", "##GF FG##", "##GF FG##", "##RLLLR##", "##LM#ML##", "#I#####I#", "#########")
            .aisle("#########", "#I#####I#", "##LLOLL##", "##GF FG##", "##GF FG##", "##RLLLR##", "##LM#ML##", "#I#####I#", "#########")
            .aisle("#########", "#I#####I#", "##LLOLL##", "##GF FG##", "##GF FG##", "##RLLLR##", "##LM#ML##", "#I#####I#", "#########")
            .aisle("#########", "#I#####I#", "##LLOLL##", "##GF FG##", "##GF FG##", "##RLLLR##", "##LM#ML##", "#I#####I#", "#########")
            .aisle("#########", "#I#####I#", "##LLOLL##", "##GF FG##", "##GF FG##", "##RLLLR##", "##LM#ML##", "#I#####I#", "#########")
            .aisle("#########", "#I#####I#", "##LLOLL##", "##GF FG##", "##GF FG##", "##RLLLR##", "##LM#ML##", "#I#####I#", "#########")
            .aisle("#########", "#I#####I#", "##LLOLL##", "##GF FG##", "##GF FG##", "##RLLLR##", "##LM#ML##", "#I#####I#", "#########")
            .aisle("#########", "#I#####I#", "##LLOLL##", "##GF FG##", "##GF FG##", "##RLLLR##", "##LM#ML##", "#I#####I#", "#########")
            .aisle("#########", "#I#####I#", "##LLOLL##", "##GF FG##", "##GF FG##", "##RLLLR##", "##LM#ML##", "#I#####I#", "#########")
            .aisle("#########", "#I#####I#", "##LLOLL##", "##GF FG##", "##GF FG##", "##RLLLR##", "##LM#ML##", "#I#####I#", "#########")
            .aisle("#########", "#I#####I#", "##LLOLL##", "##GF FG##", "##GF FG##", "##RLLLR##", "##LM#ML##", "#I#####I#", "#########")
            .aisle("#########", "#I#####I#", "##LLOLL##", "##GF FG##", "##GF FG##", "##RLLLR##", "##LM#ML##", "#I#####I#", "#########")
            .aisle("#########", "#I#####I#", "##LLOLL##", "##GF FG##", "##GF FG##", "##RLLLR##", "##LM#ML##", "#I#####I#", "#########")
            .aisle("#########", "#I#####I#", "##LLOLL##", "##GF FG##", "##GF FG##", "##RLLLR##", "##LM#ML##", "#I#####I#", "#########")
            .aisle("#########", "#I#####I#", "##LLOLL##", "##GF FG##", "##GF FG##", "##RLLLR##", "##LM#ML##", "#I#####I#", "#########")
            .aisle("#########", "#I#####I#", "##LLOLL##", "##GF FG##", "##GF FG##", "##RLLLR##", "##LM#ML##", "#I#####I#", "#########")
            .aisle("##CCCCC##", "#CCCCCCC#", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", "#CCCCCCC#", "##CCCCC##")
            .aisle("#########", "###CCC###", "##CCCCC##", "#CCCCCCC#", "#CCC@CCC#", "#CCCCCCC#", "##CCCCC##", "###CCC###", "#########")
            .where("@", Predicates.controller(Predicates.blocks(definition.get())))
            .where("C", Predicates.blocks("kubejs:dimensional_stabilization_netherite_casing").setMinGlobalLimited(200)
                .or(Predicates.abilities(PartAbility.INPUT_ENERGY).setMaxGlobalLimited(2).setPreviewCount(1))
                .or(Predicates.abilities(PartAbility.IMPORT_ITEMS).setPreviewCount(1))
                .or(Predicates.abilities(PartAbility.EXPORT_ITEMS).setPreviewCount(1))
                .or(Predicates.abilities(PartAbility.IMPORT_FLUIDS).setPreviewCount(1))
                .or(Predicates.abilities(PartAbility.PARALLEL_HATCH).setMaxGlobalLimited(1))
                .or(Predicates.abilities(PartAbility.INPUT_LASER).setMaxGlobalLimited(1))
            )
            .where("G", Predicates.blocks(GTBlocks.FUSION_GLASS.get()))
            .where("L", Predicates.blocks(GCYMBlocks.CASING_LARGE_SCALE_ASSEMBLING.get()))
            .where("O", Predicates.blocks(GTBlocks.CASING_ASSEMBLY_LINE.get()))
            .where("F", Predicates.blocks("kubejs:bioalloy_fusion_casing"))
            .where("R", Predicates.blocks(GTBlocks.CASING_GRATE.get())
                .or(Predicates.abilities(PartAbility.DATA_ACCESS).setExactLimit(1)))
            .where("M", Predicates.blocks("kubejs:omnic_matrix_machine_casing"))
            .where("I", Predicates.frames(GTMaterials.get("eltz")))
            .where(" ", Predicates.air())
            .where("#", Predicates.any())
            .build())
        .workableCasingRenderer("kubejs:block/netherite/casing",
            "gtceu:block/multiblock/assembly_line", false)

    // MABS
    const GCYMRecipeTypes = Java.loadClass("com.gregtechceu.gtceu.common.data.GCYMRecipeTypes") // Have to load it here because ALLOY_BLAST_RECIPES is not defined outside of the event
    event.create("mega_alloy_blast_smelter", "multiblock")
        .machine((holder) => new CoilWorkableElectricMultiblockMachine(holder))
        .rotationState(RotationState.ALL)
        .recipeTypes(GCYMRecipeTypes.ALLOY_BLAST_RECIPES)
        .recipeModifiers([GTRecipeModifiers.PARALLEL_HATCH, (machine, recipe) => GTRecipeModifiers.ebfOverclock(machine, recipe)])
        .appearanceBlock(GCYMBlocks.CASING_HIGH_TEMPERATURE_SMELTING)
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("###IIIII###", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########")
            .aisle("#IIIIIIIII#", "###F###F###", "###F###F###", "###F###F###", "###FIIIF###", "###FIEIF###", "###FIIIF###", "###FFFFF###", "###########", "###########", "###########", "###########", "###########", "###########", "###IIHII###", "###########")
            .aisle("#IIIIIIIII#", "###HHHHH###", "###HVVVH###", "##FHHHHHF##", "##IICCCII##", "##IICECII##", "##IICCCII##", "##FFCCCFF##", "##F#CCC#F##", "##F#CCC#F##", "##F#VVV#F##", "##F#CCC#F##", "##F#CCC#F##", "##F#CCC#F##", "##IIIIIII##", "####IHI####")
            .aisle("IIIIIIIIIII", "#FHHHHHHHF#", "#FHHHPHHHF#", "#FHHPPPHHF#", "#FIC   CIF#", "#FIC   CIF#", "#FIC   CIF#", "#FFC   CFF#", "###C   C###", "###C   C###", "###V   V###", "###C   C###", "###C   C###", "###C   C###", "#IIIHHHIII#", "###IIHII###")
            .aisle("IIIIIIIIIII", "##HHHHHHH##", "##VHHHHHV##", "##HP   PH##", "#IC     CI#", "#IC     CI#", "#IC     CI#", "#FC  P  CF#", "##C     C##", "##C     C##", "##V     V##", "##C  P  C##", "##C     C##", "##C     C##", "#IIH   HII#", "##IIHHHII##")
            .aisle("IIIIIIIIIII", "##HHHGHHH##", "##VPHGHPV##", "##HP P PH##", "#IC  P  CI#", "#EE PPP EE#", "#IC  P  CI#", "#FC  P  CF#", "##C  P  C##", "##C PPP C##", "##V  P  V##", "##C  P  C##", "##C     C##", "##C     C##", "#HIH   HIH#", "##HHHMHHH##")
            .aisle("IIIIIIIIIII", "##HHHHHHH##", "##VHHHHHV##", "##HP   PH##", "#IC     CI#", "#IC     CI#", "#IC     CI#", "#FC  P  CF#", "##C     C##", "##C     C##", "##V     V##", "##C  P  C##", "##C     C##", "##C     C##", "#IIH   HII#", "##IIHHHII##")
            .aisle("IIIIIIIIIII", "#FHHHHHHHF#", "#FHHHPHHHF#", "#FHHPPPHHF#", "#FIC   CIF#", "#FIC   CIF#", "#FIC   CIF#", "#FFC   CFF#", "###C   C###", "###C   C###", "###V   V###", "###C   C###", "###C   C###", "###C   C###", "#IIIHHHIII#", "###IIHII###")
            .aisle("#IIIIIIIII#", "###HHHHH###", "###HH@HH###", "##FHHHHHF##", "##IICCCII##", "##IICECII##", "##IICCCII##", "##FFCCCFF##", "##F#CCC#F##", "##F#CCC#F##", "##F#VVV#F##", "##F#CCC#F##", "##F#CCC#F##", "##F#CCC#F##", "##IIIIIII##", "####IHI####")
            .aisle("#IIIIIIIII#", "###F###F###", "###F###F###", "###F###F###", "###FIIIF###", "###FIEIF###", "###FIIIF###", "###FFFFF###", "###########", "###########", "###########", "###########", "###########", "###########", "###IIHII###", "###########")
            .aisle("###IIIII###", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########")
            .where("@", Predicates.controller(Predicates.blocks(definition.get())))
            .where("H", Predicates.blocks(GCYMBlocks.CASING_HIGH_TEMPERATURE_SMELTING.get()).setMinGlobalLimited(115)
                .or(Predicates.autoAbilities(definition.getRecipeTypes()))
                .or(Predicates.abilities(PartAbility.PARALLEL_HATCH).setMaxGlobalLimited(1))
                .or(Predicates.abilities(PartAbility.MAINTENANCE).setExactLimit(1))
            )
            .where("I", Predicates.blocks(GTBlocks.CASING_INVAR_HEATPROOF.get()))
            .where("F", Predicates.frames(GTMaterials.get("cryococcus")))
            .where("V", Predicates.blocks(GCYMBlocks.HEAT_VENT.get()))
            .where("C", Predicates.heatingCoils())
            .where("M", Predicates.abilities(PartAbility.MUFFLER))
            .where("G", Predicates.blocks(GTBlocks.CASING_TUNGSTENSTEEL_GEARBOX.get()))          // Change to Naquadah Gearbox if ICE gets added
            .where("P", Predicates.blocks(GTBlocks.CASING_TUNGSTENSTEEL_PIPE.get()))      // Change to Naquadah Pipe Casing if ICE gets added
            .where("E", Predicates.blocks(GTBlocks.CASING_EXTREME_ENGINE_INTAKE.get()))   // Change to Insane Engine Intake if ICE gets added
            .where(" ", Predicates.air())
            .where("#", Predicates.any())
            .build())
        .workableCasingRenderer("gtceu:block/casings/gcym/high_temperature_smelting_casing",
            "gtceu:block/multiblock/gcym/blast_alloy_smelter", false)
})
