use of com.iridium.iridiumskyblock.configs.BlockValues.ValuableBlock in project IridiumSkyblock by Iridium-Development.
the class BlockValueGUI method addContent.
@Override
public void addContent(Inventory inventory) {
inventory.clear();
InventoryUtils.fillInventory(inventory, getNoItemGUI().background);
inventory.setItem(inventory.getSize() - 3, ItemStackUtils.makeItem(IridiumSkyblock.getInstance().getInventories().nextPage));
inventory.setItem(inventory.getSize() - 7, ItemStackUtils.makeItem(IridiumSkyblock.getInstance().getInventories().previousPage));
if (guiType == BlockValueType.BLOCK) {
IridiumSkyblock.getInstance().getBlockValues().blockValues.entrySet().stream().filter(valuableBlockEntry -> (page == 1 ? valuableBlockEntry.getValue().page <= 1 : valuableBlockEntry.getValue().page == page)).forEachOrdered(valuableBlock -> {
XMaterial material = valuableBlock.getKey();
ValuableBlock blockInfo = valuableBlock.getValue();
ItemStack blockItem = ItemStackUtils.makeItem(material, 1, StringUtils.color(blockInfo.name), getColoredValueLore(blockInfo.value));
inventory.setItem(blockInfo.slot, blockItem);
});
} else if (guiType == BlockValueType.SPAWNER) {
IridiumSkyblock.getInstance().getBlockValues().spawnerValues.entrySet().stream().filter(valuableSpawnerEntry -> (page == 1 ? valuableSpawnerEntry.getValue().page <= 1 : valuableSpawnerEntry.getValue().page == page)).forEachOrdered(valuableSpawner -> {
ValuableBlock spawnerInfo = valuableSpawner.getValue();
ItemStack spawnerItem = ItemStackUtils.makeItem(XMaterial.SPAWNER, 1, StringUtils.color(spawnerInfo.name), getColoredValueLore(spawnerInfo.value));
inventory.setItem(spawnerInfo.slot, spawnerItem);
});
}
if (IridiumSkyblock.getInstance().getConfiguration().backButtons && getPreviousInventory() != null) {
inventory.setItem(inventory.getSize() + IridiumSkyblock.getInstance().getInventories().backButton.slot, ItemStackUtils.makeItem(IridiumSkyblock.getInstance().getInventories().backButton));
}
}
Aggregations