Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void buildMenuFriends(Player player) {
- ArrayList<UUID> list = MySQL.listFriends(player.getUniqueId());
- int tourChecked = 0;
- int maxfriends = MySQL.listFriends(player.getUniqueId()).size();
- Inventory inv1 = Bukkit.createInventory(null, 5*9, "Friends | "+ maxfriends + " ami(s)");
- while(tourChecked < list.size()) {
- ItemStack info = new ItemStack(Material.SKULL_ITEM, 1, (short)SkullType.PLAYER.ordinal());
- SkullMeta sm = (SkullMeta)info.getItemMeta();
- ItemStack retour = new ItemStack(Material.ARROW);
- ItemMeta retourMeta = retour.getItemMeta();
- retourMeta.setDisplayName("§6<- Retour");
- retour.setItemMeta(retourMeta);
- inv1.setItem(44, retour);
- if( MySQL.isInPlayerInfo_ISONLINE(list.get(tourChecked)) == 1) {
- //en ligne
- sm.setDisplayName("§a(En ligne) §6"+ MySQL.friendsName(list.get(tourChecked)));
- sm.setLore(Arrays.asList(new String[] {
- "§8=======================",
- "§6Server§f: §e" + MySQL.getPlayerInfo_SERVERNAME(list.get((tourChecked))),
- "§a> clique droit pour le rejoindre" ,
- "§8======================="}));
- } else {
- //pas en ligne
- sm.setDisplayName("§c(Hors Ligne) §6"+ MySQL. friendsName(list.get(tourChecked)));
- }
- sm.setOwner( MySQL.friendsName(list.get(tourChecked)));
- info.setItemMeta(sm);
- inv1.setItem(tourChecked, info);
- if(tourChecked < 44) {
- tourChecked++;
- } else {
- player.sendMessage("§8[§6Friends§8] §cCet affichage affiche jusqu'à §444 Amis §c!");
- break;
- }
- }
- player.openInventory(inv1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement