/*
██╗  ██╗ █████╗ ██╗   ██╗███████╗███╗   ██╗    ███╗   ███╗ ██████╗ ██████╗ ██████╗  █████╗  ██████╗██╗  ██╗███████╗
██║  ██║██╔══██╗██║   ██║██╔════╝████╗  ██║    ████╗ ████║██╔═══██╗██╔══██╗██╔══██╗██╔══██╗██╔════╝██║ ██╔╝██╔════╝
███████║███████║██║   ██║█████╗  ██╔██╗ ██║    ██╔████╔██║██║   ██║██║  ██║██████╔╝███████║██║     █████╔╝ ███████╗
██╔══██║██╔══██║╚██╗ ██╔╝██╔══╝  ██║╚██╗██║    ██║╚██╔╝██║██║   ██║██║  ██║██╔═══╝ ██╔══██║██║     ██╔═██╗ ╚════██║
██║  ██║██║  ██║ ╚████╔╝ ███████╗██║ ╚████║    ██║ ╚═╝ ██║╚██████╔╝██████╔╝██║     ██║  ██║╚██████╗██║  ██╗███████║
╚═╝  ╚═╝╚═╝  ╚═╝  ╚═══╝  ╚══════╝╚═╝  ╚═══╝    ╚═╝     ╚═╝ ╚═════╝ ╚═════╝ ╚═╝     ╚═╝  ╚═╝ ╚═════╝╚═╝  ╚═╝╚══════╝
*/
Ponder.registry((event) => {
    event.create([
        'mekanismgenerators:fission_fuel_assembly',
        'mekanismgenerators:control_rod_assembly'
    ])
    .scene('mekanism_fission_port', 'Constructing a Fission Reactor Fuel Rod', 'kubejs:mekanism_fission_reactor', (scene, util) => {
        scene.world.showSection([0, 0, 0, 4, 4, 4], Facing.DOWN);
        scene.idle(20);
        scene.world.hideSection([0, 1, 0, 3, 4, 3], Facing.UP);
        scene.idle(20);
        
        scene.overlay.showText(80).text("Place Fission Fuel Assemblies to form the core of the Fuel Rod.").placeNearTarget().attachKeyFrame();
        scene.world.setBlock([2, 1, 2], 'mekanismgenerators:fission_fuel_assembly', true);
        scene.world.showSection([2, 1, 2], Facing.DOWN);
        scene.idle(20);
        scene.world.setBlock([2, 2, 2], 'mekanismgenerators:fission_fuel_assembly', true);
        scene.world.showSection([2, 2, 2], Facing.DOWN);
        scene.idle(80);
        
        scene.overlay.showText(120).text("Stack several Fission Fuel Assemblies, then cap it with a Control Rod Assembly.").placeNearTarget().attachKeyFrame();
        scene.idle(40);
        scene.addKeyframe();
        scene.world.setBlock([2, 3, 2], 'mekanismgenerators:control_rod_assembly', true);
        scene.world.showSection([2, 3, 2], Facing.DOWN);
        scene.idle(80);
        
        scene.overlay.showText(80).text("Ensure the Control Rod Assembly is at the top of the Fuel Rod.").placeNearTarget().attachKeyFrame();
        scene.idle(90);
        
        scene.overlay.showText(80).text("Control Rod Assemblies should be placed one block below the ceiling.").placeNearTarget().attachKeyFrame();
        scene.idle(90);
        
        scene.overlay.showText(60).text("Fuel Rods must not touch each other.").placeNearTarget().attachKeyFrame();
        scene.world.setBlock([1, 1, 2], 'mekanismgenerators:fission_fuel_assembly', true);
        scene.world.setBlock([3, 1, 2], 'mekanismgenerators:fission_fuel_assembly', true);
        scene.world.showSection([1, 1, 2], Facing.DOWN);
        scene.world.showSection([3, 1, 2], Facing.DOWN);
        scene.idle(60);
        scene.world.setBlock([1, 1, 2], 'air', true);
        scene.world.setBlock([3, 1, 2], 'air', true);
        scene.idle(40);
        
        scene.world.hideSection([1, 1, 1, 3, 3, 3], Facing.UP);
        scene.idle(40);
        scene.world.setBlock([1, 1, 1], 'mekanismgenerators:fission_fuel_assembly', true);
        scene.world.setBlock([1, 2, 1], 'mekanismgenerators:fission_fuel_assembly', true);
        scene.world.setBlock([1, 3, 1], 'mekanismgenerators:control_rod_assembly', true);
        scene.world.setBlock([1, 1, 3], 'mekanismgenerators:fission_fuel_assembly', true);
        scene.world.setBlock([1, 2, 3], 'mekanismgenerators:fission_fuel_assembly', true);
        scene.world.setBlock([1, 3, 3], 'mekanismgenerators:control_rod_assembly', true);
        scene.world.setBlock([3, 1, 1], 'mekanismgenerators:fission_fuel_assembly', true);
        scene.world.setBlock([3, 2, 1], 'mekanismgenerators:fission_fuel_assembly', true);
        scene.world.setBlock([3, 3, 1], 'mekanismgenerators:control_rod_assembly', true);
        scene.world.setBlock([3, 1, 3], 'mekanismgenerators:fission_fuel_assembly', true);
        scene.world.setBlock([3, 2, 3], 'mekanismgenerators:fission_fuel_assembly', true);
        scene.world.setBlock([3, 3, 3], 'mekanismgenerators:control_rod_assembly', true);
        scene.world.showSection([1, 1, 1, 3, 3, 3], Facing.DOWN);
        
        scene.overlay.showText(80).text("Arrange multiple Fuel Rods in a checkerboard pattern for optimal performance.").placeNearTarget().attachKeyFrame();
        scene.idle(100);
        
        scene.world.showSection([0, 1, 0, 3, 4, 0], Facing.DOWN);
        scene.idle(5);
        scene.world.showSection([0, 1, 1, 0, 4, 3], Facing.DOWN);
        scene.idle(5);
        scene.world.showSection([1, 4, 1, 3, 4, 3], Facing.DOWN);
        scene.idle(20);
    });
});
