Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public final class Packets extends PacketListener {
- public void load() {
- // Checks if protocollib is installed
- if (!HookManager.isProtocolLibLoaded()) {
- Common.log("&cWarning: No ProtocolLib found, some features will not be available.");
- return;
- }
- // Adding the filter to catch the packet
- // two kinds of packets:
- // (1) sent out to the server which we intercept before the server processes it
- // client -> server
- // (2) sent out to the player which we can intercept before it's sent out
- // server -> client
- this.addSendingListener(PacketType.Status.Server.SERVER_INFO, event -> {
- Object handle = event.getPacket().getHandle();
- System.out.println(handle);
- });
- }
- @Override
- public void onRegister() {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement