Cannon Directors currently use LivingEntity.getTargetBlock() to find their targeted location, which only functions correctly if CannonDirectorRange is less than 120. This is because spigot arbitrarily limits their getTargetBlock method to not search beyond 120 blocks for fear of searching unloaded chunks and causing issues. While no issues were found with checking blocks outside of render in my testing, it still has the potential to load chunks, which is not something we necessarily want to do.
This pull request creates a custom raycast function that directly uses a BlockIterator towards either the CannonDirectorDistance or the distance to server render, whichever is closer.
Cannon Directors currently use
LivingEntity.getTargetBlock()
to find their targeted location, which only functions correctly if CannonDirectorRange is less than 120. This is because spigot arbitrarily limits their getTargetBlock method to not search beyond 120 blocks for fear of searching unloaded chunks and causing issues. While no issues were found with checking blocks outside of render in my testing, it still has the potential to load chunks, which is not something we necessarily want to do.This pull request creates a custom raycast function that directly uses a BlockIterator towards either the CannonDirectorDistance or the distance to server render, whichever is closer.