Automated Bedrock Breaking

Post your coolest Hexcasting creations here.

New topics are NOT for chatting or asking help, put those in the comments of a post or in a different forum.
stevebutnottoomany
Posts: 9
Joined: Wed Dec 28, 2022 5:07 am

Automated Bedrock Breaking

Post by stevebutnottoomany »

I've implemented a bedrock breaking method that relies on the falling block spell from Hexal. This method has the advantage of requiring only one look direction for piston placing, so it can be automated without needing something to look around.

The process takes several ticks.
In tick 1 a downward facing piston is placed, with a redstone block above it
In tick 2 the piston extends, and we break the head with a power 1 explosion, located two blocks beneath the piston. This leaves us with a headless piston.
In tick 3 we falling block our headless piston, and impulse it down.
In ticks 4 to 8 we wait for the piston to land on top of our bedrock, turn back into a block, and retract, breaking the bedrock
In tick 9 we collect back our piston and redstone block

The following spell implements this procedure, breaking a five by five square of bedrock each time through the process. The spell only acts on positions with bedrock present, to avoid dropping our pistons into the void. I used my Prism Counter spell to move the locus of the spell's attention across a prism.

As the spell has tick specific timing it needs to be run either via a cyclic wisp or single gametick circlespam. Costs around 5 dust per bedrock broken. In the worst case for my implementation (all of the positions on the 5x5 square contain a block) that leads to a cost of ~280 dust per second.

The spell in action: https://imgur.com/a/9btToCk

The spell itself

Code: Select all

{
    {
        //1 - state - 0, 1, 2, 3, or 4
        //2 - timer
        //3 - data - bedrock position list
        //4 - root position
        //5 - vector describing volume
        //6 - iteration
    }
    
    //Stops the spell once we've moved over the proscribed area
    Gemini Decomposition            //data data
    Numerical Reflection: 5         
    Selection Distillation          //data i
    Jester's Gambit
    Numerical Reflection: 4
    Selection Distillation          //i vector
    Vector Disintegration
    Multiplicative Distillation
    Multiplicative Distillation
    Length Purification
    Maximus Distillation II         //boolean
    Nullary Reflection
    Jester's Gambit                 //null boolean
    {
        Charon's Gambit
        Bookkeeper's Gambit: v
    }
    Flock's Disintegration
    Augur's Exaltation
    Hermes' Gambit

    
    //make a list of options
    //state 0 - generate list of present bedrock blocks, then place our pistons and redstone
    //state 1 - explode
    //state 2 - gravity block and impulse
    //state 3 - waiting
    //state 4 - cleanup piston, redstone, and move sentinel to next position
    {
        //stack is empty
        Locate Sentinel
        {
            Additive Distillation               //potential_bedrock_position
            Gemini Decomposition                //pbp pbp
            Sorter's Purification               //pbp blocktype
            {
                //Type - air    --
            }
            Flock's Disintegration              //pbp blocktype air
            Inequality Distillation             //pbp boolean_true_if_not_air
            {
                Bookkeeper's Gambit: -
                Bookkeeper's Gambit: v
            }
            Flock's Disintegration              //pbp bool - v
            Augur's Exaltation
            Hermes' Gambit                      //if it's not air we keep the blockposition, else we chuck it
        }

        {
            //List of offsets - 5x5 ---
        }
        Flock's Disintegration
        Thoth's Gambit                          //stack is sentinel pos, list of bedrock positions
        
        //Cleans up the sentinel position from the stack
        Bookkeeper's Gambit: v-

        //save the list of bedrock positions
        Gemini Decomposition
        Scribe's Reflection                     //list list spell
        Numerical Reflection: 3                 //list list spell 3
        Rotation Gambit                         //list spell 3 list
        Surgeon's Exaltation
        Scribe's Gambit                         //list
        
        //Place everything as needs placed
        {
            //stack is bedrock position
            Numerical Reflection: 3
            Vector Reflection +Y
            Multiplicative Distillation
            Additive Distillation
            Gemini Decomposition                //piston_pos piston_pos
            {
                //Mote - piston ----
            }
            Flock's Disintegration              //piston_pos piston_pos piston
            Jester's Gambit                     //pos piston pos
            Place Block II                      //pos
            
            Vector Reflection +Y
            Additive Distillation
            {
                //Mote - redstone block -----
            }
            Flock's Disintegration              //pos redstone
            Jester's Gambit
            Place Block II
        }
        //stack is bedrock_pos_list spell
        Jester's Gambit
        Thoth's Gambit
        Bookkeeper's Gambit: v

        //set state to 1
        Scribe's Reflection
        Numerical Reflection: 1
        Numerical Reflection: 1
        Surgeon's Exaltation
        Scribe's Gambit
    }

    {
        //state 1 - blow up the piston head
        Scribe's Reflection
        Numerical Reflection: 3
        Selection Distillation                  //stack is bedrock_list
        {
            Vector Reflection +Y
            Additive Distillation
            Numerical Reflection: 1
            Explosion
        }
        Jester's Gambit
        Thoth's Gambit
        Bookkeeper's Gambit: v

        //update state to 2
        Scribe's Reflection
        Numerical Reflection: 1
        Numerical Reflection: 2
        Surgeon's Exaltation
        Scribe's Gambit
    }

    {
        //state 2 - falling block, impulse, and set timer
        Scribe's Reflection
        Numerical Reflection: 3
        Selection Distillation              //stack is bedrock_list
        {
            Numerical Reflection: 3
            Vector Reflection +Y
            Multiplicative Distillation
            Additive Distillation           //piston_pos
            Gemini Decomposition            //piston_pos piston_pos
            Falling Block                   //piston_pos
            Entity Purification             //falling_piston
            Vector Reflection -Y
            Impulse
        }
        Jester's Gambit
        Thoth's Gambit
        Bookkeeper's Gambit: v
        
        //Update state and set timer
        Scribe's Reflection
        Numerical Reflection: 1
        Numerical Reflection: 3
        Surgeon's Exaltation
        Numerical Reflection: 2
        Numerical Reflection: 4
        Surgeon's Exaltation
        Scribe's Gambit
    }

    {
        //state 3 - waiting for timer
        //reduce timer by 1
        //if timer == 0, set state 4
        Scribe's Reflection
        Gemini Decomposition
        Numerical Reflection: 2
        Selection Distillation          //spell timer
        Numerical Reflection: 1
        Subtractive Distillation        //spell updated_timer
        Dioscuri Gambit                 //spell timer spell timer
        Numerical Reflection: 2
        Jester's Gambit                 //spell timer spell 2 timer
        Surgeon's Exaltation
        Scribe's Gambit                 //saves updated timer
        Bookkeeper's Gambit: v-         //timer
        Numerical Reflection: 0
        Equality Distillation           //true_if_timer_0
        
        
        //sets state to 4 if timer == 0
        {
            Scribe's Reflection
            Numerical Reflection: 1
            Numerical Reflection: 4
            Surgeon's Exaltation
            Scribe's Gambit
        }
        {
            //Deliberately empty
        }
        Augur's Exaltation
        Hermes' Gambit
    }

    {
        //state 4 - clean up our pistons and our redstone, then iterate to next position
        Scribe's Reflection
        Numerical Reflection: 3
        Selection Distillation                  //bedrock_list
        {
            Vector Reflection +Y
            Additive Distillation
            Gemini Decomposition                //fallen_piston_pos fallen_piston_pos
            Break Block                         //fallen_piston_pos
            Numerical Reflection: 3
            Vector Reflection +Y
            Multiplicative Distillation
            Additive Distillation               //redstone_pos
            Break Block
        }
        Jester's Gambit
        Thoth's Gambit
        Bookkeeper's Gambit: v
        
        //Pickup all the dropped stuff
        Locate Sentinel
        Numerical Reflection: 15
        Zone Distillation: Item
        {
            Compass' Purification
            //Mediafy macro
        }
        Jester's Gambit
        Thoth's Gambit
        Bookkeeper's Gambit: v
        
        //Update iteration and move sentinel
                //4 - root position
                //5 - vector describing volume
                //6 - iteration
        Scribe's Reflection
        Gemini Decomposition
        Numerical Reflection: 6
        Selection Distillation              //spell i
        Numerical Reflection: 1
        Additive Distillation               //spell i+1
        Numerical Reflection: 6
        Jester's Gambit                     //spell 6 i+1
        Surgeon's Exaltation
        //sets state to zero while we're here
        Numerical Reflection: 1
        Numerical Reflection: 0
        Surgeon's Exaltation
        Gemini Decomposition
        Scribe's Gambit                     //updated_spell

        Numerical Reflection: 4
        Numerical Reflection: 7
        Selection Exaltation
        Flock's Disintegration              //root_pos vector_describing_volume i
        Jester's Gambit
        //Prism Counter macro               //root_pos output_vector
        Numerical Reflection: 5
        Multiplicative Distillation
        Vector Disintegration               //root_pos 5x 5y 5z
        Jester's Gambit
        Numerical Reflection: 5
        Division Distillation               //root_pos 5x 5z y
        Jester's Gambit
        Vector Exaltation
        Additive Distillation
        Summon Greater Sentinel
    }
    Numerical Reflection: 5
    Flock's Gambit
    
    
    Scribe's Reflection
    Numerical Reflection: 1
    Selection Distillation //gets state of spell
    Selection Distillation //selects which thing to do
    Hermes' Gambit //does the thing
}
User avatar
Robotgiggle
Posts: 23
Joined: Fri Dec 02, 2022 12:38 am

Re: Automated Bedrock Breaking

Post by Robotgiggle »

In the imgur video, why does the first sweep across the bedrock only break some of the bedrock blocks?
stevebutnottoomany
Posts: 9
Joined: Wed Dec 28, 2022 5:07 am

Re: Automated Bedrock Breaking

Post by stevebutnottoomany »

There are multiple layers of bedrock. The first sweep breaks the top layer, the second breaks the layer beneath. The layer beneath has gaps in it to test whether the spell was successfully ignoring gaps in the bedrock.
User avatar
Robotgiggle
Posts: 23
Joined: Fri Dec 02, 2022 12:38 am

Re: Automated Bedrock Breaking

Post by Robotgiggle »

Ah ok, I must have missed that there were two layers.