import crafttweaker.world.IFacing;
import crafttweaker.block.IBlock;
import crafttweaker.block.IBlockState;
import crafttweaker.item.IIngredient;
import crafttweaker.item.IItemStack;

import gregtech.multiblock.Builder;
import gregtech.multiblock.FactoryBlockPattern;
import gregtech.multiblock.IBlockMatcher;
import gregtech.multiblock.MultiblockAbility;
import gregtech.multiblock.RelativeDirection;
import gregtech.multiblock.FactoryMultiblockShapeInfo;
import gregtech.multiblock.IBlockInfo;
import gregtech.multiblock.IBlockWorldState;
import gregtech.multiblock.Multiblock;

import gregtech.MetaTileEntities;

import gregtech.recipe.FactoryRecipeMap;

import gregtech.render.ITextureArea;
import gregtech.render.MoveType;
import gregtech.render.ICubeRenderer;
import gregtech.render.Textures;

val test_machiner = Builder.start("test_machiner", 32000)
    .withPattern(
            FactoryBlockPattern.start(RelativeDirection.RIGHT, RelativeDirection.BACK, RelativeDirection.UP)
                .aisle(
                    "CCCCC",
                    "CCCCC",
                    "CCCCC",
                    "CCCCC",
                    "CCSCC")
                .where("S", IBlockMatcher.controller(loc))
                .where("H", <metastate:contenttweaker:plasma_proof_hassium_casing>,
                    IBlockMatcher.abilityPartPredicate(
                        MultiblockAbility.IMPORT_FLUIDS,
                        MultiblockAbility.IMPORT_ITEMS,
                        MultiblockAbility.INPUT_ENERGY,
                        MultiblockAbility.EXPORT_FLUIDS,
                        MultiblockAbility.EXPORT_ITEMS
                ))
                .build())
        .addDesign(
                FactoryMultiblockShapeInfo.start()
                .aisle(
                    "CCCCC",
                    "     ",
                    "     ",
                    "AAAAA",
                    "     ",
                    "     ",
                    "AAAAA",
                    "     ",
                    "     ",
                    "CCSCC")
                .where("C", <metastate:contenttweaker:plasma_proof_hassium_casing>)
                .where("A", <metastate:gregtech:multiblock_casing:4>)
                .where("S", IBlockInfo.controller(loc))
                .build())

.withRecipeMap(
        FactoryRecipeMap.start(loc)
                        .maxFluidInputs(1)
                        .maxFluidOutputs(1)
                        .maxInputs(12)
                        .maxOutputs(1)
                        .build())
.withTexture(ICubeRenderer.sided("contenttweaker:blocks/plasma_proof_hassium_casing"))
.withZoom(0.5f)

.buildAndRegister() as Multiblock;