ProtocolLib

3M Downloads

ProtocolLib does nothing

Vertraubarer opened this issue · 0 comments

commented
dmulloy2-repo https://repo.dmulloy2.net/repository/public/ com.comphenix.protocol ProtocolLib 5.3.0-SNAPSHOT provided

depend:

  • ProtocolLib

import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.events.ListenerPriority;
import com.comphenix.protocol.events.PacketAdapter;
import com.comphenix.protocol.events.PacketEvent;
import com.comphenix.protocol.wrappers.WrappedServerPing;
import me.vertraubarer.farmpvp.FarmPvP;

public class ServerInfoPacket {

public static void registerPacketListener() {
    ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(FarmPvP.getInstance(),
            ListenerPriority.NORMAL,
            PacketType.Status.Server.OUT_SERVER_INFO) {
        @Override
        public void onPacketSending(PacketEvent event) {
            WrappedServerPing ping = event.getPacket().getServerPings().read(0);
            ping.setVersionName("§c§lMaintenance");
        }
    });
}

}


i use ServerInfoPacket.registerPacketListener(); in the onEnable method but it doesnt display the version name