- Баллы
- 98
- Имя в Minecraft
- BlackTrojan
Здравствуйте, использую библиотеку BungeePackets, для кое-каких целей, и столкнулся с проблемой, чтобы слушать пакеты, нужно их зарегистрировать, а аргументы брать я так не понял откуда.
With this library you can register your own packets! This is just in-case I forget to add one that you need. All of the packets that are in normal minecraft have not been added yet. But soon they will be. To add your own packet, extend the org.spawl.bungeepackets.Packet class. This is an abstract class so you will get 3 methods to start with. Read, write, and handle. Read is called when the BungeeCord recieves the packet, write is called when the Bungee is writing the packet to a pipeline, and handle is called after it is read. Below is an example of how you can register your own packet!
BungeePackets.registerPacket(Protocol.DirectionData.TO_SERVER, <ID>, <CLASS EXTENDING PACKET>);