Incorrect Distance Math for Mega Torch
bearsdotzone opened this issue ยท 1 comments
Per this at the second stage of the conditional no mobs will ever spawn above a mega torch's y level while still being in the x,z radius.
Example: Mega torch at y level 0 100 0. Potential mob spawn location at 0 170 0, well outside the default radius of 32 but within the same x,z radius. dy = 100 + 0.5 - 170 == -69.5 which is less than 32 and evaluates as true causing no mobs to spawn at this location.
I suggest the simple fix
(dx * dx + dz * dz + dy * dy) <= (this.torchRangeSq)
which is just the pythagorean theorum in 3 dimensions.