/*
██╗  ██╗ █████╗ ██╗   ██╗███████╗███╗   ██╗    ███╗   ███╗ ██████╗ ██████╗ ██████╗  █████╗  ██████╗██╗  ██╗███████╗
██║  ██║██╔══██╗██║   ██║██╔════╝████╗  ██║    ████╗ ████║██╔═══██╗██╔══██╗██╔══██╗██╔══██╗██╔════╝██║ ██╔╝██╔════╝
███████║███████║██║   ██║█████╗  ██╔██╗ ██║    ██╔████╔██║██║   ██║██║  ██║██████╔╝███████║██║     █████╔╝ ███████╗
██╔══██║██╔══██║╚██╗ ██╔╝██╔══╝  ██║╚██╗██║    ██║╚██╔╝██║██║   ██║██║  ██║██╔═══╝ ██╔══██║██║     ██╔═██╗ ╚════██║
██║  ██║██║  ██║ ╚████╔╝ ███████╗██║ ╚████║    ██║ ╚═╝ ██║╚██████╔╝██████╔╝██║     ██║  ██║╚██████╗██║  ██╗███████║
╚═╝  ╚═╝╚═╝  ╚═╝  ╚═══╝  ╚══════╝╚═╝  ╚═══╝    ╚═╝     ╚═╝ ╚═════╝ ╚═════╝ ╚═╝     ╚═╝  ╚═╝ ╚═════╝╚═╝  ╚═╝╚══════╝
*/
Ponder.registry((event) => {
    event.create([
        'mekanism:sps_casing',
        'mekanism:sps_port',
        'mekanism:supercharged_coil'
    ])
    .scene('mekanism_sps', 'Building the Mekanism Supercritical Phase Shifter (SPS)', 'kubejs:mekanism_sps', (scene, util) => {
        scene.world.showSection([0, 0, 0, 6, 7, 6], Facing.DOWN);
        scene.setSceneOffsetY(-1);
        scene.idle(25);

        scene.overlay.showText(65).text("The SPS converts Polonium into Antimatter Gas, consuming large amounts of power.").placeNearTarget();
        scene.addKeyframe();
        scene.idle(85);

        scene.overlay.showText(65).text("Configure the ports using a Configurator.").placeNearTarget();
        scene.showControls(65, [2.5, 2.5, 0], 'down').rightClick().withItem('mekanism:configurator').whileSneaking();
        scene.idle(15);
        scene.world.modifyBlock([2, 1, 0], (curState) => curState.with("active", "true"), false);
        scene.idle(25);
        scene.world.modifyBlock([2, 1, 0], (curState) => curState.with("active", "false"), false);
        scene.idle(45);

        scene.world.hideSection([0, 0, 0, 6, 6, 5], Facing.UP);
        scene.idle(15);

        scene.overlay.showText(65).text("Each face of the SPS follows this construction pattern.").placeNearTarget();
        scene.addKeyframe();
        scene.idle(65);

        scene.world.showSection([6, 0, 0, 6, 7, 5], Facing.DOWN);
        scene.idle(15);

        scene.overlay.showText(65).text("Place a port in the middle of one side for power input.").placeNearTarget();
        scene.addKeyframe();
        scene.idle(75);

        scene.world.showSection([5, 3, 3], Facing.DOWN);
        scene.overlay.showText(65).text("Place a Supercharged Coil inside on the port.").placeNearTarget();
        scene.addKeyframe();
        scene.idle(85);

        scene.world.showSection([0, 0, 0, 0, 6, 5], Facing.DOWN);
        scene.idle(35);

        scene.world.showSection([1, 3, 3], Facing.DOWN);
        scene.overlay.showText(65).text("For maximum power, use two Supercharged Coils.").placeNearTarget();
        scene.addKeyframe();
        scene.idle(85);

        scene.world.showSection([1, 0, 0, 5, 0, 5], Facing.DOWN);
        scene.idle(35);

        scene.world.showSection([1, 6, 0, 5, 6, 5], Facing.DOWN);
        scene.idle(35);

        scene.world.showSection([1, 1, 0, 5, 5, 0], Facing.DOWN);
        scene.idle(35);

        scene.overlay.showText(65).text("Add a port for Polonium input.").placeNearTarget();
        scene.addKeyframe();
        scene.idle(75);

        scene.world.modifyBlock([2, 1, 0], (curState) => curState.with("active", "true"), true);
        scene.overlay.showText(65).text("And another port for exporting Antimatter Gas.").placeNearTarget();
        scene.addKeyframe();
        scene.idle(75);
    });
});
