Page 1 of 1

Stronghold Finder

Posted: Sun Feb 19, 2023 4:21 am
by Talia
This is an update of an older hex from the archives to work on 1.19.2. Throw an ender eye, then run it with an empty focus in your offhand. Move to a new location and repeat with the same focus in your offhand to get the x and z coordinates of the nearest stronghold. The way that it works is by getting the x and z coordinates of the player and ender eye and computing the gradient and intercept of the line between the two on the XZ plane. If it's the first time the hex has been cast, the gradient and intercept are saved to the held focus. If it's the second time, the previous gradient and intercept are retrieved from the focus and the resulting linear system of equations is solved for the intersection of the two lines.

Code: Select all

{
	Mind's Reflection
	Compass' Purification
	Numerical Reflection: 20
	Prospector's Gambit
	Prospector's Gambit
	Numerical Reflection: 2
	Flock's Gambit
	Huginn's Gambit
	Zone Distillation: Non-Animal
	Muninn's Reflection
	Flock's Disintegration
	Zone Distillation: Non-Monster
	Muninn's Reflection
	Flock's Disintegration
	Zone Distillation: Non-Item
	Muninn's Reflection
	Flock's Disintegration
	Zone Distillation: Non-Player
	Muninn's Reflection
	Flock's Disintegration
	Zone Distillation: Non-Living
	
	Intersection Distillation
	Intersection Distillation
	Intersection Distillation
	Intersection Distillation
	
	Numerical Reflection: 0
	Selection Distillation   // stack contains only Eye of Ender (confirmed works)
	
	Compass' Purification
	Vector Disintegration
	Bookkeeper's Gambit: -v- // stack contains eye.x, eye.z
	
	Mind's Reflection
	Compass' Purification
	Vector Disintegration
	Bookkeeper's Gambit: -v-  // stack contains eye.x, eye.z, player.x, player.z
	
	Numerical Reflection: 2
	Swindler's Gambit // stack contains eye.x, player.x, eye.z, player.z: bac

	Subtractive Distillation
	Rotation Gambit II
	Subtractive Distillation // stack contains z_diff, x_diff
	Division Distillation // stack contains m

	Gemini Decomposition

	Mind's Reflection
	Compass' Purification
	Vector Disintegration
	Bookkeeper's Gambit: -v-  // stack contains m, m, player.x, player.z

	Rotation Gambit II
	Multiplicative Distillation // stack contains m, player.z, m*player.x
	Subtractive Distillation // stack contains m, c (confirmed works)
	
	Scribe's Reflection
	Nullary Reflection
	Inequality Distillation
	
	
	{ // if offhand isn't empty
		Scribe's Reflection
		Flock's Disintegration // stack contains m0, c0, m1, c1

		Numerical Reflection: 12
		Swindler's Gambit // stack contains m1, m0, c0, c1: bdca

		Subtractive Distillation
		Rotation Gambit II
		Subtractive Distillation
		Division Distillation // stack contains x

		Gemini Decomposition

		Scribe's Reflection
		Flock's Disintegration // stack contains x, x, m1, c1
		Rotation Gambit II
		Multiplicative Distillation
		Additive Distillation // stack contains x, z

		Numerical Reflection: 0
		Jester's Gambit
		Vector Exaltation
		Reveal // print (x, 0, z)
		Scribe's Gambit
	}

	{ // if offhand is empty
		Numerical Reflection: 2
		Flock's Gambit
		Scribe's Gambit
	}

	Augur's Exaltation
	Hermes' Gambit
}

Re: Stronghold Finder

Posted: Sun Feb 19, 2023 4:23 am
by Robotgiggle
I'm guessing you should throw an ender eye before each cast?

Re: Stronghold Finder

Posted: Sun Feb 19, 2023 4:24 am
by Talia
ah, yeah that's pretty important XD. Will not work if you don't throw an ender eye before each cast.

Re: Stronghold Finder

Posted: Sun Feb 19, 2023 4:39 am
by [object Object]
very nice! though wouldn't non-living cover non-player and non-monster? (also i believe this will also see item frames, xp orbs, arrows, boats, etc.)

Re: Stronghold Finder

Posted: Sun Feb 19, 2023 5:47 am
by Talia
probably non-living would cover player and monster, yeah, but it wasn't much extra effort to do all 5, which has some symmetry (and also I didn't really think about it). and yep, the user is responsible for making sure there isn't any XP or item frames or similar around.

Re: Stronghold Finder

Posted: Mon Feb 20, 2023 2:49 pm
by squiggity
it's great to know that the hexes i put together earlier on are still relevant today. however, my original take on the spell still had the issue of polarity regarding the x and z coordinates, where both would be negative regardless of their actual correct values. is this still an issue in this update?

Re: Stronghold Finder

Posted: Mon Feb 20, 2023 8:27 pm
by Talia
Nope! It was able to tell me both positive and negative coordinates when I used it in survival.

Re: Stronghold Finder

Posted: Tue Feb 21, 2023 1:45 am
by squiggity
what. what is this black magic. what has happened in these past 2 months.

Re: Stronghold Finder

Posted: Tue Feb 21, 2023 4:50 am
by Talia
Pretty sure it's able to tell positive/negative apart cause I did the maths differently to you? Unless you mean some of the new patterns I used and the boolean stuff, in which case yep, there's been a couple changes!