Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. public static void buildMenuFriends(Player player) {
  2. ArrayList<UUID> list = MySQL.listFriends(player.getUniqueId());
  3. int tourChecked = 0;
  4.  
  5. int maxfriends = MySQL.listFriends(player.getUniqueId()).size();
  6. Inventory inv1 = Bukkit.createInventory(null, 5*9, "Friends | "+ maxfriends + " ami(s)");
  7.  
  8. while(tourChecked < list.size()) {
  9.  
  10. ItemStack info = new ItemStack(Material.SKULL_ITEM, 1, (short)SkullType.PLAYER.ordinal());
  11. SkullMeta sm = (SkullMeta)info.getItemMeta();
  12.  
  13. ItemStack retour = new ItemStack(Material.ARROW);
  14. ItemMeta retourMeta = retour.getItemMeta();
  15. retourMeta.setDisplayName("§6<- Retour");
  16. retour.setItemMeta(retourMeta);
  17. inv1.setItem(44, retour);
  18.  
  19. if( MySQL.isInPlayerInfo_ISONLINE(list.get(tourChecked)) == 1) {
  20. //en ligne
  21. sm.setDisplayName("§a(En ligne) §6"+ MySQL.friendsName(list.get(tourChecked)));
  22. sm.setLore(Arrays.asList(new String[] {
  23. "§8=======================",
  24. "§6Server§f: §e" + MySQL.getPlayerInfo_SERVERNAME(list.get((tourChecked))),
  25. "§a> clique droit pour le rejoindre" ,
  26. "§8======================="}));
  27. } else {
  28. //pas en ligne
  29. sm.setDisplayName("§c(Hors Ligne) §6"+ MySQL. friendsName(list.get(tourChecked)));
  30. }
  31. sm.setOwner( MySQL.friendsName(list.get(tourChecked)));
  32. info.setItemMeta(sm);
  33.  
  34. inv1.setItem(tourChecked, info);
  35.  
  36. if(tourChecked < 44) {
  37. tourChecked++;
  38. } else {
  39. player.sendMessage("§8[§6Friends§8] §cCet affichage affiche jusqu'à §444 Amis §c!");
  40. break;
  41. }
  42.  
  43. }
  44.  
  45. player.openInventory(inv1);
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement