Split quest tasks in the lore if they get too long
This commit is contained in:
parent
010d31bd9e
commit
0ea229a8b4
@ -1,6 +1,7 @@
|
||||
package mineplex.core.quests.shop;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -13,6 +14,8 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.common.util.LineFormat;
|
||||
import mineplex.core.common.util.UtilText;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
@ -81,8 +84,9 @@ public class QuestPage extends ShopPageBase<QuestManager, QuestShop>
|
||||
ItemStack item = new ItemStack(Material.PAPER);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.YELLOW + "" + ChatColor.BOLD + quest.getName());
|
||||
meta.setLore(Arrays.asList(
|
||||
ChatColor.LIGHT_PURPLE + quest.getTask(),
|
||||
|
||||
List<String> lore = UtilText.splitLine(ChatColor.LIGHT_PURPLE + quest.getTask(), LineFormat.LORE);
|
||||
lore.addAll(Arrays.asList(
|
||||
"",
|
||||
ChatColor.GRAY + "Cost: " + ChatColor.GREEN + quest.getCost() + " Gems",
|
||||
ChatColor.GRAY + "Reward: " + ChatColor.AQUA + quest.getRewardAmount() + " " + quest.getRewardName(),
|
||||
@ -90,7 +94,9 @@ public class QuestPage extends ShopPageBase<QuestManager, QuestShop>
|
||||
quest.getRarity().getColor() + "" + ChatColor.BOLD + quest.getRarity().toString(),
|
||||
"",
|
||||
ChatColor.GREEN + "Click to buy " + QuestManager.QUEST_NAME + "!"
|
||||
));
|
||||
));
|
||||
meta.setLore(lore);
|
||||
|
||||
item.setItemMeta(meta);
|
||||
|
||||
addButton(i + currentSlot, item, new BuyQuestButton(_manager, this, quest));
|
||||
|
Loading…
Reference in New Issue
Block a user