/*
██╗  ██╗ █████╗ ██╗   ██╗███████╗███╗   ██╗    ███╗   ███╗ ██████╗ ██████╗ ██████╗  █████╗  ██████╗██╗  ██╗███████╗
██║  ██║██╔══██╗██║   ██║██╔════╝████╗  ██║    ████╗ ████║██╔═══██╗██╔══██╗██╔══██╗██╔══██╗██╔════╝██║ ██╔╝██╔════╝
███████║███████║██║   ██║█████╗  ██╔██╗ ██║    ██╔████╔██║██║   ██║██║  ██║██████╔╝███████║██║     █████╔╝ ███████╗
██╔══██║██╔══██║╚██╗ ██╔╝██╔══╝  ██║╚██╗██║    ██║╚██╔╝██║██║   ██║██║  ██║██╔═══╝ ██╔══██║██║     ██╔═██╗ ╚════██║
██║  ██║██║  ██║ ╚████╔╝ ███████╗██║ ╚████║    ██║ ╚═╝ ██║╚██████╔╝██████╔╝██║     ██║  ██║╚██████╗██║  ██╗███████║
╚═╝  ╚═╝╚═╝  ╚═╝  ╚═══╝  ╚══════╝╚═╝  ╚═══╝    ╚═╝     ╚═╝ ╚═════╝ ╚═════╝ ╚═╝     ╚═╝  ╚═╝ ╚═════╝╚═╝  ╚═╝╚══════╝
*/
Ponder.registry((event) => {
    event.create([
        'mekanismgenerators:fusion_reactor_logic_adapter',
        'mekanismgenerators:fusion_reactor_frame',
        'mekanismgenerators:fusion_reactor_controller',
        'mekanismgenerators:fusion_reactor_port'
    ])
    .scene('mekanism_fusion_reactor', 'Building the Mekanism Fusion Reactor', 'kubejs:mekanism_fusion_reactor', (scene, util) => {
        scene.world.showSection([0, 0, 0, 4, 4, 4], Facing.DOWN);
        scene.idle(20);
        
        scene.overlay.showText(60).text("The Fusion Reactor generates vast amounts RF per tick.").independent(20).placeNearTarget().attachKeyFrame();
        scene.idle(70);
        
        scene.overlay.showText(60).text("Use the Configurator tool to switch port functions.").independent(40).placeNearTarget().attachKeyFrame();
        scene.showControls(60, [1.5, 3.5, 0], 'down').rightClick().withItem('mekanism:configurator').whileSneaking();
        scene.idle(20);

        scene.world.modifyBlock([1, 2, 0], (curState) => curState.with("active", "true"), true);
        scene.idle(20);

        scene.world.modifyBlock([1, 2, 0], (curState) => curState.with("active", "false"), true);
        scene.idle(40);
        
        scene.world.hideSection([0, 0, 0, 4, 4, 3], Facing.UP);
        scene.idle(20);
        
        scene.overlay.showText(80).text("The Fusion Reactor structure uses this pattern on all sides.").independent(20).placeNearTarget().attachKeyFrame();
        scene.idle(90);
        
        scene.world.showSection([4, 0, 0, 4, 4, 3], Facing.DOWN);
        scene.idle(20);
        
        scene.overlay.showText(60).text("A port is required to export power.").independent(40).placeNearTarget().attachKeyFrame();
        scene.idle(70);
        
        scene.world.showSection([0, 0, 0, 0, 4, 3], Facing.DOWN);
        scene.idle(30);
        
        scene.overlay.showText(60).text("The Laser Matrix initiates the reactor.").independent(40).placeNearTarget().attachKeyFrame();
        scene.idle(70);
        
        scene.world.showSection([1, 0, 0, 3, 0, 3], Facing.DOWN);
        scene.idle(30);
        
        scene.world.showSection([0, 4, 0, 3, 4, 3], Facing.DOWN);
        scene.idle(30);
        
        scene.overlay.showText(60).text("Place the Fusion Reactor Controller at the center of the top face.").independent(40).placeNearTarget().attachKeyFrame();
        scene.idle(70);
        
        scene.world.showSection([1, 1, 0, 3, 3, 0], Facing.DOWN);
        scene.idle(30);
        
        scene.overlay.showText(30).text("Two ports are needed for Deuterium").independent(40).placeNearTarget().attachKeyFrame();
        scene.idle(40);
        scene.overlay.showText(40).text("and Tritium inputs.").independent(50).placeNearTarget().attachKeyFrame();
        scene.idle(50);
    });
});
