SHARE
TWEET

Untitled

a guest Sep 22nd, 2018 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this, PacketType.Play.Server.PLAYER_INFO) {
  2.     @Override
  3.     public void onPacketSending(PacketEvent e){
  4.         PacketContainer pc = e.getPacket();
  5.         List<PlayerInfoData> l = new ArrayList<PlayerInfoData>();
  6.         pc.getPlayerInfoDataLists().read(0).forEach(pd -> {
  7.             if(pd.getLatency() > 1){
  8.                 l.add(new PlayerInfoData(pd.getProfile(), 1, pd.getGameMode(), pd.getDisplayName()));
  9.             } else {
  10.                 l.add(pd);
  11.             }
  12.         });
  13.         pc.getPlayerInfoDataLists().write(0, l);
  14.         e.setPacket(pc);
  15.     }
  16. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top