GTCEuStartupEvents.registry('gtceu:recipe_type', event => {
    GTRecipeTypes.register('ion_exchanger', 'multiblock')
        .setEUIO('in')
        .setMaxIOSize(6, 6, 6, 6)
        .setSlotOverlay(false, false, GuiTextures.SOLIDIFIER_OVERLAY)
        .setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, FillDirection.LEFT_TO_RIGHT)
        .setSound(GTSoundEntries.COOLING)
})

GTCEuStartupEvents.registry('gtceu:machine', event => {
    event.create('ion_exchanger', 'multiblock')
        .rotationState(RotationState.NON_Y_AXIS)
        .recipeType('ion_exchanger')
        .appearanceBlock(() => Block.getBlock('gtceu:sturdy_machine_casing'))
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("#AAAAA#", "AABBBAA", "ABBBBBA", "AABBBAA", "#AAAAA#", "#######")
            .aisle("ACDCDCA", "A#EFE#A", "B#EGE#B", "A#EFE#A", "AADADAA", "#AAHAA#")
            .aisle("ACDCDCA", "B#EFE#B", "B#EGE#B", "B#EFE#B", "AADADAA", "#AAHAA#")
            .aisle("ACDCDCA", "A#EFE#A", "B#EGE#B", "A#EFE#A", "AADADAA", "#AAHAA#")
            .aisle("#AA@AA#", "AABBBAA", "ABBBBBA", "AABBBAA", "#AAAAA#", "#######")
            .where("#", Predicates.any())
            .where("A", Predicates.blocks("gtceu:sturdy_machine_casing")
                .or(Predicates.abilities(PartAbility.MAINTENANCE).setExactLimit(1))
                .or(Predicates.abilities(PartAbility.MUFFLER).setExactLimit(1))
                .or(Predicates.autoAbilities(definition.getRecipeTypes())))
            .where("B", Predicates.blocks("gtceu:laminated_glass"))
            .where("C", Predicates.blocks("gtceu:inert_machine_casing"))
            .where("D", Predicates.blocks("kubejs:osmiridium_casing"))
            .where("E", Predicates.blocks("gtceu:ptfe_pipe_casing"))
            .where("F", Predicates.blocks("gtceu:tungsten_steel_frame"))
            .where("G", Predicates.blocks("gtceu:blue_alloy_frame"))
            .where("H", Predicates.blocks("gtceu:tungsten_frame"))
            .where("@", Predicates.controller(Predicates.blocks(definition.get())))
            .build()
        )
        .workableCasingRenderer('gtceu:block/casings/solid/machine_casing_sturdy_hsse', 'gtceu:block/multiblock/implosion_compressor', false)
})
