This topic is where I'll be keeping any spells that I think are good enough for the public eye. Note that I'm playing on 1.18 here; I make 0 guarantees that anything here or the principles behind them will work in more current versions.
Veinmine
It's veinmine. Does not detect diagonal blocks (but can be easily modified to do so). Currently always ends on a mishap, either of the null reference or too many recursions variety, and this is another thing that can be fixed probably but I can't be bothered. Uses Hexal.
(
Numerical Reflection: 19 //Post-Initialization, the stack will consist of this function (for recursive cloning) and the current target vector.
Gemini Gambit //Each search operation uses the target vector 3 times. 6 operations * 3 = 18, plus one for the break block at the end.
Vector Reflection +X //Each of the next six chunks will: check if an adjacent block is the same as the target block;
Add //push that block to the list of target blocks if so; or (0,0,0) if not; then save the new list of targets to the ravenmind.
Surveyor's Distillation
Negation Purification
Jester's Gambit
Vector Reflection +X
Add
Gemini Decomposition
Numerical Reflection: 3
Fisher's Gambit
Multiply
Subtract
Muninn's Reflection
Jester's Gambit
Integration Distillation
Huginn's Gambit
Vector Reflection -X
Add
Surveyor's Distillation
Negation Purification
Jester's Gambit
Vector Reflection -X
Add
Gemini Decomposition
Numerical Reflection: 3
Fisher's Gambit
Multiply
Subtract
Muninn's Reflection
Jester's Gambit
Integration Distillation
Huginn's Gambit
Vector Reflection +Y
Add
Surveyor's Distillation
Negation Purification
Jester's Gambit
Vector Reflection +Y
Add
Gemini Decomposition
Numerical Reflection: 3
Fisher's Gambit
Multiply
Subtract
Muninn's Reflection
Jester's Gambit
Integration Distillation
Huginn's Gambit
Vector Reflection -Y
Add
Surveyor's Distillation
Negation Purification
Jester's Gambit
Vector Reflection -Y
Add
Gemini Decomposition
Numerical Reflection: 3
Fisher's Gambit
Multiply
Subtract
Muninn's Reflection
Jester's Gambit
Integration Distillation
Huginn's Gambit
Vector Reflection +Z
Add
Surveyor's Distillation
Negation Purification
Jester's Gambit
Vector Reflection +Z
Add
Gemini Decomposition
Numerical Reflection: 3
Fisher's Gambit
Multiply
Subtract
Muninn's Reflection
Jester's Gambit
Integration Distillation
Huginn's Gambit
Vector Reflection -Z
Add
Surveyor's Distillation
Negation Purification
Jester's Gambit
Vector Reflection -Z
Add
Gemini Decomposition
Numerical Reflection: 3
Fisher's Gambit
Multiply
Subtract
Muninn's Reflection
Jester's Gambit
Integration Distillation //If you want to get diagonals, add more of these chunks.
Huginn's Gambit //That'll require 16 more of these. You may want to write a helper spell for that.
Break Block //Finally we use the last target vector. The stack is now empty except for a copy of this function.
Gemini Decomposition //Which we will copy for hermes-ing later.
Muninn's Reflection //Pull the current list of target blocks.
Uniqueness Purification //Remove all blocks that were zeroed out and any dupes.
Gemini Decomoposition
Numerical Reflection: 1
Selection Distillation //Pull the next vector
Jester's Gambit
Numerical Reflection: 1
Excisor's Distillation //Remove that vector from the list
Huginn's Gambit //and push to ravenmind.
Jester's Gambit
Hermes' Gambit //Recursion
)
Gemini Decomposition //Copy the function for hermes-ing later
Mind's Reflection //Raytrace
Compass Purification
Mind's Reflection
Alidade's Purification
Archer's Distillation
Vector Reflection Zero //Prepare the ravenmind
Singleton's Purification
Huginn's Gambit //Initialize the ravenmind with a list containing the zero vector.
Jester's Gambit
Hermes' Gambit //And we're off to the races
More stuff as I come up with them, suggestions for optimizations or tweaks are welcome.
Oh dear, I'll go over my code later to see if I missed an addition or subtraction somewhere.
The place block spell can actually place directional blocks based on the octant of the block that it's cast in. However, since hexcasting usually works in centers of blocks, place block is pretty much always cast at (0.5, 0.5, 0.5). To fix this, we can take an archers and an architects and work backwards to find the exact point on the block where your raycast hit, then move it along the normal so that it's comfortably inside the coordinates we want to place at.
First, we get archers + architects. then, we add half an architects to archers in order to get the face of the block we're placing against. Next, get the distance from the caster to the face of the block, multiply our look vector by that distance, and add it to our position to get the point on the block that we're looking at*. Finally we add a quarter of an architects to get the final position to use place block on.
*this formula is not actually exact and will become less accurate as distance increases. The exact formula isn't that much more complicated, but right now it looks very ugly and nobody wants to see that.
edit: I MISSED a multiplication after Numerical Reflection: 0.5
Last edited by marshmellow on Sun Feb 26, 2023 4:29 pm, edited 1 time in total.
After a bit more testing, it looks like only the top or bottom orientation is determined by placement location, with the N/E/S/W orientation determined by the player's look direction. This only works in 1.18.2, though; I don't know what changed for 1.19.2, but it's no longer possible to place a block in an upper orientation by moving the target vector.