

// for 1.18 pls use: onEvent("ponder.registry", event => { ... })
Ponder.registry((event) => {
    event
        .create("alloy_smelter:forge_controller_tier1")
        .scene("alloy_furnace", "The Alloy Furnace", (scene, util) => {
            scene.showBasePlate()
            scene.idle(10);

            const centerBlockPos = util.grid.at(2, 0, 2);
            const centerTop = util.vector.topOf(centerBlockPos);

            scene.world.setBlocks([1, 1, 1, 3, 1, 3], 'minecraft:bricks', false)
            scene.world.showSection([0, 1, 0, 4, 1, 4], Facing.DOWN)
            scene.idle(5);

            scene.world.setBlock([2, 2, 1], Block.id('alloy_smelter:forge_controller_tier1').with('facing', 'north'), false)
            scene.world.setBlock([1, 2, 2], 'minecraft:bricks', false)
            scene.world.setBlock([2, 2, 3], 'minecraft:bricks', false)
            scene.world.setBlock([3, 2, 2], 'minecraft:bricks', false)
            scene.world.showSection([1, 2, 1, 3, 2, 3], Facing.DOWN)
            scene.idle(5);

            scene.world.setBlock([2, 3, 1], 'minecraft:bricks', false)
            scene.world.setBlock([1, 3, 2], 'minecraft:bricks', false)
            scene.world.setBlock([2, 3, 3], 'minecraft:bricks', false)
            scene.world.setBlock([3, 3, 2], 'minecraft:bricks', false)
            scene.world.showSection([1, 3, 1, 3, 3, 3], Facing.DOWN)
            scene.text(30, 'This is the Alloy Furnace', centerBlockPos.above(3));
            scene.idle(40);
            scene.text(40, "With vital recipes, you'll need to build this multiblock.", centerBlockPos.above(3));
            scene.idle(60);
            scene.text(30, 'To use it, open the GUI.', [2.5, 2, 1.5])
            scene.idle(40);

            scene.addKeyframe();
            scene.text(60, 'Then, insert your choice of fuel...', [2.5, 2, 1.5])
            scene.idle(40);
            scene.showControls(30, [2.5, 2, 1.5], "down").rightClick().withItem('minecraft:coal');
            scene.idle(40);
            scene.showControls(30, [2.5, 2, 1.5], "down").rightClick().withItem('minecraft:charcoal');
            scene.idle(40);
            scene.showControls(30, [2.5, 2, 1.5], "down").rightClick().withItem('tfmg:coal_coke');
            scene.idle(80);


            scene.addKeyframe();
            scene.text(20, "Once it's fueled, input the items you want to combine...", [2.5, 2, 1.5])
            scene.idle(30);
            scene.world.createItemEntity([2.5, 5, 2.5], util.vector.of(0, 0, 0), "iron_ingot");
            scene.idle(10);
            scene.world.createItemEntity([2.5, 5, 2.5], util.vector.of(0, 0, 0), "iron_ingot");
            scene.idle(10);
            scene.world.createItemEntity([2.5, 5, 2.5], util.vector.of(0, 0, 0), "tfmg:lead_ingot");
            scene.text(20, "And after some time...", [2.5, 2, 1.5])
            scene.world.setBlock([2, 1, 0], 'create:depot', false)

            scene.idle(80);
            scene.world.createItemEntity([2.5, 2, 0.5], util.vector.of(0, 0, 0), "eidolon:pewter_ingot");
            scene.text(20, "You will have the result!", [2.5, 2, 1.5])
            scene.idle(20)
        });
});