/*
██╗  ██╗ █████╗ ██╗   ██╗███████╗███╗   ██╗    ███╗   ███╗ ██████╗ ██████╗ ██████╗  █████╗  ██████╗██╗  ██╗███████╗
██║  ██║██╔══██╗██║   ██║██╔════╝████╗  ██║    ████╗ ████║██╔═══██╗██╔══██╗██╔══██╗██╔══██╗██╔════╝██║ ██╔╝██╔════╝
███████║███████║██║   ██║█████╗  ██╔██╗ ██║    ██╔████╔██║██║   ██║██║  ██║██████╔╝███████║██║     █████╔╝ ███████╗
██╔══██║██╔══██║╚██╗ ██╔╝██╔══╝  ██║╚██╗██║    ██║╚██╔╝██║██║   ██║██║  ██║██╔═══╝ ██╔══██║██║     ██╔═██╗ ╚════██║
██║  ██║██║  ██║ ╚████╔╝ ███████╗██║ ╚████║    ██║ ╚═╝ ██║╚██████╔╝██████╔╝██║     ██║  ██║╚██████╗██║  ██╗███████║
╚═╝  ╚═╝╚═╝  ╚═╝  ╚═══╝  ╚══════╝╚═╝  ╚═══╝    ╚═╝     ╚═╝ ╚═════╝ ╚═════╝ ╚═╝     ╚═╝  ╚═╝ ╚═════╝╚═╝  ╚═╝╚══════╝
*/
Ponder.registry((event) => {
    event.create('mekanismgenerators:fission_reactor_casing')
        .scene('mekanism_fission_reactor', 'Building a Fission Reactor', 'kubejs:mekanism_fission_reactor', (scene, util) => {
            scene.world.showSection([4, 0, 4], Facing.DOWN);
            scene.idle(10);

            [1, 2, 3, 4].forEach(num => {
                scene.world.showSection([4, num, 4], Facing.DOWN);
                scene.world.showSection([4, 0, 4 - num], Facing.DOWN);
                scene.world.showSection([4 - num, 0, 4], Facing.DOWN);
                scene.idle(10);
            });

            [1, 2, 3].forEach(num => {
                scene.world.showSection([4, 4, 4 - num], Facing.DOWN);
                scene.world.showSection([4 - num, 4, 4], Facing.DOWN);
                scene.world.showSection([0, 0, 4 - num], Facing.DOWN);
                scene.world.showSection([4 - num, 0, 0], Facing.DOWN);
                scene.world.showSection([0, num, 4], Facing.DOWN);
                scene.world.showSection([4, num, 0], Facing.DOWN);
                scene.idle(10);
            });

            scene.overlay.showText(85).text("The edges must be built with Reactor Casings.").placeNearTarget();
            scene.world.showSection([4, 4, 0], Facing.DOWN);
            scene.world.showSection([0, 4, 4], Facing.DOWN);
            scene.world.showSection([0, 0, 0], Facing.DOWN);
            scene.idle(10);

            [1, 2, 3].forEach(num => {
                scene.world.showSection([0, num, 0], Facing.DOWN);
                scene.world.showSection([0, 4, 4 - num], Facing.DOWN);
                scene.world.showSection([4 - num, 4, 0], Facing.DOWN);
                scene.idle(10);
            });

            scene.world.showSection([0, 4, 0], Facing.DOWN);
            scene.addKeyframe();
            scene.idle(85);

            scene.world.showSection([1, 4, 1, 3, 4, 3], Facing.DOWN);
            scene.idle(10);

            scene.world.showSection([1, 0, 1, 3, 0, 3], Facing.UP);
            scene.idle(10);

            scene.world.showSection([1, 1, 0, 3, 3, 0], Facing.SOUTH);
            scene.idle(10);

            scene.world.showSection([1, 1, 4, 3, 3, 4], Facing.NORTH);
            scene.idle(10);

            scene.world.showSection([0, 1, 1, 0, 3, 3], Facing.EAST);
            scene.idle(10);

            scene.overlay.showText(85).text("The walls can be either Reactor Casings or Glass.").placeNearTarget();
            scene.world.showSection([4, 1, 1, 4, 3, 3], Facing.WEST);
            scene.addKeyframe();
            scene.idle(85);

            scene.world.hideSection([0, 1, 0, 3, 4, 0], Facing.UP);
            scene.world.hideSection([0, 1, 0, 0, 4, 3], Facing.UP);
            scene.world.hideSection([1, 4, 1, 3, 4, 3], Facing.UP);
            scene.idle(15);

            scene.overlay.showText(65).text("Place Fission Fuel Assemblies inside to create Fuel Rods.").placeNearTarget();
            scene.world.setBlock([2, 1, 2], 'mekanismgenerators:fission_fuel_assembly', false);
            scene.world.showSection([2, 1, 2], Facing.DOWN);
            scene.idle(15);
            scene.world.setBlock([2, 2, 2], 'mekanismgenerators:fission_fuel_assembly', false);
            scene.world.showSection([2, 2, 2], Facing.DOWN);
            scene.idle(15);
            scene.addKeyframe();
            scene.idle(45);

            scene.world.setBlock([2, 3, 2], 'mekanismgenerators:control_rod_assembly', false);
            scene.world.showSection([2, 3, 2], Facing.DOWN);
            scene.idle(15);
            scene.overlay.showText(65).text("Place Control Rod Assemblies at the top of each Fuel Rod.").placeNearTarget();
            scene.idle(25);
            scene.addKeyframe();
            scene.idle(65);

            scene.world.showSection([0, 1, 0, 3, 4, 0], Facing.UP);
            scene.world.showSection([0, 1, 0, 0, 4, 3], Facing.UP);
            scene.world.showSection([1, 4, 1, 3, 4, 3], Facing.UP);
            scene.addKeyframe();
            scene.idle(45);
        });
});
