Search in sources :

Example 6 with Island

use of pixelssky.objects.Island in project PixelsSkyblock by dudullle.

the class Inventories method getIslandsList.

public static Inventory getIslandsList(SPlayer p) {
    Inventory inv = Bukkit.createInventory(null, ((IslandsManager.islands.size()) / 9 + 1) * 9, "§6§3Liste des îles");
    for (Island i : IslandsManager.islands) {
        ArrayList<String> lore = new ArrayList<String>();
        lore.add("§e§nNiveau de l'île :§b " + i.getLevel());
        lore.add("§e§nNombre de membres :§b " + i.getMembers().size());
        lore.add("§e§nDifficulté :§b " + i.getData("difficulty").getData());
        if (p.getIsland() == i) {
            inv.addItem(Items.get("§5§l▶Votre île", Material.STAINED_CLAY, (byte) new Random().nextInt(15), lore));
        }
    }
    return inv;
}
Also used : Random(java.util.Random) ArrayList(java.util.ArrayList) Island(pixelssky.objects.Island) Inventory(org.bukkit.inventory.Inventory)

Aggregations

Island (pixelssky.objects.Island)6 ResultSet (java.sql.ResultSet)2 SQLException (java.sql.SQLException)2 ArrayList (java.util.ArrayList)2 Player (org.bukkit.entity.Player)2 Inventory (org.bukkit.inventory.Inventory)2 SPlayer (pixelssky.objects.SPlayer)2 Random (java.util.Random)1 TreeMap (java.util.TreeMap)1 EventHandler (org.bukkit.event.EventHandler)1