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
513 stars 148 forks source link

[BUG REPORT] Some thing with wrappers giving errors #258

Closed JustDoom closed 2 years ago

JustDoom commented 2 years ago

Describe the bug I try to get the packet wrapper but it gives off errors.

To Reproduce Steps to reproduce the behavior: Example:

  1. Login on the 1.18.1 minecraft client.
  2. Join the server
  3. See error

Expected behavior That not to give errors

About your server (please complete the following information):

Additional context https://discord.com/channels/721686193061888071/755472595096174873/945178806682017802

retrooper commented 2 years ago

Can you use pastebin?

JustDoom commented 2 years ago

https://pastebin.com/0dEwkNuy not spamming like it was atm anymore. also idk if urs PE or my plugin but this happened on shutdown https://pastebin.com/iYjfJY3L

JustDoom commented 2 years ago

never mind spammed again https://pastebin.com/zU6bBmd7

retrooper commented 2 years ago

Can we see some of your code?

JustDoom commented 2 years ago

i think some lines are different. ill test it again to get the lines correct again but here is the code https://github.com/JustDoom/FlappyAC/blob/full-release/plugin/src/main/java/com/imjustdoom/flappyanticheat/packet/processor/ReceivingPacketProcessor.java

JustDoom commented 2 years ago

@retrooper ok here https://bin.birdflop.com/oxeweyazup.md just inore the boat? thing. was testing something

retrooper commented 2 years ago

Its cause you arre running threads while not on netty thread.

retrooper commented 2 years ago

Working with async listeners has become a bit tougher in 2.0, but I support it now. You basically need to clone the event. event = event.clone() and make sure you use the cloned version. BUT as soon as you are doing with the event(after cloning), you must run event.cleanUp() or else you will end up with a memory leak.

retrooper commented 2 years ago

PS. You need to clone the event while you are inside the packet listener's thread obviously. Then the rest of the processing can be done later.