More lore/display color fixes

This commit is contained in:
Nathan Wolf 2015-11-25 21:04:37 -08:00
parent d5731d324b
commit 5b18275c49
2 changed files with 11 additions and 4 deletions

View File

@ -1,5 +1,6 @@
package me.blackvein.quests.prompts; package me.blackvein.quests.prompts;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedList; import java.util.LinkedList;
@ -177,7 +178,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
short data = -1; short data = -1;
Map<Enchantment, Integer> enchs = null; Map<Enchantment, Integer> enchs = null;
String display = null; String display = null;
LinkedList<String> lore = null; List<String> lore = null;
if (cc.getSessionData("tempData") != null) { if (cc.getSessionData("tempData") != null) {
data = (Short) cc.getSessionData("tempData"); data = (Short) cc.getSessionData("tempData");
@ -187,9 +188,15 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
} }
if (cc.getSessionData("tempDisplay") != null) { if (cc.getSessionData("tempDisplay") != null) {
display = ChatColor.translateAlternateColorCodes('&', (String) cc.getSessionData("tempDisplay")); display = ChatColor.translateAlternateColorCodes('&', (String) cc.getSessionData("tempDisplay"));
org.bukkit.Bukkit.getLogger().info("LOADED: " + display);
} }
if (cc.getSessionData("tempLore") != null) { if (cc.getSessionData("tempLore") != null) {
lore = (LinkedList<String>) cc.getSessionData("tempLore"); lore = new ArrayList<String>();
LinkedList<String> loadedLore = (LinkedList<String>) cc.getSessionData("tempLore");
for (String line : loadedLore)
{
lore.add(ChatColor.translateAlternateColorCodes('&', line));
}
} }
ItemStack stack = new ItemStack(Material.matchMaterial(name), amount); ItemStack stack = new ItemStack(Material.matchMaterial(name), amount);

View File

@ -104,9 +104,9 @@ public class ItemUtil implements ColorUtil {
Enchantment e = Quests.getEnchantment(enchs[0]); Enchantment e = Quests.getEnchantment(enchs[0]);
meta.addEnchant(e, Integer.parseInt(enchs[1]), true); meta.addEnchant(e, Integer.parseInt(enchs[1]), true);
} else if (arg.startsWith("displayname-")) { } else if (arg.startsWith("displayname-")) {
meta.setDisplayName(arg.substring(12)); meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', arg.substring(12)));
} else if (arg.startsWith("lore-")) { } else if (arg.startsWith("lore-")) {
lore.add(arg.substring(5)); lore.add(ChatColor.translateAlternateColorCodes('&', arg.substring(5)));
} else { } else {
return null; return null;
} }