From 5b18275c4972e0b7a3ea42bea38046dcbbb6db92 Mon Sep 17 00:00:00 2001 From: Nathan Wolf Date: Wed, 25 Nov 2015 21:04:37 -0800 Subject: [PATCH] More lore/display color fixes --- .../me/blackvein/quests/prompts/ItemStackPrompt.java | 11 +++++++++-- src/main/java/me/blackvein/quests/util/ItemUtil.java | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/me/blackvein/quests/prompts/ItemStackPrompt.java b/src/main/java/me/blackvein/quests/prompts/ItemStackPrompt.java index cf28685d8..aa07c42db 100644 --- a/src/main/java/me/blackvein/quests/prompts/ItemStackPrompt.java +++ b/src/main/java/me/blackvein/quests/prompts/ItemStackPrompt.java @@ -1,5 +1,6 @@ package me.blackvein.quests.prompts; +import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.LinkedList; @@ -177,7 +178,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil { short data = -1; Map enchs = null; String display = null; - LinkedList lore = null; + List lore = null; if (cc.getSessionData("tempData") != null) { data = (Short) cc.getSessionData("tempData"); @@ -187,9 +188,15 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil { } if (cc.getSessionData("tempDisplay") != null) { display = ChatColor.translateAlternateColorCodes('&', (String) cc.getSessionData("tempDisplay")); + org.bukkit.Bukkit.getLogger().info("LOADED: " + display); } if (cc.getSessionData("tempLore") != null) { - lore = (LinkedList) cc.getSessionData("tempLore"); + lore = new ArrayList(); + LinkedList loadedLore = (LinkedList) cc.getSessionData("tempLore"); + for (String line : loadedLore) + { + lore.add(ChatColor.translateAlternateColorCodes('&', line)); + } } ItemStack stack = new ItemStack(Material.matchMaterial(name), amount); diff --git a/src/main/java/me/blackvein/quests/util/ItemUtil.java b/src/main/java/me/blackvein/quests/util/ItemUtil.java index f2c629f1b..64783a8b0 100644 --- a/src/main/java/me/blackvein/quests/util/ItemUtil.java +++ b/src/main/java/me/blackvein/quests/util/ItemUtil.java @@ -104,9 +104,9 @@ public class ItemUtil implements ColorUtil { Enchantment e = Quests.getEnchantment(enchs[0]); meta.addEnchant(e, Integer.parseInt(enchs[1]), true); } else if (arg.startsWith("displayname-")) { - meta.setDisplayName(arg.substring(12)); + meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', arg.substring(12))); } else if (arg.startsWith("lore-")) { - lore.add(arg.substring(5)); + lore.add(ChatColor.translateAlternateColorCodes('&', arg.substring(5))); } else { return null; }