Search in sources :

Example 1 with IslandRanksInventoryConfig

use of com.iridium.iridiumskyblock.configs.inventories.IslandRanksInventoryConfig in project IridiumSkyblock by Iridium-Development.

the class IslandRanksGUI method addContent.

@Override
public void addContent(Inventory inventory) {
    inventory.clear();
    IslandRanksInventoryConfig islandRanks = IridiumSkyblock.getInstance().getInventories().islandRanksGUI;
    InventoryUtils.fillInventory(inventory, islandRanks.background);
    List<User> members = IridiumSkyblock.getInstance().getIslandManager().getIslandMembers(getIsland());
    inventory.setItem(islandRanks.owner.slot, ItemStackUtils.makeItem(islandRanks.owner, Collections.singletonList(new Placeholder("members", getIsland().getOwner().getName()))));
    inventory.setItem(islandRanks.coOwner.slot, ItemStackUtils.makeItem(islandRanks.coOwner, Collections.singletonList(new Placeholder("members", members.stream().filter(member -> member.getIslandRank().equals(IslandRank.CO_OWNER)).map(User::getName).collect(Collectors.joining(", "))))));
    inventory.setItem(islandRanks.moderator.slot, ItemStackUtils.makeItem(islandRanks.moderator, Collections.singletonList(new Placeholder("members", members.stream().filter(member -> member.getIslandRank().equals(IslandRank.MODERATOR)).map(User::getName).collect(Collectors.joining(", "))))));
    inventory.setItem(islandRanks.member.slot, ItemStackUtils.makeItem(islandRanks.member, Collections.singletonList(new Placeholder("members", members.stream().filter(member -> member.getIslandRank().equals(IslandRank.MEMBER)).map(User::getName).collect(Collectors.joining(", "))))));
    inventory.setItem(islandRanks.visitor.slot, ItemStackUtils.makeItem(islandRanks.visitor));
    if (IridiumSkyblock.getInstance().getConfiguration().backButtons && getPreviousInventory() != null) {
        inventory.setItem(inventory.getSize() + IridiumSkyblock.getInstance().getInventories().backButton.slot, ItemStackUtils.makeItem(IridiumSkyblock.getInstance().getInventories().backButton));
    }
}
Also used : IslandRanksInventoryConfig(com.iridium.iridiumskyblock.configs.inventories.IslandRanksInventoryConfig) Placeholder(com.iridium.iridiumcore.utils.Placeholder) User(com.iridium.iridiumskyblock.database.User)

Aggregations

Placeholder (com.iridium.iridiumcore.utils.Placeholder)1 IslandRanksInventoryConfig (com.iridium.iridiumskyblock.configs.inventories.IslandRanksInventoryConfig)1 User (com.iridium.iridiumskyblock.database.User)1