retrooper / packetevents

PacketEvents is emerging as a strong contender in the realm of Minecraft packet processing libraries. Designed to simplify packet manipulation while delivering high performance, this powerful tool aims to demystify the complexities of projects utilizing packets.
GNU General Public License v3.0
512 stars 147 forks source link

1.17 entity list error #158

Closed MWHunter closed 3 years ago

MWHunter commented 3 years ago

https://gist.github.com/MWHunter/861ae64fddfda1786f76425de80f6c96

PacketEvents version: 4bbf43e

Running tuinity version: [17:49:20 INFO]: This server is running Tuinity version git-Tuinity-"6fd7e2b" (MC: 1.17.1) (Implementing API version 1.17.1-R0.1-SNAPSHOT) (Git: 6fd7e2b on HEAD)

I can't reproduce it but it occurred when a second player was logging in right next to another player already logged in. Maybe just a catch statement to get this error before trying other methods of getting the entity would work fine.

retrooper commented 3 years ago

There isn't really any other method on 1.17. Usually we cache it, but if we can't cache, we need to iterate through all entities. I'll think of a fix.

retrooper commented 3 years ago

I'll try something, can't guarantee it will always work, because according to you it happens rarely?

MWHunter commented 3 years ago

I've had it happen once. I can handle getting a null entity fine and fall back to the ZOMBIE type, as I only use bukkit entities to get the type, but getting an exception instead of no entity messes things up.

retrooper commented 3 years ago

Should be fixed, try this commit https://github.com/retrooper/packetevents/commit/8f566032aaff0d67dc7dd4d2123875d087721d9f