TogAr2 / MinestomPvP

Combat library for Minestom
Apache License 2.0
83 stars 33 forks source link

Add a way to cancel projectiles getting stuck #6

Closed ghost closed 2 years ago

ghost commented 2 years ago

https://www.youtube.com/watch?v=o001X4xabg4

TogAr2 commented 2 years ago

This is in fact an issue with Minestom (every block is treated as a full block when colliding with them) which I can’t easily fix. Other entities have this problem as well. Implementing block shapes into this extension would be difficult and goes too far in my opinion, I am sorry.

In the future I might add a way to cancel projectiles being stuck so you can implement block shapes yourself, so I will leave this issue open

cody-quinn commented 2 years ago

Is arrow collision handled here? https://github.com/Bloepiloepi/MinestomPvP/blob/4685dce6e3753a5c840646d9c01ae593796ecc17/src/main/java/io/github/bloepiloepi/pvp/projectile/CustomEntityProjectile.java#L213-L216 If it is handled there, than wouldn't it be possible to get the block shapes from Minestom (here) and take that into account. If you're writing your own collision code I feel like that would be within the scope of this extension.

TogAr2 commented 2 years ago

There is currently no easy way to parse or use the block shapes, Minestom does not have an api for it. Once it does, it will likely be implemented in Minestoms collisions and I will use it here, too

TogAr2 commented 2 years ago

The original issue in the video has been fixed! I decided to not make ProjectileBlockHitEvent cancellable, because it is difficult to implement correctly. I still might do it later