Guest User

Untitled

a guest
Sep 22nd, 2018
88
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