Paragliders

Paragliders

4M Downloads

Wind below certain y position is cut in middle

Tictim opened this issue ยท 0 comments

commented

Tested on 1.16. Not tested on 1.15 yet but I assume it is there too?

Wind with source just below certain y position, that is multiplier of 32 - like 128, 64, 32, doesn't seem to reach normal height. This bug is somewhat serious because hitting multiplier of 32 line with 9 tile high hitbox is quite common. Not to mention wind sources at sea level of 63 is affected by bug and you get hideous 1 block high wind.

I suspect this bug is due to implementation in getEntitiesWithinAABB in vanilla. Minecraft doesn't expect hitbox of entity to be so massive, or even if it were, it assumes it would have no critical side effects not detecting it in some times. So they cut search range of entities to multiplier of 32. But Paraglider currently uses getEntitiesWithinAABB to detect whether the wind is colliding with player, assuming it works regardless of condition, hence the bug.

Naive fix would be first fetching all wind entities in larger area and check if the hitbox touches the player. But imo it defeats the purpose of implementing winds as entity the first time. Entities are already quite heavy, inefficient, and doesn't fit well with wind systems except it's easy to calculate collisions (which is no longer true because this issue), and maybe easy to debug because F3+B. Since Entities are not meant to stick to one block, few facilities are built on top of the code which bloats code complexity even more.

WindUpdateHelper already suffers from this because it has to reuse entities and adjust its height while crunching blocks to find valid wind sources. #6 already denotes this problem.

All combined, I think it strongly suggests rewrite on wind system. I am imagining special capability attached to Chunk, with HashMap of XZ potion to linked list of connected winds. Syncing between client would be done by packets, and particle placement and debug visuals are possible with events.
It's not heavy, doesn't require complex collision detection, and would provide better framework for WindUpdateHelper.