Search in sources :

Example 16 with Placeholder

use of com.iridium.iridiumcore.utils.Placeholder in project IridiumSkyblock by Iridium-Development.

the class IslandManager method getIslandCrystal.

public ItemStack getIslandCrystal(int amount) {
    ItemStack itemStack = ItemStackUtils.makeItem(IridiumSkyblock.getInstance().getConfiguration().islandCrystal, Collections.singletonList(new Placeholder("amount", String.valueOf(amount))));
    NBTItem nbtItem = new NBTItem(itemStack);
    NBTCompound nbtCompound = nbtItem.getOrCreateCompound("iridiumskyblock");
    nbtCompound.setInteger("islandCrystals", amount);
    return nbtItem.getItem();
}
Also used : Placeholder(com.iridium.iridiumcore.utils.Placeholder) NBTCompound(com.iridium.iridiumcore.dependencies.nbtapi.NBTCompound) NBTItem(com.iridium.iridiumcore.dependencies.nbtapi.NBTItem) ItemStack(org.bukkit.inventory.ItemStack)

Example 17 with Placeholder

use of com.iridium.iridiumcore.utils.Placeholder in project IridiumSkyblock by Iridium-Development.

the class PlaceholderBuilder method applyPlayerPlaceholders.

public PlaceholderBuilder applyPlayerPlaceholders(User user) {
    placeholderList.add(new Placeholder("player_name", user.getName()));
    placeholderList.add(new Placeholder("has_island", user.getIsland().isPresent() ? IridiumSkyblock.getInstance().getMessages().yes : IridiumSkyblock.getInstance().getMessages().no));
    placeholderList.add(new Placeholder("player_rank", user.getIslandRank().getDisplayName()));
    placeholderList.add(new Placeholder("player_join", user.getJoinTime().format(DateTimeFormatter.ofPattern(IridiumSkyblock.getInstance().getConfiguration().dateTimeFormat))));
    return this;
}
Also used : Placeholder(com.iridium.iridiumcore.utils.Placeholder)

Aggregations

Placeholder (com.iridium.iridiumcore.utils.Placeholder)17 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)8 PlaceholderBuilder (com.iridium.iridiumskyblock.PlaceholderBuilder)5 Map (java.util.Map)5 Island (com.iridium.iridiumskyblock.database.Island)3 User (com.iridium.iridiumskyblock.database.User)3 ArrayList (java.util.ArrayList)3 List (java.util.List)3 Item (com.iridium.iridiumcore.Item)2 InventoryUtils (com.iridium.iridiumcore.utils.InventoryUtils)2 ItemStackUtils (com.iridium.iridiumcore.utils.ItemStackUtils)2 IridiumSkyblock (com.iridium.iridiumskyblock.IridiumSkyblock)2 InventoryClickEvent (org.bukkit.event.inventory.InventoryClickEvent)2 Inventory (org.bukkit.inventory.Inventory)2 ItemStack (org.bukkit.inventory.ItemStack)2 NotNull (org.jetbrains.annotations.NotNull)2 NBTCompound (com.iridium.iridiumcore.dependencies.nbtapi.NBTCompound)1 NBTItem (com.iridium.iridiumcore.dependencies.nbtapi.NBTItem)1 Booster (com.iridium.iridiumskyblock.Booster)1 Mission (com.iridium.iridiumskyblock.Mission)1