SHARE
TWEET

Untitled

a guest Oct 21st, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  public static void setBoard(Player p)
  2.     throws SQLException
  3.   {
  4.  
  5.    
  6.     Scoreboard sb = new Scoreboard();
  7.     ScoreboardObjective obj = sb.registerObjective("dummyxd", IScoreboardCriteria.b);
  8.     SimpleDateFormat dateFormat = new SimpleDateFormat("mm:ss");
  9.     dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
  10.     obj.setDisplayName("§e§lBuildFFA");
  11.    
  12.     PacketPlayOutScoreboardObjective removePacket = new PacketPlayOutScoreboardObjective(obj, 1);
  13.     PacketPlayOutScoreboardObjective createPacket = new PacketPlayOutScoreboardObjective(obj, 0);
  14.    
  15.     PacketPlayOutScoreboardDisplayObjective display = new PacketPlayOutScoreboardDisplayObjective(1, obj);
  16.     ScoreboardScore s1 = new ScoreboardScore(sb, obj, "§2");
  17.     ScoreboardScore s2 = new ScoreboardScore(sb, obj, "§8► §7Kills§8:");
  18.     ScoreboardScore s3 = new ScoreboardScore(sb, obj, "§5 §8» §a" + MySQLStats.getKills(p.getUniqueId().toString()));
  19.     ScoreboardScore s4 = new ScoreboardScore(sb, obj, "§4");
  20.     ScoreboardScore s5 = new ScoreboardScore(sb, obj, "§8► §7Tode§8:");
  21.     ScoreboardScore s6 = new ScoreboardScore(sb, obj, "§1 §8» §c" + MySQLStats.getDeaths(p.getUniqueId().toString()));
  22.     ScoreboardScore s7 = new ScoreboardScore(sb, obj, "§8");
  23.     ScoreboardScore s8 = new ScoreboardScore(sb, obj, "§8► §7Platz§8:");
  24.     ScoreboardScore s9 = new ScoreboardScore(sb, obj, "§1 §8» §b#" + MySQL.getRank(p));
  25.  
  26.  
  27.     s1.setScore(9);
  28.     s2.setScore(8);
  29.     s3.setScore(7);
  30.     s4.setScore(6);
  31.     s5.setScore(5);
  32.     s6.setScore(4);
  33.     s7.setScore(3);
  34.     s8.setScore(2);
  35.     s9.setScore(1);
  36.    
  37.     PacketPlayOutScoreboardScore ss1 = new PacketPlayOutScoreboardScore(s1);
  38.     PacketPlayOutScoreboardScore ss2 = new PacketPlayOutScoreboardScore(s2);
  39.     PacketPlayOutScoreboardScore ss3 = new PacketPlayOutScoreboardScore(s3);
  40.     PacketPlayOutScoreboardScore ss4 = new PacketPlayOutScoreboardScore(s4);
  41.     PacketPlayOutScoreboardScore ss5 = new PacketPlayOutScoreboardScore(s5);
  42.     PacketPlayOutScoreboardScore ss6 = new PacketPlayOutScoreboardScore(s6);
  43.     PacketPlayOutScoreboardScore ss7 = new PacketPlayOutScoreboardScore(s7);
  44.     PacketPlayOutScoreboardScore ss8 = new PacketPlayOutScoreboardScore(s8);
  45.     PacketPlayOutScoreboardScore ss9 = new PacketPlayOutScoreboardScore(s9);
  46.    
  47.     sendPacket(p, removePacket);
  48.     sendPacket(p, createPacket);
  49.     sendPacket(p, display);
  50.    
  51.     sendPacket(p, ss1);
  52.     sendPacket(p, ss2);
  53.     sendPacket(p, ss3);
  54.     sendPacket(p, ss4);
  55.     sendPacket(p, ss5);
  56.     sendPacket(p, ss6);
  57.     sendPacket(p, ss7);
  58.     sendPacket(p, ss8);
  59.     sendPacket(p, ss9);
  60.   }
  61.  
  62.   private static void sendPacket(Player p, Packet packet)
  63.   {
  64.     ((CraftPlayer)p).getHandle().playerConnection.sendPacket(packet);
  65.   }
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top