Mojira Archive
MC-11199

Eye of Ender does not always lead to the nearest Stronghold

When throwing an Eye of Ender it does not always lead you to the nearest structure due to a typo in the method for that.

What I expected to happen:
I expected the Eye of Ender to always lead to the nearest stronghold

What actually happend:
It sometimes shows a stronghold farther away

Steps to reproduce:
Easy way:
1. Create a superflat world with the preset
2;7,2x3,2;1;stronghold(distance=10 count=10 spread=10)
2. Teleport to 0 10 0
3. Fly close to a Stronghold
4. Throw Eyes of Ender
5. From some points they will not lead to the Stronghold you are closest to.

Harder way to prove it's not due to the preset or flatworlds:
1. Create a world with the seed 3351546583236556057 (Creative, so you can teleport and fly)
2. Teleport to -515 80 601 so it generates the stronghold at that position
3. Teleport to 693 80 269 and dig down until you find the stronghold (At y=44)
4. Throw Eyes of Ender

Why it happens:
In the structure class, where it tries to find the nearest instance it calculates the distance as
d2 = i + i * j * j + k * k;
where it should be
d2 = i * i + j * j + k * k;
In 1.5 it is in the agm class in lines 145 and 164.

Fixed

Ferd Erik

2013-03-07, 04:53 AM

2015-05-03, 07:17 AM

2013-06-13, 07:11 PM

10

6

Confirmed

nearest, stronghold, structure, world

Minecraft 1.4.6 - Minecraft 1.5.2Minecraft 1.4.6, Minecraft 1.4.7, Snapshot 13w10a, Snapshot 13w10b, Minecraft 1.5, Minecraft 1.5.2

Snapshot 13w24a