APDevTeam / Movecraft-Combat

Movecraft Combat Addon
GNU General Public License v3.0
7 stars 17 forks source link

Director Changes #71

Closed drfiveminusmint closed 3 years ago

drfiveminusmint commented 3 years ago

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.