// priority: 0

onEvent("ponder.registry", event => {
    // Bloomery
    event.create("the_winter_rescue:bloomery", ["charcoal_pit:main_bloomery", "charcoal_pit:sandy_tuyere", "charcoal_pit:sandy_brick","charcoal_pit:bellows"])
        .tag("the_winter_rescue:bloomery")
        // bloomery building
        .scene("assembly", "1", "kubejs:bloomery", (scene, util) => {
            scene.showBasePlate()
            scene.idle(20)

            scene.world().showSection(util.select().layer(1), Facing.down)
            scene.addKeyframe()
            scene.idle(40)
            scene.world().showSection(util.select().layer(2), Facing.down)
            scene.addKeyframe()
            scene.idle(40)

            // Bloomery info scene
            scene.addKeyframe()
            const pos = util.grid().at(3, 2, 1)
            scene.overlay().showText(50)
                .text("A single Bellow is required for the Bloomery to work")
                .pointAt(util.vector().centerOf(pos))
            scene.idle(60)
            scene.overlay().showOutline(PonderPalette.GREEN, new Object(), util.select().position(pos), 130)
            scene.overlay().showText(50)
                .text("Make sure to check it's vent orientation")
                .pointAt(util.vector().centerOf(pos))
            scene.idle(60)
            scene.overlay().showText(50)
                .colored(PonderPalette.RED)
                .text("If the vent doesnt face the Tuyere, the Bellow will not work")
                .pointAt(util.vector().centerOf(pos))
            scene.idle(70)

            scene.addKeyframe()
            scene.overlay().showText(50)
                .text("Right-Click to push air in using the Bellow")
                .pointAt(util.vector().centerOf(pos))
            scene.idle(30)
            scene.overlay().showControls(new PonderInput(util.vector().blockSurface(pos, Facing.down), PonderPointing.RIGHT)
                .rightClick(), 20)
            scene.world().modifyBlock(pos, state => state.with("push", true))
            scene.idle(20)
            scene.world().modifyBlock(pos, state => state.with("push", false))
            scene.idle(20)

            // Bloomery extraupgrade scene
            scene.addKeyframe()
            const pos2 = util.grid().at(1, 2, 1)
            scene.overlay().showOutline(PonderPalette.GREEN, new Object(), util.select().position(pos2), 50)
            scene.overlay().showText(50)
                .colored(PonderPalette.GREEN)
                .text("Another Tuyere can be added on this side, just make sure to check it's vent direction")
                .pointAt(util.vector().centerOf(pos2))
            scene.idle(30)
            scene.world().setBlock(pos2, util.getDefaultState("charcoal_pit:bellows"), true)
            scene.world().modifyBlock(pos2, state => state.with("facing", Facing.east))
            scene.idle(30)
    
            scene.world().showSection(util.select().layer(3), Facing.down)
            scene.overlay().showOutline(PonderPalette.GREEN, new Object(), util.select().fromTo(1, 3, 1, 3, 3, 3), 40)
            scene.overlay().showText(50)
                .colored(PonderPalette.GREEN)
                .text("Another layer can be placed for 2x processing. You cannot stack another layer after this one")
                .pointAt(util.vector().centerOf(util.grid().at(2, 3, 2)))
            scene.idle(40)
        })
        // bloomery usage
        .scene("usage", "Using the bloomery", "kubejs:bloomery", (scene, util) => {
            scene.showBasePlate()
            scene.idle(5)
            scene.world().showSection(util.select().layer(1), Facing.down)
            scene.idle(5)
            scene.world().showSection(util.select().layer(2), Facing.down)
            scene.idle(5)
        
            const center = util.grid().at(2, 2, 2)

            scene.overlay().showOutline(PonderPalette.GREEN, new Object(), util.select().position(center), 50)
            scene.overlay().showText(50)
                .colored(PonderPalette.GREEN)
                .text("To start processing, use Shift + Right-Click with the first ore in hand (not blocks)")
                .pointAt(util.vector().centerOf(center))
            scene.overlay().showControls(new PonderInput(util.vector().blockSurface(center, Facing.down), PonderPointing.RIGHT)
                .rightClick()
                .whileSneaking()
                .withItem("rankine:magnetite"), 20)
            scene.idle(50)

            scene.addKeyframe()
            scene.overlay().showText(40)
                .colored(PonderPalette.GREEN)
                .text("After the initial placement, Right-Click the pile with the ore and charcoal")
                .pointAt(util.vector().centerOf(center))
            scene.overlay().showControls(new PonderInput(util.vector().blockSurface(center, Facing.down), PonderPointing.RIGHT)
                .rightClick()
                .withItem("rankine:magnetite"), 40)
            scene.idle(50)

            scene.overlay().showControls(new PonderInput(util.vector().blockSurface(center, Facing.down), PonderPointing.RIGHT)
                .rightClick()
                .withItem("minecraft:charcoal"), 40)


            const sectionFromTo = util.select().fromTo(1, 5, 1, 3, 7, 3);
            const theSection = scene.world().showIndependentSectionImmediately(sectionFromTo);
            scene.world().moveSection(theSection, util.vector().of(0, -4, 0), 0)
            scene.idle(50)

            scene.addKeyframe()
            scene.overlay().showText(40)
                .colored(PonderPalette.GREEN)
                .text("After filling it up, start it by using a firestarter")
                .pointAt(util.vector().centerOf(center))
            scene.overlay().showControls(new PonderInput(util.vector().blockSurface(util.grid().at(2, 3, 2), Facing.down), PonderPointing.RIGHT)
                .rightClick()
                .withItem("charcoal_pit:fire_starter"), 40)
            scene.world().replaceBlocks(sectionFromTo, util.getDefaultState("minecraft:air"), false)

            const swapBlockFromTo = util.select().fromTo(1, 8, 1, 3, 9, 3);
            
            scene.world().moveSection(scene.world().showIndependentSectionImmediately(swapBlockFromTo), util.vector().of(0, -7, 0), 0)
            scene.idle(50)

            scene.overlay().showText(40)
                .colored(PonderPalette.GREEN)
                .text("Once it's done burning, you can mine it up and collect the iron")
                .pointAt(util.vector().centerOf(center))
            scene.idle(40)
        })

    // Generator Consruction (Tier 1)
    event.create("the_winter_rescue:generator_construction_t1", 
        [
            "frostedheart:generator", 
            "frostedheart:generator_core_t1", 
            "frostedheart:generator_amplifier_r1", 
            "frostedheart:generator_brick"
        ])
        .tag("the_winter_rescue:generator")
        .scene("basic_usage", "", "kubejs:generator_t1", (scene, util) => {
            scene.configureBasePlate(0, 0, 5)
            scene.scaleSceneView(0.7) // zoom out, t2 is big
            scene.showBasePlate()
            scene.idle(10)

            // Generic build
            scene.world().showSection(util.select().layer(1), Facing.down)
            scene.addKeyframe()
            scene.idle(40)
            scene.world().showSection(util.select().layer(2), Facing.down)
            scene.addKeyframe()
            scene.idle(40)
            scene.world().showSection(util.select().layer(3), Facing.down)
            scene.addKeyframe()
            scene.idle(40)
            scene.world().showSection(util.select().layer(4), Facing.down)
            scene.addKeyframe()
            scene.idle(40)

            const pos = util.grid().at(2, 2, 1)
            // text
            scene.overlay().showText(40)
                .text("Right-Click to assemble")
                .pointAt(util.vector().centerOf(pos))
            scene.idle(20)
            scene.overlay().showControls(new PonderInput(util.vector().blockSurface(pos, Facing.down), PonderPointing.RIGHT)
                .rightClick().withItem("immersiveengineering:hammer"),
                40)
            scene.world().moveSection(scene.world().showIndependentSectionImmediately(util.select().fromTo(1, 6, 1, 3, 10, 3)), util.vector().of(0, -5, 0), 0)
            scene.world().replaceBlocks(util.select().fromTo(1, 1, 1, 3, 4, 3), util.getDefaultState("minecraft:air"), false)
            scene.idle(40)
        })

    // Generator Consruction (Tier 2)
    event.create("the_winter_rescue:generator_construction_t2", ["frostedheart:generator_t2","rankine:invar_block"])
        .tag("the_winter_rescue:generator")
        .scene("basic_usage", "", "kubejs:generator_t2", (scene, util) => {
            scene.configureBasePlate(0, 0, 5)
            scene.scaleSceneView(0.5) // zoom out, t2 is big
            scene.showBasePlate()
            scene.idle(10)

            // Generic build
            scene.world().showSection(util.select().layer(1), Facing.down)
            scene.addKeyframe()
            scene.idle(40)
            scene.world().showSection(util.select().layer(2), Facing.down)
            scene.addKeyframe()
            scene.idle(40)
            scene.world().showSection(util.select().layer(3), Facing.down)
            scene.addKeyframe()
            scene.idle(40)
            scene.world().showSection(util.select().layer(4), Facing.down)
            scene.addKeyframe()
            scene.idle(40)
            scene.world().showSection(util.select().layer(5), Facing.down)
            scene.addKeyframe()
            scene.idle(40)
            scene.world().showSection(util.select().layer(6), Facing.down)
            scene.addKeyframe()
            scene.idle(40)
            scene.world().showSection(util.select().layer(7), Facing.down)
            scene.addKeyframe()
            scene.idle(40)

            const pos = util.grid().at(2, 2, 1)
            // text
            scene.overlay().showText(40)
                .text("Right-Click to assemble")
                .pointAt(util.vector().centerOf(pos))
            scene.idle(20)
            scene.overlay().showControls(new PonderInput(util.vector().blockSurface(pos, Facing.down), PonderPointing.RIGHT)
                .rightClick().withItem("immersiveengineering:hammer"),
                40)
            scene.world().moveSection(scene.world().showIndependentSectionImmediately(util.select().fromTo(1, 8, 1, 3, 15, 3)), util.vector().of(0, -8, 0), 0)
            scene.world().replaceBlocks(util.select().fromTo(1, 1, 1, 3, 7, 3), util.getDefaultState("minecraft:air"), false)
            scene.idle(40)
        })/*.scene("usage", "", "kubejs:generator_t2", (scene, util) => {
            scene.configureBasePlate(0, 0, 5)
            scene.scaleSceneView(1)
            scene.showBasePlate()
            scene.idle(10)
            scene.world().moveSection(scene.world().showIndependentSectionImmediately(util.select().fromTo(1, 8, 1, 3, 15, 3)), util.vector().of(0, -8, 0), 0)
            scene.world().replaceBlocks(util.select().fromTo(1, 1, 1, 3, 7, 3), util.getDefaultState("minecraft:air"), false)
            scene.idle(20)
			scene.addKeyframe()
			scene.overlay().showOutline(PonderPalette.GREEN, new Object(), util.select().position(2,1,2), 20)
			scene.overlay().showText(20)
                .text("Input heat medium from bottom blue marked ")
                .pointAt(util.vector().blockSurface(util.grid().at(2, 1, 2), Facing.down))
            scene.idle(40)
			scene.addKeyframe()
			
			scene.overlay().showOutline(PonderPalette.GREEN, new Object(), util.select().position(1,1,2), 60)
			scene.overlay().showOutline(PonderPalette.GREEN, new Object(), util.select().position(3,1,2), 60)
			scene.overlay().showOutline(PonderPalette.GREEN, new Object(), util.select().position(2,1,1), 60)
			scene.overlay().showOutline(PonderPalette.GREEN, new Object(), util.select().position(2,1,3), 60)
			scene.overlay().showText(60)
                .text("Export energy from the bottom of these locations")
                .pointAt(util.vector().blockSurface(util.grid().at(2, 1, 2), Facing.down))
			scene.idle(20)
			scene.rotateCameraY(180)
			scene.idle(40)
        })*/

    // Crucible
    event.create("the_winter_rescue:steel_mill", ["immersiveindustry:crucible", "immersiveindustry:burning_chamber", "rankine:high_refractory_bricks", "immersiveengineering:blastfurnace_preheater"])
        .tag("the_winter_rescue:crucible")
        .scene("assembly", "", "kubejs:steel_mill_crucible", (scene, util) => {
            scene.configureBasePlate(0, 0, 5)
            scene.scaleSceneView(0.7) // zoom out, t2 is big
            scene.showBasePlate()
            scene.idle(10)

            // Generic build
            scene.world().showSection(util.select().layer(1), Facing.down)
            scene.addKeyframe()
            scene.idle(40)
            scene.world().showSection(util.select().layer(2), Facing.down)
            scene.addKeyframe()
            scene.idle(40)
            scene.world().showSection(util.select().layer(3), Facing.down)
            scene.addKeyframe()
            scene.idle(40)
            scene.world().showSection(util.select().layer(4), Facing.down)
            scene.addKeyframe()
            scene.idle(40)
			scene.addKeyframe()
            const pos = util.grid().at(2, 2, 1)
            // text
            scene.overlay().showText(40)
                .text("Right-Click to assemble")
                .pointAt(util.vector().centerOf(pos))
            scene.idle(20)
            scene.overlay().showControls(new PonderInput(util.vector().blockSurface(pos, Facing.down), PonderPointing.RIGHT)
                .rightClick().withItem("immersiveengineering:hammer"),
                40)
            scene.world().moveSection(scene.world().showIndependentSectionImmediately(util.select().fromTo(1, 6, 1, 3, 10, 3)), util.vector().of(0, -5, 0), 0)
            scene.world().replaceBlocks(util.select().fromTo(1, 1, 1, 3, 4, 3), util.getDefaultState("minecraft:air"), false)
            scene.idle(40)
			scene.addKeyframe()
			scene.rotateCameraY(180)
			scene.idle(20)
			scene.overlay().showText(40)
                .text("Install Preheater here")
                .pointAt(util.vector().centerOf(util.grid().at(2, 1, 4)))
			scene.idle(20)
			scene.world().moveSection(scene.world().showIndependentSection(util.select().fromTo(0, 6, 4, 4, 10, 4),Facing.north), util.vector().of(0, -5, 0), 0)
			scene.idle(60)
        })
		.scene("basic_usage", "", "kubejs:steel_mill_crucible_usage", (scene, util) => {
            scene.configureBasePlate(0, 0, 6)
            scene.showBasePlate()
            scene.idle(10)

            scene.world().showSection(util.select().fromTo(1, 1, 2, 3, 4, 4), Facing.down)
            scene.idle(20)
            // text
            scene.overlay().showText(40)
                .text("Install Preheater here")
                .pointAt(util.vector().centerOf(util.grid().at(2, 1, 1)))
            scene.idle(20)
			scene.world().showSection(util.select().fromTo(2, 1, 1,2, 4, 1), Facing.south)
            scene.idle(20)
			scene.overlay().showText(40)
                .text("Power must be provided here")
                .pointAt(util.vector().centerOf(util.grid().at(2, 4, 1)))
			scene.idle(40)
			scene.addKeyframe()
			scene.overlay().showText(20)
                .text("You can either use GUI or automation input")
                .pointAt(util.vector().centerOf(util.grid().at(1, 1, 2)))
			scene.idle(40)
			scene.addKeyframe()
			var itemloc=util.vector().centerOf(util.grid().at(2, 5, 3));
			scene.overlay().showText(20)
                .text("Ingredients can be throw into crucible")
                .pointAt(itemloc)
			scene.idle(20)
			scene.overlay().showControls(new PonderInput(itemloc, PonderPointing.DOWN).withItem("kubejs:flux"), 10)
			scene.idle(12)
			var fluxItem = scene.world().createItemEntity(itemloc, util.vector().of(0, 0, 0),Ingredient.of("kubejs:flux"))
			scene.idle(20)
			scene.overlay().showControls(new PonderInput(itemloc, PonderPointing.DOWN).withItem("minecraft:iron_ingot"), 10)
			scene.idle(12)
			var ironItem = scene.world().createItemEntity(itemloc, util.vector().of(0, 0, 0),Ingredient.of("minecraft:iron_ingot"))
			scene.idle(40)
			scene.addKeyframe()
			scene.overlay().showText(20)
                .text("Ingredients can also insert into crucible on the top")
                .pointAt(itemloc)
			scene.world().showSection(util.select().position(2,5,2), Facing.down)
			scene.idle(20)
			scene.overlay().showControls(new PonderInput(util.vector().centerOf(util.grid().at(2,5,2)), PonderPointing.DOWN).withItem("minecraft:iron_ingot"), 10);
			scene.idle(20)
			scene.overlay().showControls(new PonderInput(util.vector().centerOf(util.grid().at(2,5,2)), PonderPointing.DOWN).withItem("kubejs:flux"), 10);
            scene.idle(40)
			scene.addKeyframe()
			scene.rotateCameraY(90)
			scene.idle(20)
			scene.world().showSection(util.select().fromTo(4, 1, 0,5, 2, 5), Facing.west)
			scene.overlay().showText(20)
                .text("Coke coal can insert to the burners")
                .pointAt(util.grid().at(4,1,3))
			scene.overlay().showControls(new PonderInput(util.vector().centerOf(util.grid().at(4,1,3)), PonderPointing.DOWN).withItem("immersiveengineering:coal_coke"), 20);
			scene.idle(40)
			scene.addKeyframe()
			scene.world().showSection(util.select().fromTo(4, 2, 0,5, 5, 5), Facing.north)
			scene.overlay().showText(20)
                .text("Products can be extracted from sides of the crucible part")
                .pointAt(util.vector().centerOf(util.grid().at(4,4,3)))
			scene.idle(20)

			scene.world().createItemOnBelt(util.grid().at(4, 3, 3),Facing.up,"immersiveengineering:ingot_steel");
			//scene.overlay()
			scene.idle(40)
        })

    event.create("the_winter_rescue:steam_turbine", ["immersiveindustry:steam_turbine", "immersiveengineering:generator"])
        .tag("the_winter_rescue:steam_turbine")
        .scene("basic_usage", "", "kubejs:steam_turbine", (scene, util) => {
            scene.rotateCameraY(130)
            scene.scaleSceneView(0.7) // zoom out, t2 is big
            scene.configureBasePlate(0, 0, 9) // baseplace is a square
			scene.showBasePlate()
			scene.idle(20)

            scene.world().showSection(util.select().layer(1), Facing.down)
            scene.addKeyframe()
            scene.idle(40)
            scene.world().showSection(util.select().layer(2), Facing.down)
            scene.addKeyframe()
            scene.idle(40)
            scene.world().showSection(util.select().layer(3), Facing.down)
            scene.addKeyframe()
            scene.idle(40)

            scene.rotateCameraY(-110)
            const pos = util.grid().at(2, 2, 1)
            scene.overlay().showText(40)
                .text("Right-Click to assemble")
                .pointAt(util.vector().centerOf(pos))
            scene.idle(20)
            scene.overlay().showControls(new PonderInput(util.vector().blockSurface(pos, Facing.down), PonderPointing.RIGHT)
                .rightClick().withItem("immersiveengineering:hammer"),
                40)
            scene.world().moveSection(scene.world().showIndependentSectionImmediately(util.select().fromTo(1, 5, 1, 3, 10, 7)), util.vector().of(0, -4, 0), 0)
            scene.world().replaceBlocks(util.select().fromTo(1, 1, 1, 3, 3, 7), util.getDefaultState("minecraft:air"), false)
            scene.idle(60)
			scene.addKeyframe()
			scene.rotateCameraY(180)
			scene.overlay().showText(40)
                .text("Input steam here")
                .pointAt(util.grid().at(1, 2, 8))
			scene.idle(60)
        })

	event.create("the_winter_rescue:beehive_oven_pit", ["rankine:beehive_oven_pit"])
        .tag("the_winter_rescue:beehive_oven_pit")
        .scene("basic_usage", "", "kubejs:beehive_oven_pit", (scene, util) => {
            scene.configureBasePlate(0, 0, 5)
            scene.rotateCameraY(-70)
			scene.showBasePlate()
			scene.idle(20)

            scene.world().showSection(util.select().layer(1), Facing.down)
            scene.addKeyframe()
            scene.idle(40)
            
			scene.overlay().showText(40)
                .text("Place marble on the top without blocking the beehive oven pit")
                .pointAt(util.vector().centerOf(util.grid().at(2, 2, 2)))
            scene.overlay().showOutline(PonderPalette.GREEN, new Object(), util.select().fromTo(1, 2, 1, 3, 2, 3), 40)
            scene.world().showSection(util.select().layer(2), Facing.down)
            scene.addKeyframe()
            scene.idle(50)

            const pos = util.grid().at(2, 1, 2);
			scene.overlay().showText(40)
                .text("After placing the blocks, use a flint and steel to turn it on")
                .pointAt(util.vector().blockSurface(pos, Facing.up))
            scene.overlay().showControls(new PonderInput(util.vector().blockSurface(pos, Facing.up), PonderPointing.DOWN)
                .rightClick().withItem("minecraft:flint_and_steel"),
                40)
			scene.world().modifyBlock(pos, state => state.with("lit",true))
            scene.addKeyframe()
			scene.idle(40)

			scene.overlay().showText(40)
                .text("Once it finishes, you will get quicklime from the marble")
                .pointAt(util.vector().centerOf(pos))
            scene.world().moveSection(scene.world().showIndependentSectionImmediately(util.select().fromTo(1, 3, 1, 3, 5, 3)), util.vector().of(0, -3, 0), 0)
            scene.world().replaceBlocks(util.select().fromTo(1, 1, 1, 3, 2, 3), util.getDefaultState("minecraft:air"), false)
			scene.world().modifyBlock(pos, state => state.with("lit",true))
            scene.idle(40)
        })
	event.create("the_winter_rescue:charcoal_pit", ["charcoal_pit:log_pile"])
        .tag("the_winter_rescue:charcoal_pit")
        .scene("basic_usage", "", "kubejs:charcoal_pit", (scene, util) => {
            scene.showBasePlate()
            scene.idle(20)

            scene.world().showSection(util.select().layer(1), Facing.down)
            scene.world().showSection(util.select().layer(2), Facing.down)
            scene.idle(30)
			
			scene.overlay().showControls(new PonderInput(util.vector().blockSurface(util.grid().at(2, 2, 2), Facing.down), PonderPointing.RIGHT)
                .rightClick()
                .withItem("charcoal_pit:fire_starter"), 40)
			scene.addKeyframe()
			scene.idle(20)

			const pos = util.grid().at(2, 2, 2)
			scene.world().setBlock(pos, util.getDefaultState("minecraft:fire"), true)
			scene.world().modifyBlock(util.grid().at(2, 1, 2), state => state.with("lit", true))
			scene.idle(40)
			
			scene.world().setBlock(pos, util.getDefaultState("minecraft:air"), true)
			const theSection = scene.world().showIndependentSection(util.select().position(2, 3, 2), Facing.down)
			scene.world().moveSection(theSection, util.vector().of(0, -1, 0), 0)
			scene.addKeyframe()
			scene.idle(60)
			scene.world().hideSection(util.select().fromTo(1, 1, 1, 3, 1, 3), Facing.down)
			scene.world().hideIndependentSection(theSection, Facing.down)
			scene.idle(20)

			scene.world().setBlock(util.grid().at(2, 3, 2), util.getDefaultState("minecraft:air"), false)
			scene.world().replaceBlocks(util.select().fromTo(1, 1, 1, 3, 1, 3), util.getDefaultState("minecraft:air"), false)
			scene.world().moveSection(scene.world().showIndependentSection(util.select().fromTo(0, 4, 0, 4, 4, 4), Facing.down), util.vector().of(0, -3, 0), 0)
            scene.world().setBlocks(util.select().fromTo(1, 1, 1, 3, 1, 3), util.getDefaultState("charcoal_pit:log_pile"), false)
            scene.world().showSection(util.select().fromTo(1, 1, 1, 3, 1, 3), Facing.down)
            scene.addKeyframe()
            scene.idle(40)

            scene.overlay().showControls(new PonderInput(util.vector().blockSurface(util.grid().at(2, 2, 2), Facing.down), PonderPointing.RIGHT)
                .rightClick()
                .withItem("charcoal_pit:fire_starter"), 40)
			scene.idle(20)

            scene.world().setBlocks(util.select().fromTo(1, 2, 1, 3, 2, 3), util.getDefaultState("minecraft:fire"), false)
            scene.world().modifyBlock(util.grid().at(2, 1, 2), state => state.with("lit", true))
            scene.world().modifyBlock(util.grid().at(1, 1, 2), state => state.with("lit", true))
            scene.world().modifyBlock(util.grid().at(3, 1, 2), state => state.with("lit", true))
            scene.world().modifyBlock(util.grid().at(2, 1, 1), state => state.with("lit", true))
            scene.world().modifyBlock(util.grid().at(1, 1, 1), state => state.with("lit", true))
            scene.world().modifyBlock(util.grid().at(3, 1, 1), state => state.with("lit", true))
            scene.world().modifyBlock(util.grid().at(2, 1, 3), state => state.with("lit", true))
            scene.world().modifyBlock(util.grid().at(1, 1, 3), state => state.with("lit", true))
            scene.world().modifyBlock(util.grid().at(3, 1, 3), state => state.with("lit", true))
			scene.idle(40)
            
            scene.world().replaceBlocks(util.select().fromTo(1, 2, 1, 3, 2, 3), util.getDefaultState("minecraft:air"), false)
            scene.world().moveSection(scene.world().showIndependentSection(util.select().fromTo(1, 5, 1, 3, 5, 3), Facing.down), util.vector().of(0, -3, 0), 0)
            scene.idle(20)
        })
	event.create("the_winter_rescue:pottery_kiln", ["charcoal_pit:straw", "charcoal_pit:clay_pot"])
        .tag("the_winter_rescue:charcoal_pit")
        .scene("basic_usage", "", "kubejs:pottery_kiln", (scene, util) => {
            scene.showBasePlate()
            scene.scaleSceneView(1)
            scene.idle(20)

			scene.overlay().showControls(new PonderInput(util.vector().blockSurface(util.grid().at(1, 1, 1), Facing.down), PonderPointing.RIGHT)
                .whileSneaking()
                .rightClick()
                .withItem("rankine:limestone"), 40)
			scene.idle(40)

			scene.world().showSection(util.select().layer(1), Facing.down)
			scene.idle(40)

            scene.overlay().showText(60)
                .text("Surrounding blocks can be ANY block, not just dirt.")
                .pointAt(util.grid().at(2,1,2))

			scene.world().moveSection(scene.world().showIndependentSection(util.select().fromTo(0, 2, 0, 2, 2, 2), Facing.down), util.vector().of(0, -1, 0), 0)
			scene.addKeyframe()
			scene.idle(30)

			const pos = util.grid().at(1, 1, 1)
			scene.world().setBlock(pos, util.getDefaultState("minecraft:air"), false)
			scene.overlay().showControls(new PonderInput(util.vector().blockSurface(pos, Facing.down), PonderPointing.RIGHT)
                .rightClick()
                .withItem("charcoal_pit:straw"), 30)
            scene.world().moveSection(scene.world().showIndependentSection(util.select().position(2, 3, 1), Facing.down), util.vector().of(-1, -2, 0), 0)
			scene.idle(40)

			scene.overlay().showControls(new PonderInput(util.vector().blockSurface(pos, Facing.down), PonderPointing.RIGHT)
                .rightClick()
                .withItem("minecraft:oak_log"), 30)
            scene.world().moveSection(scene.world().showIndependentSection(util.select().position(0, 3, 1), Facing.down), util.vector().of(1, -2, 0), 0)
			scene.idle(40)

			scene.overlay().showControls(new PonderInput(util.vector().blockSurface(pos, Facing.down), PonderPointing.RIGHT)
                .rightClick()
                .withItem("charcoal_pit:fire_starter"), 40)
            scene.world().setBlock(util.grid().at(1, 2, 1), util.getDefaultState("minecraft:fire"), true)
            scene.world().showSection(util.select().position(1, 2, 1), Facing.up)
            scene.addKeyframe()
            scene.idle(60)
        })
})