mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-24 03:25:20 +01:00
More lore/display color fixes
This commit is contained in:
parent
d5731d324b
commit
5b18275c49
@ -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<Enchantment, Integer> enchs = null;
|
||||
String display = null;
|
||||
LinkedList<String> lore = null;
|
||||
List<String> 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<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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user