Quests - V2.8.2-04 - Removed duplicate ColorUtil - By GregZ_

* Incremented dev version in pom.xml.
     * Removed duplicate ColorUtil interface, why were there even two of these?
     * Updated classes that inherited ColorUtil to use the ChatColor enum instead.
This commit is contained in:
GregZ_ 2017-06-18 20:47:40 +01:00
parent 38842f8ca7
commit 38e82e4fcc
11 changed files with 1282 additions and 1311 deletions

View File

@ -3,7 +3,7 @@
<groupId>me.blackvein.quests</groupId>
<artifactId>quests</artifactId>
<version>2.8.2-03</version>
<version>2.8.2-04</version>
<name>quests</name>
<url>https://github.com/FlyingPikachu/Quests/</url>
<packaging>jar</packaging>

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,5 @@
package me.blackvein.quests;
import com.sk89q.worldguard.protection.managers.RegionManager;
import me.blackvein.quests.util.ColorUtil;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
@ -14,15 +10,6 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.UUID;
import me.blackvein.quests.prompts.ItemStackPrompt;
import me.blackvein.quests.prompts.RequirementsPrompt;
import me.blackvein.quests.prompts.RewardsPrompt;
import me.blackvein.quests.prompts.StagesPrompt;
import me.blackvein.quests.util.CK;
import me.blackvein.quests.util.ItemUtil;
import me.blackvein.quests.util.Lang;
import net.citizensnpcs.api.CitizensAPI;
import org.bukkit.ChatColor;
import org.bukkit.DyeColor;
import org.bukkit.Location;
@ -33,13 +20,31 @@ import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.conversations.*;
import org.bukkit.conversations.ConversationAbandonedEvent;
import org.bukkit.conversations.ConversationAbandonedListener;
import org.bukkit.conversations.ConversationContext;
import org.bukkit.conversations.ConversationFactory;
import org.bukkit.conversations.FixedSetPrompt;
import org.bukkit.conversations.NumericPrompt;
import org.bukkit.conversations.Prompt;
import org.bukkit.conversations.StringPrompt;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
import com.sk89q.worldguard.protection.managers.RegionManager;
import me.blackvein.quests.prompts.ItemStackPrompt;
import me.blackvein.quests.prompts.RequirementsPrompt;
import me.blackvein.quests.prompts.RewardsPrompt;
import me.blackvein.quests.prompts.StagesPrompt;
import me.blackvein.quests.util.CK;
import me.blackvein.quests.util.ItemUtil;
import me.blackvein.quests.util.Lang;
import net.citizensnpcs.api.CitizensAPI;
public class QuestFactory implements ConversationAbandonedListener{
public Quests quests;
Map<UUID, Quest> editSessions = new HashMap<UUID, Quest>();
@ -94,11 +99,11 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
public String getPromptText(ConversationContext context) {
String text
= GOLD + Lang.get("questEditorTitle") + "\n"
+ BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("questEditorCreate") + "\n"
+ BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("questEditorEdit") + "\n"
+ BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("questEditorDelete") + "\n"
+ GOLD + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("exit");
= ChatColor.GOLD + Lang.get("questEditorTitle") + "\n"
+ ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorCreate") + "\n"
+ ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorEdit") + "\n"
+ ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorDelete") + "\n"
+ ChatColor.GOLD + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("exit");
return text;
@ -114,7 +119,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
if (player.hasPermission("quests.editor.*") || player.hasPermission("quests.editor.create")) {
return new QuestNamePrompt();
} else {
player.sendMessage(RED + Lang.get("questEditorNoPermsCreate"));
player.sendMessage(ChatColor.RED + Lang.get("questEditorNoPermsCreate"));
return new MenuPrompt();
}
@ -123,7 +128,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
if (player.hasPermission("quests.editor.*") || player.hasPermission("quests.editor.edit")) {
return new SelectEditPrompt();
} else {
player.sendMessage(RED + Lang.get("questEditorNoPermsCreate"));
player.sendMessage(ChatColor.RED + Lang.get("questEditorNoPermsCreate"));
return new MenuPrompt();
}
@ -132,12 +137,12 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
if (player.hasPermission("quests.editor.*") || player.hasPermission("quests.editor.delete")) {
return new SelectDeletePrompt();
} else {
player.sendMessage(RED + Lang.get("questEditorNoPermsDelete"));
player.sendMessage(ChatColor.RED + Lang.get("questEditorNoPermsDelete"));
return new MenuPrompt();
}
} else if (input.equalsIgnoreCase("4")) {
context.getForWhom().sendRawMessage(YELLOW + Lang.get("exited"));
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("exited"));
return Prompt.END_OF_CONVERSATION;
}
@ -164,29 +169,29 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
public String getPromptText(ConversationContext context) {
String text
= GOLD + "- " + Lang.get("quest") + ": " + AQUA + context.getSessionData(CK.Q_NAME) + GOLD + " -\n";
= ChatColor.GOLD + "- " + Lang.get("quest") + ": " + ChatColor.AQUA + context.getSessionData(CK.Q_NAME) + ChatColor.GOLD + " -\n";
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("questEditorName") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorName") + "\n";
if (context.getSessionData(CK.Q_ASK_MESSAGE) == null) {
text += BLUE + "" + BOLD + "2" + RESET + RED + " - " + Lang.get("questEditorAskMessage") + " " + DARKRED + "(" + Lang.get("questRequiredNoneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.RED + " - " + Lang.get("questEditorAskMessage") + " " + ChatColor.DARK_RED + "(" + Lang.get("questRequiredNoneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("questEditorAskMessage") + " (\"" + context.getSessionData(CK.Q_ASK_MESSAGE) + "\")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorAskMessage") + " (\"" + context.getSessionData(CK.Q_ASK_MESSAGE) + "\")\n";
}
if (context.getSessionData(CK.Q_FINISH_MESSAGE) == null) {
text += BLUE + "" + BOLD + "3" + RESET + RED + " - " + Lang.get("questEditorFinishMessage") + " " + DARKRED + "(" + Lang.get("questRequiredNoneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.RED + " - " + Lang.get("questEditorFinishMessage") + " " + ChatColor.DARK_RED + "(" + Lang.get("questRequiredNoneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("questEditorFinishMessage") + " (\"" + context.getSessionData(CK.Q_FINISH_MESSAGE) + "\")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorFinishMessage") + " (\"" + context.getSessionData(CK.Q_FINISH_MESSAGE) + "\")\n";
}
if (context.getSessionData(CK.Q_REDO_DELAY) == null) {
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("questEditorRedoDelay") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorRedoDelay") + " (" + Lang.get("noneSet") + ")\n";
} else {
//something here is throwing an exception
try {
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("questEditorRedoDelay") + " (" + Quests.getTime((Long) context.getSessionData(CK.Q_REDO_DELAY)) + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorRedoDelay") + " (" + Quests.getTime((Long) context.getSessionData(CK.Q_REDO_DELAY)) + ")\n";
} catch (Exception e) {
e.printStackTrace();
}
@ -195,27 +200,27 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
}
if (context.getSessionData(CK.Q_START_NPC) == null && quests.citizens != null) {
text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("questEditorNPCStart") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorNPCStart") + " (" + Lang.get("noneSet") + ")\n";
} else if (quests.citizens != null) {
text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("questEditorNPCStart") + " (" + CitizensAPI.getNPCRegistry().getById((Integer) context.getSessionData(CK.Q_START_NPC)).getName() + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorNPCStart") + " (" + CitizensAPI.getNPCRegistry().getById((Integer) context.getSessionData(CK.Q_START_NPC)).getName() + ")\n";
}
if (context.getSessionData(CK.Q_START_BLOCK) == null) {
if (quests.citizens != null) {
text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - " + Lang.get("questEditorBlockStart") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "6" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorBlockStart") + " (" + Lang.get("noneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("questEditorBlockStart") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorBlockStart") + " (" + Lang.get("noneSet") + ")\n";
}
} else {
if (quests.citizens != null) {
Location l = (Location) context.getSessionData(CK.Q_START_BLOCK);
text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - " + Lang.get("questEditorBlockStart") + " (" + l.getWorld().getName() + ", " + l.getBlockX() + ", " + l.getBlockY() + ", " + l.getBlockZ() + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "6" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorBlockStart") + " (" + l.getWorld().getName() + ", " + l.getBlockX() + ", " + l.getBlockY() + ", " + l.getBlockZ() + ")\n";
} else {
Location l = (Location) context.getSessionData(CK.Q_START_BLOCK);
text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("questEditorBlockStart") + " (" + l.getWorld().getName() + ", " + l.getBlockX() + ", " + l.getBlockY() + ", " + l.getBlockZ() + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorBlockStart") + " (" + l.getWorld().getName() + ", " + l.getBlockX() + ", " + l.getBlockY() + ", " + l.getBlockZ() + ")\n";
}
}
@ -225,19 +230,19 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
if (context.getSessionData(CK.Q_REGION) == null) {
if (quests.citizens != null) {
text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - " + Lang.get("questWGSetRegion") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "7" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questWGSetRegion") + " (" + Lang.get("noneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - " + Lang.get("questWGSetRegion") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "6" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questWGSetRegion") + " (" + Lang.get("noneSet") + ")\n";
}
} else {
if (quests.citizens != null) {
String s = (String) context.getSessionData(CK.Q_REGION);
text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - " + Lang.get("questWGSetRegion") + " (" + GREEN + s + YELLOW + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "7" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questWGSetRegion") + " (" + ChatColor.GREEN + s + ChatColor.YELLOW + ")\n";
} else {
String s = (String) context.getSessionData(CK.Q_REGION);
text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - " + Lang.get("questWGSetRegion") + " (" + GREEN + s + YELLOW + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "6" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questWGSetRegion") + " (" + ChatColor.GREEN + s + ChatColor.YELLOW + ")\n";
}
}
@ -245,9 +250,9 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
} else {
if (quests.citizens != null) {
text += GRAY + "7 - " + Lang.get("questWGSetRegion") + " (" + Lang.get("questWGNotInstalled") + ")\n";
text += ChatColor.GRAY + "7 - " + Lang.get("questWGSetRegion") + " (" + Lang.get("questWGNotInstalled") + ")\n";
} else {
text += GRAY + "6 - " + Lang.get("questWGSetRegion") + " (" + Lang.get("questWGNotInstalled") + ")\n";
text += ChatColor.GRAY + "6 - " + Lang.get("questWGSetRegion") + " (" + Lang.get("questWGNotInstalled") + ")\n";
}
}
@ -255,19 +260,19 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
if (context.getSessionData(CK.Q_INITIAL_EVENT) == null) {
if (quests.citizens != null) {
text += BLUE + "" + BOLD + "8" + RESET + YELLOW + " - " + Lang.get("questEditorInitialEvent") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "8" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorInitialEvent") + " (" + Lang.get("noneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - " + Lang.get("questEditorInitialEvent") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "7" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorInitialEvent") + " (" + Lang.get("noneSet") + ")\n";
}
} else {
if (quests.citizens != null) {
String s = (String) context.getSessionData(CK.Q_INITIAL_EVENT);
text += BLUE + "" + BOLD + "8" + RESET + YELLOW + " - " + Lang.get("questEditorInitialEvent") + " (" + s + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "8" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorInitialEvent") + " (" + s + ")\n";
} else {
String s = (String) context.getSessionData(CK.Q_INITIAL_EVENT);
text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - " + Lang.get("questEditorInitialEvent") + " (" + s + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "7" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorInitialEvent") + " (" + s + ")\n";
}
}
@ -275,46 +280,46 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
if (quests.citizens != null) {
if (context.getSessionData(CK.Q_GUIDISPLAY) == null) {
text += BLUE + "" + BOLD + "9" + RESET + YELLOW + " - " + Lang.get("questEditorSetGUI") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "9" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorSetGUI") + " (" + Lang.get("noneSet") + ")\n";
} else {
ItemStack stack = (ItemStack) context.getSessionData(CK.Q_GUIDISPLAY);
text += BLUE + "" + BOLD + "9" + RESET + YELLOW + " - " + Lang.get("questEditorSetGUI") + " (" + ItemUtil.getDisplayString(stack) + RESET + YELLOW + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "9" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorSetGUI") + " (" + ItemUtil.getDisplayString(stack) + ChatColor.RESET + ChatColor.YELLOW + ")\n";
}
} else {
text += GRAY + "8 - " + Lang.get("questEditorSetGUI") + " (" + Lang.get("questCitNotInstalled") + ")\n";
text += ChatColor.GRAY + "8 - " + Lang.get("questEditorSetGUI") + " (" + Lang.get("questCitNotInstalled") + ")\n";
}
if (quests.citizens != null) {
text += BLUE + "" + BOLD + "10" + RESET + DARKAQUA + " - " + Lang.get("questEditorReqs") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "10" + ChatColor.RESET + ChatColor.DARK_AQUA + " - " + Lang.get("questEditorReqs") + "\n";
} else {
text += BLUE + "" + BOLD + "9" + RESET + DARKAQUA + " - " + Lang.get("questEditorReqs") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "9" + ChatColor.RESET + ChatColor.DARK_AQUA + " - " + Lang.get("questEditorReqs") + "\n";
}
if (quests.citizens != null) {
text += BLUE + "" + BOLD + "11" + RESET + PINK + " - " + Lang.get("questEditorStages") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "11" + ChatColor.RESET + ChatColor.LIGHT_PURPLE + " - " + Lang.get("questEditorStages") + "\n";
} else {
text += BLUE + "" + BOLD + "10" + RESET + PINK + " - " + Lang.get("questEditorStages") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "10" + ChatColor.RESET + ChatColor.LIGHT_PURPLE + " - " + Lang.get("questEditorStages") + "\n";
}
if (quests.citizens != null) {
text += BLUE + "" + BOLD + "12" + RESET + GREEN + " - " + Lang.get("questEditorRews") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "12" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("questEditorRews") + "\n";
} else {
text += BLUE + "" + BOLD + "11" + RESET + GREEN + " - " + Lang.get("questEditorRews") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "11" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("questEditorRews") + "\n";
}
if (quests.citizens != null) {
text += BLUE + "" + BOLD + "13" + RESET + GOLD + " - " + Lang.get("save") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "13" + ChatColor.RESET + ChatColor.GOLD + " - " + Lang.get("save") + "\n";
} else {
text += BLUE + "" + BOLD + "12" + RESET + GOLD + " - " + Lang.get("save") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "12" + ChatColor.RESET + ChatColor.GOLD + " - " + Lang.get("save") + "\n";
}
if (quests.citizens != null) {
text += BLUE + "" + BOLD + "14" + RESET + RED + " - " + Lang.get("exit") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "14" + ChatColor.RESET + ChatColor.RED + " - " + Lang.get("exit") + "\n";
} else {
text += BLUE + "" + BOLD + "13" + RESET + RED + " - " + Lang.get("exit") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "13" + ChatColor.RESET + ChatColor.RED + " - " + Lang.get("exit") + "\n";
}
return text;
@ -438,12 +443,12 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
String s = GOLD + Lang.get("questEditTitle") + "\n";
String s = ChatColor.GOLD + Lang.get("questEditTitle") + "\n";
for (Quest q : quests.getQuests()) {
s += GRAY + "- " + YELLOW + q.getName() + "\n";
s += ChatColor.GRAY + "- " + ChatColor.YELLOW + q.getName() + "\n";
}
return s + GOLD + Lang.get("questEditorEditEnterQuestName");
return s + ChatColor.GOLD + Lang.get("questEditorEditEnterQuestName");
}
@ -493,8 +498,8 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
String text = GOLD + Lang.get("questCreateTitle") + "\n";
text += AQUA + Lang.get("questEditorCreate") + " " + GOLD + "- " + Lang.get("questEditorEnterQuestName");
String text = ChatColor.GOLD + Lang.get("questCreateTitle") + "\n";
text += ChatColor.AQUA + Lang.get("questEditorCreate") + " " + ChatColor.GOLD + "- " + Lang.get("questEditorEnterQuestName");
return text;
@ -651,7 +656,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
}
if (s != null && s.equalsIgnoreCase(input) == false) {
context.getForWhom().sendRawMessage(RED + Lang.get("questEditorNameExists"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorNameExists"));
return new SetNamePrompt();
}
}
@ -659,7 +664,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
}
if (names.contains(input)) {
context.getForWhom().sendRawMessage(RED + Lang.get("questEditorBeingEdited"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorBeingEdited"));
return new SetNamePrompt();
}
@ -740,16 +745,16 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
String text = DARKGREEN + Lang.get("eventTitle") + "\n";
String text = ChatColor.DARK_GREEN + Lang.get("eventTitle") + "\n";
if (quests.events.isEmpty()) {
text += RED + "- " + Lang.get("none");
text += ChatColor.RED + "- " + Lang.get("none");
} else {
for (Event e : quests.events) {
text += GREEN + "- " + e.getName() + "\n";
text += ChatColor.GREEN + "- " + e.getName() + "\n";
}
}
return text + YELLOW + Lang.get("questEditorEnterInitialEvent");
return text + ChatColor.YELLOW + Lang.get("questEditorEnterInitialEvent");
}
@ -772,7 +777,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
}
if (found == null) {
player.sendMessage(RED + input + YELLOW + " " + Lang.get("questEditorInvalidEventName"));
player.sendMessage(ChatColor.RED + input + ChatColor.YELLOW + " " + Lang.get("questEditorInvalidEventName"));
return new InitialEventPrompt();
} else {
context.setSessionData(CK.Q_INITIAL_EVENT, found.getName());
@ -781,7 +786,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
context.setSessionData(CK.Q_INITIAL_EVENT, null);
player.sendMessage(YELLOW + Lang.get("questEditorEventCleared"));
player.sendMessage(ChatColor.YELLOW + Lang.get("questEditorEventCleared"));
return new CreateMenuPrompt();
} else {
return new CreateMenuPrompt();
@ -813,8 +818,8 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
if (ItemUtil.compareItems(stack, quest.guiDisplay, false) == 0) {
String error = Lang.get("questGUIError");
error = error.replaceAll("<quest>", PURPLE + quest.name + RED);
context.getForWhom().sendRawMessage(RED + error);
error = error.replaceAll("<quest>", ChatColor.DARK_PURPLE + quest.name + ChatColor.RED);
context.getForWhom().sendRawMessage(ChatColor.RED + error);
failed = true;
break;
@ -832,16 +837,16 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
}
String text = GREEN + Lang.get("questGUITitle") + "\n";
String text = ChatColor.GREEN + Lang.get("questGUITitle") + "\n";
if (context.getSessionData(CK.Q_GUIDISPLAY) != null) {
ItemStack stack = (ItemStack) context.getSessionData(CK.Q_GUIDISPLAY);
text += DARKGREEN + Lang.get("questCurrentItem") + " " + RESET + ItemUtil.getDisplayString(stack) + "\n\n";
text += ChatColor.DARK_GREEN + Lang.get("questCurrentItem") + " " + ChatColor.RESET + ItemUtil.getDisplayString(stack) + "\n\n";
} else {
text += DARKGREEN + Lang.get("questCurrentItem") + " " + GRAY + "(" + Lang.get("none") + ")\n\n";
text += ChatColor.DARK_GREEN + Lang.get("questCurrentItem") + " " + ChatColor.GRAY + "(" + Lang.get("none") + ")\n\n";
}
text += GREEN + "" + BOLD + "1 -" + RESET + DARKGREEN + " " + Lang.get("questSetItem") + "\n";
text += GREEN + "" + BOLD + "2 -" + RESET + DARKGREEN + " " + Lang.get("questClearItem") + "\n";
text += GREEN + "" + BOLD + "3 -" + RESET + GREEN + " " + Lang.get("done") + "\n";
text += ChatColor.GREEN + "" + ChatColor.BOLD + "1 -" + ChatColor.RESET + ChatColor.DARK_GREEN + " " + Lang.get("questSetItem") + "\n";
text += ChatColor.GREEN + "" + ChatColor.BOLD + "2 -" + ChatColor.RESET + ChatColor.DARK_GREEN + " " + Lang.get("questClearItem") + "\n";
text += ChatColor.GREEN + "" + ChatColor.BOLD + "3 -" + ChatColor.RESET + ChatColor.GREEN + " " + Lang.get("done") + "\n";
return text;
@ -857,7 +862,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
} else if (input.equalsIgnoreCase("2")) {
context.setSessionData(CK.Q_GUIDISPLAY, null);
context.getForWhom().sendRawMessage(YELLOW + Lang.get("questGUICleared"));
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("questGUICleared"));
return new GUIDisplayPrompt();
} else {
@ -875,7 +880,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
String text = DARKGREEN + Lang.get("questRegionTitle") + "\n";
String text = ChatColor.DARK_GREEN + Lang.get("questRegionTitle") + "\n";
boolean any = false;
for (World world : quests.getServer().getWorlds()) {
@ -884,7 +889,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
for (String region : rm.getRegions().keySet()) {
any = true;
text += GREEN + region + ", ";
text += ChatColor.GREEN + region + ", ";
}
@ -894,10 +899,10 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
text = text.substring(0, text.length() - 2);
text += "\n\n";
} else {
text += GRAY + "(" + Lang.get("none") + ")\n\n";
text += ChatColor.GRAY + "(" + Lang.get("none") + ")\n\n";
}
return text + YELLOW + Lang.get("questWGPrompt");
return text + ChatColor.YELLOW + Lang.get("questWGPrompt");
}
@ -931,8 +936,8 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
if (found == null) {
String error = Lang.get("questWGInvalidRegion");
error = error.replaceAll("<region>", RED + input + YELLOW);
player.sendMessage(RED + error);
error = error.replaceAll("<region>", ChatColor.RED + input + ChatColor.YELLOW);
player.sendMessage(ChatColor.RED + error);
return new RegionPrompt();
} else {
context.setSessionData(CK.Q_REGION, found);
@ -941,7 +946,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
context.setSessionData(CK.Q_REGION, null);
player.sendMessage(YELLOW + Lang.get("questWGRegionCleared"));
player.sendMessage(ChatColor.YELLOW + Lang.get("questWGRegionCleared"));
return new CreateMenuPrompt();
} else {
return new CreateMenuPrompt();
@ -974,13 +979,13 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
int i = Integer.parseInt(input);
delay = i * 1000;
} catch (NumberFormatException e) {
context.getForWhom().sendRawMessage(ITALIC + "" + RED + input + RESET + RED + " " + Lang.get("stageEditorInvalidNumber"));
context.getForWhom().sendRawMessage(ChatColor.ITALIC + "" + ChatColor.RED + input + ChatColor.RESET + ChatColor.RED + " " + Lang.get("stageEditorInvalidNumber"));
//delay = MiscUtil.getTimeFromString(input);
return new RedoDelayPrompt();
}
if (delay < -1) {
context.getForWhom().sendRawMessage(RED + Lang.get("questEditorPositiveAmount"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorPositiveAmount"));
} else if (delay == 0) {
context.setSessionData(CK.Q_REDO_DELAY, null);
} else if (delay != -1) {
@ -997,10 +1002,10 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
String text = GREEN
String text = ChatColor.GREEN
+ "1 - " + Lang.get("yesWord") + "\n"
+ "2 - " + Lang.get("noWord");
return ChatColor.YELLOW + Lang.get("questEditorSave") + " \"" + AQUA + context.getSessionData(CK.Q_NAME) + YELLOW + "\"?\n" + text;
return ChatColor.YELLOW + Lang.get("questEditorSave") + " \"" + ChatColor.AQUA + context.getSessionData(CK.Q_NAME) + ChatColor.YELLOW + "\"?\n" + text;
}
@ -1010,13 +1015,13 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
if (input.equalsIgnoreCase("1") || input.equalsIgnoreCase(Lang.get("yesWord"))) {
if (context.getSessionData(CK.Q_ASK_MESSAGE) == null) {
context.getForWhom().sendRawMessage(RED + Lang.get("questEditorNeedAskMessage"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorNeedAskMessage"));
return new CreateMenuPrompt();
} else if (context.getSessionData(CK.Q_FINISH_MESSAGE) == null) {
context.getForWhom().sendRawMessage(RED + Lang.get("questEditorNeedFinishMessage"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorNeedFinishMessage"));
return new CreateMenuPrompt();
} else if (StagesPrompt.getStages(context) == 0) {
context.getForWhom().sendRawMessage(RED + Lang.get("questEditorNeedStages"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorNeedStages"));
return new CreateMenuPrompt();
}
@ -1046,7 +1051,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
}
quests.updateData();
}
context.getForWhom().sendRawMessage(BOLD + Lang.get("questEditorSaved"));
context.getForWhom().sendRawMessage(ChatColor.BOLD + Lang.get("questEditorSaved"));
} catch (IOException e) {
e.printStackTrace();
@ -1070,7 +1075,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
String text = GREEN
String text = ChatColor.GREEN
+ "1 - " + Lang.get("yesWord") + "\n"
+ "2 - " + Lang.get("noWord");
return ChatColor.YELLOW + Lang.get("questEditorExited") + "\n" + text;
@ -1082,7 +1087,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
if (input.equalsIgnoreCase("1") || input.equalsIgnoreCase(Lang.get("yesWord"))) {
context.getForWhom().sendRawMessage(BOLD + "" + YELLOW + Lang.get("exited"));
context.getForWhom().sendRawMessage(ChatColor.BOLD + "" + ChatColor.YELLOW + Lang.get("exited"));
return Prompt.END_OF_CONVERSATION;
} else if (input.equalsIgnoreCase("2") || input.equalsIgnoreCase(Lang.get("noWord"))) {
@ -2247,14 +2252,14 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
String text = GOLD + Lang.get("questDeleteTitle") + "\n";
String text = ChatColor.GOLD + Lang.get("questDeleteTitle") + "\n";
for (Quest quest : quests.quests) {
text += AQUA + quest.name + YELLOW + ",";
text += ChatColor.AQUA + quest.name + ChatColor.YELLOW + ",";
}
text = text.substring(0, text.length() - 1) + "\n";
text += YELLOW + Lang.get("questEditorEnterQuestName");
text += ChatColor.YELLOW + Lang.get("questEditorEnterQuestName");
return text;
@ -2283,17 +2288,17 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
context.setSessionData(CK.ED_QUEST_DELETE, found.name);
return new DeletePrompt();
} else {
((Player) context.getForWhom()).sendMessage(RED + Lang.get("questEditorQuestAsRequirement1") + " \"" + PURPLE + context.getSessionData(CK.ED_QUEST_DELETE) + RED + "\" " + Lang.get("questEditorQuestAsRequirement2"));
((Player) context.getForWhom()).sendMessage(ChatColor.RED + Lang.get("questEditorQuestAsRequirement1") + " \"" + ChatColor.DARK_PURPLE + context.getSessionData(CK.ED_QUEST_DELETE) + ChatColor.RED + "\" " + Lang.get("questEditorQuestAsRequirement2"));
for (String s : used) {
((Player) context.getForWhom()).sendMessage(RED + "- " + DARKRED + s);
((Player) context.getForWhom()).sendMessage(ChatColor.RED + "- " + ChatColor.DARK_RED + s);
}
((Player) context.getForWhom()).sendMessage(RED + Lang.get("questEditorQuestAsRequirement3"));
((Player) context.getForWhom()).sendMessage(ChatColor.RED + Lang.get("questEditorQuestAsRequirement3"));
return new SelectDeletePrompt();
}
}
((Player) context.getForWhom()).sendMessage(RED + Lang.get("questEditorQuestNotFound"));
((Player) context.getForWhom()).sendMessage(ChatColor.RED + Lang.get("questEditorQuestNotFound"));
return new SelectDeletePrompt();
} else {
@ -2309,8 +2314,8 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
public String getPromptText(ConversationContext context) {
String text
= RED + Lang.get("questEditorDeleted") + " \"" + GOLD + (String) context.getSessionData(CK.ED_QUEST_DELETE) + RED + "\"?\n";
text += YELLOW + Lang.get("yesWord") + "/" + Lang.get("noWord");
= ChatColor.RED + Lang.get("questEditorDeleted") + " \"" + ChatColor.GOLD + (String) context.getSessionData(CK.ED_QUEST_DELETE) + ChatColor.RED + "\"?\n";
text += ChatColor.YELLOW + Lang.get("yesWord") + "/" + Lang.get("noWord");
return text;
@ -2367,7 +2372,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
quests.reloadQuests();
context.getForWhom().sendRawMessage(WHITE + "" + BOLD + Lang.get("questDeleted"));
context.getForWhom().sendRawMessage(ChatColor.WHITE + "" + ChatColor.BOLD + Lang.get("questDeleted"));
}
}

View File

@ -8,11 +8,6 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import me.blackvein.quests.Quester;
import me.blackvein.quests.Quests;
import me.blackvein.quests.util.ColorUtil;
import me.blackvein.quests.util.Lang;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.conversations.ConversationContext;
@ -24,7 +19,11 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
import me.blackvein.quests.Quester;
import me.blackvein.quests.Quests;
import me.blackvein.quests.util.Lang;
public class ItemStackPrompt extends FixedSetPrompt {
//Stores itemstack in "tempStack" context data.
//Stores name in "tempName"
@ -44,7 +43,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext cc) {
String menu = YELLOW + Lang.get("createItemTitle") + "\n";
String menu = ChatColor.YELLOW + Lang.get("createItemTitle") + "\n";
if (cc.getSessionData("tempName") != null) {
String stackData = getItemData(cc);
if (stackData != null) {
@ -53,15 +52,15 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
} else {
menu += "\n";
}
menu += GOLD + "" + BOLD + "0. " + RESET + "" + YELLOW + Lang.get("itemCreateLoadHand") + "\n";
menu += YELLOW + "" + BOLD + "1. " + RESET + "" + GOLD + Lang.get("itemCreateSetName") + "\n";
menu += YELLOW + "" + BOLD + "2. " + RESET + "" + GOLD + Lang.get("itemCreateSetAmount") + "\n";
menu += YELLOW + "" + BOLD + "3. " + RESET + "" + GOLD + Lang.get("itemCreateSetDurab") + "\n";
menu += YELLOW + "" + BOLD + "4. " + RESET + "" + GOLD + Lang.get("itemCreateSetEnchs") + "\n";
menu += YELLOW + "" + BOLD + "5. " + RESET + "" + ITALIC + GOLD + Lang.get("itemCreateSetDisplay") + "\n";
menu += YELLOW + "" + BOLD + "6. " + RESET + "" + ITALIC + GOLD + Lang.get("itemCreateSetLore") + "\n";
menu += YELLOW + "" + BOLD + "7. " + RESET + "" + RED + Lang.get("cancel") + "\n";
menu += YELLOW + "" + BOLD + "8. " + RESET + "" + GREEN + Lang.get("done") + "\n";
menu += ChatColor.GOLD + "" + ChatColor.BOLD + "0. " + ChatColor.RESET + "" + ChatColor.YELLOW + Lang.get("itemCreateLoadHand") + "\n";
menu += ChatColor.YELLOW + "" + ChatColor.BOLD + "1. " + ChatColor.RESET + "" + ChatColor.GOLD + Lang.get("itemCreateSetName") + "\n";
menu += ChatColor.YELLOW + "" + ChatColor.BOLD + "2. " + ChatColor.RESET + "" + ChatColor.GOLD + Lang.get("itemCreateSetAmount") + "\n";
menu += ChatColor.YELLOW + "" + ChatColor.BOLD + "3. " + ChatColor.RESET + "" + ChatColor.GOLD + Lang.get("itemCreateSetDurab") + "\n";
menu += ChatColor.YELLOW + "" + ChatColor.BOLD + "4. " + ChatColor.RESET + "" + ChatColor.GOLD + Lang.get("itemCreateSetEnchs") + "\n";
menu += ChatColor.YELLOW + "" + ChatColor.BOLD + "5. " + ChatColor.RESET + "" + ChatColor.ITALIC + ChatColor.GOLD + Lang.get("itemCreateSetDisplay") + "\n";
menu += ChatColor.YELLOW + "" + ChatColor.BOLD + "6. " + ChatColor.RESET + "" + ChatColor.ITALIC + ChatColor.GOLD + Lang.get("itemCreateSetLore") + "\n";
menu += ChatColor.YELLOW + "" + ChatColor.BOLD + "7. " + ChatColor.RESET + "" + ChatColor.RED + Lang.get("cancel") + "\n";
menu += ChatColor.YELLOW + "" + ChatColor.BOLD + "8. " + ChatColor.RESET + "" + ChatColor.GREEN + Lang.get("done") + "\n";
return menu;
}
@ -76,7 +75,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
ItemStack is = player.getItemInHand();
if (is == null || is.getType().equals(Material.AIR)) {
player.sendMessage(RED + Lang.get("itemCreateNoItem"));
player.sendMessage(ChatColor.RED + Lang.get("itemCreateNoItem"));
return new ItemStackPrompt(oldPrompt);
} else {
@ -108,7 +107,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
}
player.sendMessage(GREEN + Lang.get("itemCreateLoaded"));
player.sendMessage(ChatColor.GREEN + Lang.get("itemCreateLoaded"));
return new ItemStackPrompt(oldPrompt);
}
@ -120,7 +119,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
if (cc.getSessionData("tempName") != null) {
return new AmountPrompt();
} else {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateNoName"));
cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateNoName"));
return new ItemStackPrompt(oldPrompt);
}
@ -129,7 +128,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
if (cc.getSessionData("tempName") != null && cc.getSessionData("tempAmount") != null) {
return new DataPrompt();
} else {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateNoIDAmount"));
cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateNoIDAmount"));
return new ItemStackPrompt(oldPrompt);
}
@ -138,7 +137,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
if (cc.getSessionData("tempName") != null && cc.getSessionData("tempAmount") != null) {
return new EnchantmentPrompt();
} else {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateNoIDAmount"));
cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateNoIDAmount"));
return new ItemStackPrompt(oldPrompt);
}
@ -147,7 +146,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
if (cc.getSessionData("tempName") != null && cc.getSessionData("tempAmount") != null) {
return new DisplayPrompt();
} else {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateNoNameAmount"));
cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateNoNameAmount"));
return new ItemStackPrompt(oldPrompt);
}
@ -156,7 +155,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
if (cc.getSessionData("tempName") != null && cc.getSessionData("tempAmount") != null) {
return new LorePrompt();
} else {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateNoNameAmount"));
cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateNoNameAmount"));
return new ItemStackPrompt(oldPrompt);
}
@ -222,7 +221,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
cc.setSessionData("tempStack", stack);
cc.setSessionData("newItem", Boolean.TRUE);
} else {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateNoNameAmount"));
cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateNoNameAmount"));
return new ItemStackPrompt(oldPrompt);
}
@ -231,7 +230,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
try {
return oldPrompt;
} catch (Exception e) {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateCriticalError"));
cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError"));
return Prompt.END_OF_CONVERSATION;
}
}
@ -240,7 +239,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext cc) {
return YELLOW + Lang.get("itemCreateEnterName");
return ChatColor.YELLOW + Lang.get("itemCreateEnterName");
}
@Override
@ -258,7 +257,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
Material mat = Material.matchMaterial(input.toUpperCase().replace(" ", "_"));
if (mat == null) {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateInvalidName"));
cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidName"));
return new NamePrompt();
} else {
cc.setSessionData("tempName", mat.name());
@ -269,7 +268,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
short data = Short.parseShort(dataString);
cc.setSessionData("tempData", data);
} catch (NumberFormatException e) {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateInvalidData"));
cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidData"));
return new NamePrompt();
}
}
@ -289,7 +288,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext cc) {
return YELLOW + Lang.get("itemCreateEnterAmount");
return ChatColor.YELLOW + Lang.get("itemCreateEnterAmount");
}
@Override
@ -300,7 +299,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
int amt = Integer.parseInt(input);
if (amt < 1 || amt > 64) {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateInvalidAmount"));
cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidAmount"));
return new AmountPrompt();
} else {
cc.setSessionData("tempAmount", Integer.parseInt(input));
@ -308,7 +307,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
}
} catch (NumberFormatException e) {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateInvalidInput"));
cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidInput"));
return new AmountPrompt();
}
@ -325,7 +324,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext cc) {
return YELLOW + Lang.get("itemCreateEnterDurab");
return ChatColor.YELLOW + Lang.get("itemCreateEnterDurab");
}
@Override
@ -336,7 +335,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
int amt = Integer.parseInt(input);
if (amt < 1) {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateInvalidDurab"));
cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidDurab"));
return new DataPrompt();
} else {
cc.setSessionData("tempData", Short.parseShort(input));
@ -344,7 +343,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
}
} catch (NumberFormatException e) {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateInvalidInput"));
cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidInput"));
return new DataPrompt();
}
@ -365,15 +364,15 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext cc) {
String text = PINK + Lang.get("enchantmentsTitle") + "\n";
String text = ChatColor.LIGHT_PURPLE + Lang.get("enchantmentsTitle") + "\n";
for (Enchantment e : Enchantment.values()) {
text += GREEN + Quester.prettyEnchantmentString(e) + ", ";
text += ChatColor.GREEN + Quester.prettyEnchantmentString(e) + ", ";
}
text = text.substring(0, text.length() - 1);
return text + "\n" + YELLOW + Lang.get("itemCreateEnterEnch");
return text + "\n" + ChatColor.YELLOW + Lang.get("itemCreateEnterEnch");
}
@ -390,7 +389,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
} else {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateInvalidEnch"));
cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidEnch"));
return new EnchantmentPrompt();
}
@ -414,7 +413,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
public String getPromptText(ConversationContext cc) {
String text = Lang.get("itemCreateEnterLevel");
text = text.replaceAll("<enchantment>", enchantment);
return AQUA + text;
return ChatColor.AQUA + text;
}
@Override
@ -424,7 +423,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
int num = Integer.parseInt(input);
if (num < 1) {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateInvalidLevel"));
cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidLevel"));
return new LevelPrompt(enchantment);
} else {
@ -446,7 +445,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
}
} catch (NumberFormatException e) {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateNotNumber"));
cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateNotNumber"));
return new LevelPrompt(enchantment);
}
@ -460,7 +459,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext cc) {
return YELLOW + Lang.get("itemCreateEnterName");
return ChatColor.YELLOW + Lang.get("itemCreateEnterName");
}
@Override
@ -487,7 +486,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext cc) {
return YELLOW + Lang.get("itemCreateEnterLore");
return ChatColor.YELLOW + Lang.get("itemCreateEnterLore");
}
@Override
@ -521,28 +520,28 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
if (cc.getSessionData("tempDisplay") == null) {
String name = (String) cc.getSessionData("tempName");
item = AQUA + Quester.prettyItemString(name);
item = ChatColor.AQUA + Quester.prettyItemString(name);
if (cc.getSessionData("tempData") != null) {
item += ":" + BLUE + (Short) cc.getSessionData("tempData");
item += ":" + ChatColor.BLUE + (Short) cc.getSessionData("tempData");
}
} else {
item = PINK + "" + ITALIC + (String) cc.getSessionData("tempDisplay") + RESET + "" + GRAY + " (";
item = ChatColor.LIGHT_PURPLE + "" + ChatColor.ITALIC + (String) cc.getSessionData("tempDisplay") + ChatColor.RESET + "" + ChatColor.GRAY + " (";
String name = (String) cc.getSessionData("tempName");
item += AQUA + Quester.prettyItemString(name);
item += ChatColor.AQUA + Quester.prettyItemString(name);
if (cc.getSessionData("tempData") != null) {
item += ":" + BLUE + (Short) cc.getSessionData("tempData");
item += ":" + ChatColor.BLUE + (Short) cc.getSessionData("tempData");
}
item += GRAY + ")";
item += ChatColor.GRAY + ")";
}
if (cc.getSessionData("tempAmount") != null) {
item += GRAY + " x " + DARKAQUA + (Integer) cc.getSessionData("tempAmount");
item += ChatColor.GRAY + " x " + ChatColor.DARK_AQUA + (Integer) cc.getSessionData("tempAmount");
} else {
item += GRAY + " x " + DARKAQUA + "1";
item += ChatColor.GRAY + " x " + ChatColor.DARK_AQUA + "1";
}
item += "\n";
@ -553,7 +552,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
Map<Enchantment, Integer> enchantments = (Map<Enchantment, Integer>) cc.getSessionData("tempEnchantments");
for (Entry<Enchantment, Integer> e : enchantments.entrySet()) {
item += GRAY + " - " + RED + Quester.prettyEnchantmentString(e.getKey()) + " " + Quests.getNumeral(e.getValue()) + "\n";
item += ChatColor.GRAY + " - " + ChatColor.RED + Quester.prettyEnchantmentString(e.getKey()) + " " + Quests.getNumeral(e.getValue()) + "\n";
}
@ -564,13 +563,13 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
@SuppressWarnings("unchecked")
List<String> lore = (List<String>) cc.getSessionData("tempLore");
item += DARKGREEN + "(Lore)\n\"";
item += ChatColor.DARK_GREEN + "(Lore)\n\"";
for (String s : lore) {
if (lore.indexOf(s) != (lore.size() - 1)) {
item += DARKGREEN + "" + ITALIC + s + "\n";
item += ChatColor.DARK_GREEN + "" + ChatColor.ITALIC + s + "\n";
} else {
item += DARKGREEN + "" + ITALIC + s + "\"\n";
item += ChatColor.DARK_GREEN + "" + ChatColor.ITALIC + s + "\"\n";
}
}

View File

@ -3,12 +3,6 @@ package me.blackvein.quests.prompts;
import java.text.MessageFormat;
import java.util.LinkedList;
import me.blackvein.quests.util.ColorUtil;
import me.blackvein.quests.Quest;
import me.blackvein.quests.Quester;
import me.blackvein.quests.Quests;
import me.blackvein.quests.util.Lang;
import org.apache.commons.lang.StringUtils;
import org.bukkit.ChatColor;
import org.bukkit.conversations.Conversable;
@ -17,7 +11,12 @@ import org.bukkit.conversations.Prompt;
import org.bukkit.conversations.StringPrompt;
import org.bukkit.entity.Player;
public class QuestAcceptPrompt extends StringPrompt implements ColorUtil {
import me.blackvein.quests.Quest;
import me.blackvein.quests.Quester;
import me.blackvein.quests.Quests;
import me.blackvein.quests.util.Lang;
public class QuestAcceptPrompt extends StringPrompt {
final Quests plugin;
Quester quester;
@ -42,15 +41,15 @@ public class QuestAcceptPrompt extends StringPrompt implements ColorUtil {
Quest quest = quests.get(i - 1);
if (quester.completedQuests.contains(quest.getName())) {
menu += DARKGREEN + "" + BOLD + "" + i + ". " + RESET + "" + GREEN + "" + ITALIC + quest.getName() + RESET + "" + GREEN + " (" + Lang.get("completed") + ")\n";
menu += ChatColor.DARK_GREEN + "" + ChatColor.BOLD + "" + i + ". " + ChatColor.RESET + "" + ChatColor.GREEN + "" + ChatColor.ITALIC + quest.getName() + ChatColor.RESET + "" + ChatColor.GREEN + " (" + Lang.get("completed") + ")\n";
} else {
menu += GOLD + "" + BOLD + "" + i + ". " + RESET + "" + YELLOW + "" + ITALIC + quest.getName() + "\n";
menu += ChatColor.GOLD + "" + ChatColor.BOLD + "" + i + ". " + ChatColor.RESET + "" + ChatColor.YELLOW + "" + ChatColor.ITALIC + quest.getName() + "\n";
}
}
menu += GOLD + "" + BOLD + "" + (quests.size() + 1) + ". " + RESET + "" + ColorUtil.GRAY + Lang.get("cancel") + "\n";
menu += WHITE + Lang.get("enterAnOption");
menu += ChatColor.GOLD + "" + ChatColor.BOLD + "" + (quests.size() + 1) + ". " + ChatColor.RESET + "" + ChatColor.GRAY + Lang.get("cancel") + "\n";
menu += ChatColor.WHITE + Lang.get("enterAnOption");
return menu;
}
@ -66,7 +65,7 @@ public class QuestAcceptPrompt extends StringPrompt implements ColorUtil {
}
if (input.equalsIgnoreCase(Lang.get("cancel")) || numInput == (quests.size() + 1)) {
cc.getForWhom().sendRawMessage(YELLOW + Lang.get("cancelled"));
cc.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("cancelled"));
return Prompt.END_OF_CONVERSATION;
} else {
@ -104,7 +103,7 @@ public class QuestAcceptPrompt extends StringPrompt implements ColorUtil {
}
if (q == null) {
cc.getForWhom().sendRawMessage(RED + Lang.get("invalidSelection"));
cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidSelection"));
return new QuestAcceptPrompt(plugin);
} else {
@ -134,7 +133,7 @@ public class QuestAcceptPrompt extends StringPrompt implements ColorUtil {
String msg = Lang.get("questMaxAllowed");
msg = msg.replaceAll("<number>", String.valueOf(Quests.maxQuests));
player.sendMessage(YELLOW + msg);
player.sendMessage(ChatColor.YELLOW + msg);
}
@ -166,7 +165,7 @@ public class QuestAcceptPrompt extends StringPrompt implements ColorUtil {
String msg = Lang.get("questMaxAllowed");
msg = msg.replaceAll("<number>", String.valueOf(Quests.maxQuests));
player.sendMessage(YELLOW + msg);
player.sendMessage(ChatColor.YELLOW + msg);
}

View File

@ -1,8 +1,5 @@
package me.blackvein.quests.prompts;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.herocraftonline.heroes.characters.classes.HeroClass;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
@ -10,8 +7,18 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.bukkit.ChatColor;
import org.bukkit.conversations.ConversationContext;
import org.bukkit.conversations.FixedSetPrompt;
import org.bukkit.conversations.NumericPrompt;
import org.bukkit.conversations.Prompt;
import org.bukkit.conversations.StringPrompt;
import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.herocraftonline.heroes.characters.classes.HeroClass;
import me.blackvein.quests.CustomRequirement;
import me.blackvein.quests.util.ColorUtil;
import me.blackvein.quests.Quest;
import me.blackvein.quests.QuestFactory;
import me.blackvein.quests.Quests;
@ -20,14 +27,7 @@ import me.blackvein.quests.util.ItemUtil;
import me.blackvein.quests.util.Lang;
import me.blackvein.quests.util.MiscUtil;
import org.bukkit.conversations.ConversationContext;
import org.bukkit.conversations.FixedSetPrompt;
import org.bukkit.conversations.NumericPrompt;
import org.bukkit.conversations.Prompt;
import org.bukkit.conversations.StringPrompt;
import org.bukkit.inventory.ItemStack;
public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
public class RequirementsPrompt extends FixedSetPrompt {
Quests quests;
final QuestFactory factory;
@ -47,59 +47,59 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
String text;
String lang = Lang.get("requirementsTitle");
lang = lang.replaceAll("<quest>", AQUA + (String) context.getSessionData(CK.Q_NAME) + DARKAQUA);
text = DARKAQUA + lang + "\n";
lang = lang.replaceAll("<quest>", ChatColor.AQUA + (String) context.getSessionData(CK.Q_NAME) + ChatColor.DARK_AQUA);
text = ChatColor.DARK_AQUA + lang + "\n";
if (context.getSessionData(CK.REQ_MONEY) == null) {
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("reqSetMoney") + " " + GRAY + "(" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetMoney") + " " + ChatColor.GRAY + "(" + Lang.get("noneSet") + ")\n";
} else {
int moneyReq = (Integer) context.getSessionData(CK.REQ_MONEY);
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("reqSetMoney") + " (" + moneyReq + " " + (moneyReq > 1 ? Quests.getCurrency(true) : Quests.getCurrency(false)) + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetMoney") + " (" + moneyReq + " " + (moneyReq > 1 ? Quests.getCurrency(true) : Quests.getCurrency(false)) + ")\n";
}
if (context.getSessionData(CK.REQ_QUEST_POINTS) == null) {
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("reqSetQuestPoints") + " " + GRAY + "(" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetQuestPoints") + " " + ChatColor.GRAY + "(" + Lang.get("noneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("reqSetQuestPoints") + " " + GRAY + "(" + AQUA + context.getSessionData(CK.REQ_QUEST_POINTS) + " " + Lang.get("questPoints") + GRAY + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetQuestPoints") + " " + ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.REQ_QUEST_POINTS) + " " + Lang.get("questPoints") + ChatColor.GRAY + ")\n";
}
text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("reqSetItem") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetItem") + "\n";
if (context.getSessionData(CK.REQ_PERMISSION) == null) {
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("reqSetPerms") + " " + GRAY + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetPerms") + " " + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("reqSetPerms") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetPerms") + "\n";
List<String> perms = (List<String>) context.getSessionData(CK.REQ_PERMISSION);
for (String s : perms) {
text += GRAY + " - " + AQUA + s + "\n";
text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n";
}
}
if (context.getSessionData(CK.REQ_QUEST) == null) {
text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("reqSetQuest") + " " + GRAY + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetQuest") + " " + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("reqSetQuest") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetQuest") + "\n";
List<String> qs = (List<String>) context.getSessionData(CK.REQ_QUEST);
for (String s : qs) {
text += GRAY + " - " + AQUA + s + "\n";
text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n";
}
}
if (context.getSessionData(CK.REQ_QUEST_BLOCK) == null) {
text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - " + Lang.get("reqSetQuestBlocks") + " " + GRAY + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "6" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetQuestBlocks") + " " + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - " + Lang.get("reqSetQuestBlocks") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "6" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetQuestBlocks") + "\n";
List<String> qs = (List<String>) context.getSessionData(CK.REQ_QUEST_BLOCK);
for (String s : qs) {
text += GRAY + " - " + AQUA + s + "\n";
text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n";
}
}
@ -107,62 +107,62 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
if (Quests.mcmmo != null) {
if (context.getSessionData(CK.REQ_MCMMO_SKILLS) == null) {
text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - " + Lang.get("reqSetMcMMO") + " " + GRAY + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "7" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetMcMMO") + " " + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - " + Lang.get("reqSetMcMMO") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "7" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetMcMMO") + "\n";
List<String> skills = (List<String>) context.getSessionData(CK.REQ_MCMMO_SKILLS);
List<Integer> amounts = (List<Integer>) context.getSessionData(CK.REQ_MCMMO_SKILL_AMOUNTS);
for (String s : skills) {
text += GRAY + " - " + DARKGREEN + s + RESET + YELLOW + " " + Lang.get("mcMMOLevel") + " " + GREEN + amounts.get(skills.indexOf(s)) + "\n";
text += ChatColor.GRAY + " - " + ChatColor.DARK_GREEN + s + ChatColor.RESET + ChatColor.YELLOW + " " + Lang.get("mcMMOLevel") + " " + ChatColor.GREEN + amounts.get(skills.indexOf(s)) + "\n";
}
}
} else {
text += GRAY + "6 - " + Lang.get("reqSetMcMMO") + " (" + Lang.get("reqNoMcMMO") + ")\n";
text += ChatColor.GRAY + "6 - " + Lang.get("reqSetMcMMO") + " (" + Lang.get("reqNoMcMMO") + ")\n";
}
if (Quests.heroes != null) {
if (context.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) == null && context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) == null) {
text += BLUE + "" + BOLD + "8" + RESET + YELLOW + " - " + Lang.get("reqSetHeroes") + " " + GRAY + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "8" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetHeroes") + " " + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "8" + RESET + YELLOW + " - " + Lang.get("reqSetHeroes") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "8" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetHeroes") + "\n";
if (context.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) != null) {
text += AQUA + " " + Lang.get("reqHeroesPrimaryDisplay") + " " + BLUE + (String) context.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) + "\n";
text += ChatColor.AQUA + " " + Lang.get("reqHeroesPrimaryDisplay") + " " + ChatColor.BLUE + (String) context.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) + "\n";
}
if (context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) != null) {
text += AQUA + " " + Lang.get("reqHeroesSecondaryDisplay") + " " + BLUE + (String) context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) + "\n";
text += ChatColor.AQUA + " " + Lang.get("reqHeroesSecondaryDisplay") + " " + ChatColor.BLUE + (String) context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) + "\n";
}
}
} else {
text += GRAY + "8 - " + Lang.get("reqSetHeroes") + " (" + Lang.get("reqNoHeroes") + ")\n";
text += ChatColor.GRAY + "8 - " + Lang.get("reqSetHeroes") + " (" + Lang.get("reqNoHeroes") + ")\n";
}
if (context.getSessionData(CK.REQ_CUSTOM) == null) {
text += BLUE + "" + BOLD + "9 - " + RESET + ITALIC + PURPLE + Lang.get("reqSetCustom") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "9 - " + ChatColor.RESET + ChatColor.ITALIC + ChatColor.DARK_PURPLE + Lang.get("reqSetCustom") + " (" + Lang.get("noneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "9 - " + RESET + ITALIC + PURPLE + Lang.get("reqSetCustom") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "9 - " + ChatColor.RESET + ChatColor.ITALIC + ChatColor.DARK_PURPLE + Lang.get("reqSetCustom") + "\n";
LinkedList<String> customReqs = (LinkedList<String>) context.getSessionData(CK.REQ_CUSTOM);
for (String s : customReqs) {
text += RESET + "" + PURPLE + " - " + PINK + s + "\n";
text += ChatColor.RESET + "" + ChatColor.DARK_PURPLE + " - " + ChatColor.LIGHT_PURPLE + s + "\n";
}
}
if (context.getSessionData(CK.REQ_MONEY) == null && context.getSessionData(CK.REQ_QUEST_POINTS) == null && context.getSessionData(CK.REQ_QUEST_BLOCK) == null && context.getSessionData(CK.REQ_ITEMS) == null && context.getSessionData(CK.REQ_PERMISSION) == null && context.getSessionData(CK.REQ_QUEST) == null && context.getSessionData(CK.REQ_QUEST_BLOCK) == null && context.getSessionData(CK.REQ_MCMMO_SKILLS) == null && context.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) == null && context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) == null && context.getSessionData(CK.REQ_CUSTOM) == null) {
text += GRAY + "" + BOLD + "10 - " + RESET + GRAY + Lang.get("reqSetFail") + " (" + Lang.get("reqNone") + ")\n";
text += ChatColor.GRAY + "" + ChatColor.BOLD + "10 - " + ChatColor.RESET + ChatColor.GRAY + Lang.get("reqSetFail") + " (" + Lang.get("reqNone") + ")\n";
} else if (context.getSessionData(CK.Q_FAIL_MESSAGE) == null) {
text += RED + "" + BOLD + "10 - " + RESET + RED + Lang.get("reqSetFail") + " (" + Lang.get("questRequiredNoneSet") + ")\n";
text += ChatColor.RED + "" + ChatColor.BOLD + "10 - " + ChatColor.RESET + ChatColor.RED + Lang.get("reqSetFail") + " (" + Lang.get("questRequiredNoneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "10 - " + RESET + YELLOW + Lang.get("reqSetFail") + GRAY + "(" + AQUA + "\"" + context.getSessionData(CK.Q_FAIL_MESSAGE) + "\"" + GRAY + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "10 - " + ChatColor.RESET + ChatColor.YELLOW + Lang.get("reqSetFail") + ChatColor.GRAY + "(" + ChatColor.AQUA + "\"" + context.getSessionData(CK.Q_FAIL_MESSAGE) + "\"" + ChatColor.GRAY + ")\n";
}
text += GREEN + "" + BOLD + "11" + RESET + YELLOW + " - " + Lang.get("done");
text += ChatColor.GREEN + "" + ChatColor.BOLD + "11" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done");
return text;
@ -203,7 +203,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
if (context.getSessionData(CK.REQ_MONEY) != null || context.getSessionData(CK.REQ_QUEST_POINTS) != null || context.getSessionData(CK.REQ_ITEMS) != null || context.getSessionData(CK.REQ_PERMISSION) != null || context.getSessionData(CK.REQ_QUEST) != null || context.getSessionData(CK.REQ_QUEST_BLOCK) != null || context.getSessionData(CK.REQ_MCMMO_SKILLS) != null || context.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) != null || context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) != null || context.getSessionData(CK.REQ_CUSTOM) != null) {
if (context.getSessionData(CK.Q_FAIL_MESSAGE) == null) {
context.getForWhom().sendRawMessage(RED + Lang.get("reqNoMessage"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNoMessage"));
return new RequirementsPrompt(quests, factory);
}
@ -221,8 +221,8 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
public String getPromptText(ConversationContext context) {
String text = Lang.get("reqMoneyPrompt");
text = text.replaceAll("<money>", PURPLE + ((Quests.economy.currencyNamePlural().isEmpty() ? Lang.get("money") : Quests.economy.currencyNamePlural())) + YELLOW);
return YELLOW + text;
text = text.replaceAll("<money>", ChatColor.DARK_PURPLE + ((Quests.economy.currencyNamePlural().isEmpty() ? Lang.get("money") : Quests.economy.currencyNamePlural())) + ChatColor.YELLOW);
return ChatColor.YELLOW + text;
}
@ -230,7 +230,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
protected Prompt acceptValidatedInput(ConversationContext context, Number input) {
if (input.intValue() < -1) {
context.getForWhom().sendRawMessage(RED + Lang.get("reqGreaterThanZero"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqGreaterThanZero"));
return new MoneyPrompt();
} else if (input.intValue() == -1) {
return new RequirementsPrompt(quests, factory);
@ -250,7 +250,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
return YELLOW + Lang.get("reqQuestPointsPrompt");
return ChatColor.YELLOW + Lang.get("reqQuestPointsPrompt");
}
@ -258,7 +258,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
protected Prompt acceptValidatedInput(ConversationContext context, Number input) {
if (input.intValue() < -1) {
context.getForWhom().sendRawMessage(RED + Lang.get("reqGreaterThanZero"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqGreaterThanZero"));
return new QuestPointsPrompt();
} else if (input.intValue() == -1) {
return new RequirementsPrompt(quests, factory);
@ -284,7 +284,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
String text = PINK + Lang.get("questListTitle") + "\n" + PURPLE;
String text = ChatColor.LIGHT_PURPLE + Lang.get("questListTitle") + "\n" + ChatColor.DARK_PURPLE;
boolean none = true;
for (Quest q : quests.getQuests()) {
@ -302,8 +302,8 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
}
String lang = Lang.get("reqQuestPrompt");
lang = lang.replaceAll("<comma>", RED + "" + BOLD + Lang.get("comma") + RESET + YELLOW);
text += YELLOW + lang;
lang = lang.replaceAll("<comma>", ChatColor.RED + "" + ChatColor.BOLD + Lang.get("comma") + ChatColor.RESET + ChatColor.YELLOW);
text += ChatColor.YELLOW + lang;
return text;
@ -322,7 +322,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
if (quests.getQuest(s) == null) {
String text = Lang.get("reqNotAQuestName");
text = text.replaceAll("<quest>", PINK + s + RED);
text = text.replaceAll("<quest>", ChatColor.LIGHT_PURPLE + s + ChatColor.RED);
context.getForWhom().sendRawMessage(text);
return new QuestListPrompt(isRequiredQuest);
@ -330,7 +330,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
if (questNames.contains(s)) {
context.getForWhom().sendRawMessage(RED + Lang.get("listDuplicate"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listDuplicate"));
return new QuestListPrompt(isRequiredQuest);
}
@ -397,37 +397,37 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
}
String text = GOLD + Lang.get("itemRequirementsTitle") + "\n";
String text = ChatColor.GOLD + Lang.get("itemRequirementsTitle") + "\n";
if (context.getSessionData(CK.REQ_ITEMS) == null) {
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("reqAddItem") + "\n";
text += GRAY + "2 - " + Lang.get("reqSetRemoveItems") + " (" + Lang.get("reqNoItemsSet") + ")\n";
text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("clear") + "\n";
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("done");
text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqAddItem") + "\n";
text += ChatColor.GRAY + "2 - " + Lang.get("reqSetRemoveItems") + " (" + Lang.get("reqNoItemsSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done");
} else {
for (ItemStack is : getItems(context)) {
text += GRAY + " - " + ItemUtil.getDisplayString(is) + "\n";
text += ChatColor.GRAY + " - " + ItemUtil.getDisplayString(is) + "\n";
}
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("reqAddItem") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqAddItem") + "\n";
if (context.getSessionData(CK.REQ_ITEMS_REMOVE) == null) {
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("reqSetRemoveItems") + " (" + Lang.get("reqNoValuesSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetRemoveItems") + " (" + Lang.get("reqNoValuesSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("reqSetRemoveItems") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetRemoveItems") + "\n";
for (Boolean b : getRemoveItems(context)) {
text += GRAY + " - " + AQUA + (b.equals(Boolean.TRUE) ? Lang.get("yesWord") : Lang.get("noWord")) + "\n";
text += ChatColor.GRAY + " - " + ChatColor.AQUA + (b.equals(Boolean.TRUE) ? Lang.get("yesWord") : Lang.get("noWord")) + "\n";
}
}
text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("clear") + "\n";
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("done");
text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done");
}
@ -443,13 +443,13 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
return new ItemStackPrompt(ItemListPrompt.this);
} else if (input.equalsIgnoreCase("2")) {
if (context.getSessionData(CK.REQ_ITEMS) == null) {
context.getForWhom().sendRawMessage(RED + Lang.get("reqMustAddItem"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqMustAddItem"));
return new ItemListPrompt();
} else {
return new RemoveItemsPrompt();
}
} else if (input.equalsIgnoreCase("3")) {
context.getForWhom().sendRawMessage(YELLOW + Lang.get("reqItemCleared"));
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqItemCleared"));
context.setSessionData(CK.REQ_ITEMS, null);
context.setSessionData(CK.REQ_ITEMS_REMOVE, null);
return new ItemListPrompt();
@ -473,7 +473,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
if (one == two) {
return new RequirementsPrompt(quests, factory);
} else {
context.getForWhom().sendRawMessage(RED + Lang.get("reqListsNotSameSize"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqListsNotSameSize"));
return new ItemListPrompt();
}
}
@ -496,7 +496,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
return YELLOW + Lang.get("reqRemoveItemsPrompt");
return ChatColor.YELLOW + Lang.get("reqRemoveItemsPrompt");
}
@Override
@ -515,8 +515,8 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
booleans.add(false);
} else {
String text = Lang.get("reqTrueFalseError");
text = text.replaceAll("<input>", PINK + s + RED);
context.getForWhom().sendRawMessage(RED + text);
text = text.replaceAll("<input>", ChatColor.LIGHT_PURPLE + s + ChatColor.RED);
context.getForWhom().sendRawMessage(ChatColor.RED + text);
return new RemoveItemsPrompt();
}
@ -535,7 +535,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
return YELLOW + Lang.get("reqPermissionsPrompt");
return ChatColor.YELLOW + Lang.get("reqPermissionsPrompt");
}
@Override
@ -562,16 +562,16 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
String text = PINK + Lang.get("customRequirementsTitle") + "\n";
String text = ChatColor.LIGHT_PURPLE + Lang.get("customRequirementsTitle") + "\n";
if (quests.customRequirements.isEmpty()) {
text += BOLD + "" + PURPLE + "(" + Lang.get("stageEditorNoModules") + ")";
text += ChatColor.BOLD + "" + ChatColor.DARK_PURPLE + "(" + Lang.get("stageEditorNoModules") + ")";
} else {
for (CustomRequirement cr : quests.customRequirements) {
text += PURPLE + " - " + cr.getName() + "\n";
text += ChatColor.DARK_PURPLE + " - " + cr.getName() + "\n";
}
}
return text + YELLOW + Lang.get("reqCustomPrompt");
return text + ChatColor.YELLOW + Lang.get("reqCustomPrompt");
}
@SuppressWarnings("unchecked")
@ -608,7 +608,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
context.setSessionData(CK.REQ_CUSTOM, list);
context.setSessionData(CK.REQ_CUSTOM_DATA, datamapList);
} else {
context.getForWhom().sendRawMessage(YELLOW + Lang.get("reqCustomAlreadyAdded"));
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqCustomAlreadyAdded"));
return new CustomRequirementsPrompt();
}
} else {
@ -630,7 +630,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
//
} else {
context.getForWhom().sendRawMessage(YELLOW + Lang.get("reqCustomNotFound"));
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqCustomNotFound"));
return new CustomRequirementsPrompt();
}
@ -638,7 +638,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
context.setSessionData(CK.REQ_CUSTOM, null);
context.setSessionData(CK.REQ_CUSTOM_DATA, null);
context.setSessionData(CK.REQ_CUSTOM_DATA_TEMP, null);
context.getForWhom().sendRawMessage(YELLOW + Lang.get("reqCustomCleared"));
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqCustomCleared"));
}
return new RequirementsPrompt(quests, factory);
@ -652,7 +652,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
String text = BOLD + "" + AQUA + "- ";
String text = ChatColor.BOLD + "" + ChatColor.AQUA + "- ";
LinkedList<String> list = (LinkedList<String>) context.getSessionData(CK.REQ_CUSTOM);
LinkedList<Map<String, Object>> datamapList = (LinkedList<Map<String, Object>>) context.getSessionData(CK.REQ_CUSTOM_DATA);
@ -671,18 +671,18 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
for (String dataKey : datamapKeys) {
text += BOLD + "" + DARKBLUE + index + " - " + RESET + BLUE + dataKey;
text += ChatColor.BOLD + "" + ChatColor.DARK_BLUE + index + " - " + ChatColor.RESET + ChatColor.BLUE + dataKey;
if (datamap.get(dataKey) != null) {
text += GREEN + " (" + (String) datamap.get(dataKey) + ")\n";
text += ChatColor.GREEN + " (" + (String) datamap.get(dataKey) + ")\n";
} else {
text += RED + " (" + Lang.get("valRequired") + ")\n";
text += ChatColor.RED + " (" + Lang.get("valRequired") + ")\n";
}
index++;
}
text += BOLD + "" + DARKBLUE + index + " - " + AQUA + Lang.get("finish");
text += ChatColor.BOLD + "" + ChatColor.DARK_BLUE + index + " - " + ChatColor.AQUA + Lang.get("finish");
return text;
}
@ -742,12 +742,12 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@SuppressWarnings("unchecked")
Map<String, String> descriptions = (Map<String, String>) context.getSessionData(CK.REQ_CUSTOM_DATA_DESCRIPTIONS);
if (descriptions.get(temp) != null) {
text += GOLD + descriptions.get(temp) + "\n";
text += ChatColor.GOLD + descriptions.get(temp) + "\n";
}
String lang = Lang.get("stageEditorCustomDataPrompt");
lang = lang.replaceAll("<data>", temp);
text += YELLOW + lang;
text += ChatColor.YELLOW + lang;
return text;
}
@ -772,30 +772,30 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext cc) {
String text = DARKGREEN + Lang.get("mcMMORequirementsTitle") + "\n";
String text = ChatColor.DARK_GREEN + Lang.get("mcMMORequirementsTitle") + "\n";
if (cc.getSessionData(CK.REQ_MCMMO_SKILLS) == null) {
text += BOLD + "" + GREEN + "1" + RESET + GREEN + " - " + Lang.get("reqSetSkills") + "(" + Lang.get("noneSet") + ")\n";
text += ChatColor.BOLD + "" + ChatColor.GREEN + "1" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("reqSetSkills") + "(" + Lang.get("noneSet") + ")\n";
} else {
text += BOLD + "" + GREEN + "1" + RESET + GREEN + " - " + Lang.get("reqSetSkills") + "\n";
text += ChatColor.BOLD + "" + ChatColor.GREEN + "1" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("reqSetSkills") + "\n";
@SuppressWarnings("unchecked")
LinkedList<String> skills = (LinkedList<String>) cc.getSessionData(CK.REQ_MCMMO_SKILLS);
for (String skill : skills) {
text += GRAY + " - " + AQUA + skill + "\n";
text += ChatColor.GRAY + " - " + ChatColor.AQUA + skill + "\n";
}
}
if (cc.getSessionData(CK.REQ_MCMMO_SKILL_AMOUNTS) == null) {
text += BOLD + "" + GREEN + "2" + RESET + GREEN + " - " + Lang.get("reqSetSkillAmounts") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BOLD + "" + ChatColor.GREEN + "2" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("reqSetSkillAmounts") + " (" + Lang.get("noneSet") + ")\n";
} else {
text += BOLD + "" + GREEN + "2" + RESET + GREEN + " - " + Lang.get("reqSetSkillAmounts") + "\n";
text += ChatColor.BOLD + "" + ChatColor.GREEN + "2" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("reqSetSkillAmounts") + "\n";
@SuppressWarnings("unchecked")
LinkedList<Integer> amounts = (LinkedList<Integer>) cc.getSessionData(CK.REQ_MCMMO_SKILL_AMOUNTS);
for (int i : amounts) {
text += GRAY + " - " + AQUA + i + "\n";
text += ChatColor.GRAY + " - " + ChatColor.AQUA + i + "\n";
}
}
text += BOLD + "" + GREEN + "3" + RESET + GREEN + " - " + Lang.get("done");
text += ChatColor.BOLD + "" + ChatColor.GREEN + "3" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("done");
return text;
}
@ -821,19 +821,19 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
String skillList = DARKGREEN + Lang.get("skillListTitle") + "\n";
String skillList = ChatColor.DARK_GREEN + Lang.get("skillListTitle") + "\n";
SkillType[] skills = SkillType.values();
for (int i = 0; i < skills.length; i++) {
if (i == (skills.length - 1)) {
skillList += GREEN + skills[i].getName() + "\n";
skillList += ChatColor.GREEN + skills[i].getName() + "\n";
} else {
skillList += GREEN + skills[i].getName() + "\n\n";
skillList += ChatColor.GREEN + skills[i].getName() + "\n\n";
}
}
return skillList + YELLOW + Lang.get("reqMcMMOPrompt");
return skillList + ChatColor.YELLOW + Lang.get("reqMcMMOPrompt");
}
@Override
@ -850,12 +850,12 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
if (Quests.getMcMMOSkill(formatted) != null) {
skills.add(formatted);
} else if (skills.contains(formatted)) {
cc.getForWhom().sendRawMessage(YELLOW + Lang.get("listDuplicate"));
cc.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("listDuplicate"));
return new mcMMOSkillsPrompt();
} else {
String text = Lang.get("reqMcMMOError");
text = text.replaceAll("<input>", RED + s + YELLOW);
cc.getForWhom().sendRawMessage(YELLOW + text);
text = text.replaceAll("<input>", ChatColor.RED + s + ChatColor.YELLOW);
cc.getForWhom().sendRawMessage(ChatColor.YELLOW + text);
return new mcMMOSkillsPrompt();
}
@ -865,7 +865,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
return new mcMMOPrompt();
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
cc.getForWhom().sendRawMessage(YELLOW + Lang.get("reqMcMMOCleared"));
cc.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqMcMMOCleared"));
cc.setSessionData(CK.REQ_MCMMO_SKILLS, null);
return new mcMMOPrompt();
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
@ -883,7 +883,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
return YELLOW + Lang.get("reqMcMMOAmountsPrompt");
return ChatColor.YELLOW + Lang.get("reqMcMMOAmountsPrompt");
}
@Override
@ -902,8 +902,8 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
} catch (NumberFormatException nfe) {
String text = Lang.get("reqNotANumber");
text = text.replaceAll("<input>", RED + s + YELLOW);
cc.getForWhom().sendRawMessage(YELLOW + text);
text = text.replaceAll("<input>", ChatColor.RED + s + ChatColor.YELLOW);
cc.getForWhom().sendRawMessage(ChatColor.YELLOW + text);
return new mcMMOAmountsPrompt();
}
@ -913,7 +913,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
return new mcMMOPrompt();
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
cc.getForWhom().sendRawMessage(YELLOW + Lang.get("reqMcMMOAmountsCleared"));
cc.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqMcMMOAmountsCleared"));
cc.setSessionData(CK.REQ_MCMMO_SKILL_AMOUNTS, null);
return new mcMMOPrompt();
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
@ -935,20 +935,20 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext cc) {
String text = DARKGREEN + Lang.get("heroesRequirementsTitle") + "\n";
String text = ChatColor.DARK_GREEN + Lang.get("heroesRequirementsTitle") + "\n";
if (cc.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) == null) {
text += BOLD + "" + GREEN + "1" + RESET + GREEN + " - " + Lang.get("reqHeroesSetPrimary") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BOLD + "" + ChatColor.GREEN + "1" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("reqHeroesSetPrimary") + " (" + Lang.get("noneSet") + ")\n";
} else {
text += BOLD + "" + GREEN + "1" + RESET + GREEN + " - " + Lang.get("reqHeroesSetPrimary") + " (" + AQUA + (String) cc.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) + GREEN + ")\n";
text += ChatColor.BOLD + "" + ChatColor.GREEN + "1" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("reqHeroesSetPrimary") + " (" + ChatColor.AQUA + (String) cc.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) + ChatColor.GREEN + ")\n";
}
if (cc.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) == null) {
text += BOLD + "" + GREEN + "2" + RESET + GREEN + " - " + Lang.get("reqHeroesSetSecondary") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BOLD + "" + ChatColor.GREEN + "2" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("reqHeroesSetSecondary") + " (" + Lang.get("noneSet") + ")\n";
} else {
text += BOLD + "" + GREEN + "2" + RESET + GREEN + " - " + Lang.get("reqHeroesSetSecondary") + " (" + AQUA + (String) cc.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) + GREEN + ")\n";
text += ChatColor.BOLD + "" + ChatColor.GREEN + "2" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("reqHeroesSetSecondary") + " (" + ChatColor.AQUA + (String) cc.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) + ChatColor.GREEN + ")\n";
}
text += BOLD + "" + GREEN + "3" + RESET + GREEN + " - " + Lang.get("done");
text += ChatColor.BOLD + "" + ChatColor.GREEN + "3" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("done");
return text;
}
@ -974,7 +974,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext cc) {
String text = PURPLE + Lang.get("heroesPrimaryTitle") + "\n";
String text = ChatColor.DARK_PURPLE + Lang.get("heroesPrimaryTitle") + "\n";
LinkedList<String> list = new LinkedList<String>();
for (HeroClass hc : Quests.heroes.getClassManager().getClasses()) {
if (hc.isPrimary()) {
@ -983,18 +983,18 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
}
if (list.isEmpty()) {
text += GRAY + "(" + Lang.get("none") + ")\n";
text += ChatColor.GRAY + "(" + Lang.get("none") + ")\n";
} else {
Collections.sort(list);
for (String s : list) {
text += PURPLE + "- " + PINK + s + "\n";
text += ChatColor.DARK_PURPLE + "- " + ChatColor.LIGHT_PURPLE + s + "\n";
}
}
text += YELLOW + Lang.get("reqHeroesPrimaryPrompt");
text += ChatColor.YELLOW + Lang.get("reqHeroesPrimaryPrompt");
return text;
}
@ -1014,20 +1014,20 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
} else {
String text = Lang.get("reqHeroesNotPrimary");
text = text.replaceAll("<class>", PINK + hc.getName() + RED);
cc.getForWhom().sendRawMessage(RED + text);
text = text.replaceAll("<class>", ChatColor.LIGHT_PURPLE + hc.getName() + ChatColor.RED);
cc.getForWhom().sendRawMessage(ChatColor.RED + text);
return new HeroesPrimaryPrompt();
}
} else {
cc.getForWhom().sendRawMessage(RED + Lang.get("reqHeroesClassNotFound"));
cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqHeroesClassNotFound"));
return new HeroesPrimaryPrompt();
}
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
cc.setSessionData(CK.REQ_HEROES_PRIMARY_CLASS, null);
cc.getForWhom().sendRawMessage(YELLOW + Lang.get("reqHeroesPrimaryCleared"));
cc.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqHeroesPrimaryCleared"));
return new HeroesPrompt();
} else {
@ -1044,7 +1044,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext cc) {
String text = PURPLE + Lang.get("heroesSecondaryTitle") + "\n";
String text = ChatColor.DARK_PURPLE + Lang.get("heroesSecondaryTitle") + "\n";
LinkedList<String> list = new LinkedList<String>();
for (HeroClass hc : Quests.heroes.getClassManager().getClasses()) {
if (hc.isSecondary()) {
@ -1053,18 +1053,18 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
}
if (list.isEmpty()) {
text += GRAY + "(" + Lang.get("none") + ")\n";
text += ChatColor.GRAY + "(" + Lang.get("none") + ")\n";
} else {
Collections.sort(list);
for (String s : list) {
text += PURPLE + "- " + PINK + s + "\n";
text += ChatColor.DARK_PURPLE + "- " + ChatColor.LIGHT_PURPLE + s + "\n";
}
}
text += YELLOW + Lang.get("reqHeroesSecondaryPrompt");
text += ChatColor.YELLOW + Lang.get("reqHeroesSecondaryPrompt");
return text;
}
@ -1085,20 +1085,20 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
} else {
String text = Lang.get("reqHeroesNotSecondary");
text = text.replaceAll("<class>", PINK + hc.getName() + RED);
cc.getForWhom().sendRawMessage(RED + text);
text = text.replaceAll("<class>", ChatColor.LIGHT_PURPLE + hc.getName() + ChatColor.RED);
cc.getForWhom().sendRawMessage(ChatColor.RED + text);
return new HeroesSecondaryPrompt();
}
} else {
cc.getForWhom().sendRawMessage(RED + Lang.get("reqHeroesClassNotFound"));
cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqHeroesClassNotFound"));
return new HeroesSecondaryPrompt();
}
} else if (input.equalsIgnoreCase(Lang.get("clear"))) {
cc.setSessionData(CK.REQ_HEROES_SECONDARY_CLASS, null);
cc.getForWhom().sendRawMessage(YELLOW + Lang.get("reqHeroesSecondaryCleared"));
cc.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqHeroesSecondaryCleared"));
return new HeroesPrompt();
} else {
@ -1114,7 +1114,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
return YELLOW + Lang.get("reqFailMessagePrompt");
return ChatColor.YELLOW + Lang.get("reqFailMessagePrompt");
}
@Override

View File

@ -1,25 +1,12 @@
package me.blackvein.quests.prompts;
import com.codisimus.plugins.phatloots.PhatLoot;
import com.codisimus.plugins.phatloots.PhatLootsAPI;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.herocraftonline.heroes.characters.classes.HeroClass;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import me.blackvein.quests.CustomReward;
import me.blackvein.quests.util.ColorUtil;
import me.blackvein.quests.QuestFactory;
import me.blackvein.quests.Quester;
import me.blackvein.quests.Quests;
import me.blackvein.quests.util.CK;
import me.blackvein.quests.util.ItemUtil;
import me.blackvein.quests.util.Lang;
import org.bukkit.ChatColor;
import org.bukkit.conversations.ConversationContext;
import org.bukkit.conversations.FixedSetPrompt;
import org.bukkit.conversations.NumericPrompt;
@ -27,7 +14,20 @@ import org.bukkit.conversations.Prompt;
import org.bukkit.conversations.StringPrompt;
import org.bukkit.inventory.ItemStack;
public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
import com.codisimus.plugins.phatloots.PhatLoot;
import com.codisimus.plugins.phatloots.PhatLootsAPI;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.herocraftonline.heroes.characters.classes.HeroClass;
import me.blackvein.quests.CustomReward;
import me.blackvein.quests.QuestFactory;
import me.blackvein.quests.Quester;
import me.blackvein.quests.Quests;
import me.blackvein.quests.util.CK;
import me.blackvein.quests.util.ItemUtil;
import me.blackvein.quests.util.Lang;
public class RewardsPrompt extends FixedSetPrompt {
final Quests quests;
@ -48,52 +48,52 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
String text;
String lang = Lang.get("rewardsTitle");
lang = lang.replaceAll("<quest>", AQUA + (String) context.getSessionData(CK.Q_NAME) + DARKAQUA);
text = DARKAQUA + lang + "\n";
lang = lang.replaceAll("<quest>", ChatColor.AQUA + (String) context.getSessionData(CK.Q_NAME) + ChatColor.DARK_AQUA);
text = ChatColor.DARK_AQUA + lang + "\n";
if (context.getSessionData(CK.REW_MONEY) == null) {
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("rewSetMoney") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetMoney") + " (" + Lang.get("noneSet") + ")\n";
} else {
int moneyRew = (Integer) context.getSessionData(CK.REW_MONEY);
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("rewSetMoney") + " (" + moneyRew + " " + (moneyRew > 1 ? Quests.getCurrency(true) : Quests.getCurrency(false)) + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetMoney") + " (" + moneyRew + " " + (moneyRew > 1 ? Quests.getCurrency(true) : Quests.getCurrency(false)) + ")\n";
}
if (context.getSessionData(CK.REW_QUEST_POINTS) == null) {
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("rewSetQuestPoints") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetQuestPoints") + " (" + Lang.get("noneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("rewSetQuestPoints") + " (" + context.getSessionData(CK.REW_QUEST_POINTS) + " " + Lang.get("questPoints") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetQuestPoints") + " (" + context.getSessionData(CK.REW_QUEST_POINTS) + " " + Lang.get("questPoints") + ")\n";
}
text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("rewSetItems") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetItems") + "\n";
if (context.getSessionData(CK.REW_EXP) == null) {
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("rewSetExperience") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetExperience") + " (" + Lang.get("noneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("rewSetExperience") + " (" + context.getSessionData(CK.REW_EXP) + " " + Lang.get("points") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetExperience") + " (" + context.getSessionData(CK.REW_EXP) + " " + Lang.get("points") + ")\n";
}
if (context.getSessionData(CK.REW_COMMAND) == null) {
text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("rewSetCommands") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetCommands") + " (" + Lang.get("noneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("rewSetCommands") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetCommands") + "\n";
List<String> commands = (List<String>) context.getSessionData(CK.REW_COMMAND);
for (String cmd : commands) {
text += GRAY + " - " + AQUA + cmd + "\n";
text += ChatColor.GRAY + " - " + ChatColor.AQUA + cmd + "\n";
}
}
if (context.getSessionData(CK.REW_PERMISSION) == null) {
text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - " + Lang.get("rewSetPermission") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "6" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetPermission") + " (" + Lang.get("noneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - " + Lang.get("rewSetPermission") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "6" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetPermission") + "\n";
List<String> permissions = (List<String>) context.getSessionData(CK.REW_PERMISSION);
for (String perm : permissions) {
text += GRAY + " - " + AQUA + perm + "\n";
text += ChatColor.GRAY + " - " + ChatColor.AQUA + perm + "\n";
}
}
@ -101,81 +101,81 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
if (Quests.mcmmo != null) {
if (context.getSessionData(CK.REW_MCMMO_SKILLS) == null) {
text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - " + Lang.get("rewSetMcMMO") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "7" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetMcMMO") + " (" + Lang.get("noneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - " + Lang.get("rewSetMcMMO") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "7" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetMcMMO") + "\n";
List<String> skills = (List<String>) context.getSessionData(CK.REW_MCMMO_SKILLS);
List<Integer> amounts = (List<Integer>) context.getSessionData(CK.REW_MCMMO_AMOUNTS);
for (String skill : skills) {
text += GRAY + " - " + AQUA + skill + GRAY + " x " + DARKAQUA + amounts.get(skills.indexOf(skill)) + "\n";
text += ChatColor.GRAY + " - " + ChatColor.AQUA + skill + ChatColor.GRAY + " x " + ChatColor.DARK_AQUA + amounts.get(skills.indexOf(skill)) + "\n";
}
}
} else {
text += GRAY + "7 - " + Lang.get("rewSetMcMMO") + " (" + Lang.get("reqNoMcMMO") + ")\n";
text += ChatColor.GRAY + "7 - " + Lang.get("rewSetMcMMO") + " (" + Lang.get("reqNoMcMMO") + ")\n";
}
if (Quests.heroes != null) {
if (context.getSessionData(CK.REW_HEROES_CLASSES) == null) {
text += BLUE + "" + BOLD + "8" + RESET + YELLOW + " - " + Lang.get("rewSetHeroes") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "8" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetHeroes") + " (" + Lang.get("noneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "8" + RESET + YELLOW + " - " + Lang.get("rewSetHeroes") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "8" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetHeroes") + "\n";
List<String> heroClasses = (List<String>) context.getSessionData(CK.REW_HEROES_CLASSES);
List<Double> amounts = (List<Double>) context.getSessionData(CK.REW_HEROES_AMOUNTS);
for (String heroClass : heroClasses) {
text += GRAY + " - " + AQUA + amounts.get(heroClasses.indexOf(heroClass)) + " " + DARKAQUA + heroClass + " " + Lang.get("experience") + "\n";
text += ChatColor.GRAY + " - " + ChatColor.AQUA + amounts.get(heroClasses.indexOf(heroClass)) + " " + ChatColor.DARK_AQUA + heroClass + " " + Lang.get("experience") + "\n";
}
}
} else {
text += GRAY + "8 - " + Lang.get("rewSetHeroes") + " (" + Lang.get("rewNoHeroes") + ")\n";
text += ChatColor.GRAY + "8 - " + Lang.get("rewSetHeroes") + " (" + Lang.get("rewNoHeroes") + ")\n";
}
if (Quests.phatLoots != null) {
if (context.getSessionData(CK.REW_PHAT_LOOTS) == null) {
text += BLUE + "" + BOLD + "9" + RESET + YELLOW + " - " + Lang.get("rewSetPhat") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "9" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetPhat") + " (" + Lang.get("noneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "9" + RESET + YELLOW + " - " + Lang.get("rewSetPhat") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "9" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetPhat") + "\n";
List<String> phatLoots = (List<String>) context.getSessionData(CK.REW_PHAT_LOOTS);
for (String phatLoot : phatLoots) {
text += GRAY + " - " + AQUA + phatLoot + "\n";
text += ChatColor.GRAY + " - " + ChatColor.AQUA + phatLoot + "\n";
}
}
} else {
text += GRAY + "9 - " + Lang.get("rewSetPhat") + " (" + Lang.get("rewNoPhat") + ")\n";
text += ChatColor.GRAY + "9 - " + Lang.get("rewSetPhat") + " (" + Lang.get("rewNoPhat") + ")\n";
}
if (context.getSessionData(CK.REW_CUSTOM) == null) {
text += BLUE + "" + BOLD + "10 - " + RESET + ITALIC + PURPLE + Lang.get("rewSetCustom") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "10 - " + ChatColor.RESET + ChatColor.ITALIC + ChatColor.DARK_PURPLE + Lang.get("rewSetCustom") + " (" + Lang.get("noneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "10 - " + RESET + ITALIC + PURPLE + Lang.get("rewSetCustom") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "10 - " + ChatColor.RESET + ChatColor.ITALIC + ChatColor.DARK_PURPLE + Lang.get("rewSetCustom") + "\n";
LinkedList<String> customRews = (LinkedList<String>) context.getSessionData(CK.REW_CUSTOM);
for (String s : customRews) {
text += RESET + "" + PURPLE + " - " + PINK + s + "\n";
text += ChatColor.RESET + "" + ChatColor.DARK_PURPLE + " - " + ChatColor.LIGHT_PURPLE + s + "\n";
}
}
text += GREEN + "" + BOLD + "11" + RESET + YELLOW + " - " + Lang.get("done");
text += ChatColor.GREEN + "" + ChatColor.BOLD + "11" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done");
return text;
@ -229,8 +229,8 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
public String getPromptText(ConversationContext context) {
String text = Lang.get("rewMoneyPrompt");
text = text.replaceAll("<money>", AQUA + (Quests.economy.currencyNamePlural().isEmpty() ? Lang.get("money") : Quests.economy.currencyNamePlural()) + YELLOW);
return YELLOW + text;
text = text.replaceAll("<money>", ChatColor.AQUA + (Quests.economy.currencyNamePlural().isEmpty() ? Lang.get("money") : Quests.economy.currencyNamePlural()) + ChatColor.YELLOW);
return ChatColor.YELLOW + text;
}
@ -238,7 +238,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
protected Prompt acceptValidatedInput(ConversationContext context, Number input) {
if (input.intValue() < -1) {
context.getForWhom().sendRawMessage(RED + Lang.get("inputPosNum"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("inputPosNum"));
return new MoneyPrompt();
} else if (input.intValue() == 0) {
context.setSessionData(CK.REW_MONEY, null);
@ -257,7 +257,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
return YELLOW + Lang.get("rewExperiencePrompt");
return ChatColor.YELLOW + Lang.get("rewExperiencePrompt");
}
@ -265,7 +265,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
protected Prompt acceptValidatedInput(ConversationContext context, Number input) {
if (input.intValue() < -1) {
context.getForWhom().sendRawMessage(RED + Lang.get("inputPosNum"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("inputPosNum"));
return new ExperiencePrompt();
} else if (input.intValue() == -1) {
context.setSessionData(CK.REW_EXP, null);
@ -284,7 +284,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
return YELLOW + Lang.get("rewQuestPointsPrompt");
return ChatColor.YELLOW + Lang.get("rewQuestPointsPrompt");
}
@ -292,7 +292,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
protected Prompt acceptValidatedInput(ConversationContext context, Number input) {
if (input.intValue() < -1) {
context.getForWhom().sendRawMessage(RED + Lang.get("inputPosNum"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("inputPosNum"));
return new QuestPointsPrompt();
} else if (input.intValue() == -1) {
context.setSessionData(CK.REW_QUEST_POINTS, null);
@ -334,22 +334,22 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
}
String text = GOLD + Lang.get("itemRewardsTitle") + "\n";
String text = ChatColor.GOLD + Lang.get("itemRewardsTitle") + "\n";
if (context.getSessionData(CK.REW_ITEMS) == null) {
text += GRAY + " (" + Lang.get("noneSet") + ")\n";
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("reqAddItem") + "\n";
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("clear") + "\n";
text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("done");
text += ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqAddItem") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done");
} else {
for (ItemStack is : getItems(context)) {
text += GRAY + "- " + ItemUtil.getDisplayString(is) + "\n";
text += ChatColor.GRAY + "- " + ItemUtil.getDisplayString(is) + "\n";
}
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("reqAddItem") + "\n";
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("clear") + "\n";
text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("done");
text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqAddItem") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done");
}
@ -363,7 +363,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
if (input.equalsIgnoreCase("1")) {
return new ItemStackPrompt(ItemListPrompt.this);
} else if (input.equalsIgnoreCase("2")) {
context.getForWhom().sendRawMessage(YELLOW + Lang.get("rewItemsCleared"));
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("rewItemsCleared"));
context.setSessionData(CK.REW_ITEMS, null);
return new ItemListPrompt();
} else if (input.equalsIgnoreCase("3")) {
@ -385,9 +385,9 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
String lang1 = Lang.get("rewCommandPrompt");
lang1 = lang1.replaceAll("<comma>", BOLD + "" + RED + "comma" + RESET + YELLOW);
lang1 = lang1.replaceAll("<comma>", ChatColor.BOLD + "" + ChatColor.RED + "comma" + ChatColor.RESET + ChatColor.YELLOW);
String lang2 = Lang.get("rewCommandPromptHint");
return YELLOW + lang1 + "\n" + lang2;
return ChatColor.YELLOW + lang1 + "\n" + lang2;
}
@Override
@ -423,7 +423,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
return YELLOW + Lang.get("rewPermissionsPrompt");
return ChatColor.YELLOW + Lang.get("rewPermissionsPrompt");
}
@Override
@ -459,36 +459,36 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
String text = GOLD + Lang.get("mcMMORewardsTitle") + "\n";
String text = ChatColor.GOLD + Lang.get("mcMMORewardsTitle") + "\n";
if (context.getSessionData(CK.REW_MCMMO_SKILLS) == null) {
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("reqSetSkills") + " (" + Lang.get("noneSet") + ")\n";
text += GRAY + "2 - " + Lang.get("reqSetSkillAmounts") + " (" + Lang.get("rewNoMcMMOSkills") + ")\n";
text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("clear") + "\n";
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("done");
text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetSkills") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.GRAY + "2 - " + Lang.get("reqSetSkillAmounts") + " (" + Lang.get("rewNoMcMMOSkills") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done");
} else {
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("reqSetSkills") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetSkills") + "\n";
for (String s : getSkills(context)) {
text += GRAY + " - " + AQUA + s + "\n";
text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n";
}
if (context.getSessionData(CK.REW_MCMMO_AMOUNTS) == null) {
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("reqSetSkillAmounts") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetSkillAmounts") + " (" + Lang.get("noneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("reqSetSkillAmounts") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetSkillAmounts") + "\n";
for (Integer i : getSkillAmounts(context)) {
text += GRAY + " - " + AQUA + i + "\n";
text += ChatColor.GRAY + " - " + ChatColor.AQUA + i + "\n";
}
}
text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("clear") + "\n";
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("done");
text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done");
}
@ -504,13 +504,13 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
return new mcMMOSkillsPrompt();
} else if (input.equalsIgnoreCase("2")) {
if (context.getSessionData(CK.REW_MCMMO_SKILLS) == null) {
context.getForWhom().sendRawMessage(RED + Lang.get("rewSetMcMMOSkillsFirst"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("rewSetMcMMOSkillsFirst"));
return new mcMMOListPrompt();
} else {
return new mcMMOAmountsPrompt();
}
} else if (input.equalsIgnoreCase("3")) {
context.getForWhom().sendRawMessage(YELLOW + Lang.get("rewMcMMOCleared"));
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("rewMcMMOCleared"));
context.setSessionData(CK.REW_MCMMO_SKILLS, null);
context.setSessionData(CK.REW_MCMMO_AMOUNTS, null);
return new mcMMOListPrompt();
@ -534,7 +534,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
if (one == two) {
return new RewardsPrompt(quests, factory);
} else {
context.getForWhom().sendRawMessage(RED + Lang.get("rewMcMMOListsNotSameSize"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("rewMcMMOListsNotSameSize"));
return new mcMMOListPrompt();
}
}
@ -559,19 +559,19 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
String skillList = DARKGREEN + Lang.get("skillListTitle") + "\n";
String skillList = ChatColor.DARK_GREEN + Lang.get("skillListTitle") + "\n";
SkillType[] skills = SkillType.values();
for (int i = 0; i < skills.length; i++) {
if (i == (skills.length - 1)) {
skillList += GREEN + skills[i].getName() + "\n";
skillList += ChatColor.GREEN + skills[i].getName() + "\n";
} else {
skillList += GREEN + skills[i].getName() + "\n\n";
skillList += ChatColor.GREEN + skills[i].getName() + "\n\n";
}
}
return skillList + Lang.get("rewMcMMOPrompt") + "\n" + GOLD + Lang.get("rewMcMMOPromptHint");
return skillList + Lang.get("rewMcMMOPrompt") + "\n" + ChatColor.GOLD + Lang.get("rewMcMMOPromptHint");
}
@Override
@ -588,14 +588,14 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
if (skills.contains(s) == false) {
skills.add(Quester.getCapitalized(s));
} else {
context.getForWhom().sendRawMessage(RED + Lang.get("listDuplicate"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listDuplicate"));
return new mcMMOSkillsPrompt();
}
} else {
String text = Lang.get("reqMcMMOError");
text = text.replaceAll("<input>", PINK + s + RED);
context.getForWhom().sendRawMessage(RED + text);
text = text.replaceAll("<input>", ChatColor.LIGHT_PURPLE + s + ChatColor.RED);
context.getForWhom().sendRawMessage(ChatColor.RED + text);
return new mcMMOSkillsPrompt();
}
@ -615,7 +615,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
return YELLOW + Lang.get("reqMcMMOAmountsPrompt");
return ChatColor.YELLOW + Lang.get("reqMcMMOAmountsPrompt");
}
@Override
@ -633,8 +633,8 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
} catch (NumberFormatException e) {
String text = Lang.get("reqNotANumber");
text = text.replaceAll("<input>", PINK + s + RED);
context.getForWhom().sendRawMessage(RED + text);
text = text.replaceAll("<input>", ChatColor.LIGHT_PURPLE + s + ChatColor.RED);
context.getForWhom().sendRawMessage(ChatColor.RED + text);
return new mcMMOAmountsPrompt();
}
@ -661,36 +661,36 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
String text = GOLD + Lang.get("heroesRewardsTitle") + "\n";
String text = ChatColor.GOLD + Lang.get("heroesRewardsTitle") + "\n";
if (context.getSessionData(CK.REW_HEROES_CLASSES) == null) {
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("rewSetHeroesClasses") + " (" + Lang.get("noneSet") + ")\n";
text += GRAY + "2 - " + Lang.get("rewSetHeroesAmounts") + "(" + Lang.get("rewNoHeroesClasses") + ")\n";
text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("clear") + "\n";
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("done");
text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetHeroesClasses") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.GRAY + "2 - " + Lang.get("rewSetHeroesAmounts") + "(" + Lang.get("rewNoHeroesClasses") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done");
} else {
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("rewSetHeroesClasses") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetHeroesClasses") + "\n";
for (String s : getClasses(context)) {
text += GRAY + " - " + AQUA + s + "\n";
text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n";
}
if (context.getSessionData(CK.REW_HEROES_AMOUNTS) == null) {
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("rewSetHeroesAmounts") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetHeroesAmounts") + " (" + Lang.get("noneSet") + ")\n";
} else {
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("rewSetHeroesAmounts") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetHeroesAmounts") + "\n";
for (Double d : getClassAmounts(context)) {
text += GRAY + " - " + AQUA + d + "\n";
text += ChatColor.GRAY + " - " + ChatColor.AQUA + d + "\n";
}
}
text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("clear") + "\n";
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("done");
text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n";
text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done");
}
@ -706,13 +706,13 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
return new HeroesClassesPrompt();
} else if (input.equalsIgnoreCase("2")) {
if (context.getSessionData(CK.REW_HEROES_CLASSES) == null) {
context.getForWhom().sendRawMessage(RED + Lang.get("rewSetHeroesClassesFirst"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("rewSetHeroesClassesFirst"));
return new HeroesListPrompt();
} else {
return new HeroesExperiencePrompt();
}
} else if (input.equalsIgnoreCase("3")) {
context.getForWhom().sendRawMessage(YELLOW + Lang.get("rewHeroesCleared"));
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("rewHeroesCleared"));
context.setSessionData(CK.REW_HEROES_CLASSES, null);
context.setSessionData(CK.REW_HEROES_AMOUNTS, null);
return new HeroesListPrompt();
@ -736,7 +736,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
if (one == two) {
return new RewardsPrompt(quests, factory);
} else {
context.getForWhom().sendRawMessage(RED + Lang.get("rewHeroesListsNotSameSize"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("rewHeroesListsNotSameSize"));
return new HeroesListPrompt();
}
}
@ -761,27 +761,27 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext cc) {
String text = PURPLE + Lang.get("heroesClassesTitle") + "\n";
String text = ChatColor.DARK_PURPLE + Lang.get("heroesClassesTitle") + "\n";
LinkedList<String> list = new LinkedList<String>();
for (HeroClass hc : Quests.heroes.getClassManager().getClasses()) {
list.add(hc.getName());
}
if (list.isEmpty()) {
text += GRAY + "(" + Lang.get("none") + ")\n";
text += ChatColor.GRAY + "(" + Lang.get("none") + ")\n";
} else {
Collections.sort(list);
for (String s : list) {
text += PINK + s + ", ";
text += ChatColor.LIGHT_PURPLE + s + ", ";
}
text = text.substring(0, text.length() - 2) + "\n";
}
text += YELLOW + Lang.get("rewHeroesClassesPrompt");
text += ChatColor.YELLOW + Lang.get("rewHeroesClassesPrompt");
return text;
}
@ -799,8 +799,8 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
HeroClass hc = Quests.heroes.getClassManager().getClass(s);
if (hc == null) {
String text = Lang.get("rewHeroesInvalidClass");
text = text.replaceAll("<input>", PINK + s + RED);
cc.getForWhom().sendRawMessage(RED + text);
text = text.replaceAll("<input>", ChatColor.LIGHT_PURPLE + s + ChatColor.RED);
cc.getForWhom().sendRawMessage(ChatColor.RED + text);
return new HeroesClassesPrompt();
} else {
classes.add(hc.getName());
@ -826,7 +826,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
String text = Lang.get("heroesExperienceTitle") + "\n";
text += YELLOW + Lang.get("rewHeroesExperiencePrompt");
text += ChatColor.YELLOW + Lang.get("rewHeroesExperiencePrompt");
return text;
}
@ -848,8 +848,8 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
} catch (NumberFormatException nfe) {
String text = Lang.get("reqNotANumber");
text = text.replaceAll("<input>", PINK + s + RED);
cc.getForWhom().sendRawMessage(RED + text);
text = text.replaceAll("<input>", ChatColor.LIGHT_PURPLE + s + ChatColor.RED);
cc.getForWhom().sendRawMessage(ChatColor.RED + text);
return new HeroesExperiencePrompt();
}
@ -870,15 +870,15 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext cc) {
String text = DARKAQUA + Lang.get("phatLootsRewardsTitle") + "\n";
String text = ChatColor.DARK_AQUA + Lang.get("phatLootsRewardsTitle") + "\n";
for (PhatLoot pl : PhatLootsAPI.getAllPhatLoots()) {
text += GRAY + "- " + BLUE + pl.name + "\n";
text += ChatColor.GRAY + "- " + ChatColor.BLUE + pl.name + "\n";
}
text += YELLOW + Lang.get("rewPhatLootsPrompt");
text += ChatColor.YELLOW + Lang.get("rewPhatLootsPrompt");
return text;
}
@ -895,8 +895,8 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
if (PhatLootsAPI.getPhatLoot(s) == null) {
String text = Lang.get("rewPhatLootsInvalid");
text = text.replaceAll("<input>", DARKRED + s + RED);
cc.getForWhom().sendRawMessage(RED + text);
text = text.replaceAll("<input>", ChatColor.DARK_RED + s + ChatColor.RED);
cc.getForWhom().sendRawMessage(ChatColor.RED + text);
return new PhatLootsPrompt();
}
@ -909,7 +909,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
cc.setSessionData(CK.REW_PHAT_LOOTS, null);
cc.getForWhom().sendRawMessage(YELLOW + Lang.get("rewPhatLootsCleared"));
cc.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("rewPhatLootsCleared"));
return new RewardsPrompt(quests, factory);
} else {
@ -923,16 +923,16 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
String text = PINK + Lang.get("customRewardsTitle") + "\n";
String text = ChatColor.LIGHT_PURPLE + Lang.get("customRewardsTitle") + "\n";
if (quests.customRewards.isEmpty()) {
text += BOLD + "" + PURPLE + "(" + Lang.get("stageEditorNoModules") + ")";
text += ChatColor.BOLD + "" + ChatColor.DARK_PURPLE + "(" + Lang.get("stageEditorNoModules") + ")";
} else {
for (CustomReward cr : quests.customRewards) {
text += PURPLE + " - " + cr.getName() + "\n";
text += ChatColor.DARK_PURPLE + " - " + cr.getName() + "\n";
}
}
return text + YELLOW + Lang.get("rewCustomRewardPrompt");
return text + ChatColor.YELLOW + Lang.get("rewCustomRewardPrompt");
}
@SuppressWarnings("unchecked")
@ -969,7 +969,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
context.setSessionData(CK.REW_CUSTOM, list);
context.setSessionData(CK.REW_CUSTOM_DATA, datamapList);
} else {
context.getForWhom().sendRawMessage(YELLOW + Lang.get("rewCustomAlreadyAdded"));
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("rewCustomAlreadyAdded"));
return new CustomRewardsPrompt();
}
} else {
@ -991,7 +991,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
//
} else {
context.getForWhom().sendRawMessage(YELLOW + Lang.get("rewCustomNotFound"));
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("rewCustomNotFound"));
return new CustomRewardsPrompt();
}
@ -999,7 +999,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
context.setSessionData(CK.REW_CUSTOM, null);
context.setSessionData(CK.REW_CUSTOM_DATA, null);
context.setSessionData(CK.REW_CUSTOM_DATA_TEMP, null);
context.getForWhom().sendRawMessage(YELLOW + Lang.get("rewCustomCleared"));
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("rewCustomCleared"));
}
return new RewardsPrompt(quests, factory);
@ -1013,7 +1013,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext context) {
String text = BOLD + "" + AQUA + "- ";
String text = ChatColor.BOLD + "" + ChatColor.AQUA + "- ";
LinkedList<String> list = (LinkedList<String>) context.getSessionData(CK.REW_CUSTOM);
LinkedList<Map<String, Object>> datamapList = (LinkedList<Map<String, Object>>) context.getSessionData(CK.REW_CUSTOM_DATA);
@ -1032,18 +1032,18 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
for (String dataKey : datamapKeys) {
text += BOLD + "" + DARKBLUE + index + " - " + RESET + BLUE + dataKey;
text += ChatColor.BOLD + "" + ChatColor.DARK_BLUE + index + " - " + ChatColor.RESET + ChatColor.BLUE + dataKey;
if (datamap.get(dataKey) != null) {
text += GREEN + " (" + (String) datamap.get(dataKey) + ")\n";
text += ChatColor.GREEN + " (" + (String) datamap.get(dataKey) + ")\n";
} else {
text += RED + " (" + Lang.get("valRequired") + ")\n";
text += ChatColor.RED + " (" + Lang.get("valRequired") + ")\n";
}
index++;
}
text += BOLD + "" + DARKBLUE + index + " - " + AQUA + Lang.get("finish");
text += ChatColor.BOLD + "" + ChatColor.DARK_BLUE + index + " - " + ChatColor.AQUA + Lang.get("finish");
return text;
}
@ -1103,12 +1103,12 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@SuppressWarnings("unchecked")
Map<String, String> descriptions = (Map<String, String>) context.getSessionData(CK.REW_CUSTOM_DATA_DESCRIPTIONS);
if (descriptions.get(temp) != null) {
text += GOLD + descriptions.get(temp) + "\n";
text += ChatColor.GOLD + descriptions.get(temp) + "\n";
}
String lang = Lang.get("stageEditorCustomDataPrompt");
lang = lang.replaceAll("<data>", temp);
text += YELLOW + lang;
text += ChatColor.YELLOW + lang;
return text;
}

View File

@ -1,15 +1,15 @@
package me.blackvein.quests.prompts;
import me.blackvein.quests.util.ColorUtil;
import me.blackvein.quests.QuestFactory;
import me.blackvein.quests.util.CK;
import me.blackvein.quests.util.Lang;
import org.bukkit.ChatColor;
import org.bukkit.conversations.ConversationContext;
import org.bukkit.conversations.Prompt;
import org.bukkit.conversations.StringPrompt;
public class StagesPrompt extends StringPrompt implements ColorUtil {
import me.blackvein.quests.QuestFactory;
import me.blackvein.quests.util.CK;
import me.blackvein.quests.util.Lang;
public class StagesPrompt extends StringPrompt {
private final QuestFactory questFactory;
@ -22,20 +22,20 @@ public class StagesPrompt extends StringPrompt implements ColorUtil {
@Override
public String getPromptText(ConversationContext cc) {
String text = PINK + "- " + PURPLE + Lang.get("stageEditorStages") + PINK + " -\n";
String text = ChatColor.LIGHT_PURPLE + "- " + ChatColor.DARK_PURPLE + Lang.get("stageEditorStages") + ChatColor.LIGHT_PURPLE + " -\n";
int stages = getStages(cc);
for (int i = 1; i <= stages; i++) {
text += BOLD + "" + GREEN + i + ". " + RESET + GOLD + Lang.get("stageEditorEditStage") + " " + i + "\n";
text += ChatColor.BOLD + "" + ChatColor.GREEN + i + ". " + ChatColor.RESET + ChatColor.GOLD + Lang.get("stageEditorEditStage") + " " + i + "\n";
}
stages++;
text += "\n" + BOLD + "" + GREEN + stages + ". " + RESET + YELLOW + Lang.get("stageEditorNewStage");
text += "\n" + ChatColor.BOLD + "" + ChatColor.GREEN + stages + ". " + ChatColor.RESET + ChatColor.YELLOW + Lang.get("stageEditorNewStage");
stages++;
text += "\n" + BOLD + "" + BLUE + stages + ". " + RESET + YELLOW + Lang.get("done");
text += "\n" + ChatColor.BOLD + "" + ChatColor.BLUE + stages + ". " + ChatColor.RESET + ChatColor.YELLOW + Lang.get("done");
return text;
}

View File

@ -1,30 +0,0 @@
package me.blackvein.quests.util;
import org.bukkit.ChatColor;
public interface ColorUtil {
static final ChatColor BOLD = ChatColor.BOLD;
static final ChatColor ITALIC = ChatColor.ITALIC;
static final ChatColor UNDERLINE = ChatColor.UNDERLINE;
static final ChatColor STRIKETHROUGH = ChatColor.STRIKETHROUGH;
static final ChatColor MAGIC = ChatColor.MAGIC;
static final ChatColor RESET = ChatColor.RESET;
static final ChatColor WHITE = ChatColor.WHITE;
static final ChatColor BLACK = ChatColor.BLACK;
static final ChatColor AQUA = ChatColor.AQUA;
static final ChatColor DARKAQUA = ChatColor.DARK_AQUA;
static final ChatColor BLUE = ChatColor.BLUE;
static final ChatColor DARKBLUE = ChatColor.DARK_BLUE;
static final ChatColor GOLD = ChatColor.GOLD;
static final ChatColor GRAY = ChatColor.GRAY;
static final ChatColor DARKGRAY = ChatColor.DARK_GRAY;
static final ChatColor PINK = ChatColor.LIGHT_PURPLE;
static final ChatColor PURPLE = ChatColor.DARK_PURPLE;
static final ChatColor GREEN = ChatColor.GREEN;
static final ChatColor DARKGREEN = ChatColor.DARK_GREEN;
static final ChatColor RED = ChatColor.RED;
static final ChatColor DARKRED = ChatColor.DARK_RED;
static final ChatColor YELLOW = ChatColor.YELLOW;
}

View File

@ -14,7 +14,7 @@ import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
public class ItemUtil implements ColorUtil {
public class ItemUtil {
static Quests plugin;
@ -172,17 +172,17 @@ public class ItemUtil implements ColorUtil {
return null;
}
if (is.hasItemMeta() && is.getItemMeta().hasDisplayName()) {
text = "" + DARKAQUA + ITALIC + is.getItemMeta().getDisplayName() + RESET + AQUA + " x " + is.getAmount();
text = "" + ChatColor.DARK_AQUA + ChatColor.ITALIC + is.getItemMeta().getDisplayName() + ChatColor.RESET + ChatColor.AQUA + " x " + is.getAmount();
} else {
text = AQUA + Quester.prettyItemString(is.getType().name());
text = ChatColor.AQUA + Quester.prettyItemString(is.getType().name());
if (is.getDurability() != 0) {
text += AQUA + ":" + is.getDurability();
text += ChatColor.AQUA + ":" + is.getDurability();
}
text += AQUA + " x " + is.getAmount();
text += ChatColor.AQUA + " x " + is.getAmount();
if (is.getEnchantments().isEmpty() == false) {
text += " " + PURPLE + Lang.get("enchantedItem");
text += " " + ChatColor.DARK_PURPLE + Lang.get("enchantedItem");
}
}
@ -196,14 +196,14 @@ public class ItemUtil implements ColorUtil {
String text;
if (is.hasItemMeta() && is.getItemMeta().hasDisplayName()) {
text = "" + DARKAQUA + ITALIC + is.getItemMeta().getDisplayName() + RESET + AQUA + " x " + is.getAmount();
text = "" + ChatColor.DARK_AQUA + ChatColor.ITALIC + is.getItemMeta().getDisplayName() + ChatColor.RESET + ChatColor.AQUA + " x " + is.getAmount();
} else {
text = AQUA + Quester.prettyItemString(is.getType().name());
text = ChatColor.AQUA + Quester.prettyItemString(is.getType().name());
if (is.getDurability() != 0) {
text += AQUA + ":" + is.getDurability();
text += ChatColor.AQUA + ":" + is.getDurability();
}
text += AQUA + " x " + is.getAmount();
text += ChatColor.AQUA + " x " + is.getAmount();
}
@ -216,10 +216,10 @@ public class ItemUtil implements ColorUtil {
String text = "";
if (is.hasItemMeta() && is.getItemMeta().hasDisplayName()) {
text = "" + DARKAQUA + ITALIC + is.getItemMeta().getDisplayName();
text = "" + ChatColor.DARK_AQUA + ChatColor.ITALIC + is.getItemMeta().getDisplayName();
} else {
try {
text = AQUA + Items.itemByStack(is).getName();
text = ChatColor.AQUA + Items.itemByStack(is).getName();
} catch (NullPointerException ne) {
Bukkit.getLogger().severe("This error is caused by an incompatible version of Vault. Please update!");
ne.printStackTrace();
@ -253,7 +253,7 @@ public class ItemUtil implements ColorUtil {
if(is.getItemMeta().hasDisplayName() == false)
return false;
return is.getItemMeta().getDisplayName().equals(PINK + Lang.get("journalTitle"));
return is.getItemMeta().getDisplayName().equals(ChatColor.LIGHT_PURPLE + Lang.get("journalTitle"));
}