EntityTrackers somehow don't contain the player.
JakeNijssen opened this issue ยท 2 comments
Make sure you're doing the following
- You're using the latest build for your server version
- This isn't an issue caused by another plugin
- You've checked for duplicate issues
- You didn't use
/reload
Describe the question
So I've been trying to fix a bug for my vanish plugin. I spend hours on trying to fix it to find out, that it is one if statement, which uses the ProtocolLib-API. What happens is that if a player vanishes in front of another player, the vanishedplayer disappears on everything execpt the player entity, so somehow the entityDestroy packet I'm trying to send doesn't get received by the client.
API method(s) used
ProtocolLibrary.getProtocolManager.getEntityTrackers(vanishedPlayer).contains(viewer);
And a packet interceptor, which checks on the Entity_Destroy packet.
Expected behavior
The player his body should be removed with entityDestroy. And the API method should return true. Weird thing is, if the player reappears(When I check for the same method again but then for spawning a player) it does work.
Code
https://github.com/AzortisCode/ProtocolVanish/blob/master/src/main/java/com/azortis/protocolvanish/visibility/VisibilityChanger.java method sendEntityDestroyPacket on line 109.
If statement line 110.
https://github.com/AzortisCode/ProtocolVanish/blob/master/src/main/java/com/azortis/protocolvanish/visibility/packetlisteners/GeneralEntityPacketListener.java
From line 61, where the entityDestroy packet is being looked at.
Just so you know, I did debug it, and in the spawnPlayer method it does get "debugged", and in the destroyEntity it doesn't.