mirror of
https://github.com/PikaMug/Quests.git
synced 2024-12-18 07:07:40 +01:00
Supply external conversation hooks, part 19 (BREAKING)
This commit is contained in:
parent
ebd291bb31
commit
dcdeeeb627
@ -46,16 +46,16 @@ import org.bukkit.inventory.ItemStack;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
|
||||
import me.blackvein.quests.actions.Action;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorStringPrompt;
|
||||
import me.blackvein.quests.convo.quests.prompts.GUIDisplayPrompt;
|
||||
import me.blackvein.quests.convo.quests.prompts.OptionsPrompt;
|
||||
import me.blackvein.quests.convo.quests.prompts.PlannerPrompt;
|
||||
import me.blackvein.quests.convo.quests.prompts.RequirementsPrompt;
|
||||
import me.blackvein.quests.convo.quests.prompts.RewardsPrompt;
|
||||
import me.blackvein.quests.convo.quests.prompts.StageMenuPrompt;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenNumericPromptEvent;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenStringPromptEvent;
|
||||
import me.blackvein.quests.prompts.QuestsNumericPrompt;
|
||||
import me.blackvein.quests.prompts.QuestsStringPrompt;
|
||||
import me.blackvein.quests.prompts.quests.GUIDisplayPrompt;
|
||||
import me.blackvein.quests.prompts.quests.OptionsPrompt;
|
||||
import me.blackvein.quests.prompts.quests.PlannerPrompt;
|
||||
import me.blackvein.quests.prompts.quests.RequirementsPrompt;
|
||||
import me.blackvein.quests.prompts.quests.RewardsPrompt;
|
||||
import me.blackvein.quests.prompts.quests.StageMenuPrompt;
|
||||
import me.blackvein.quests.reflect.worldguard.WorldGuardAPI;
|
||||
import me.blackvein.quests.util.CK;
|
||||
import me.blackvein.quests.util.ConfigUtil;
|
||||
@ -140,7 +140,7 @@ public class QuestFactory implements ConversationAbandonedListener {
|
||||
selectedReachLocations.remove(player.getUniqueId());
|
||||
}
|
||||
|
||||
public class QuestMenuPrompt extends QuestsNumericPrompt {
|
||||
public class QuestMenuPrompt extends QuestsEditorNumericPrompt {
|
||||
public QuestMenuPrompt(Quests plugin, ConversationContext context, QuestFactory factory) {
|
||||
super(context, factory);
|
||||
}
|
||||
@ -157,29 +157,29 @@ public class QuestFactory implements ConversationAbandonedListener {
|
||||
|
||||
public ChatColor getNumberColor(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
return ChatColor.BLUE;
|
||||
case 4:
|
||||
return ChatColor.RED;
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
return ChatColor.BLUE;
|
||||
case 4:
|
||||
return ChatColor.RED;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getSelectionText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("questEditorCreate");
|
||||
case 2:
|
||||
return ChatColor.YELLOW + Lang.get("questEditorEdit");
|
||||
case 3:
|
||||
return ChatColor.YELLOW + Lang.get("questEditorDelete");
|
||||
case 4:
|
||||
return ChatColor.RED + Lang.get("exit");
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("questEditorCreate");
|
||||
case 2:
|
||||
return ChatColor.YELLOW + Lang.get("questEditorEdit");
|
||||
case 3:
|
||||
return ChatColor.YELLOW + Lang.get("questEditorDelete");
|
||||
case 4:
|
||||
return ChatColor.RED + Lang.get("exit");
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -204,32 +204,32 @@ public class QuestFactory implements ConversationAbandonedListener {
|
||||
protected Prompt acceptValidatedInput(ConversationContext context, Number input) {
|
||||
final Player player = (Player) context.getForWhom();
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
if (player.hasPermission("quests.editor.*") || player.hasPermission("quests.editor.create")) {
|
||||
return new QuestSelectCreatePrompt(plugin, context, QuestFactory.this);
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("noPermission"));
|
||||
return new QuestMenuPrompt(plugin, context, QuestFactory.this);
|
||||
}
|
||||
case 2:
|
||||
if (player.hasPermission("quests.editor.*") || player.hasPermission("quests.editor.edit")) {
|
||||
return new QuestSelectEditPrompt();
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("noPermission"));
|
||||
return new QuestMenuPrompt(plugin, context, QuestFactory.this);
|
||||
}
|
||||
case 3:
|
||||
if (player.hasPermission("quests.editor.*") || player.hasPermission("quests.editor.delete")) {
|
||||
return new QuestSelectDeletePrompt();
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("noPermission"));
|
||||
return new QuestMenuPrompt(plugin, context, QuestFactory.this);
|
||||
}
|
||||
case 4:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("exited"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
if (player.hasPermission("quests.editor.*") || player.hasPermission("quests.editor.create")) {
|
||||
return new QuestSelectCreatePrompt(plugin, context, QuestFactory.this);
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("noPermission"));
|
||||
return new QuestMenuPrompt(plugin, context, QuestFactory.this);
|
||||
}
|
||||
case 2:
|
||||
if (player.hasPermission("quests.editor.*") || player.hasPermission("quests.editor.edit")) {
|
||||
return new QuestSelectEditPrompt();
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("noPermission"));
|
||||
return new QuestMenuPrompt(plugin, context, QuestFactory.this);
|
||||
}
|
||||
case 3:
|
||||
if (player.hasPermission("quests.editor.*") || player.hasPermission("quests.editor.delete")) {
|
||||
return new QuestSelectDeletePrompt();
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("noPermission"));
|
||||
return new QuestMenuPrompt(plugin, context, QuestFactory.this);
|
||||
}
|
||||
case 4:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("exited"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -238,7 +238,7 @@ public class QuestFactory implements ConversationAbandonedListener {
|
||||
return new QuestMainPrompt(plugin, context, this);
|
||||
}
|
||||
|
||||
public class QuestMainPrompt extends QuestsNumericPrompt {
|
||||
public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
||||
public QuestMainPrompt(Quests plugin, ConversationContext context, QuestFactory factory) {
|
||||
super(context, factory);
|
||||
}
|
||||
@ -257,183 +257,183 @@ public class QuestFactory implements ConversationAbandonedListener {
|
||||
|
||||
public ChatColor getNumberColor(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
return ChatColor.BLUE;
|
||||
case 6:
|
||||
if (plugin.getDependencies().getWorldGuardApi() != null) {
|
||||
return ChatColor.BLUE;
|
||||
case 6:
|
||||
if (plugin.getDependencies().getWorldGuardApi() != null) {
|
||||
return ChatColor.BLUE;
|
||||
} else {
|
||||
return ChatColor.GRAY;
|
||||
}
|
||||
case 7:
|
||||
} else {
|
||||
return ChatColor.GRAY;
|
||||
}
|
||||
case 7:
|
||||
return ChatColor.BLUE;
|
||||
case 8:
|
||||
if (plugin.getDependencies().getCitizens() != null) {
|
||||
return ChatColor.BLUE;
|
||||
case 8:
|
||||
if (plugin.getDependencies().getCitizens() != null) {
|
||||
return ChatColor.BLUE;
|
||||
} else {
|
||||
return ChatColor.GRAY;
|
||||
}
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
return ChatColor.BLUE;
|
||||
case 14:
|
||||
return ChatColor.GREEN;
|
||||
case 15:
|
||||
return ChatColor.RED;
|
||||
default:
|
||||
return null;
|
||||
} else {
|
||||
return ChatColor.GRAY;
|
||||
}
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
return ChatColor.BLUE;
|
||||
case 14:
|
||||
return ChatColor.GREEN;
|
||||
case 15:
|
||||
return ChatColor.RED;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getSelectionText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("questEditorName");
|
||||
case 2:
|
||||
if (context.getSessionData(CK.Q_ASK_MESSAGE) == null) {
|
||||
return ChatColor.RED + Lang.get("questEditorAskMessage");
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("questEditorName");
|
||||
case 2:
|
||||
if (context.getSessionData(CK.Q_ASK_MESSAGE) == null) {
|
||||
return ChatColor.RED + Lang.get("questEditorAskMessage");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("questEditorAskMessage");
|
||||
}
|
||||
case 3:
|
||||
if (context.getSessionData(CK.Q_FINISH_MESSAGE) == null) {
|
||||
return ChatColor.RED + Lang.get("questEditorFinishMessage");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("questEditorFinishMessage");
|
||||
}
|
||||
case 4:
|
||||
if (context.getSessionData(CK.Q_START_NPC) == null && plugin.getDependencies().getCitizens()
|
||||
!= null) {
|
||||
return ChatColor.YELLOW + Lang.get("questEditorNPCStart");
|
||||
} else if (plugin.getDependencies().getCitizens() != null) {
|
||||
return ChatColor.YELLOW + Lang.get("questEditorNPCStart");
|
||||
} else {
|
||||
return ChatColor.GRAY + Lang.get("questEditorNPCStart");
|
||||
}
|
||||
case 5:
|
||||
return ChatColor.YELLOW + Lang.get("questEditorBlockStart");
|
||||
case 6:
|
||||
if (plugin.getDependencies().getWorldGuardApi() != null) {
|
||||
if (context.getSessionData(CK.Q_REGION) == null) {
|
||||
return ChatColor.YELLOW + Lang.get("questWGSetRegion");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("questEditorAskMessage");
|
||||
return ChatColor.YELLOW + Lang.get("questWGSetRegion");
|
||||
}
|
||||
case 3:
|
||||
if (context.getSessionData(CK.Q_FINISH_MESSAGE) == null) {
|
||||
return ChatColor.RED + Lang.get("questEditorFinishMessage");
|
||||
} else {
|
||||
return ChatColor.GRAY + Lang.get("questWGSetRegion");
|
||||
}
|
||||
case 7:
|
||||
return ChatColor.YELLOW + Lang.get("questEditorInitialEvent");
|
||||
case 8:
|
||||
if (plugin.getDependencies().getCitizens() != null) {
|
||||
if (context.getSessionData(CK.Q_GUIDISPLAY) == null) {
|
||||
return ChatColor.YELLOW + Lang.get("questEditorSetGUI");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("questEditorFinishMessage");
|
||||
return ChatColor.YELLOW + Lang.get("questEditorSetGUI");
|
||||
}
|
||||
case 4:
|
||||
if (context.getSessionData(CK.Q_START_NPC) == null && plugin.getDependencies().getCitizens()
|
||||
!= null) {
|
||||
return ChatColor.YELLOW + Lang.get("questEditorNPCStart");
|
||||
} else if (plugin.getDependencies().getCitizens() != null) {
|
||||
return ChatColor.YELLOW + Lang.get("questEditorNPCStart");
|
||||
} else {
|
||||
return ChatColor.GRAY + Lang.get("questEditorNPCStart");
|
||||
}
|
||||
case 5:
|
||||
return ChatColor.YELLOW + Lang.get("questEditorBlockStart");
|
||||
case 6:
|
||||
if (plugin.getDependencies().getWorldGuardApi() != null) {
|
||||
if (context.getSessionData(CK.Q_REGION) == null) {
|
||||
return ChatColor.YELLOW + Lang.get("questWGSetRegion");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("questWGSetRegion");
|
||||
}
|
||||
} else {
|
||||
return ChatColor.GRAY + Lang.get("questWGSetRegion");
|
||||
}
|
||||
case 7:
|
||||
return ChatColor.YELLOW + Lang.get("questEditorInitialEvent");
|
||||
case 8:
|
||||
if (plugin.getDependencies().getCitizens() != null) {
|
||||
if (context.getSessionData(CK.Q_GUIDISPLAY) == null) {
|
||||
return ChatColor.YELLOW + Lang.get("questEditorSetGUI");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("questEditorSetGUI");
|
||||
}
|
||||
} else {
|
||||
return ChatColor.GRAY + Lang.get("questEditorSetGUI");
|
||||
}
|
||||
case 9:
|
||||
return ChatColor.DARK_AQUA + Lang.get("questEditorReqs");
|
||||
case 10:
|
||||
return ChatColor.AQUA + Lang.get("questEditorPln");
|
||||
case 11:
|
||||
return ChatColor.LIGHT_PURPLE + Lang.get("questEditorStages");
|
||||
case 12:
|
||||
return ChatColor.DARK_PURPLE + Lang.get("questEditorRews");
|
||||
case 13:
|
||||
return ChatColor.DARK_GREEN + Lang.get("questEditorOpts");
|
||||
case 14:
|
||||
return ChatColor.GREEN + Lang.get("save");
|
||||
case 15:
|
||||
return ChatColor.RED + Lang.get("exit");
|
||||
default:
|
||||
return null;
|
||||
} else {
|
||||
return ChatColor.GRAY + Lang.get("questEditorSetGUI");
|
||||
}
|
||||
case 9:
|
||||
return ChatColor.DARK_AQUA + Lang.get("questEditorReqs");
|
||||
case 10:
|
||||
return ChatColor.AQUA + Lang.get("questEditorPln");
|
||||
case 11:
|
||||
return ChatColor.LIGHT_PURPLE + Lang.get("questEditorStages");
|
||||
case 12:
|
||||
return ChatColor.DARK_PURPLE + Lang.get("questEditorRews");
|
||||
case 13:
|
||||
return ChatColor.DARK_GREEN + Lang.get("questEditorOpts");
|
||||
case 14:
|
||||
return ChatColor.GREEN + Lang.get("save");
|
||||
case 15:
|
||||
return ChatColor.RED + Lang.get("exit");
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getAdditionalText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return "";
|
||||
case 2:
|
||||
if (context.getSessionData(CK.Q_ASK_MESSAGE) == null) {
|
||||
return ChatColor.DARK_RED + "(" + Lang.get("questRequiredNoneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.YELLOW + "(" + context.getSessionData(CK.Q_ASK_MESSAGE) + ChatColor.RESET
|
||||
+ ChatColor.YELLOW + ")";
|
||||
}
|
||||
case 3:
|
||||
if (context.getSessionData(CK.Q_FINISH_MESSAGE) == null) {
|
||||
return ChatColor.DARK_RED + "(" + Lang.get("questRequiredNoneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.YELLOW + "(" + context.getSessionData(CK.Q_FINISH_MESSAGE) + ChatColor.RESET
|
||||
+ ChatColor.YELLOW + ")";
|
||||
}
|
||||
case 4:
|
||||
if (context.getSessionData(CK.Q_START_NPC) == null && plugin.getDependencies().getCitizens()
|
||||
!= null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else if (plugin.getDependencies().getCitizens() != null) {
|
||||
return ChatColor.YELLOW + "(" + CitizensAPI.getNPCRegistry().getById((Integer) context
|
||||
.getSessionData(CK.Q_START_NPC)).getName() + ChatColor.RESET + ChatColor.YELLOW + ")";
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||
}
|
||||
case 5:
|
||||
if (context.getSessionData(CK.Q_START_BLOCK) == null) {
|
||||
case 1:
|
||||
return "";
|
||||
case 2:
|
||||
if (context.getSessionData(CK.Q_ASK_MESSAGE) == null) {
|
||||
return ChatColor.DARK_RED + "(" + Lang.get("questRequiredNoneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.YELLOW + "(" + context.getSessionData(CK.Q_ASK_MESSAGE) + ChatColor.RESET
|
||||
+ ChatColor.YELLOW + ")";
|
||||
}
|
||||
case 3:
|
||||
if (context.getSessionData(CK.Q_FINISH_MESSAGE) == null) {
|
||||
return ChatColor.DARK_RED + "(" + Lang.get("questRequiredNoneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.YELLOW + "(" + context.getSessionData(CK.Q_FINISH_MESSAGE) + ChatColor.RESET
|
||||
+ ChatColor.YELLOW + ")";
|
||||
}
|
||||
case 4:
|
||||
if (context.getSessionData(CK.Q_START_NPC) == null && plugin.getDependencies().getCitizens()
|
||||
!= null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else if (plugin.getDependencies().getCitizens() != null) {
|
||||
return ChatColor.YELLOW + "(" + CitizensAPI.getNPCRegistry().getById((Integer) context
|
||||
.getSessionData(CK.Q_START_NPC)).getName() + ChatColor.RESET + ChatColor.YELLOW + ")";
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||
}
|
||||
case 5:
|
||||
if (context.getSessionData(CK.Q_START_BLOCK) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
Location l = (Location) context.getSessionData(CK.Q_START_BLOCK);
|
||||
return ChatColor.YELLOW + "(" + l.getWorld().getName() + ", " + l.getBlockX() + ", "
|
||||
+ l.getBlockY() + ", " + l.getBlockZ() + ")";
|
||||
}
|
||||
case 6:
|
||||
if (plugin.getDependencies().getWorldGuardApi() != null) {
|
||||
if (context.getSessionData(CK.Q_REGION) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
Location l = (Location) context.getSessionData(CK.Q_START_BLOCK);
|
||||
return ChatColor.YELLOW + "(" + l.getWorld().getName() + ", " + l.getBlockX() + ", "
|
||||
+ l.getBlockY() + ", " + l.getBlockZ() + ")";
|
||||
return ChatColor.YELLOW + "(" + ChatColor.GREEN
|
||||
+ (String) context.getSessionData(CK.Q_REGION) + ChatColor.YELLOW + ")";
|
||||
}
|
||||
case 6:
|
||||
if (plugin.getDependencies().getWorldGuardApi() != null) {
|
||||
if (context.getSessionData(CK.Q_REGION) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.YELLOW + "(" + ChatColor.GREEN
|
||||
+ (String) context.getSessionData(CK.Q_REGION) + ChatColor.YELLOW + ")";
|
||||
}
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||
}
|
||||
case 7:
|
||||
if (context.getSessionData(CK.Q_INITIAL_EVENT) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.YELLOW + "(" + (String) context.getSessionData(CK.Q_INITIAL_EVENT) + ")";
|
||||
}
|
||||
case 8:
|
||||
if (plugin.getDependencies().getCitizens() != null) {
|
||||
if (context.getSessionData(CK.Q_GUIDISPLAY) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||
return ChatColor.YELLOW + "(" + ItemUtil.getDisplayString((ItemStack) context
|
||||
.getSessionData(CK.Q_GUIDISPLAY)) + ChatColor.RESET + ChatColor.YELLOW + ")";
|
||||
}
|
||||
case 7:
|
||||
if (context.getSessionData(CK.Q_INITIAL_EVENT) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.YELLOW + "(" + (String) context.getSessionData(CK.Q_INITIAL_EVENT) + ")";
|
||||
}
|
||||
case 8:
|
||||
if (plugin.getDependencies().getCitizens() != null) {
|
||||
if (context.getSessionData(CK.Q_GUIDISPLAY) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.YELLOW + "(" + ItemUtil.getDisplayString((ItemStack) context
|
||||
.getSessionData(CK.Q_GUIDISPLAY)) + ChatColor.RESET + ChatColor.YELLOW + ")";
|
||||
}
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||
}
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||
}
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -455,56 +455,56 @@ public class QuestFactory implements ConversationAbandonedListener {
|
||||
@Override
|
||||
protected Prompt acceptValidatedInput(ConversationContext context, Number input) {
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
return new QuestSetNamePrompt();
|
||||
case 2:
|
||||
return new AskMessagePrompt();
|
||||
case 3:
|
||||
return new FinishMessagePrompt();
|
||||
case 4:
|
||||
if (plugin.getDependencies().getCitizens() != null) {
|
||||
return new NPCStartPrompt();
|
||||
} else {
|
||||
return new QuestMainPrompt(plugin, context, QuestFactory.this);
|
||||
}
|
||||
case 5:
|
||||
selectedBlockStarts.put(((Player) context.getForWhom()).getUniqueId(), null);
|
||||
return new BlockStartPrompt();
|
||||
case 6:
|
||||
if (plugin.getDependencies().getWorldGuardApi() != null) {
|
||||
return new RegionPrompt();
|
||||
} else {
|
||||
return new QuestMainPrompt(plugin, context, QuestFactory.this);
|
||||
}
|
||||
case 7:
|
||||
return new InitialActionPrompt();
|
||||
case 8:
|
||||
if (plugin.getDependencies().getCitizens() != null) {
|
||||
return new GUIDisplayPrompt(plugin, context, QuestFactory.this);
|
||||
} else {
|
||||
return new QuestMainPrompt(plugin, context, QuestFactory.this);
|
||||
}
|
||||
case 9:
|
||||
return new RequirementsPrompt(plugin, context, QuestFactory.this);
|
||||
case 10:
|
||||
return new PlannerPrompt(plugin, context, QuestFactory.this);
|
||||
case 11:
|
||||
return new StageMenuPrompt(plugin, context, QuestFactory.this);
|
||||
case 12:
|
||||
return new RewardsPrompt(plugin, context, QuestFactory.this);
|
||||
case 13:
|
||||
return new OptionsPrompt(plugin, context, QuestFactory.this);
|
||||
case 14:
|
||||
return new SavePrompt(plugin, context, QuestFactory.this);
|
||||
case 15:
|
||||
return new ExitPrompt(plugin, context, QuestFactory.this);
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return new QuestSetNamePrompt();
|
||||
case 2:
|
||||
return new AskMessagePrompt();
|
||||
case 3:
|
||||
return new FinishMessagePrompt();
|
||||
case 4:
|
||||
if (plugin.getDependencies().getCitizens() != null) {
|
||||
return new NPCStartPrompt();
|
||||
} else {
|
||||
return new QuestMainPrompt(plugin, context, QuestFactory.this);
|
||||
}
|
||||
case 5:
|
||||
selectedBlockStarts.put(((Player) context.getForWhom()).getUniqueId(), null);
|
||||
return new BlockStartPrompt();
|
||||
case 6:
|
||||
if (plugin.getDependencies().getWorldGuardApi() != null) {
|
||||
return new RegionPrompt();
|
||||
} else {
|
||||
return new QuestMainPrompt(plugin, context, QuestFactory.this);
|
||||
}
|
||||
case 7:
|
||||
return new InitialActionPrompt();
|
||||
case 8:
|
||||
if (plugin.getDependencies().getCitizens() != null) {
|
||||
return new GUIDisplayPrompt(plugin, context, QuestFactory.this);
|
||||
} else {
|
||||
return new QuestMainPrompt(plugin, context, QuestFactory.this);
|
||||
}
|
||||
case 9:
|
||||
return new RequirementsPrompt(plugin, context, QuestFactory.this);
|
||||
case 10:
|
||||
return new PlannerPrompt(plugin, context, QuestFactory.this);
|
||||
case 11:
|
||||
return new StageMenuPrompt(plugin, context, QuestFactory.this);
|
||||
case 12:
|
||||
return new RewardsPrompt(plugin, context, QuestFactory.this);
|
||||
case 13:
|
||||
return new OptionsPrompt(plugin, context, QuestFactory.this);
|
||||
case 14:
|
||||
return new SavePrompt(plugin, context, QuestFactory.this);
|
||||
case 15:
|
||||
return new ExitPrompt(plugin, context, QuestFactory.this);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class QuestSelectCreatePrompt extends QuestsStringPrompt {
|
||||
public class QuestSelectCreatePrompt extends QuestsEditorStringPrompt {
|
||||
public QuestSelectCreatePrompt(Quests plugin, ConversationContext context, QuestFactory factory) {
|
||||
super(context, factory);
|
||||
}
|
||||
@ -1320,7 +1320,7 @@ public class QuestFactory implements ConversationAbandonedListener {
|
||||
}
|
||||
}
|
||||
|
||||
public class SavePrompt extends QuestsStringPrompt {
|
||||
public class SavePrompt extends QuestsEditorStringPrompt {
|
||||
public SavePrompt(Quests plugin, ConversationContext context, QuestFactory factory) {
|
||||
super(context, factory);
|
||||
}
|
||||
@ -1337,23 +1337,23 @@ public class QuestFactory implements ConversationAbandonedListener {
|
||||
|
||||
public ChatColor getNumberColor(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.GREEN;
|
||||
case 2:
|
||||
return ChatColor.RED;
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return ChatColor.GREEN;
|
||||
case 2:
|
||||
return ChatColor.RED;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getSelectionText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.GREEN + Lang.get("yesWord");
|
||||
case 2:
|
||||
return ChatColor.RED + Lang.get("noWord");
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return ChatColor.GREEN + Lang.get("yesWord");
|
||||
case 2:
|
||||
return ChatColor.RED + Lang.get("noWord");
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1424,7 +1424,7 @@ public class QuestFactory implements ConversationAbandonedListener {
|
||||
}
|
||||
}
|
||||
|
||||
public class ExitPrompt extends QuestsStringPrompt {
|
||||
public class ExitPrompt extends QuestsEditorStringPrompt {
|
||||
public ExitPrompt(Quests plugin, ConversationContext context, QuestFactory factory) {
|
||||
super(context, factory);
|
||||
}
|
||||
@ -1441,23 +1441,23 @@ public class QuestFactory implements ConversationAbandonedListener {
|
||||
|
||||
public ChatColor getNumberColor(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.GREEN;
|
||||
case 2:
|
||||
return ChatColor.RED;
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return ChatColor.GREEN;
|
||||
case 2:
|
||||
return ChatColor.RED;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getSelectionText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.GREEN + Lang.get("yesWord");
|
||||
case 2:
|
||||
return ChatColor.RED + Lang.get("noWord");
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return ChatColor.GREEN + Lang.get("yesWord");
|
||||
case 2:
|
||||
return ChatColor.RED + Lang.get("noWord");
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,6 +77,7 @@ import com.herocraftonline.heroes.characters.classes.HeroClass;
|
||||
|
||||
import me.blackvein.quests.actions.Action;
|
||||
import me.blackvein.quests.actions.ActionFactory;
|
||||
import me.blackvein.quests.convo.quests.prompts.QuestOfferPrompt;
|
||||
import me.blackvein.quests.exceptions.QuestFormatException;
|
||||
import me.blackvein.quests.exceptions.StageFormatException;
|
||||
import me.blackvein.quests.listeners.CmdExecutor;
|
||||
@ -84,7 +85,6 @@ import me.blackvein.quests.listeners.DungeonsListener;
|
||||
import me.blackvein.quests.listeners.NpcListener;
|
||||
import me.blackvein.quests.listeners.PartiesListener;
|
||||
import me.blackvein.quests.listeners.PlayerListener;
|
||||
import me.blackvein.quests.prompts.quests.QuestOfferPrompt;
|
||||
import me.blackvein.quests.tasks.NpcEffectThread;
|
||||
import me.blackvein.quests.tasks.PlayerMoveThread;
|
||||
import me.blackvein.quests.util.ConfigUtil;
|
||||
|
@ -51,10 +51,11 @@ import me.blackvein.quests.QuestMob;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.Stage;
|
||||
import me.blackvein.quests.events.editor.actions.ActionsEditorPostOpenMainPromptEvent;
|
||||
import me.blackvein.quests.events.editor.actions.ActionsEditorPostOpenMenuPromptEvent;
|
||||
import me.blackvein.quests.events.editor.actions.ActionsEditorPostOpenSelectCreatePromptEvent;
|
||||
import me.blackvein.quests.prompts.quests.ItemStackPrompt;
|
||||
import me.blackvein.quests.convo.actions.ActionsEditorNumericPrompt;
|
||||
import me.blackvein.quests.convo.actions.ActionsEditorStringPrompt;
|
||||
import me.blackvein.quests.convo.quests.prompts.ItemStackPrompt;
|
||||
import me.blackvein.quests.events.editor.actions.ActionsEditorPostOpenNumericPromptEvent;
|
||||
import me.blackvein.quests.events.editor.actions.ActionsEditorPostOpenStringPromptEvent;
|
||||
import me.blackvein.quests.util.CK;
|
||||
import me.blackvein.quests.util.ConfigUtil;
|
||||
import me.blackvein.quests.util.ItemUtil;
|
||||
@ -79,8 +80,8 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
actionsFile = new File(plugin.getDataFolder(), "actions.yml");
|
||||
// Ensure to initialize convoCreator last so that 'this' is fully initialized before it is passed
|
||||
this.convoCreator = new ConversationFactory(plugin).withModality(false).withLocalEcho(false)
|
||||
.withPrefix(new QuestCreatorPrefix()).withFirstPrompt(new ActionMenuPrompt()).withTimeout(3600)
|
||||
.thatExcludesNonPlayersWithMessage("Console may not perform this operation!")
|
||||
.withPrefix(new QuestCreatorPrefix()).withFirstPrompt(new ActionMenuPrompt(null, this))
|
||||
.withTimeout(3600).thatExcludesNonPlayersWithMessage("Console may not perform this operation!")
|
||||
.addConversationAbandonedListener(this);
|
||||
}
|
||||
|
||||
@ -149,50 +150,59 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
}
|
||||
}
|
||||
|
||||
public class ActionMenuPrompt extends NumericPrompt {
|
||||
public class ActionMenuPrompt extends ActionsEditorNumericPrompt {
|
||||
public ActionMenuPrompt(ConversationContext context, ActionFactory factory) {
|
||||
super(context, factory);
|
||||
}
|
||||
|
||||
private final int size = 4;
|
||||
|
||||
public int getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
public String getTitle(ConversationContext context) {
|
||||
return Lang.get("eventEditorTitle");
|
||||
}
|
||||
|
||||
public ChatColor getNumberColor(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
return ChatColor.BLUE;
|
||||
case 4:
|
||||
return ChatColor.RED;
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
return ChatColor.BLUE;
|
||||
case 4:
|
||||
return ChatColor.RED;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getSelectionText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("eventEditorCreate");
|
||||
case 2:
|
||||
return ChatColor.YELLOW + Lang.get("eventEditorEdit");
|
||||
case 3:
|
||||
return ChatColor.YELLOW + Lang.get("eventEditorDelete");
|
||||
case 4:
|
||||
return ChatColor.RED + Lang.get("exit");
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("eventEditorCreate");
|
||||
case 2:
|
||||
return ChatColor.YELLOW + Lang.get("eventEditorEdit");
|
||||
case 3:
|
||||
return ChatColor.YELLOW + Lang.get("eventEditorDelete");
|
||||
case 4:
|
||||
return ChatColor.RED + Lang.get("exit");
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getAdditionalText(ConversationContext context, int number) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPromptText(ConversationContext context) {
|
||||
ActionsEditorPostOpenMenuPromptEvent event = new ActionsEditorPostOpenMenuPromptEvent(context);
|
||||
ActionsEditorPostOpenNumericPromptEvent event
|
||||
= new ActionsEditorPostOpenNumericPromptEvent(context, ActionFactory.this, this);
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
String text = ChatColor.GOLD + getTitle() + "\n";
|
||||
String text = ChatColor.GOLD + getTitle(context) + "\n";
|
||||
for (int i = 1; i <= size; i++) {
|
||||
text += getNumberColor(context, i) + "" + ChatColor.BOLD + i + ChatColor.RESET + " - "
|
||||
+ getSelectionText(context, i) + "\n";
|
||||
@ -204,57 +214,61 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
protected Prompt acceptValidatedInput(ConversationContext context, Number input) {
|
||||
final Player player = (Player) context.getForWhom();
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
if (player.hasPermission("quests.editor.actions.create")
|
||||
|| player.hasPermission("quests.editor.events.create")) {
|
||||
context.setSessionData(CK.E_OLD_EVENT, "");
|
||||
return new ActionSelectCreatePrompt();
|
||||
case 1:
|
||||
if (player.hasPermission("quests.editor.actions.create")
|
||||
|| player.hasPermission("quests.editor.events.create")) {
|
||||
context.setSessionData(CK.E_OLD_EVENT, "");
|
||||
return new ActionSelectCreatePrompt(context, ActionFactory.this);
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("noPermission"));
|
||||
return new ActionMenuPrompt(context, ActionFactory.this);
|
||||
}
|
||||
case 2:
|
||||
if (player.hasPermission("quests.editor.actions.edit")
|
||||
|| player.hasPermission("quests.editor.events.edit")) {
|
||||
if (plugin.getActions().isEmpty()) {
|
||||
((Player) context.getForWhom()).sendMessage(ChatColor.YELLOW
|
||||
+ Lang.get("eventEditorNoneToEdit"));
|
||||
return new ActionMenuPrompt(context, ActionFactory.this);
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("noPermission"));
|
||||
return new ActionMenuPrompt();
|
||||
return new ActionSelectEditPrompt();
|
||||
}
|
||||
case 2:
|
||||
if (player.hasPermission("quests.editor.actions.edit")
|
||||
|| player.hasPermission("quests.editor.events.edit")) {
|
||||
if (plugin.getActions().isEmpty()) {
|
||||
((Player) context.getForWhom()).sendMessage(ChatColor.YELLOW
|
||||
+ Lang.get("eventEditorNoneToEdit"));
|
||||
return new ActionMenuPrompt();
|
||||
} else {
|
||||
return new ActionSelectEditPrompt();
|
||||
}
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("noPermission"));
|
||||
return new ActionMenuPrompt(context, ActionFactory.this);
|
||||
}
|
||||
case 3:
|
||||
if (player.hasPermission("quests.editor.actions.delete")
|
||||
|| player.hasPermission("quests.editor.events.delete")) {
|
||||
if (plugin.getActions().isEmpty()) {
|
||||
((Player) context.getForWhom()).sendMessage(ChatColor.YELLOW
|
||||
+ Lang.get("eventEditorNoneToDelete"));
|
||||
return new ActionMenuPrompt(context, ActionFactory.this);
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("noPermission"));
|
||||
return new ActionMenuPrompt();
|
||||
return new ActionSelectDeletePrompt();
|
||||
}
|
||||
case 3:
|
||||
if (player.hasPermission("quests.editor.actions.delete")
|
||||
|| player.hasPermission("quests.editor.events.delete")) {
|
||||
if (plugin.getActions().isEmpty()) {
|
||||
((Player) context.getForWhom()).sendMessage(ChatColor.YELLOW
|
||||
+ Lang.get("eventEditorNoneToDelete"));
|
||||
return new ActionMenuPrompt();
|
||||
} else {
|
||||
return new ActionSelectDeletePrompt();
|
||||
}
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("noPermission"));
|
||||
return new ActionMenuPrompt();
|
||||
}
|
||||
case 4:
|
||||
((Player) context.getForWhom()).sendMessage(ChatColor.YELLOW + Lang.get("exited"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
default:
|
||||
return null;
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("noPermission"));
|
||||
return new ActionMenuPrompt(context, ActionFactory.this);
|
||||
}
|
||||
case 4:
|
||||
((Player) context.getForWhom()).sendMessage(ChatColor.YELLOW + Lang.get("exited"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Prompt returnToMenu() {
|
||||
return new ActionMainPrompt();
|
||||
public Prompt returnToMenu(ConversationContext context) {
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
}
|
||||
|
||||
public class ActionMainPrompt extends NumericPrompt {
|
||||
public class ActionMainPrompt extends ActionsEditorNumericPrompt {
|
||||
public ActionMainPrompt(ConversationContext context, ActionFactory factory) {
|
||||
super(context, factory);
|
||||
}
|
||||
|
||||
private final int size = 10;
|
||||
|
||||
public int getSize() {
|
||||
@ -267,111 +281,112 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
|
||||
public ChatColor getNumberColor(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
if (plugin.getDependencies().getDenizenAPI() == null) {
|
||||
return ChatColor.GRAY;
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
}
|
||||
case 8:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
if (plugin.getDependencies().getDenizenAPI() == null) {
|
||||
return ChatColor.GRAY;
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
case 9:
|
||||
return ChatColor.GREEN;
|
||||
case 10:
|
||||
return ChatColor.RED;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
case 8:
|
||||
return ChatColor.BLUE;
|
||||
case 9:
|
||||
return ChatColor.GREEN;
|
||||
case 10:
|
||||
return ChatColor.RED;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getSelectionText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("eventEditorSetName");
|
||||
case 2:
|
||||
return ChatColor.GOLD + Lang.get("eventEditorPlayer");
|
||||
case 3:
|
||||
return ChatColor.GOLD + Lang.get("eventEditorTimer");
|
||||
case 4:
|
||||
return ChatColor.GOLD + Lang.get("eventEditorEffect");
|
||||
case 5:
|
||||
return ChatColor.GOLD + Lang.get("eventEditorWeather");
|
||||
case 6:
|
||||
return ChatColor.YELLOW + Lang.get("eventEditorSetMobSpawns");
|
||||
case 7:
|
||||
if (plugin.getDependencies().getDenizenAPI() == null) {
|
||||
return ChatColor.GRAY + Lang.get("stageEditorDenizenScript");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorDenizenScript");
|
||||
}
|
||||
case 8:
|
||||
return ChatColor.YELLOW + Lang.get("eventEditorFailQuest") + ":";
|
||||
case 9:
|
||||
return ChatColor.GREEN + Lang.get("save");
|
||||
case 10:
|
||||
return ChatColor.RED + Lang.get("exit");
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("eventEditorSetName");
|
||||
case 2:
|
||||
return ChatColor.GOLD + Lang.get("eventEditorPlayer");
|
||||
case 3:
|
||||
return ChatColor.GOLD + Lang.get("eventEditorTimer");
|
||||
case 4:
|
||||
return ChatColor.GOLD + Lang.get("eventEditorEffect");
|
||||
case 5:
|
||||
return ChatColor.GOLD + Lang.get("eventEditorWeather");
|
||||
case 6:
|
||||
return ChatColor.YELLOW + Lang.get("eventEditorSetMobSpawns");
|
||||
case 7:
|
||||
if (plugin.getDependencies().getDenizenAPI() == null) {
|
||||
return ChatColor.GRAY + Lang.get("stageEditorDenizenScript");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorDenizenScript");
|
||||
}
|
||||
case 8:
|
||||
return ChatColor.YELLOW + Lang.get("eventEditorFailQuest") + ":";
|
||||
case 9:
|
||||
return ChatColor.GREEN + Lang.get("save");
|
||||
case 10:
|
||||
return ChatColor.RED + Lang.get("exit");
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public String getAdditionalText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
return "";
|
||||
case 6:
|
||||
if (context.getSessionData(CK.E_MOB_TYPES) == null) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
return "";
|
||||
case 6:
|
||||
if (context.getSessionData(CK.E_MOB_TYPES) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
LinkedList<String> types = (LinkedList<String>) context.getSessionData(CK.E_MOB_TYPES);
|
||||
String text = "";
|
||||
for (String s : types) {
|
||||
QuestMob qm = QuestMob.fromString(s);
|
||||
text += ChatColor.GRAY + " - " + ChatColor.AQUA + qm.getType().name()
|
||||
+ ((qm.getName() != null) ? ": " + qm.getName() : "") + ChatColor.GRAY + " x "
|
||||
+ ChatColor.DARK_AQUA + qm.getSpawnAmounts() + ChatColor.GRAY + " -> "
|
||||
+ ChatColor.GREEN + ConfigUtil.getLocationInfo(qm.getSpawnLocation()) + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 7:
|
||||
if (plugin.getDependencies().getDenizenAPI() == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||
} else {
|
||||
if (context.getSessionData(CK.E_DENIZEN) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
LinkedList<String> types = (LinkedList<String>) context.getSessionData(CK.E_MOB_TYPES);
|
||||
String text = "";
|
||||
for (String s : types) {
|
||||
QuestMob qm = QuestMob.fromString(s);
|
||||
text += ChatColor.GRAY + " - " + ChatColor.AQUA + qm.getType().name()
|
||||
+ ((qm.getName() != null) ? ": " + qm.getName() : "") + ChatColor.GRAY + " x "
|
||||
+ ChatColor.DARK_AQUA + qm.getSpawnAmounts() + ChatColor.GRAY + " -> "
|
||||
+ ChatColor.GREEN + ConfigUtil.getLocationInfo(qm.getSpawnLocation()) + "\n";
|
||||
}
|
||||
return text;
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.E_DENIZEN)
|
||||
+ ChatColor.GRAY + ")";
|
||||
}
|
||||
case 7:
|
||||
if (plugin.getDependencies().getDenizenAPI() == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||
} else {
|
||||
if (context.getSessionData(CK.E_DENIZEN) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.E_DENIZEN)
|
||||
+ ChatColor.GRAY + ")";
|
||||
}
|
||||
}
|
||||
case 8:
|
||||
if (context.getSessionData(CK.E_FAIL_QUEST) == null) {
|
||||
context.setSessionData(CK.E_FAIL_QUEST, Lang.get("noWord"));
|
||||
}
|
||||
return "" + ChatColor.AQUA + context.getSessionData(CK.E_FAIL_QUEST);
|
||||
case 9:
|
||||
case 10:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
case 8:
|
||||
if (context.getSessionData(CK.E_FAIL_QUEST) == null) {
|
||||
context.setSessionData(CK.E_FAIL_QUEST, Lang.get("noWord"));
|
||||
}
|
||||
return "" + ChatColor.AQUA + context.getSessionData(CK.E_FAIL_QUEST);
|
||||
case 9:
|
||||
case 10:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPromptText(ConversationContext context) {
|
||||
ActionsEditorPostOpenMainPromptEvent event = new ActionsEditorPostOpenMainPromptEvent(context);
|
||||
ActionsEditorPostOpenNumericPromptEvent event
|
||||
= new ActionsEditorPostOpenNumericPromptEvent(context, ActionFactory.this, this);
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
String text = ChatColor.GOLD + "- " + getTitle(context).replaceFirst(": ", ": " + ChatColor.AQUA)
|
||||
@ -407,7 +422,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
} else {
|
||||
context.setSessionData(CK.E_FAIL_QUEST, Lang.get("yesWord"));
|
||||
}
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
case 9:
|
||||
if (context.getSessionData(CK.E_OLD_EVENT) != null) {
|
||||
return new SavePrompt((String) context.getSessionData(CK.E_OLD_EVENT));
|
||||
@ -422,23 +437,26 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
}
|
||||
}
|
||||
|
||||
private class ActionSelectCreatePrompt extends StringPrompt {
|
||||
|
||||
public String getTitle() {
|
||||
public class ActionSelectCreatePrompt extends ActionsEditorStringPrompt {
|
||||
public ActionSelectCreatePrompt(ConversationContext context, ActionFactory factory) {
|
||||
super(context, factory);
|
||||
}
|
||||
|
||||
public String getTitle(ConversationContext context) {
|
||||
return Lang.get("eventEditorCreate");
|
||||
}
|
||||
|
||||
public String getQueryText() {
|
||||
public String getQueryText(ConversationContext context) {
|
||||
return Lang.get("eventEditorEnterEventName");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPromptText(ConversationContext context) {
|
||||
ActionsEditorPostOpenSelectCreatePromptEvent event
|
||||
= new ActionsEditorPostOpenSelectCreatePromptEvent(context);
|
||||
ActionsEditorPostOpenStringPromptEvent event
|
||||
= new ActionsEditorPostOpenStringPromptEvent(context, ActionFactory.this, this);
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
String text = ChatColor.GOLD + getTitle() + "\n" + ChatColor.YELLOW + getQueryText();
|
||||
String text = ChatColor.GOLD + getTitle(context) + "\n" + ChatColor.YELLOW + getQueryText(context);
|
||||
return text;
|
||||
}
|
||||
|
||||
@ -448,22 +466,22 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
for (Action e : plugin.getActions()) {
|
||||
if (e.getName().equalsIgnoreCase(input)) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorExists"));
|
||||
return new ActionSelectCreatePrompt();
|
||||
return new ActionSelectCreatePrompt(context, ActionFactory.this);
|
||||
}
|
||||
}
|
||||
if (names.contains(input)) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorSomeone"));
|
||||
return new ActionSelectCreatePrompt();
|
||||
return new ActionSelectCreatePrompt(context, ActionFactory.this);
|
||||
}
|
||||
if (StringUtils.isAlphanumeric(input) == false) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorAlpha"));
|
||||
return new ActionSelectCreatePrompt();
|
||||
return new ActionSelectCreatePrompt(context, ActionFactory.this);
|
||||
}
|
||||
context.setSessionData(CK.E_NAME, input);
|
||||
names.add(input);
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
} else {
|
||||
return new ActionMenuPrompt();
|
||||
return new ActionMenuPrompt(context, ActionFactory.this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -489,12 +507,12 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
context.setSessionData(CK.E_OLD_EVENT, a.getName());
|
||||
context.setSessionData(CK.E_NAME, a.getName());
|
||||
loadData(a, context);
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
}
|
||||
((Player) context.getForWhom()).sendMessage(ChatColor.RED + Lang.get("eventEditorNotFound"));
|
||||
return new ActionSelectEditPrompt();
|
||||
} else {
|
||||
return new ActionMenuPrompt();
|
||||
return new ActionMenuPrompt(context, ActionFactory.this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -638,7 +656,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
((Player) context.getForWhom()).sendMessage(ChatColor.RED + Lang.get("eventEditorNotFound"));
|
||||
return new ActionSelectDeletePrompt();
|
||||
} else {
|
||||
return new ActionMenuPrompt();
|
||||
return new ActionMenuPrompt(context, ActionFactory.this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -659,9 +677,9 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
public Prompt acceptInput(ConversationContext context, String input) {
|
||||
if (input.equalsIgnoreCase("1") || input.equalsIgnoreCase(Lang.get("yesWord"))) {
|
||||
deleteAction(context);
|
||||
return new ActionMenuPrompt();
|
||||
return new ActionMenuPrompt(context, ActionFactory.this);
|
||||
} else if (input.equalsIgnoreCase("2") || input.equalsIgnoreCase(Lang.get("noWord"))) {
|
||||
return new ActionMenuPrompt();
|
||||
return new ActionMenuPrompt(context, ActionFactory.this);
|
||||
} else {
|
||||
return new ActionConfirmDeletePrompt();
|
||||
}
|
||||
@ -780,7 +798,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
} else {
|
||||
context.setSessionData(CK.E_CLEAR_INVENTORY, Lang.get("yesWord"));
|
||||
}
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
} else if (input.equalsIgnoreCase("3")) {
|
||||
return new ItemListPrompt();
|
||||
} else if (input.equalsIgnoreCase("4")) {
|
||||
@ -797,7 +815,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
} else if (input.equalsIgnoreCase("9")) {
|
||||
return new CommandsPrompt();
|
||||
}
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -840,9 +858,9 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
} else {
|
||||
context.setSessionData(CK.E_CANCEL_TIMER, Lang.get("yesWord"));
|
||||
}
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
}
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -893,7 +911,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
selectedExplosionLocations.put(((Player) context.getForWhom()).getUniqueId(), null);
|
||||
return new ExplosionPrompt();
|
||||
}
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -954,7 +972,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
selectedLightningLocations.put(((Player) context.getForWhom()).getUniqueId(), null);
|
||||
return new LightningPrompt();
|
||||
}
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -963,7 +981,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
@Override
|
||||
protected Prompt acceptValidatedInput(final ConversationContext context, final Number number) {
|
||||
context.setSessionData(CK.E_TIMER, number);
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1011,9 +1029,9 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
public Prompt acceptInput(ConversationContext context, String input) {
|
||||
if (input.equalsIgnoreCase("1") || input.equalsIgnoreCase(Lang.get("yesWord"))) {
|
||||
saveAction(context);
|
||||
return new ActionMenuPrompt();
|
||||
return new ActionMenuPrompt(context, ActionFactory.this);
|
||||
} else if (input.equalsIgnoreCase("2") || input.equalsIgnoreCase(Lang.get("noWord"))) {
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
} else {
|
||||
return new SavePrompt(modName);
|
||||
}
|
||||
@ -1037,7 +1055,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
clearData(context);
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
} else if (input.equalsIgnoreCase("2") || input.equalsIgnoreCase(Lang.get("noWord"))) {
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
} else {
|
||||
return new ExitPrompt();
|
||||
}
|
||||
@ -1337,14 +1355,14 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("eventEditorSelectBlockFirst"));
|
||||
return new ExplosionPrompt();
|
||||
}
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.E_EXPLOSIONS, null);
|
||||
selectedExplosionLocations.remove(player.getUniqueId());
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
selectedExplosionLocations.remove(player.getUniqueId());
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
} else {
|
||||
return new ExplosionPrompt();
|
||||
}
|
||||
@ -1379,7 +1397,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
context.setSessionData(CK.E_NAME, input);
|
||||
names.add(input);
|
||||
}
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1398,7 +1416,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.E_MESSAGE, null);
|
||||
}
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1455,7 +1473,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
context.setSessionData(CK.E_ITEMS, null);
|
||||
return new ItemListPrompt();
|
||||
} else if (input.equalsIgnoreCase("3")) {
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -1539,7 +1557,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
two = 0;
|
||||
}
|
||||
if (one == two) {
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new SoundEffectListPrompt();
|
||||
@ -1704,7 +1722,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorMustSetStormDuration"));
|
||||
return new StormPrompt();
|
||||
} else {
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@ -1820,7 +1838,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorMustSetThunderDuration"));
|
||||
return new ThunderPrompt();
|
||||
} else {
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@ -1918,7 +1936,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
context.setSessionData(CK.E_MOB_TYPES, null);
|
||||
return new MobPrompt();
|
||||
} else if (input.equalsIgnoreCase("3")) {
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
}
|
||||
} else {
|
||||
@SuppressWarnings("unchecked")
|
||||
@ -1938,7 +1956,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
context.setSessionData(CK.E_MOB_TYPES, null);
|
||||
return new MobPrompt();
|
||||
} else if (inp == types.size() + 3) {
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
} else if (inp > types.size()) {
|
||||
return new MobPrompt();
|
||||
} else {
|
||||
@ -2329,14 +2347,14 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("eventEditorSelectBlockFirst"));
|
||||
return new LightningPrompt();
|
||||
}
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.E_LIGHTNING, null);
|
||||
selectedLightningLocations.remove(player.getUniqueId());
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
selectedLightningLocations.remove(player.getUniqueId());
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
} else {
|
||||
return new LightningPrompt();
|
||||
}
|
||||
@ -2450,7 +2468,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
three = 0;
|
||||
}
|
||||
if (one == two && two == three) {
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorListSizeMismatch"));
|
||||
return new PotionEffectPrompt();
|
||||
@ -2581,7 +2599,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
} else {
|
||||
context.setSessionData(CK.E_HUNGER, null);
|
||||
}
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2612,7 +2630,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
} else {
|
||||
context.setSessionData(CK.E_SATURATION, null);
|
||||
}
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2643,7 +2661,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
} else {
|
||||
context.setSessionData(CK.E_HEALTH, null);
|
||||
}
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2667,14 +2685,14 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("eventEditorSelectBlockFirst"));
|
||||
return new TeleportPrompt();
|
||||
}
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.E_TELEPORT, null);
|
||||
selectedTeleportLocations.remove(player.getUniqueId());
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
selectedTeleportLocations.remove(player.getUniqueId());
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
} else {
|
||||
return new TeleportPrompt();
|
||||
}
|
||||
@ -2700,7 +2718,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.E_COMMANDS, null);
|
||||
}
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2732,7 +2750,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
&& input.equalsIgnoreCase(Lang.get("cmdClear")) == false) {
|
||||
if (plugin.getDependencies().getDenizenAPI().containsScript(input)) {
|
||||
context.setSessionData(CK.E_DENIZEN, input.toUpperCase());
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("stageEditorInvalidScript"));
|
||||
return new DenizenPrompt();
|
||||
@ -2740,9 +2758,9 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.E_DENIZEN, null);
|
||||
player.sendMessage(ChatColor.YELLOW + Lang.get("stageEditorDenizenCleared"));
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
} else {
|
||||
return new ActionMainPrompt();
|
||||
return new ActionMainPrompt(context, ActionFactory.this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,23 @@
|
||||
package me.blackvein.quests.convo;
|
||||
|
||||
import org.bukkit.conversations.NumericPrompt;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public abstract class QuestsNumericPrompt extends NumericPrompt {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
|
||||
public QuestsNumericPrompt() {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package me.blackvein.quests.convo;
|
||||
|
||||
import org.bukkit.conversations.StringPrompt;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public abstract class QuestsStringPrompt extends StringPrompt {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
|
||||
public QuestsStringPrompt() {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
@ -10,25 +10,42 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************************************/
|
||||
|
||||
package me.blackvein.quests.events.editor.actions;
|
||||
package me.blackvein.quests.convo.actions;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public class ActionsEditorPostOpenSelectCreatePromptEvent extends ActionsEditorEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
import me.blackvein.quests.actions.ActionFactory;
|
||||
import me.blackvein.quests.convo.QuestsNumericPrompt;
|
||||
|
||||
public ActionsEditorPostOpenSelectCreatePromptEvent(ConversationContext context) {
|
||||
super(context);
|
||||
public abstract class ActionsEditorNumericPrompt extends QuestsNumericPrompt {
|
||||
private ConversationContext context;
|
||||
private ActionFactory factory;
|
||||
|
||||
public ActionsEditorNumericPrompt(final ConversationContext context, final ActionFactory factory) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
public String getName() {
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
|
||||
public ConversationContext getConversationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public ActionFactory getActionFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
public abstract int getSize();
|
||||
|
||||
public abstract String getTitle(ConversationContext context);
|
||||
|
||||
public abstract ChatColor getNumberColor(ConversationContext context, int number);
|
||||
|
||||
public abstract String getSelectionText(ConversationContext context, int number);
|
||||
|
||||
public abstract String getAdditionalText(ConversationContext context, int number);
|
||||
}
|
@ -10,25 +10,35 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************************************/
|
||||
|
||||
package me.blackvein.quests.events.editor.actions;
|
||||
package me.blackvein.quests.convo.actions;
|
||||
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public class ActionsEditorPostOpenMenuPromptEvent extends ActionsEditorEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
import me.blackvein.quests.actions.ActionFactory;
|
||||
import me.blackvein.quests.convo.QuestsStringPrompt;
|
||||
|
||||
public ActionsEditorPostOpenMenuPromptEvent(ConversationContext context) {
|
||||
super(context);
|
||||
public abstract class ActionsEditorStringPrompt extends QuestsStringPrompt {
|
||||
private ConversationContext context;
|
||||
private ActionFactory factory;
|
||||
|
||||
public ActionsEditorStringPrompt(final ConversationContext context, final ActionFactory factory) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
public String getName() {
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
|
||||
public ConversationContext getConversationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public ActionFactory getActionFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
public abstract String getTitle(ConversationContext context);
|
||||
|
||||
public abstract String getQueryText(ConversationContext context);
|
||||
}
|
@ -10,19 +10,19 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************************************/
|
||||
|
||||
package me.blackvein.quests.prompts;
|
||||
package me.blackvein.quests.convo.quests;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.NumericPrompt;
|
||||
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
import me.blackvein.quests.convo.QuestsNumericPrompt;
|
||||
|
||||
public abstract class QuestsNumericPrompt extends NumericPrompt {
|
||||
public abstract class QuestsEditorNumericPrompt extends QuestsNumericPrompt {
|
||||
private ConversationContext context;
|
||||
private QuestFactory factory;
|
||||
|
||||
public QuestsNumericPrompt(final ConversationContext context, final QuestFactory factory) {
|
||||
public QuestsEditorNumericPrompt(final ConversationContext context, final QuestFactory factory) {
|
||||
this.context = context;
|
||||
this.factory = factory;
|
||||
}
|
@ -10,18 +10,18 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************************************/
|
||||
|
||||
package me.blackvein.quests.prompts;
|
||||
package me.blackvein.quests.convo.quests;
|
||||
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.StringPrompt;
|
||||
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
import me.blackvein.quests.convo.QuestsStringPrompt;
|
||||
|
||||
public abstract class QuestsStringPrompt extends StringPrompt {
|
||||
public abstract class QuestsEditorStringPrompt extends QuestsStringPrompt {
|
||||
private ConversationContext context;
|
||||
private QuestFactory factory;
|
||||
|
||||
public QuestsStringPrompt(final ConversationContext context, final QuestFactory factory) {
|
||||
public QuestsEditorStringPrompt(final ConversationContext context, final QuestFactory factory) {
|
||||
this.context = context;
|
||||
this.factory = factory;
|
||||
}
|
@ -10,13 +10,15 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************************************/
|
||||
|
||||
package me.blackvein.quests.prompts.quests;
|
||||
package me.blackvein.quests.convo.quests.prompts;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenNumericPromptEvent;
|
||||
import me.blackvein.quests.util.CK;
|
||||
import me.blackvein.quests.util.ItemUtil;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
@ -28,113 +30,177 @@ import org.bukkit.conversations.FixedSetPrompt;
|
||||
import org.bukkit.conversations.Prompt;
|
||||
import org.bukkit.conversations.StringPrompt;
|
||||
|
||||
public class BlocksPrompt extends FixedSetPrompt {
|
||||
public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
||||
private final Quests plugin;
|
||||
private final int stageNum;
|
||||
private final String pref;
|
||||
private final QuestFactory questFactory;
|
||||
private final QuestFactory factory;
|
||||
|
||||
public BlocksPrompt(Quests plugin, int stageNum, QuestFactory qf) {
|
||||
super("1", "2", "3", "4", "5", "6");
|
||||
public BlocksPrompt(Quests plugin, int stageNum, ConversationContext context, QuestFactory qf) {
|
||||
super(context, qf);
|
||||
this.plugin = plugin;
|
||||
this.stageNum = stageNum;
|
||||
this.pref = "stage" + stageNum;
|
||||
this.questFactory = qf;
|
||||
this.factory = qf;
|
||||
}
|
||||
|
||||
private final int size = 6;
|
||||
|
||||
public int getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public String getTitle(ConversationContext context) {
|
||||
return Lang.get("stageEditorBlocks");
|
||||
}
|
||||
|
||||
public ChatColor getNumberColor(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
return ChatColor.BLUE;
|
||||
case 6:
|
||||
return ChatColor.GREEN;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getSelectionText(ConversationContext context, int number) {
|
||||
switch(number) {
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorBreakBlocks");
|
||||
case 2:
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorDamageBlocks");
|
||||
case 3:
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorPlaceBlocks");
|
||||
case 4:
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorUseBlocks");
|
||||
case 5:
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorCutBlocks");
|
||||
case 6:
|
||||
return ChatColor.GREEN + Lang.get("done");
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public String getAdditionalText(ConversationContext context, int number) {
|
||||
switch(number) {
|
||||
case 1:
|
||||
if (context.getSessionData(pref + CK.S_BREAK_NAMES) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "\n";
|
||||
LinkedList<String> names = (LinkedList<String>) context.getSessionData(pref + CK.S_BREAK_NAMES);
|
||||
LinkedList<Integer> amnts = (LinkedList<Integer>) context.getSessionData(pref + CK.S_BREAK_AMOUNTS);
|
||||
for (int i = 0; i < names.size(); i++) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.BLUE + ItemUtil.getPrettyItemName(names.get(i))
|
||||
+ ChatColor.GRAY + " x " + ChatColor.DARK_AQUA + amnts.get(i) + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 2:
|
||||
if (context.getSessionData(pref + CK.S_DAMAGE_NAMES) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "\n";
|
||||
LinkedList<String> names = (LinkedList<String>) context.getSessionData(pref + CK.S_DAMAGE_NAMES);
|
||||
LinkedList<Integer> amnts = (LinkedList<Integer>) context.getSessionData(pref + CK.S_DAMAGE_AMOUNTS);
|
||||
for (int i = 0; i < names.size(); i++) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.BLUE + ItemUtil.getPrettyItemName(names.get(i))
|
||||
+ ChatColor.GRAY + " x " + ChatColor.DARK_AQUA + amnts.get(i) + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 3:
|
||||
if (context.getSessionData(pref + CK.S_PLACE_NAMES) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "\n";
|
||||
LinkedList<String> names = (LinkedList<String>) context.getSessionData(pref + CK.S_PLACE_NAMES);
|
||||
LinkedList<Integer> amnts = (LinkedList<Integer>) context.getSessionData(pref + CK.S_PLACE_AMOUNTS);
|
||||
for (int i = 0; i < names.size(); i++) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.BLUE + ItemUtil.getPrettyItemName(names.get(i))
|
||||
+ ChatColor.GRAY + " x " + ChatColor.DARK_AQUA + amnts.get(i) + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 4:
|
||||
if (context.getSessionData(pref + CK.S_USE_NAMES) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "\n";
|
||||
LinkedList<String> names = (LinkedList<String>) context.getSessionData(pref + CK.S_USE_NAMES);
|
||||
LinkedList<Integer> amnts = (LinkedList<Integer>) context.getSessionData(pref + CK.S_USE_AMOUNTS);
|
||||
for (int i = 0; i < names.size(); i++) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.BLUE + ItemUtil.getPrettyItemName(names.get(i))
|
||||
+ ChatColor.GRAY + " x " + ChatColor.DARK_AQUA + amnts.get(i) + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 5:
|
||||
if (context.getSessionData(pref + CK.S_CUT_NAMES) == null) {
|
||||
return ChatColor.GRAY + " (" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "\n";
|
||||
LinkedList<String> names = (LinkedList<String>) context.getSessionData(pref + CK.S_CUT_NAMES);
|
||||
LinkedList<Integer> amnts = (LinkedList<Integer>) context.getSessionData(pref + CK.S_CUT_AMOUNTS);
|
||||
for (int i = 0; i < names.size(); i++) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.BLUE + ItemUtil.getPrettyItemName(names.get(i))
|
||||
+ ChatColor.GRAY + " x " + ChatColor.DARK_AQUA + amnts.get(i) + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 6:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public String getPromptText(ConversationContext context) {
|
||||
context.setSessionData(pref, Boolean.TRUE);
|
||||
String text = ChatColor.AQUA + "- " + Lang.get("stageEditorBlocks") + " -\n";
|
||||
if (context.getSessionData(pref + CK.S_BREAK_NAMES) == null) {
|
||||
text += ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD + "1 " + ChatColor.RESET + ChatColor.LIGHT_PURPLE
|
||||
+ "- " + Lang.get("stageEditorBreakBlocks") + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n";
|
||||
} else {
|
||||
text += ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD + "1 " + ChatColor.RESET + ChatColor.LIGHT_PURPLE
|
||||
+ "- " + Lang.get("stageEditorBreakBlocks") + "\n";
|
||||
LinkedList<String> names = (LinkedList<String>) context.getSessionData(pref + CK.S_BREAK_NAMES);
|
||||
LinkedList<Integer> amnts = (LinkedList<Integer>) context.getSessionData(pref + CK.S_BREAK_AMOUNTS);
|
||||
for (int i = 0; i < names.size(); i++) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.BLUE + ItemUtil.getPrettyItemName(names.get(i))
|
||||
+ ChatColor.GRAY + " x " + ChatColor.DARK_AQUA + amnts.get(i) + "\n";
|
||||
}
|
||||
|
||||
QuestsEditorPostOpenNumericPromptEvent event
|
||||
= new QuestsEditorPostOpenNumericPromptEvent(context, factory, this);
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
String text = ChatColor.AQUA + "- " + getTitle(context) + " -\n";
|
||||
for (int i = 1; i <= size; i++) {
|
||||
text += getNumberColor(context, i) + "" + ChatColor.BOLD + i + ChatColor.RESET + " - "
|
||||
+ getSelectionText(context, i) + " " + getAdditionalText(context, i) + "\n";
|
||||
}
|
||||
if (context.getSessionData(pref + CK.S_DAMAGE_NAMES) == null) {
|
||||
text += ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD + "2 " + ChatColor.RESET + ChatColor.LIGHT_PURPLE
|
||||
+ "- " + Lang.get("stageEditorDamageBlocks") + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n";
|
||||
} else {
|
||||
text += ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD + "2 " + ChatColor.RESET + ChatColor.LIGHT_PURPLE
|
||||
+ "- " + Lang.get("stageEditorDamageBlocks") + "\n";
|
||||
LinkedList<String> names = (LinkedList<String>) context.getSessionData(pref + CK.S_DAMAGE_NAMES);
|
||||
LinkedList<Integer> amnts = (LinkedList<Integer>) context.getSessionData(pref + CK.S_DAMAGE_AMOUNTS);
|
||||
for (int i = 0; i < names.size(); i++) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.BLUE + ItemUtil.getPrettyItemName(names.get(i))
|
||||
+ ChatColor.GRAY + " x " + ChatColor.DARK_AQUA + amnts.get(i) + "\n";
|
||||
}
|
||||
}
|
||||
if (context.getSessionData(pref + CK.S_PLACE_NAMES) == null) {
|
||||
text += ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD + "3 " + ChatColor.RESET + ChatColor.LIGHT_PURPLE
|
||||
+ "- " + Lang.get("stageEditorPlaceBlocks") + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n";
|
||||
} else {
|
||||
text += ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD + "3 " + ChatColor.RESET + ChatColor.LIGHT_PURPLE
|
||||
+ "- " + Lang.get("stageEditorPlaceBlocks") + "\n";
|
||||
LinkedList<String> names = (LinkedList<String>) context.getSessionData(pref + CK.S_PLACE_NAMES);
|
||||
LinkedList<Integer> amnts = (LinkedList<Integer>) context.getSessionData(pref + CK.S_PLACE_AMOUNTS);
|
||||
for (int i = 0; i < names.size(); i++) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.BLUE + ItemUtil.getPrettyItemName(names.get(i))
|
||||
+ ChatColor.GRAY + " x " + ChatColor.DARK_AQUA + amnts.get(i) + "\n";
|
||||
}
|
||||
}
|
||||
if (context.getSessionData(pref + CK.S_USE_NAMES) == null) {
|
||||
text += ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD + "4 " + ChatColor.RESET + ChatColor.LIGHT_PURPLE
|
||||
+ "- " + Lang.get("stageEditorUseBlocks") + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n";
|
||||
} else {
|
||||
text += ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD + "4 " + ChatColor.RESET + ChatColor.LIGHT_PURPLE
|
||||
+ "- " + Lang.get("stageEditorUseBlocks") + "\n";
|
||||
LinkedList<String> names = (LinkedList<String>) context.getSessionData(pref + CK.S_USE_NAMES);
|
||||
LinkedList<Integer> amnts = (LinkedList<Integer>) context.getSessionData(pref + CK.S_USE_AMOUNTS);
|
||||
for (int i = 0; i < names.size(); i++) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.BLUE + ItemUtil.getPrettyItemName(names.get(i))
|
||||
+ ChatColor.GRAY + " x " + ChatColor.DARK_AQUA + amnts.get(i) + "\n";
|
||||
}
|
||||
}
|
||||
if (context.getSessionData(pref + CK.S_CUT_NAMES) == null) {
|
||||
text += ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD + "5 " + ChatColor.RESET + ChatColor.LIGHT_PURPLE
|
||||
+ "- " + Lang.get("stageEditorCutBlocks") + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n";
|
||||
} else {
|
||||
text += ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD + "5 " + ChatColor.RESET + ChatColor.LIGHT_PURPLE
|
||||
+ "- " + Lang.get("stageEditorCutBlocks") + "\n";
|
||||
LinkedList<String> names = (LinkedList<String>) context.getSessionData(pref + CK.S_CUT_NAMES);
|
||||
LinkedList<Integer> amnts = (LinkedList<Integer>) context.getSessionData(pref + CK.S_CUT_AMOUNTS);
|
||||
for (int i = 0; i < names.size(); i++) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.BLUE + ItemUtil.getPrettyItemName(names.get(i))
|
||||
+ ChatColor.GRAY + " x " + ChatColor.DARK_AQUA + amnts.get(i) + "\n";
|
||||
}
|
||||
}
|
||||
text += ChatColor.GREEN + "" + ChatColor.BOLD + "6 " + ChatColor.RESET + ChatColor.DARK_PURPLE + "- "
|
||||
+ Lang.get("done") + "\n";
|
||||
return text;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Prompt acceptValidatedInput(ConversationContext context, String input) {
|
||||
if (input.equalsIgnoreCase("1")) {
|
||||
protected Prompt acceptValidatedInput(ConversationContext context, Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new BreakBlockListPrompt();
|
||||
} else if (input.equalsIgnoreCase("2")) {
|
||||
case 2:
|
||||
return new DamageBlockListPrompt();
|
||||
} else if (input.equalsIgnoreCase("3")) {
|
||||
case 3:
|
||||
return new PlaceBlockListPrompt();
|
||||
} else if (input.equalsIgnoreCase("4")) {
|
||||
case 4:
|
||||
return new UseBlockListPrompt();
|
||||
} else if (input.equalsIgnoreCase("5")) {
|
||||
case 5:
|
||||
return new CutBlockListPrompt();
|
||||
}
|
||||
try {
|
||||
return new StageMainPrompt(plugin, stageNum, context, questFactory);
|
||||
} catch (Exception e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
case 6:
|
||||
try {
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
} catch (Exception e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -244,7 +310,7 @@ public class BlocksPrompt extends FixedSetPrompt {
|
||||
elements.add((short) 0);
|
||||
}
|
||||
context.setSessionData(pref + CK.S_BREAK_DURABILITY, elements);
|
||||
return new BlocksPrompt(plugin, stageNum, questFactory);
|
||||
return new BlocksPrompt(plugin, stageNum, context, factory);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new BreakBlockListPrompt();
|
||||
@ -481,7 +547,7 @@ public class BlocksPrompt extends FixedSetPrompt {
|
||||
elements.add((short) 0);
|
||||
}
|
||||
context.setSessionData(pref + CK.S_DAMAGE_DURABILITY, elements);
|
||||
return new BlocksPrompt(plugin, stageNum, questFactory);
|
||||
return new BlocksPrompt(plugin, stageNum, context, factory);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new DamageBlockListPrompt();
|
||||
@ -718,7 +784,7 @@ public class BlocksPrompt extends FixedSetPrompt {
|
||||
elements.add((short) 0);
|
||||
}
|
||||
context.setSessionData(pref + CK.S_PLACE_DURABILITY, elements);
|
||||
return new BlocksPrompt(plugin, stageNum, questFactory);
|
||||
return new BlocksPrompt(plugin, stageNum, context, factory);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new PlaceBlockListPrompt();
|
||||
@ -955,7 +1021,7 @@ public class BlocksPrompt extends FixedSetPrompt {
|
||||
elements.add((short) 0);
|
||||
}
|
||||
context.setSessionData(pref + CK.S_USE_DURABILITY, elements);
|
||||
return new BlocksPrompt(plugin, stageNum, questFactory);
|
||||
return new BlocksPrompt(plugin, stageNum, context, factory);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new UseBlockListPrompt();
|
||||
@ -1192,7 +1258,7 @@ public class BlocksPrompt extends FixedSetPrompt {
|
||||
elements.add((short) 0);
|
||||
}
|
||||
context.setSessionData(pref + CK.S_CUT_DURABILITY, elements);
|
||||
return new BlocksPrompt(plugin, stageNum, questFactory);
|
||||
return new BlocksPrompt(plugin, stageNum, context, factory);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new CutBlockListPrompt();
|
@ -10,7 +10,7 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************************************/
|
||||
|
||||
package me.blackvein.quests.prompts.quests;
|
||||
package me.blackvein.quests.convo.quests.prompts;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
@ -1,4 +1,4 @@
|
||||
package me.blackvein.quests.prompts.quests;
|
||||
package me.blackvein.quests.convo.quests.prompts;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
@ -8,13 +8,13 @@ import org.bukkit.inventory.ItemStack;
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenNumericPromptEvent;
|
||||
import me.blackvein.quests.prompts.QuestsNumericPrompt;
|
||||
import me.blackvein.quests.util.CK;
|
||||
import me.blackvein.quests.util.ItemUtil;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
|
||||
public class GUIDisplayPrompt extends QuestsNumericPrompt {
|
||||
public class GUIDisplayPrompt extends QuestsEditorNumericPrompt {
|
||||
private final Quests plugin;
|
||||
private final QuestFactory factory;
|
||||
|
||||
@ -36,27 +36,27 @@ public class GUIDisplayPrompt extends QuestsNumericPrompt {
|
||||
|
||||
public ChatColor getNumberColor(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.BLUE;
|
||||
case 2:
|
||||
return ChatColor.RED;
|
||||
case 3:
|
||||
return ChatColor.GREEN;
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return ChatColor.BLUE;
|
||||
case 2:
|
||||
return ChatColor.RED;
|
||||
case 3:
|
||||
return ChatColor.GREEN;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getSelectionText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorDeliveryAddItem");
|
||||
case 2:
|
||||
return ChatColor.YELLOW + Lang.get("clear");
|
||||
case 3:
|
||||
return ChatColor.YELLOW + Lang.get("done");
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorDeliveryAddItem");
|
||||
case 2:
|
||||
return ChatColor.YELLOW + Lang.get("clear");
|
||||
case 3:
|
||||
return ChatColor.YELLOW + Lang.get("done");
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,16 +106,16 @@ public class GUIDisplayPrompt extends QuestsNumericPrompt {
|
||||
@Override
|
||||
protected Prompt acceptValidatedInput(ConversationContext context, Number input) {
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
return new ItemStackPrompt(GUIDisplayPrompt.this);
|
||||
case 2:
|
||||
context.setSessionData(CK.Q_GUIDISPLAY, null);
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("questGUICleared"));
|
||||
return new GUIDisplayPrompt(plugin, context, factory);
|
||||
case 3:
|
||||
return factory.returnToMenu(context);
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return new ItemStackPrompt(GUIDisplayPrompt.this);
|
||||
case 2:
|
||||
context.setSessionData(CK.Q_GUIDISPLAY, null);
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("questGUICleared"));
|
||||
return new GUIDisplayPrompt(plugin, context, factory);
|
||||
case 3:
|
||||
return factory.returnToMenu(context);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
@ -10,7 +10,7 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************************************/
|
||||
|
||||
package me.blackvein.quests.prompts.quests;
|
||||
package me.blackvein.quests.convo.quests.prompts;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
@ -10,7 +10,7 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************************************/
|
||||
|
||||
package me.blackvein.quests.prompts.quests;
|
||||
package me.blackvein.quests.convo.quests.prompts;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@ -35,14 +35,14 @@ public class ItemsPrompt extends FixedSetPrompt {
|
||||
private final Quests plugin;
|
||||
private final int stageNum;
|
||||
private final String pref;
|
||||
private final QuestFactory questFactory;
|
||||
private final QuestFactory factory;
|
||||
|
||||
public ItemsPrompt(Quests plugin, int stageNum, QuestFactory qf) {
|
||||
super("1", "2", "3", "4", "5");
|
||||
this.plugin = plugin;
|
||||
this.stageNum = stageNum;
|
||||
this.pref = "stage" + stageNum;
|
||||
this.questFactory = qf;
|
||||
this.factory = qf;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@ -133,7 +133,7 @@ public class ItemsPrompt extends FixedSetPrompt {
|
||||
return new BrewListPrompt();
|
||||
}
|
||||
try {
|
||||
return new StageMainPrompt(plugin, stageNum, context, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
} catch (Exception e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
@ -190,7 +190,7 @@ public class ItemsPrompt extends FixedSetPrompt {
|
||||
context.setSessionData(pref + CK.S_CRAFT_ITEMS, null);
|
||||
return new CraftListPrompt();
|
||||
} else if (input.equalsIgnoreCase("3")) {
|
||||
return new ItemsPrompt(plugin, stageNum, questFactory);
|
||||
return new ItemsPrompt(plugin, stageNum, factory);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -251,7 +251,7 @@ public class ItemsPrompt extends FixedSetPrompt {
|
||||
context.setSessionData(pref + CK.S_SMELT_ITEMS, null);
|
||||
return new SmeltListPrompt();
|
||||
} else if (input.equalsIgnoreCase("3")) {
|
||||
return new ItemsPrompt(plugin, stageNum, questFactory);
|
||||
return new ItemsPrompt(plugin, stageNum, factory);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -361,7 +361,7 @@ public class ItemsPrompt extends FixedSetPrompt {
|
||||
three = 0;
|
||||
}
|
||||
if (one == two && two == three) {
|
||||
return new ItemsPrompt(plugin, stageNum, questFactory);
|
||||
return new ItemsPrompt(plugin, stageNum, factory);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new EnchantmentListPrompt();
|
||||
@ -549,7 +549,7 @@ public class ItemsPrompt extends FixedSetPrompt {
|
||||
context.setSessionData(pref + CK.S_BREW_ITEMS, null);
|
||||
return new BrewListPrompt();
|
||||
} else if (input.equalsIgnoreCase("3")) {
|
||||
return new ItemsPrompt(plugin, stageNum, questFactory);
|
||||
return new ItemsPrompt(plugin, stageNum, factory);
|
||||
}
|
||||
return null;
|
||||
}
|
@ -10,7 +10,7 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************************************/
|
||||
|
||||
package me.blackvein.quests.prompts.quests;
|
||||
package me.blackvein.quests.convo.quests.prompts;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
@ -41,14 +41,14 @@ public class MobsPrompt extends FixedSetPrompt {
|
||||
private final Quests plugin;
|
||||
private final int stageNum;
|
||||
private final String pref;
|
||||
private final QuestFactory questFactory;
|
||||
private final QuestFactory factory;
|
||||
|
||||
public MobsPrompt(Quests plugin, int stageNum, QuestFactory qf) {
|
||||
super("1", "2", "3", "4", "5", "6");
|
||||
this.plugin = plugin;
|
||||
this.stageNum = stageNum;
|
||||
this.pref = "stage" + stageNum;
|
||||
this.questFactory = qf;
|
||||
this.factory = qf;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@ -149,7 +149,7 @@ public class MobsPrompt extends FixedSetPrompt {
|
||||
return new ShearListPrompt();
|
||||
}
|
||||
try {
|
||||
return new StageMainPrompt(plugin, stageNum, context, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
} catch (Exception e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
@ -252,9 +252,9 @@ public class MobsPrompt extends FixedSetPrompt {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNoMobTypes"));
|
||||
return new MobListPrompt();
|
||||
} else {
|
||||
Map<UUID, Block> temp = questFactory.getSelectedKillLocations();
|
||||
Map<UUID, Block> temp = factory.getSelectedKillLocations();
|
||||
temp.put(((Player) context.getForWhom()).getUniqueId(), null);
|
||||
questFactory.setSelectedKillLocations(temp);
|
||||
factory.setSelectedKillLocations(temp);
|
||||
return new MobLocationPrompt();
|
||||
}
|
||||
} else if (input.equalsIgnoreCase("4")) {
|
||||
@ -313,13 +313,13 @@ public class MobsPrompt extends FixedSetPrompt {
|
||||
if (one == two) {
|
||||
if (three != 0 || four != 0 || five != 0) {
|
||||
if (two == three && three == four && four == five) {
|
||||
return new StageMainPrompt(plugin, stageNum, context, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new MobListPrompt();
|
||||
}
|
||||
} else {
|
||||
return new StageMainPrompt(plugin, stageNum, context, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
}
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
@ -443,7 +443,7 @@ public class MobsPrompt extends FixedSetPrompt {
|
||||
public Prompt acceptInput(ConversationContext context, String input) {
|
||||
Player player = (Player) context.getForWhom();
|
||||
if (input.equalsIgnoreCase(Lang.get("cmdAdd"))) {
|
||||
Block block = questFactory.getSelectedKillLocations().get(player.getUniqueId());
|
||||
Block block = factory.getSelectedKillLocations().get(player.getUniqueId());
|
||||
if (block != null) {
|
||||
Location loc = block.getLocation();
|
||||
LinkedList<String> locs;
|
||||
@ -454,18 +454,18 @@ public class MobsPrompt extends FixedSetPrompt {
|
||||
}
|
||||
locs.add(ConfigUtil.getLocationInfo(loc));
|
||||
context.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS, locs);
|
||||
Map<UUID, Block> temp = questFactory.getSelectedKillLocations();
|
||||
Map<UUID, Block> temp = factory.getSelectedKillLocations();
|
||||
temp.remove(player.getUniqueId());
|
||||
questFactory.setSelectedKillLocations(temp);
|
||||
factory.setSelectedKillLocations(temp);
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("stageEditorNoBlock"));
|
||||
return new MobLocationPrompt();
|
||||
}
|
||||
return new MobListPrompt();
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
Map<UUID, Block> temp = questFactory.getSelectedKillLocations();
|
||||
Map<UUID, Block> temp = factory.getSelectedKillLocations();
|
||||
temp.remove(player.getUniqueId());
|
||||
questFactory.setSelectedKillLocations(temp);
|
||||
factory.setSelectedKillLocations(temp);
|
||||
return new MobListPrompt();
|
||||
} else {
|
||||
return new MobLocationPrompt();
|
||||
@ -551,7 +551,7 @@ public class MobsPrompt extends FixedSetPrompt {
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(pref + CK.S_FISH, null);
|
||||
}
|
||||
return new StageMainPrompt(plugin, stageNum, context, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
}
|
||||
}
|
||||
|
||||
@ -582,7 +582,7 @@ public class MobsPrompt extends FixedSetPrompt {
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(pref + CK.S_COW_MILK, null);
|
||||
}
|
||||
return new StageMainPrompt(plugin, stageNum, context, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
}
|
||||
}
|
||||
|
||||
@ -659,7 +659,7 @@ public class MobsPrompt extends FixedSetPrompt {
|
||||
two = 0;
|
||||
}
|
||||
if (one == two) {
|
||||
return new StageMainPrompt(plugin, stageNum, context, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new TameListPrompt();
|
||||
@ -829,7 +829,7 @@ public class MobsPrompt extends FixedSetPrompt {
|
||||
two = 0;
|
||||
}
|
||||
if (one == two) {
|
||||
return new StageMainPrompt(plugin, stageNum, context, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new ShearListPrompt();
|
@ -10,7 +10,7 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************************************/
|
||||
|
||||
package me.blackvein.quests.prompts.quests;
|
||||
package me.blackvein.quests.convo.quests.prompts;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
@ -35,14 +35,14 @@ public class NPCsPrompt extends FixedSetPrompt {
|
||||
private final Quests plugin;
|
||||
private final int stageNum;
|
||||
private final String pref;
|
||||
private final QuestFactory questFactory;
|
||||
private final QuestFactory factory;
|
||||
|
||||
public NPCsPrompt(Quests plugin, int stageNum, QuestFactory qf) {
|
||||
super("1", "2", "3", "4");
|
||||
this.plugin = plugin;
|
||||
this.stageNum = stageNum;
|
||||
this.pref = "stage" + stageNum;
|
||||
this.questFactory = qf;
|
||||
this.factory = qf;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@ -127,25 +127,25 @@ public class NPCsPrompt extends FixedSetPrompt {
|
||||
return new DeliveryListPrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNoCitizens"));
|
||||
return new StageMainPrompt(plugin, stageNum, context, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
}
|
||||
} else if (input.equalsIgnoreCase("2")) {
|
||||
if (plugin.getDependencies().getCitizens() != null) {
|
||||
return new NPCIDsToTalkToPrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNoCitizens"));
|
||||
return new StageMainPrompt(plugin, stageNum, context, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
}
|
||||
} else if (input.equalsIgnoreCase("3")) {
|
||||
if (plugin.getDependencies().getCitizens() != null) {
|
||||
return new NPCKillListPrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNoCitizens"));
|
||||
return new StageMainPrompt(plugin, stageNum, context, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
}
|
||||
}
|
||||
try {
|
||||
return new StageMainPrompt(plugin, stageNum, context, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
} catch (Exception e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
@ -264,7 +264,7 @@ public class NPCsPrompt extends FixedSetPrompt {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNoDeliveryMessage"));
|
||||
return new DeliveryListPrompt();
|
||||
} else {
|
||||
return new NPCsPrompt(plugin, stageNum, questFactory);
|
||||
return new NPCsPrompt(plugin, stageNum, factory);
|
||||
}
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
@ -294,9 +294,9 @@ public class NPCsPrompt extends FixedSetPrompt {
|
||||
|
||||
@Override
|
||||
public String getPromptText(ConversationContext context) {
|
||||
HashSet<Player> temp = questFactory.getSelectingNpcs();
|
||||
HashSet<Player> temp = factory.getSelectingNpcs();
|
||||
temp.add((Player) context.getForWhom());
|
||||
questFactory.setSelectingNpcs(temp);
|
||||
factory.setSelectingNpcs(temp);
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorNPCPrompt") + "\n" + ChatColor.GOLD + Lang.get("npcHint");
|
||||
}
|
||||
|
||||
@ -323,9 +323,9 @@ public class NPCsPrompt extends FixedSetPrompt {
|
||||
}
|
||||
context.setSessionData(pref + CK.S_DELIVERY_NPCS, npcs);
|
||||
}
|
||||
HashSet<Player> temp = questFactory.getSelectingNpcs();
|
||||
HashSet<Player> temp = factory.getSelectingNpcs();
|
||||
temp.remove((Player) context.getForWhom());
|
||||
questFactory.setSelectingNpcs(temp);
|
||||
factory.setSelectingNpcs(temp);
|
||||
return new DeliveryListPrompt();
|
||||
}
|
||||
}
|
||||
@ -354,9 +354,9 @@ public class NPCsPrompt extends FixedSetPrompt {
|
||||
|
||||
@Override
|
||||
public String getPromptText(ConversationContext context) {
|
||||
HashSet<Player> temp = questFactory.getSelectingNpcs();
|
||||
HashSet<Player> temp = factory.getSelectingNpcs();
|
||||
temp.add((Player) context.getForWhom());
|
||||
questFactory.setSelectingNpcs(temp);
|
||||
factory.setSelectingNpcs(temp);
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorNPCToTalkToPrompt") + "\n" + ChatColor.GOLD
|
||||
+ Lang.get("npcHint");
|
||||
}
|
||||
@ -383,14 +383,14 @@ public class NPCsPrompt extends FixedSetPrompt {
|
||||
return new NPCIDsToTalkToPrompt();
|
||||
}
|
||||
}
|
||||
HashSet<Player> temp = questFactory.getSelectingNpcs();
|
||||
HashSet<Player> temp = factory.getSelectingNpcs();
|
||||
temp.remove((Player) context.getForWhom());
|
||||
questFactory.setSelectingNpcs(temp);
|
||||
factory.setSelectingNpcs(temp);
|
||||
context.setSessionData(pref + CK.S_NPCS_TO_TALK_TO, npcs);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(pref + CK.S_NPCS_TO_TALK_TO, null);
|
||||
}
|
||||
return new StageMainPrompt(plugin, stageNum, context, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
}
|
||||
}
|
||||
|
||||
@ -469,7 +469,7 @@ public class NPCsPrompt extends FixedSetPrompt {
|
||||
two = 0;
|
||||
}
|
||||
if (one == two) {
|
||||
return new StageMainPrompt(plugin, stageNum, context, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new NPCKillListPrompt();
|
||||
@ -493,9 +493,9 @@ public class NPCsPrompt extends FixedSetPrompt {
|
||||
|
||||
@Override
|
||||
public String getPromptText(ConversationContext context) {
|
||||
HashSet<Player> temp = questFactory.getSelectingNpcs();
|
||||
HashSet<Player> temp = factory.getSelectingNpcs();
|
||||
temp.add((Player) context.getForWhom());
|
||||
questFactory.setSelectingNpcs(temp);
|
||||
factory.setSelectingNpcs(temp);
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorNPCPrompt") + "\n" + ChatColor.GOLD + Lang.get("npcHint");
|
||||
}
|
||||
|
||||
@ -522,9 +522,9 @@ public class NPCsPrompt extends FixedSetPrompt {
|
||||
}
|
||||
context.setSessionData(pref + CK.S_NPCS_TO_KILL, npcs);
|
||||
}
|
||||
HashSet<Player> temp = questFactory.getSelectingNpcs();
|
||||
HashSet<Player> temp = factory.getSelectingNpcs();
|
||||
temp.remove((Player) context.getForWhom());
|
||||
questFactory.setSelectingNpcs(temp);
|
||||
factory.setSelectingNpcs(temp);
|
||||
return new NPCKillListPrompt();
|
||||
}
|
||||
}
|
@ -10,7 +10,7 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************************************/
|
||||
|
||||
package me.blackvein.quests.prompts.quests;
|
||||
package me.blackvein.quests.convo.quests.prompts;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
@ -19,14 +19,14 @@ import org.bukkit.conversations.Prompt;
|
||||
import me.blackvein.quests.Options;
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorStringPrompt;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenNumericPromptEvent;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenStringPromptEvent;
|
||||
import me.blackvein.quests.prompts.QuestsNumericPrompt;
|
||||
import me.blackvein.quests.prompts.QuestsStringPrompt;
|
||||
import me.blackvein.quests.util.CK;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
|
||||
public class OptionsPrompt extends QuestsNumericPrompt {
|
||||
public class OptionsPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
private final Quests plugin;
|
||||
private final QuestFactory factory;
|
||||
@ -51,27 +51,27 @@ public class OptionsPrompt extends QuestsNumericPrompt {
|
||||
|
||||
public ChatColor getNumberColor(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.BLUE;
|
||||
case 2:
|
||||
return ChatColor.BLUE;
|
||||
case 3:
|
||||
return ChatColor.GREEN;
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return ChatColor.BLUE;
|
||||
case 2:
|
||||
return ChatColor.BLUE;
|
||||
case 3:
|
||||
return ChatColor.GREEN;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getSelectionText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.GOLD + Lang.get("optGeneral");
|
||||
case 2:
|
||||
return ChatColor.GOLD + Lang.get("optMultiplayer");
|
||||
case 3:
|
||||
return ChatColor.YELLOW + Lang.get("done");
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return ChatColor.GOLD + Lang.get("optGeneral");
|
||||
case 2:
|
||||
return ChatColor.GOLD + Lang.get("optMultiplayer");
|
||||
case 3:
|
||||
return ChatColor.YELLOW + Lang.get("done");
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -98,18 +98,18 @@ public class OptionsPrompt extends QuestsNumericPrompt {
|
||||
@Override
|
||||
protected Prompt acceptValidatedInput(ConversationContext context, Number input) {
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
return new GeneralPrompt(plugin, context, factory);
|
||||
case 2:
|
||||
return new MultiplayerPrompt(plugin, context, factory);
|
||||
case 3:
|
||||
return factory.returnToMenu(context);
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return new GeneralPrompt(plugin, context, factory);
|
||||
case 2:
|
||||
return new MultiplayerPrompt(plugin, context, factory);
|
||||
case 3:
|
||||
return factory.returnToMenu(context);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public class TrueFalsePrompt extends QuestsStringPrompt {
|
||||
public class TrueFalsePrompt extends QuestsEditorStringPrompt {
|
||||
public TrueFalsePrompt(Quests plugin, ConversationContext context, QuestFactory factory) {
|
||||
super(context, factory);
|
||||
}
|
||||
@ -133,16 +133,16 @@ public class OptionsPrompt extends QuestsNumericPrompt {
|
||||
|
||||
public String getSelectionText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("true");
|
||||
case 2:
|
||||
return ChatColor.YELLOW + Lang.get("false");
|
||||
case 3:
|
||||
return ChatColor.RED + Lang.get("cmdClear");
|
||||
case 4:
|
||||
return ChatColor.RED + Lang.get("cmdCancel");
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("true");
|
||||
case 2:
|
||||
return ChatColor.YELLOW + Lang.get("false");
|
||||
case 3:
|
||||
return ChatColor.RED + Lang.get("cmdClear");
|
||||
case 4:
|
||||
return ChatColor.RED + Lang.get("cmdCancel");
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -181,7 +181,7 @@ public class OptionsPrompt extends QuestsNumericPrompt {
|
||||
}
|
||||
}
|
||||
|
||||
public class LevelPrompt extends QuestsStringPrompt {
|
||||
public class LevelPrompt extends QuestsEditorStringPrompt {
|
||||
public LevelPrompt(Quests plugin, ConversationContext context, QuestFactory factory) {
|
||||
super(context, factory);
|
||||
}
|
||||
@ -202,39 +202,39 @@ public class OptionsPrompt extends QuestsNumericPrompt {
|
||||
|
||||
public String getSelectionText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.GOLD + "1";
|
||||
case 2:
|
||||
return ChatColor.GOLD + "2";
|
||||
case 3:
|
||||
return ChatColor.GOLD + "3";
|
||||
case 4:
|
||||
return ChatColor.GOLD + "4";
|
||||
case 5:
|
||||
return ChatColor.RED + Lang.get("cmdClear");
|
||||
case 6:
|
||||
return ChatColor.RED + Lang.get("cmdCancel");
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return ChatColor.GOLD + "1";
|
||||
case 2:
|
||||
return ChatColor.GOLD + "2";
|
||||
case 3:
|
||||
return ChatColor.GOLD + "3";
|
||||
case 4:
|
||||
return ChatColor.GOLD + "4";
|
||||
case 5:
|
||||
return ChatColor.RED + Lang.get("cmdClear");
|
||||
case 6:
|
||||
return ChatColor.RED + Lang.get("cmdCancel");
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getAdditionalText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.GRAY + Lang.get("everything");
|
||||
case 2:
|
||||
return ChatColor.GRAY + Lang.get("objectives");
|
||||
case 3:
|
||||
return ChatColor.GRAY + Lang.get("stageEditorStages");
|
||||
case 4:
|
||||
return ChatColor.GRAY + Lang.get("quests");
|
||||
case 5:
|
||||
return "";
|
||||
case 6:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return ChatColor.GRAY + Lang.get("everything");
|
||||
case 2:
|
||||
return ChatColor.GRAY + Lang.get("objectives");
|
||||
case 3:
|
||||
return ChatColor.GRAY + Lang.get("stageEditorStages");
|
||||
case 4:
|
||||
return ChatColor.GRAY + Lang.get("quests");
|
||||
case 5:
|
||||
return "";
|
||||
case 6:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -275,7 +275,7 @@ public class OptionsPrompt extends QuestsNumericPrompt {
|
||||
}
|
||||
}
|
||||
|
||||
public class GeneralPrompt extends QuestsNumericPrompt {
|
||||
public class GeneralPrompt extends QuestsEditorNumericPrompt {
|
||||
public GeneralPrompt(Quests plugin, ConversationContext context, QuestFactory factory) {
|
||||
super(context, factory);
|
||||
}
|
||||
@ -292,60 +292,60 @@ public class OptionsPrompt extends QuestsNumericPrompt {
|
||||
|
||||
public ChatColor getNumberColor(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.BLUE;
|
||||
case 2:
|
||||
return ChatColor.BLUE;
|
||||
case 3:
|
||||
return ChatColor.GREEN;
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return ChatColor.BLUE;
|
||||
case 2:
|
||||
return ChatColor.BLUE;
|
||||
case 3:
|
||||
return ChatColor.GREEN;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getSelectionText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("optAllowCommands");
|
||||
case 2:
|
||||
return ChatColor.YELLOW + Lang.get("optAllowQuitting");
|
||||
case 3:
|
||||
return ChatColor.YELLOW + Lang.get("done");
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("optAllowCommands");
|
||||
case 2:
|
||||
return ChatColor.YELLOW + Lang.get("optAllowQuitting");
|
||||
case 3:
|
||||
return ChatColor.YELLOW + Lang.get("done");
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getAdditionalText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
if (context.getSessionData(CK.OPT_ALLOW_COMMANDS) == null) {
|
||||
boolean defaultOpt = new Options().getAllowCommands();
|
||||
return ChatColor.GRAY + "(" + (defaultOpt ? ChatColor.GREEN
|
||||
case 1:
|
||||
if (context.getSessionData(CK.OPT_ALLOW_COMMANDS) == null) {
|
||||
boolean defaultOpt = new Options().getAllowCommands();
|
||||
return ChatColor.GRAY + "(" + (defaultOpt ? ChatColor.GREEN
|
||||
+ Lang.get(String.valueOf(defaultOpt)) : ChatColor.RED
|
||||
+ Lang.get(String.valueOf(defaultOpt))) + ChatColor.GRAY + ")";
|
||||
} else {
|
||||
boolean commandsOpt = (Boolean) context.getSessionData(CK.OPT_ALLOW_COMMANDS);
|
||||
return ChatColor.GRAY + "(" + (commandsOpt ? ChatColor.GREEN
|
||||
+ Lang.get(String.valueOf(commandsOpt)) : ChatColor.RED
|
||||
+ Lang.get(String.valueOf(commandsOpt))) + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 2:
|
||||
if (context.getSessionData(CK.OPT_ALLOW_QUITTING) == null) {
|
||||
boolean defaultOpt = new Options().getAllowQuitting();
|
||||
return ChatColor.GRAY + "(" + (defaultOpt ? ChatColor.GREEN
|
||||
+ Lang.get(String.valueOf(defaultOpt)) : ChatColor.RED
|
||||
+ Lang.get(String.valueOf(defaultOpt))) + ChatColor.GRAY + ")";
|
||||
} else {
|
||||
boolean commandsOpt = (Boolean) context.getSessionData(CK.OPT_ALLOW_COMMANDS);
|
||||
return ChatColor.GRAY + "(" + (commandsOpt ? ChatColor.GREEN
|
||||
+ Lang.get(String.valueOf(commandsOpt)) : ChatColor.RED
|
||||
+ Lang.get(String.valueOf(commandsOpt))) + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 2:
|
||||
if (context.getSessionData(CK.OPT_ALLOW_QUITTING) == null) {
|
||||
boolean defaultOpt = new Options().getAllowQuitting();
|
||||
return ChatColor.GRAY + "(" + (defaultOpt ? ChatColor.GREEN
|
||||
+ Lang.get(String.valueOf(defaultOpt)) : ChatColor.RED
|
||||
+ Lang.get(String.valueOf(defaultOpt))) + ChatColor.GRAY + ")";
|
||||
} else {
|
||||
boolean quittingOpt = (Boolean) context.getSessionData(CK.OPT_ALLOW_QUITTING);
|
||||
return ChatColor.GRAY + "(" + (quittingOpt ? ChatColor.GREEN
|
||||
+ Lang.get(String.valueOf(quittingOpt)) : ChatColor.RED
|
||||
+ Lang.get(String.valueOf(quittingOpt))) + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 3:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
} else {
|
||||
boolean quittingOpt = (Boolean) context.getSessionData(CK.OPT_ALLOW_QUITTING);
|
||||
return ChatColor.GRAY + "(" + (quittingOpt ? ChatColor.GREEN
|
||||
+ Lang.get(String.valueOf(quittingOpt)) : ChatColor.RED
|
||||
+ Lang.get(String.valueOf(quittingOpt))) + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 3:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -366,30 +366,30 @@ public class OptionsPrompt extends QuestsNumericPrompt {
|
||||
@Override
|
||||
public Prompt acceptValidatedInput(ConversationContext context, Number input) {
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
tempKey = CK.OPT_ALLOW_COMMANDS;
|
||||
tempPrompt = new GeneralPrompt(plugin, context, factory);
|
||||
return new TrueFalsePrompt(plugin, context, factory);
|
||||
case 2:
|
||||
tempKey = CK.OPT_ALLOW_QUITTING;
|
||||
tempPrompt = new GeneralPrompt(plugin, context, factory);
|
||||
return new TrueFalsePrompt(plugin, context, factory);
|
||||
case 3:
|
||||
tempKey = null;
|
||||
tempPrompt = null;
|
||||
try {
|
||||
return new OptionsPrompt(plugin, context, factory);
|
||||
} catch (Exception e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
tempKey = CK.OPT_ALLOW_COMMANDS;
|
||||
tempPrompt = new GeneralPrompt(plugin, context, factory);
|
||||
return new TrueFalsePrompt(plugin, context, factory);
|
||||
case 2:
|
||||
tempKey = CK.OPT_ALLOW_QUITTING;
|
||||
tempPrompt = new GeneralPrompt(plugin, context, factory);
|
||||
return new TrueFalsePrompt(plugin, context, factory);
|
||||
case 3:
|
||||
tempKey = null;
|
||||
tempPrompt = null;
|
||||
try {
|
||||
return new OptionsPrompt(plugin, context, factory);
|
||||
} catch (Exception e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MultiplayerPrompt extends QuestsNumericPrompt {
|
||||
public class MultiplayerPrompt extends QuestsEditorNumericPrompt {
|
||||
public MultiplayerPrompt(Quests plugin, ConversationContext context, QuestFactory factory) {
|
||||
super(context, factory);
|
||||
}
|
||||
@ -406,89 +406,88 @@ public class OptionsPrompt extends QuestsNumericPrompt {
|
||||
|
||||
public ChatColor getNumberColor(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.BLUE;
|
||||
case 2:
|
||||
return ChatColor.BLUE;
|
||||
case 3:
|
||||
return ChatColor.BLUE;
|
||||
case 4:
|
||||
return ChatColor.BLUE;
|
||||
case 5:
|
||||
return ChatColor.GREEN;
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return ChatColor.BLUE;
|
||||
case 2:
|
||||
return ChatColor.BLUE;
|
||||
case 3:
|
||||
return ChatColor.BLUE;
|
||||
case 4:
|
||||
return ChatColor.BLUE;
|
||||
case 5:
|
||||
return ChatColor.GREEN;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getSelectionText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("optUseDungeonsXLPlugin");
|
||||
case 2:
|
||||
return ChatColor.YELLOW + Lang.get("optUsePartiesPlugin");
|
||||
case 3:
|
||||
return ChatColor.YELLOW + Lang.get("optShareProgressLevel");
|
||||
case 4:
|
||||
return ChatColor.YELLOW + Lang.get("optRequireSameQuest");
|
||||
case 5:
|
||||
return ChatColor.YELLOW + Lang.get("done");
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("optUseDungeonsXLPlugin");
|
||||
case 2:
|
||||
return ChatColor.YELLOW + Lang.get("optUsePartiesPlugin");
|
||||
case 3:
|
||||
return ChatColor.YELLOW + Lang.get("optShareProgressLevel");
|
||||
case 4:
|
||||
return ChatColor.YELLOW + Lang.get("optRequireSameQuest");
|
||||
case 5:
|
||||
return ChatColor.YELLOW + Lang.get("done");
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getAdditionalText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
if (context.getSessionData(CK.OPT_USE_DUNGEONSXL_PLUGIN) == null) {
|
||||
boolean defaultOpt = new Options().getUseDungeonsXLPlugin();
|
||||
return ChatColor.GRAY + "(" + (defaultOpt ? ChatColor.GREEN
|
||||
+ Lang.get(String.valueOf(defaultOpt)) : ChatColor.RED
|
||||
+ Lang.get(String.valueOf(defaultOpt))) + ChatColor.GRAY + ")";
|
||||
} else {
|
||||
boolean dungeonsOpt = (Boolean) context.getSessionData(CK.OPT_USE_DUNGEONSXL_PLUGIN);
|
||||
return ChatColor.GRAY + "(" + (dungeonsOpt ? ChatColor.GREEN
|
||||
+ Lang.get(String.valueOf(dungeonsOpt)) : ChatColor.RED
|
||||
+ Lang.get(String.valueOf(dungeonsOpt))) + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 2:
|
||||
if (context.getSessionData(CK.OPT_USE_PARTIES_PLUGIN) == null) {
|
||||
boolean defaultOpt = new Options().getUsePartiesPlugin();
|
||||
return ChatColor.GRAY + "("+ (defaultOpt ? ChatColor.GREEN
|
||||
+ Lang.get(String.valueOf(defaultOpt)) : ChatColor.RED
|
||||
+ Lang.get(String.valueOf(defaultOpt))) + ChatColor.GRAY + ")";
|
||||
} else {
|
||||
boolean partiesOpt = (Boolean) context.getSessionData(CK.OPT_USE_PARTIES_PLUGIN);
|
||||
return ChatColor.GRAY + "(" + (partiesOpt ? ChatColor.GREEN
|
||||
+ Lang.get(String.valueOf(partiesOpt)) : ChatColor.RED
|
||||
+ Lang.get(String.valueOf(partiesOpt))) + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 3:
|
||||
if (context.getSessionData(CK.OPT_SHARE_PROGRESS_LEVEL) == null) {
|
||||
int defaultOpt = new Options().getShareProgressLevel();
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + String.valueOf(defaultOpt) + ChatColor.GRAY
|
||||
+ ")";
|
||||
} else {
|
||||
int shareOpt = (Integer) context.getSessionData(CK.OPT_SHARE_PROGRESS_LEVEL);
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + String.valueOf(shareOpt) + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 4:
|
||||
if (context.getSessionData(CK.OPT_REQUIRE_SAME_QUEST) == null) {
|
||||
boolean defaultOpt = new Options().getRequireSameQuest();
|
||||
return ChatColor.GRAY + "(" + (defaultOpt ? ChatColor.GREEN
|
||||
+ Lang.get(String.valueOf(defaultOpt)) : ChatColor.RED
|
||||
+ Lang.get(String.valueOf(defaultOpt))) + ChatColor.GRAY + ")";
|
||||
} else {
|
||||
boolean requireOpt = (Boolean) context.getSessionData(CK.OPT_REQUIRE_SAME_QUEST);
|
||||
return ChatColor.GRAY + "(" + (requireOpt ? ChatColor.GREEN
|
||||
+ Lang.get(String.valueOf(requireOpt)) : ChatColor.RED
|
||||
+ Lang.get(String.valueOf(requireOpt))) + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 5:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
if (context.getSessionData(CK.OPT_USE_DUNGEONSXL_PLUGIN) == null) {
|
||||
boolean defaultOpt = new Options().getUseDungeonsXLPlugin();
|
||||
return ChatColor.GRAY + "(" + (defaultOpt ? ChatColor.GREEN
|
||||
+ Lang.get(String.valueOf(defaultOpt)) : ChatColor.RED
|
||||
+ Lang.get(String.valueOf(defaultOpt))) + ChatColor.GRAY + ")";
|
||||
} else {
|
||||
boolean dungeonsOpt = (Boolean) context.getSessionData(CK.OPT_USE_DUNGEONSXL_PLUGIN);
|
||||
return ChatColor.GRAY + "(" + (dungeonsOpt ? ChatColor.GREEN
|
||||
+ Lang.get(String.valueOf(dungeonsOpt)) : ChatColor.RED
|
||||
+ Lang.get(String.valueOf(dungeonsOpt))) + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 2:
|
||||
if (context.getSessionData(CK.OPT_USE_PARTIES_PLUGIN) == null) {
|
||||
boolean defaultOpt = new Options().getUsePartiesPlugin();
|
||||
return ChatColor.GRAY + "("+ (defaultOpt ? ChatColor.GREEN
|
||||
+ Lang.get(String.valueOf(defaultOpt)) : ChatColor.RED
|
||||
+ Lang.get(String.valueOf(defaultOpt))) + ChatColor.GRAY + ")";
|
||||
} else {
|
||||
boolean partiesOpt = (Boolean) context.getSessionData(CK.OPT_USE_PARTIES_PLUGIN);
|
||||
return ChatColor.GRAY + "(" + (partiesOpt ? ChatColor.GREEN
|
||||
+ Lang.get(String.valueOf(partiesOpt)) : ChatColor.RED
|
||||
+ Lang.get(String.valueOf(partiesOpt))) + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 3:
|
||||
if (context.getSessionData(CK.OPT_SHARE_PROGRESS_LEVEL) == null) {
|
||||
int defaultOpt = new Options().getShareProgressLevel();
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + String.valueOf(defaultOpt) + ChatColor.GRAY + ")";
|
||||
} else {
|
||||
int shareOpt = (Integer) context.getSessionData(CK.OPT_SHARE_PROGRESS_LEVEL);
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + String.valueOf(shareOpt) + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 4:
|
||||
if (context.getSessionData(CK.OPT_REQUIRE_SAME_QUEST) == null) {
|
||||
boolean defaultOpt = new Options().getRequireSameQuest();
|
||||
return ChatColor.GRAY + "(" + (defaultOpt ? ChatColor.GREEN
|
||||
+ Lang.get(String.valueOf(defaultOpt)) : ChatColor.RED
|
||||
+ Lang.get(String.valueOf(defaultOpt))) + ChatColor.GRAY + ")";
|
||||
} else {
|
||||
boolean requireOpt = (Boolean) context.getSessionData(CK.OPT_REQUIRE_SAME_QUEST);
|
||||
return ChatColor.GRAY + "(" + (requireOpt ? ChatColor.GREEN
|
||||
+ Lang.get(String.valueOf(requireOpt)) : ChatColor.RED
|
||||
+ Lang.get(String.valueOf(requireOpt))) + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 5:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -509,33 +508,33 @@ public class OptionsPrompt extends QuestsNumericPrompt {
|
||||
@Override
|
||||
public Prompt acceptValidatedInput(ConversationContext context, Number input) {
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
tempKey = CK.OPT_USE_DUNGEONSXL_PLUGIN;
|
||||
tempPrompt = new MultiplayerPrompt(plugin, context, factory);
|
||||
return new TrueFalsePrompt(plugin, context, factory);
|
||||
case 2:
|
||||
tempKey = CK.OPT_USE_PARTIES_PLUGIN;
|
||||
tempPrompt = new MultiplayerPrompt(plugin, context, factory);
|
||||
return new TrueFalsePrompt(plugin, context, factory);
|
||||
case 3:
|
||||
tempKey = CK.OPT_SHARE_PROGRESS_LEVEL;
|
||||
tempPrompt = new MultiplayerPrompt(plugin, context, factory);
|
||||
return new LevelPrompt(plugin, context, factory);
|
||||
case 4:
|
||||
tempKey = CK.OPT_REQUIRE_SAME_QUEST;
|
||||
tempPrompt = new MultiplayerPrompt(plugin, context, factory);
|
||||
return new TrueFalsePrompt(plugin, context, factory);
|
||||
case 5:
|
||||
tempKey = null;
|
||||
tempPrompt = null;
|
||||
try {
|
||||
return new OptionsPrompt(plugin, context, factory);
|
||||
} catch (Exception e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
tempKey = CK.OPT_USE_DUNGEONSXL_PLUGIN;
|
||||
tempPrompt = new MultiplayerPrompt(plugin, context, factory);
|
||||
return new TrueFalsePrompt(plugin, context, factory);
|
||||
case 2:
|
||||
tempKey = CK.OPT_USE_PARTIES_PLUGIN;
|
||||
tempPrompt = new MultiplayerPrompt(plugin, context, factory);
|
||||
return new TrueFalsePrompt(plugin, context, factory);
|
||||
case 3:
|
||||
tempKey = CK.OPT_SHARE_PROGRESS_LEVEL;
|
||||
tempPrompt = new MultiplayerPrompt(plugin, context, factory);
|
||||
return new LevelPrompt(plugin, context, factory);
|
||||
case 4:
|
||||
tempKey = CK.OPT_REQUIRE_SAME_QUEST;
|
||||
tempPrompt = new MultiplayerPrompt(plugin, context, factory);
|
||||
return new TrueFalsePrompt(plugin, context, factory);
|
||||
case 5:
|
||||
tempKey = null;
|
||||
tempPrompt = null;
|
||||
try {
|
||||
return new OptionsPrompt(plugin, context, factory);
|
||||
} catch (Exception e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
@ -10,7 +10,7 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************************************/
|
||||
|
||||
package me.blackvein.quests.prompts.quests;
|
||||
package me.blackvein.quests.convo.quests.prompts;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
@ -20,8 +20,8 @@ import java.util.TimeZone;
|
||||
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenNumericPromptEvent;
|
||||
import me.blackvein.quests.prompts.QuestsNumericPrompt;
|
||||
import me.blackvein.quests.util.CK;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import me.blackvein.quests.util.MiscUtil;
|
||||
@ -31,7 +31,7 @@ import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.Prompt;
|
||||
import org.bukkit.conversations.StringPrompt;
|
||||
|
||||
public class PlannerPrompt extends QuestsNumericPrompt {
|
||||
public class PlannerPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
private final Quests plugin;
|
||||
private final QuestFactory factory;
|
||||
@ -54,88 +54,84 @@ public class PlannerPrompt extends QuestsNumericPrompt {
|
||||
|
||||
public ChatColor getNumberColor(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
case 1:
|
||||
return ChatColor.BLUE;
|
||||
case 2:
|
||||
return ChatColor.BLUE;
|
||||
case 3:
|
||||
if (context.getSessionData(CK.PLN_START_DATE) == null || context.getSessionData(CK.PLN_END_DATE) == null) {
|
||||
return ChatColor.GRAY;
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
case 2:
|
||||
return ChatColor.BLUE;
|
||||
case 3:
|
||||
if (context.getSessionData(CK.PLN_START_DATE) == null
|
||||
|| context.getSessionData(CK.PLN_END_DATE) == null) {
|
||||
return ChatColor.GRAY;
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
}
|
||||
case 4:
|
||||
return ChatColor.BLUE;
|
||||
case 5:
|
||||
return ChatColor.GREEN;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
case 4:
|
||||
return ChatColor.BLUE;
|
||||
case 5:
|
||||
return ChatColor.GREEN;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getSelectionText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("plnStart");
|
||||
case 2:
|
||||
return ChatColor.YELLOW + Lang.get("plnEnd");
|
||||
case 3:
|
||||
if (context.getSessionData(CK.PLN_START_DATE) == null
|
||||
|| context.getSessionData(CK.PLN_END_DATE) == null) {
|
||||
return ChatColor.GRAY + Lang.get("plnRepeat");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("plnRepeat");
|
||||
}
|
||||
case 4:
|
||||
return ChatColor.YELLOW + Lang.get("plnCooldown");
|
||||
case 5:
|
||||
return ChatColor.YELLOW + Lang.get("done");
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("plnStart");
|
||||
case 2:
|
||||
return ChatColor.YELLOW + Lang.get("plnEnd");
|
||||
case 3:
|
||||
if (context.getSessionData(CK.PLN_START_DATE) == null || context.getSessionData(CK.PLN_END_DATE) == null) {
|
||||
return ChatColor.GRAY + Lang.get("plnRepeat");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("plnRepeat");
|
||||
}
|
||||
case 4:
|
||||
return ChatColor.YELLOW + Lang.get("plnCooldown");
|
||||
case 5:
|
||||
return ChatColor.YELLOW + Lang.get("done");
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getAdditionalText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
if (context.getSessionData(CK.PLN_START_DATE) == null) {
|
||||
case 1:
|
||||
if (context.getSessionData(CK.PLN_START_DATE) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.YELLOW + " - " + getPrettyDate((String) context.getSessionData(CK.PLN_START_DATE));
|
||||
}
|
||||
case 2:
|
||||
if (context.getSessionData(CK.PLN_END_DATE) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.YELLOW + " - "
|
||||
+ getPrettyDate((String) context.getSessionData(CK.PLN_END_DATE));
|
||||
}
|
||||
case 3:
|
||||
if (context.getSessionData(CK.PLN_START_DATE) == null || context.getSessionData(CK.PLN_END_DATE) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("stageEditorOptional") + ")";
|
||||
} else {
|
||||
if (context.getSessionData(CK.PLN_REPEAT_CYCLE) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.YELLOW + " - "
|
||||
+ getPrettyDate((String) context.getSessionData(CK.PLN_START_DATE));
|
||||
}
|
||||
case 2:
|
||||
if (context.getSessionData(CK.PLN_END_DATE) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.YELLOW + " - "
|
||||
+ getPrettyDate((String) context.getSessionData(CK.PLN_END_DATE));
|
||||
}
|
||||
case 3:
|
||||
if (context.getSessionData(CK.PLN_START_DATE) == null
|
||||
|| context.getSessionData(CK.PLN_END_DATE) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("stageEditorOptional") + ")";
|
||||
} else {
|
||||
if (context.getSessionData(CK.PLN_REPEAT_CYCLE) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.YELLOW + "("
|
||||
+ MiscUtil.getTime((Long) context.getSessionData(CK.PLN_REPEAT_CYCLE))
|
||||
+ ChatColor.RESET + ChatColor.YELLOW + ")";
|
||||
}
|
||||
}
|
||||
case 4:
|
||||
if (context.getSessionData(CK.PLN_COOLDOWN) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.YELLOW + "(" + MiscUtil.getTime((Long) context.getSessionData(CK.PLN_COOLDOWN))
|
||||
return ChatColor.YELLOW + "("
|
||||
+ MiscUtil.getTime((Long) context.getSessionData(CK.PLN_REPEAT_CYCLE))
|
||||
+ ChatColor.RESET + ChatColor.YELLOW + ")";
|
||||
}
|
||||
case 5:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
case 4:
|
||||
if (context.getSessionData(CK.PLN_COOLDOWN) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.YELLOW + "(" + MiscUtil.getTime((Long) context.getSessionData(CK.PLN_COOLDOWN))
|
||||
+ ChatColor.RESET + ChatColor.YELLOW + ")";
|
||||
}
|
||||
case 5:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************************************/
|
||||
|
||||
package me.blackvein.quests.prompts.quests;
|
||||
package me.blackvein.quests.convo.quests.prompts;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.HashMap;
|
@ -10,7 +10,7 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************************************/
|
||||
|
||||
package me.blackvein.quests.prompts.quests;
|
||||
package me.blackvein.quests.convo.quests.prompts;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
@ -33,14 +33,14 @@ import me.blackvein.quests.CustomRequirement;
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenNumericPromptEvent;
|
||||
import me.blackvein.quests.prompts.QuestsNumericPrompt;
|
||||
import me.blackvein.quests.util.CK;
|
||||
import me.blackvein.quests.util.ItemUtil;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import me.blackvein.quests.util.MiscUtil;
|
||||
|
||||
public class RequirementsPrompt extends QuestsNumericPrompt {
|
||||
public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
private final Quests plugin;
|
||||
private final QuestFactory factory;
|
||||
@ -63,206 +63,205 @@ public class RequirementsPrompt extends QuestsNumericPrompt {
|
||||
|
||||
public ChatColor getNumberColor(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
return ChatColor.BLUE;
|
||||
case 7:
|
||||
if (plugin.getDependencies().getMcmmoClassic() != null) {
|
||||
return ChatColor.BLUE;
|
||||
case 7:
|
||||
if (plugin.getDependencies().getMcmmoClassic() != null) {
|
||||
return ChatColor.BLUE;
|
||||
} else {
|
||||
return ChatColor.GRAY;
|
||||
}
|
||||
case 8:
|
||||
if (plugin.getDependencies().getHeroes() != null) {
|
||||
return ChatColor.BLUE;
|
||||
} else {
|
||||
return ChatColor.GRAY;
|
||||
}
|
||||
case 9:
|
||||
} else {
|
||||
return ChatColor.GRAY;
|
||||
}
|
||||
case 8:
|
||||
if (plugin.getDependencies().getHeroes() != null) {
|
||||
return ChatColor.BLUE;
|
||||
case 10:
|
||||
if (!hasRequirement) {
|
||||
return ChatColor.GRAY;
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
}
|
||||
case 11:
|
||||
return ChatColor.GREEN;
|
||||
default:
|
||||
return null;
|
||||
} else {
|
||||
return ChatColor.GRAY;
|
||||
}
|
||||
case 9:
|
||||
return ChatColor.BLUE;
|
||||
case 10:
|
||||
if (!hasRequirement) {
|
||||
return ChatColor.GRAY;
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
}
|
||||
case 11:
|
||||
return ChatColor.GREEN;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getSelectionText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("reqSetMoney");
|
||||
case 2:
|
||||
return ChatColor.YELLOW + Lang.get("reqSetQuestPoints");
|
||||
case 3:
|
||||
return ChatColor.YELLOW + Lang.get("reqSetItem");
|
||||
case 4:
|
||||
return ChatColor.YELLOW + Lang.get("reqSetPerms");
|
||||
case 5:
|
||||
return ChatColor.YELLOW + Lang.get("reqSetQuest");
|
||||
case 6:
|
||||
return ChatColor.YELLOW + Lang.get("reqSetQuestBlocks");
|
||||
case 7:
|
||||
return ChatColor.YELLOW + Lang.get("reqSetMcMMO");
|
||||
case 8:
|
||||
return ChatColor.YELLOW + Lang.get("reqSetHeroes");
|
||||
case 9:
|
||||
return ChatColor.DARK_PURPLE + Lang.get("reqSetCustom");
|
||||
case 10:
|
||||
if (!hasRequirement) {
|
||||
return ChatColor.GRAY + Lang.get("reqSetFail");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("reqSetFail");
|
||||
}
|
||||
case 11:
|
||||
return ChatColor.YELLOW + Lang.get("done");
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("reqSetMoney");
|
||||
case 2:
|
||||
return ChatColor.YELLOW + Lang.get("reqSetQuestPoints");
|
||||
case 3:
|
||||
return ChatColor.YELLOW + Lang.get("reqSetItem");
|
||||
case 4:
|
||||
return ChatColor.YELLOW + Lang.get("reqSetPerms");
|
||||
case 5:
|
||||
return ChatColor.YELLOW + Lang.get("reqSetQuest");
|
||||
case 6:
|
||||
return ChatColor.YELLOW + Lang.get("reqSetQuestBlocks");
|
||||
case 7:
|
||||
return ChatColor.YELLOW + Lang.get("reqSetMcMMO");
|
||||
case 8:
|
||||
return ChatColor.YELLOW + Lang.get("reqSetHeroes");
|
||||
case 9:
|
||||
return ChatColor.DARK_PURPLE + Lang.get("reqSetCustom");
|
||||
case 10:
|
||||
if (!hasRequirement) {
|
||||
return ChatColor.GRAY + Lang.get("reqSetFail");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("reqSetFail");
|
||||
}
|
||||
case 11:
|
||||
return ChatColor.YELLOW + Lang.get("done");
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public String getAdditionalText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
if (context.getSessionData(CK.REQ_MONEY) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
int moneyReq = (Integer) context.getSessionData(CK.REQ_MONEY);
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + moneyReq + " "
|
||||
+ (moneyReq > 1 ? plugin.getDependencies().getCurrency(true)
|
||||
: plugin.getDependencies().getCurrency(false)) + ChatColor.GRAY + ")";
|
||||
case 1:
|
||||
if (context.getSessionData(CK.REQ_MONEY) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
int moneyReq = (Integer) context.getSessionData(CK.REQ_MONEY);
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + moneyReq + " "
|
||||
+ (moneyReq > 1 ? plugin.getDependencies().getCurrency(true)
|
||||
: plugin.getDependencies().getCurrency(false)) + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 2:
|
||||
if (context.getSessionData(CK.REQ_QUEST_POINTS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.REQ_QUEST_POINTS) + " "
|
||||
+ Lang.get("questPoints") + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 3:
|
||||
if (context.getSessionData(CK.REQ_ITEMS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "\n";
|
||||
LinkedList<ItemStack> items = (LinkedList<ItemStack>) context.getSessionData(CK.REQ_ITEMS);
|
||||
for (int i = 0; i < items.size(); i++) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.BLUE + ItemUtil.getName(items.get(i))
|
||||
+ ChatColor.GRAY + " x " + ChatColor.AQUA + items.get(i).getAmount() + "\n";
|
||||
}
|
||||
case 2:
|
||||
if (context.getSessionData(CK.REQ_QUEST_POINTS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.REQ_QUEST_POINTS) + " "
|
||||
+ Lang.get("questPoints") + ChatColor.GRAY + ")";
|
||||
return text;
|
||||
}
|
||||
case 4:
|
||||
if (context.getSessionData(CK.REQ_PERMISSION) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "\n";
|
||||
List<String> perms = (List<String>) context.getSessionData(CK.REQ_PERMISSION);
|
||||
for (String s : perms) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n";
|
||||
}
|
||||
case 3:
|
||||
if (context.getSessionData(CK.REQ_ITEMS) == null) {
|
||||
return text;
|
||||
}
|
||||
case 5:
|
||||
if (context.getSessionData(CK.REQ_QUEST) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "\n";
|
||||
List<String> qs = (List<String>) context.getSessionData(CK.REQ_QUEST);
|
||||
for (String s : qs) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 6:
|
||||
if (context.getSessionData(CK.REQ_QUEST_BLOCK) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "\n";
|
||||
List<String> qs = (List<String>) context.getSessionData(CK.REQ_QUEST_BLOCK);
|
||||
for (String s : qs) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 7:
|
||||
if (plugin.getDependencies().getMcmmoClassic() != null) {
|
||||
if (context.getSessionData(CK.REQ_MCMMO_SKILLS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "\n";
|
||||
LinkedList<ItemStack> items = (LinkedList<ItemStack>) context.getSessionData(CK.REQ_ITEMS);
|
||||
for (int i = 0; i < items.size(); i++) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.BLUE + ItemUtil.getName(items.get(i))
|
||||
+ ChatColor.GRAY + " x " + ChatColor.AQUA + items.get(i).getAmount() + "\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 += ChatColor.GRAY + " - " + ChatColor.DARK_GREEN + s + ChatColor.RESET
|
||||
+ ChatColor.YELLOW + " " + Lang.get("mcMMOLevel") + " " + ChatColor.GREEN
|
||||
+ amounts.get(skills.indexOf(s)) + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 4:
|
||||
if (context.getSessionData(CK.REQ_PERMISSION) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||
}
|
||||
case 8:
|
||||
if (plugin.getDependencies().getHeroes() != null) {
|
||||
if (context.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) == null
|
||||
&& context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")\n";
|
||||
} else {
|
||||
String text = "\n";
|
||||
List<String> perms = (List<String>) context.getSessionData(CK.REQ_PERMISSION);
|
||||
for (String s : perms) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n";
|
||||
if (context.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) != null) {
|
||||
text += ChatColor.AQUA + " " + Lang.get("reqHeroesPrimaryDisplay") + " "
|
||||
+ ChatColor.BLUE + (String) context.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS);
|
||||
}
|
||||
if (context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) != null) {
|
||||
text += ChatColor.AQUA + " " + Lang.get("reqHeroesSecondaryDisplay") + " "
|
||||
+ ChatColor.BLUE + (String) context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 5:
|
||||
if (context.getSessionData(CK.REQ_QUEST) == null) {
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||
}
|
||||
case 9:
|
||||
if (context.getSessionData(CK.REQ_CUSTOM) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "\n";
|
||||
LinkedList<String> customReqs = (LinkedList<String>) context.getSessionData(CK.REQ_CUSTOM);
|
||||
for (String s : customReqs) {
|
||||
text += ChatColor.RESET + "" + ChatColor.DARK_PURPLE + " - " + ChatColor.LIGHT_PURPLE + s + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 10:
|
||||
if (context.getSessionData(CK.REQ_FAIL_MESSAGE) == null) {
|
||||
if (!hasRequirement) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("stageEditorOptional") + ")";
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "\n";
|
||||
List<String> qs = (List<String>) context.getSessionData(CK.REQ_QUEST);
|
||||
for (String s : qs) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 6:
|
||||
if (context.getSessionData(CK.REQ_QUEST_BLOCK) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "\n";
|
||||
List<String> qs = (List<String>) context.getSessionData(CK.REQ_QUEST_BLOCK);
|
||||
for (String s : qs) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 7:
|
||||
if (plugin.getDependencies().getMcmmoClassic() != null) {
|
||||
if (context.getSessionData(CK.REQ_MCMMO_SKILLS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "\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 += ChatColor.GRAY + " - " + ChatColor.DARK_GREEN + s + ChatColor.RESET
|
||||
+ ChatColor.YELLOW + " " + Lang.get("mcMMOLevel") + " " + ChatColor.GREEN
|
||||
+ amounts.get(skills.indexOf(s)) + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||
}
|
||||
case 8:
|
||||
if (plugin.getDependencies().getHeroes() != null) {
|
||||
if (context.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) == null
|
||||
&& context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")\n";
|
||||
} else {
|
||||
String text = "\n";
|
||||
if (context.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) != null) {
|
||||
text += ChatColor.AQUA + " " + Lang.get("reqHeroesPrimaryDisplay") + " "
|
||||
+ ChatColor.BLUE + (String) context.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS);
|
||||
}
|
||||
if (context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) != null) {
|
||||
text += ChatColor.AQUA + " " + Lang.get("reqHeroesSecondaryDisplay") + " "
|
||||
+ ChatColor.BLUE + (String) context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||
}
|
||||
case 9:
|
||||
if (context.getSessionData(CK.REQ_CUSTOM) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "\n";
|
||||
LinkedList<String> customReqs = (LinkedList<String>) context.getSessionData(CK.REQ_CUSTOM);
|
||||
for (String s : customReqs) {
|
||||
text += ChatColor.RESET + "" + ChatColor.DARK_PURPLE + " - " + ChatColor.LIGHT_PURPLE + s
|
||||
+ "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 10:
|
||||
if (context.getSessionData(CK.REQ_FAIL_MESSAGE) == null) {
|
||||
if (!hasRequirement) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("stageEditorOptional") + ")";
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
}
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + "\"" + context.getSessionData(CK.REQ_FAIL_MESSAGE)
|
||||
+ "\"" + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + "\"" + context.getSessionData(CK.REQ_FAIL_MESSAGE)+ "\""
|
||||
+ ChatColor.GRAY + ")";
|
||||
}
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -287,43 +286,43 @@ public class RequirementsPrompt extends QuestsNumericPrompt {
|
||||
@Override
|
||||
protected Prompt acceptValidatedInput(ConversationContext context, Number input) {
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
return new MoneyPrompt();
|
||||
case 2:
|
||||
return new QuestPointsPrompt();
|
||||
case 3:
|
||||
return new ItemListPrompt(plugin, context, factory);
|
||||
case 4:
|
||||
return new PermissionsPrompt();
|
||||
case 5:
|
||||
return new QuestListPrompt(true);
|
||||
case 6:
|
||||
return new QuestListPrompt(false);
|
||||
case 7:
|
||||
if (plugin.getDependencies().getMcmmoClassic() != null) {
|
||||
return new mcMMOPrompt();
|
||||
} else {
|
||||
return new RequirementsPrompt(plugin, context, factory);
|
||||
}
|
||||
case 8:
|
||||
if (plugin.getDependencies().getHeroes() != null) {
|
||||
return new HeroesPrompt();
|
||||
} else {
|
||||
return new RequirementsPrompt(plugin, context, factory);
|
||||
}
|
||||
case 9:
|
||||
return new CustomRequirementsPrompt();
|
||||
case 10:
|
||||
if (hasRequirement) {
|
||||
return new FailMessagePrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||
return new RequirementsPrompt(plugin, context, factory);
|
||||
}
|
||||
case 11:
|
||||
return factory.returnToMenu(context);
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return new MoneyPrompt();
|
||||
case 2:
|
||||
return new QuestPointsPrompt();
|
||||
case 3:
|
||||
return new ItemListPrompt(plugin, context, factory);
|
||||
case 4:
|
||||
return new PermissionsPrompt();
|
||||
case 5:
|
||||
return new QuestListPrompt(true);
|
||||
case 6:
|
||||
return new QuestListPrompt(false);
|
||||
case 7:
|
||||
if (plugin.getDependencies().getMcmmoClassic() != null) {
|
||||
return new mcMMOPrompt();
|
||||
} else {
|
||||
return new RequirementsPrompt(plugin, context, factory);
|
||||
}
|
||||
case 8:
|
||||
if (plugin.getDependencies().getHeroes() != null) {
|
||||
return new HeroesPrompt();
|
||||
} else {
|
||||
return new RequirementsPrompt(plugin, context, factory);
|
||||
}
|
||||
case 9:
|
||||
return new CustomRequirementsPrompt();
|
||||
case 10:
|
||||
if (hasRequirement) {
|
||||
return new FailMessagePrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||
return new RequirementsPrompt(plugin, context, factory);
|
||||
}
|
||||
case 11:
|
||||
return factory.returnToMenu(context);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -482,7 +481,7 @@ public class RequirementsPrompt extends QuestsNumericPrompt {
|
||||
}
|
||||
}
|
||||
|
||||
public class ItemListPrompt extends QuestsNumericPrompt {
|
||||
public class ItemListPrompt extends QuestsEditorNumericPrompt {
|
||||
public ItemListPrompt(Quests plugin, ConversationContext context, QuestFactory factory) {
|
||||
super(context, factory);
|
||||
}
|
||||
@ -499,73 +498,73 @@ public class RequirementsPrompt extends QuestsNumericPrompt {
|
||||
|
||||
public ChatColor getNumberColor(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
case 1:
|
||||
return ChatColor.BLUE;
|
||||
case 2:
|
||||
if (context.getSessionData(CK.REQ_ITEMS) == null) {
|
||||
return ChatColor.GRAY;
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
case 2:
|
||||
if (context.getSessionData(CK.REQ_ITEMS) == null) {
|
||||
return ChatColor.GRAY;
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
}
|
||||
case 3:
|
||||
return ChatColor.RED;
|
||||
case 4:
|
||||
return ChatColor.GREEN;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
case 3:
|
||||
return ChatColor.RED;
|
||||
case 4:
|
||||
return ChatColor.GREEN;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getSelectionText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorDeliveryAddItem");
|
||||
case 2:
|
||||
if (context.getSessionData(CK.REQ_ITEMS) == null) {
|
||||
return ChatColor.GRAY + Lang.get("reqSetRemoveItems");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("reqSetRemoveItems");
|
||||
}
|
||||
case 3:
|
||||
return ChatColor.RED + Lang.get("clear");
|
||||
case 4:
|
||||
return ChatColor.GREEN + Lang.get("done");
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorDeliveryAddItem");
|
||||
case 2:
|
||||
if (context.getSessionData(CK.REQ_ITEMS) == null) {
|
||||
return ChatColor.GRAY + Lang.get("reqSetRemoveItems");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("reqSetRemoveItems");
|
||||
}
|
||||
case 3:
|
||||
return ChatColor.RED + Lang.get("clear");
|
||||
case 4:
|
||||
return ChatColor.GREEN + Lang.get("done");
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getAdditionalText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
if (context.getSessionData(CK.REQ_ITEMS) != null) {
|
||||
case 1:
|
||||
if (context.getSessionData(CK.REQ_ITEMS) != null) {
|
||||
String text = "\n";
|
||||
for (ItemStack is : getItems(context)) {
|
||||
text += ChatColor.GRAY + " - " + ItemUtil.getDisplayString(is) + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
return "";
|
||||
case 2:
|
||||
if (context.getSessionData(CK.REQ_ITEMS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("reqNoItemsSet") + ")";
|
||||
} else {
|
||||
if (context.getSessionData(CK.REQ_ITEMS_REMOVE) == null) {
|
||||
return ChatColor.YELLOW + "(" + Lang.get("reqNoValuesSet") + ")";
|
||||
} else {
|
||||
String text = "\n";
|
||||
for (ItemStack is : getItems(context)) {
|
||||
text += ChatColor.GRAY + " - " + ItemUtil.getDisplayString(is) + "\n";
|
||||
for (Boolean b : getRemoveItems(context)) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.AQUA
|
||||
+ (b.equals(Boolean.TRUE) ? Lang.get("yesWord") : Lang.get("noWord")) + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
return "";
|
||||
case 2:
|
||||
if (context.getSessionData(CK.REQ_ITEMS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("reqNoItemsSet") + ")";
|
||||
} else {
|
||||
if (context.getSessionData(CK.REQ_ITEMS_REMOVE) == null) {
|
||||
return ChatColor.YELLOW + "(" + Lang.get("reqNoValuesSet") + ")";
|
||||
} else {
|
||||
String text = "\n";
|
||||
for (Boolean b : getRemoveItems(context)) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.AQUA
|
||||
+ (b.equals(Boolean.TRUE) ? Lang.get("yesWord") : Lang.get("noWord")) + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
}
|
||||
case 3:
|
||||
case 4:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
case 3:
|
||||
case 4:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -602,41 +601,41 @@ public class RequirementsPrompt extends QuestsNumericPrompt {
|
||||
@Override
|
||||
protected Prompt acceptValidatedInput(ConversationContext context, Number input) {
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
return new ItemStackPrompt(ItemListPrompt.this);
|
||||
case 2:
|
||||
if (context.getSessionData(CK.REQ_ITEMS) == null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqMustAddItem"));
|
||||
return new ItemListPrompt(plugin, context, factory);
|
||||
} else {
|
||||
return new RemoveItemsPrompt();
|
||||
}
|
||||
case 3:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqItemCleared"));
|
||||
context.setSessionData(CK.REQ_ITEMS, null);
|
||||
context.setSessionData(CK.REQ_ITEMS_REMOVE, null);
|
||||
case 1:
|
||||
return new ItemStackPrompt(ItemListPrompt.this);
|
||||
case 2:
|
||||
if (context.getSessionData(CK.REQ_ITEMS) == null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqMustAddItem"));
|
||||
return new ItemListPrompt(plugin, context, factory);
|
||||
case 4:
|
||||
int one;
|
||||
int two;
|
||||
if (context.getSessionData(CK.REQ_ITEMS) != null) {
|
||||
one = ((List<ItemStack>) context.getSessionData(CK.REQ_ITEMS)).size();
|
||||
} else {
|
||||
one = 0;
|
||||
}
|
||||
if (context.getSessionData(CK.REQ_ITEMS_REMOVE) != null) {
|
||||
two = ((List<Boolean>) context.getSessionData(CK.REQ_ITEMS_REMOVE)).size();
|
||||
} else {
|
||||
two = 0;
|
||||
}
|
||||
if (one == two) {
|
||||
return new RequirementsPrompt(plugin, context, factory);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new ItemListPrompt(plugin, context, factory);
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
} else {
|
||||
return new RemoveItemsPrompt();
|
||||
}
|
||||
case 3:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqItemCleared"));
|
||||
context.setSessionData(CK.REQ_ITEMS, null);
|
||||
context.setSessionData(CK.REQ_ITEMS_REMOVE, null);
|
||||
return new ItemListPrompt(plugin, context, factory);
|
||||
case 4:
|
||||
int one;
|
||||
int two;
|
||||
if (context.getSessionData(CK.REQ_ITEMS) != null) {
|
||||
one = ((List<ItemStack>) context.getSessionData(CK.REQ_ITEMS)).size();
|
||||
} else {
|
||||
one = 0;
|
||||
}
|
||||
if (context.getSessionData(CK.REQ_ITEMS_REMOVE) != null) {
|
||||
two = ((List<Boolean>) context.getSessionData(CK.REQ_ITEMS_REMOVE)).size();
|
||||
} else {
|
||||
two = 0;
|
||||
}
|
||||
if (one == two) {
|
||||
return new RequirementsPrompt(plugin, context, factory);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new ItemListPrompt(plugin, context, factory);
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************************************/
|
||||
|
||||
package me.blackvein.quests.prompts.quests;
|
||||
package me.blackvein.quests.convo.quests.prompts;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
@ -33,14 +33,14 @@ import com.herocraftonline.heroes.characters.classes.HeroClass;
|
||||
import me.blackvein.quests.CustomReward;
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenNumericPromptEvent;
|
||||
import me.blackvein.quests.prompts.QuestsNumericPrompt;
|
||||
import me.blackvein.quests.util.CK;
|
||||
import me.blackvein.quests.util.ItemUtil;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import me.blackvein.quests.util.MiscUtil;
|
||||
|
||||
public class RewardsPrompt extends QuestsNumericPrompt {
|
||||
public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
private final Quests plugin;
|
||||
private final QuestFactory factory;
|
||||
@ -62,209 +62,209 @@ public class RewardsPrompt extends QuestsNumericPrompt {
|
||||
|
||||
public ChatColor getNumberColor(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
return ChatColor.BLUE;
|
||||
case 7:
|
||||
if (plugin.getDependencies().getMcmmoClassic() != null) {
|
||||
return ChatColor.BLUE;
|
||||
case 7:
|
||||
if (plugin.getDependencies().getMcmmoClassic() != null) {
|
||||
return ChatColor.BLUE;
|
||||
} else {
|
||||
return ChatColor.GRAY;
|
||||
}
|
||||
case 8:
|
||||
if (plugin.getDependencies().getHeroes() != null) {
|
||||
return ChatColor.BLUE;
|
||||
} else {
|
||||
return ChatColor.GRAY;
|
||||
}
|
||||
case 9:
|
||||
if (plugin.getDependencies().getPhatLoots() != null) {
|
||||
return ChatColor.BLUE;
|
||||
} else {
|
||||
return ChatColor.GRAY;
|
||||
}
|
||||
case 10:
|
||||
} else {
|
||||
return ChatColor.GRAY;
|
||||
}
|
||||
case 8:
|
||||
if (plugin.getDependencies().getHeroes() != null) {
|
||||
return ChatColor.BLUE;
|
||||
case 11:
|
||||
return ChatColor.GREEN;
|
||||
default:
|
||||
return null;
|
||||
} else {
|
||||
return ChatColor.GRAY;
|
||||
}
|
||||
case 9:
|
||||
if (plugin.getDependencies().getPhatLoots() != null) {
|
||||
return ChatColor.BLUE;
|
||||
} else {
|
||||
return ChatColor.GRAY;
|
||||
}
|
||||
case 10:
|
||||
return ChatColor.BLUE;
|
||||
case 11:
|
||||
return ChatColor.GREEN;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getSelectionText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("rewSetMoney");
|
||||
case 2:
|
||||
return ChatColor.YELLOW + Lang.get("rewSetQuestPoints");
|
||||
case 3:
|
||||
return ChatColor.YELLOW + Lang.get("rewSetItems");
|
||||
case 4:
|
||||
return ChatColor.YELLOW + Lang.get("rewSetExperience");
|
||||
case 5:
|
||||
return ChatColor.YELLOW + Lang.get("rewSetCommands");
|
||||
case 6:
|
||||
return ChatColor.YELLOW + Lang.get("rewSetPermission");
|
||||
case 7:
|
||||
return ChatColor.YELLOW + Lang.get("rewSetMcMMO");
|
||||
case 8:
|
||||
return ChatColor.YELLOW + Lang.get("rewSetHeroes");
|
||||
case 9:
|
||||
return ChatColor.YELLOW + Lang.get("rewSetPhat");
|
||||
case 10:
|
||||
return ChatColor.DARK_PURPLE + Lang.get("rewSetCustom");
|
||||
case 11:
|
||||
return ChatColor.YELLOW + Lang.get("done");
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return ChatColor.YELLOW + Lang.get("rewSetMoney");
|
||||
case 2:
|
||||
return ChatColor.YELLOW + Lang.get("rewSetQuestPoints");
|
||||
case 3:
|
||||
return ChatColor.YELLOW + Lang.get("rewSetItems");
|
||||
case 4:
|
||||
return ChatColor.YELLOW + Lang.get("rewSetExperience");
|
||||
case 5:
|
||||
return ChatColor.YELLOW + Lang.get("rewSetCommands");
|
||||
case 6:
|
||||
return ChatColor.YELLOW + Lang.get("rewSetPermission");
|
||||
case 7:
|
||||
return ChatColor.YELLOW + Lang.get("rewSetMcMMO");
|
||||
case 8:
|
||||
return ChatColor.YELLOW + Lang.get("rewSetHeroes");
|
||||
case 9:
|
||||
return ChatColor.YELLOW + Lang.get("rewSetPhat");
|
||||
case 10:
|
||||
return ChatColor.DARK_PURPLE + Lang.get("rewSetCustom");
|
||||
case 11:
|
||||
return ChatColor.YELLOW + Lang.get("done");
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public String getAdditionalText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
if (context.getSessionData(CK.REW_MONEY) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
int moneyRew = (Integer) context.getSessionData(CK.REW_MONEY);
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + moneyRew + " "
|
||||
+ (moneyRew > 1 ? plugin.getDependencies().getCurrency(true)
|
||||
: plugin.getDependencies().getCurrency(false)) + ChatColor.GRAY + ")";
|
||||
case 1:
|
||||
if (context.getSessionData(CK.REW_MONEY) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
int moneyRew = (Integer) context.getSessionData(CK.REW_MONEY);
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + moneyRew + " "
|
||||
+ (moneyRew > 1 ? plugin.getDependencies().getCurrency(true)
|
||||
: plugin.getDependencies().getCurrency(false)) + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 2:
|
||||
if (context.getSessionData(CK.REW_QUEST_POINTS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.REW_QUEST_POINTS) + " "
|
||||
+ Lang.get("questPoints") + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 3:
|
||||
if (context.getSessionData(CK.REW_ITEMS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "";
|
||||
LinkedList<ItemStack> items = (LinkedList<ItemStack>) context.getSessionData(CK.REW_ITEMS);
|
||||
for (int i = 0; i < items.size(); i++) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.BLUE + ItemUtil.getName(items.get(i))
|
||||
+ ChatColor.GRAY + " x " + ChatColor.AQUA + items.get(i).getAmount() + "\n";
|
||||
}
|
||||
case 2:
|
||||
if (context.getSessionData(CK.REW_QUEST_POINTS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.REW_QUEST_POINTS) + " "
|
||||
+ Lang.get("questPoints") + ChatColor.GRAY + ")";
|
||||
return text;
|
||||
}
|
||||
case 4:
|
||||
if (context.getSessionData(CK.REW_EXP) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.REW_EXP) + " "
|
||||
+ Lang.get("points") + ChatColor.DARK_GRAY + ")";
|
||||
}
|
||||
case 5:
|
||||
if (context.getSessionData(CK.REW_COMMAND) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "";
|
||||
List<String> commands = (List<String>) context.getSessionData(CK.REW_COMMAND);
|
||||
List<String> overrides = (List<String>) context.getSessionData(CK.REW_COMMAND_OVERRIDE_DISPLAY);
|
||||
int index = 0;
|
||||
for (String cmd : commands) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.AQUA + cmd;
|
||||
if (overrides != null) {
|
||||
if (index < overrides.size()) {
|
||||
text += ChatColor.GRAY + " (\"" + ChatColor.AQUA + overrides.get(index)
|
||||
+ ChatColor.GRAY + "\")";
|
||||
}
|
||||
}
|
||||
text += "\n";
|
||||
index++;
|
||||
}
|
||||
case 3:
|
||||
if (context.getSessionData(CK.REW_ITEMS) == null) {
|
||||
return text;
|
||||
}
|
||||
case 6:
|
||||
if (context.getSessionData(CK.REW_PERMISSION) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "";
|
||||
List<String> permissions = (List<String>) context.getSessionData(CK.REW_PERMISSION);
|
||||
for (String perm : permissions) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.AQUA + perm + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 7:
|
||||
if (plugin.getDependencies().getMcmmoClassic() != null) {
|
||||
if (context.getSessionData(CK.REW_MCMMO_SKILLS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "";
|
||||
LinkedList<ItemStack> items = (LinkedList<ItemStack>) context.getSessionData(CK.REW_ITEMS);
|
||||
for (int i = 0; i < items.size(); i++) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.BLUE + ItemUtil.getName(items.get(i))
|
||||
+ ChatColor.GRAY + " x " + ChatColor.AQUA + items.get(i).getAmount() + "\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 += ChatColor.GRAY + " - " + ChatColor.AQUA + skill + ChatColor.GRAY + " x "
|
||||
+ ChatColor.DARK_AQUA + amounts.get(skills.indexOf(skill)) + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 4:
|
||||
if (context.getSessionData(CK.REW_EXP) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.REW_EXP) + " "
|
||||
+ Lang.get("points") + ChatColor.DARK_GRAY + ")";
|
||||
}
|
||||
case 5:
|
||||
if (context.getSessionData(CK.REW_COMMAND) == null) {
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||
}
|
||||
case 8:
|
||||
if (plugin.getDependencies().getHeroes() != null) {
|
||||
if (context.getSessionData(CK.REW_HEROES_CLASSES) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "";
|
||||
List<String> commands = (List<String>) context.getSessionData(CK.REW_COMMAND);
|
||||
List<String> overrides = (List<String>) context.getSessionData(CK.REW_COMMAND_OVERRIDE_DISPLAY);
|
||||
int index = 0;
|
||||
for (String cmd : commands) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.AQUA + cmd;
|
||||
if (overrides != null) {
|
||||
if (index < overrides.size()) {
|
||||
text += ChatColor.GRAY + " (\"" + ChatColor.AQUA + overrides.get(index)
|
||||
+ ChatColor.GRAY + "\")";
|
||||
}
|
||||
}
|
||||
text += "\n";
|
||||
index++;
|
||||
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 += ChatColor.GRAY + " - " + ChatColor.AQUA
|
||||
+ amounts.get(heroClasses.indexOf(heroClass)) + " " + ChatColor.DARK_AQUA
|
||||
+ heroClass + " " + Lang.get("experience") + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 6:
|
||||
if (context.getSessionData(CK.REW_PERMISSION) == null) {
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||
}
|
||||
case 9:
|
||||
if (plugin.getDependencies().getPhatLoots() != null) {
|
||||
if (context.getSessionData(CK.REW_PHAT_LOOTS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "";
|
||||
List<String> permissions = (List<String>) context.getSessionData(CK.REW_PERMISSION);
|
||||
for (String perm : permissions) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.AQUA + perm + "\n";
|
||||
List<String> phatLoots = (List<String>) context.getSessionData(CK.REW_PHAT_LOOTS);
|
||||
for (String phatLoot : phatLoots) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.AQUA + phatLoot + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 7:
|
||||
if (plugin.getDependencies().getMcmmoClassic() != null) {
|
||||
if (context.getSessionData(CK.REW_MCMMO_SKILLS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "";
|
||||
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 += ChatColor.GRAY + " - " + ChatColor.AQUA + skill + ChatColor.GRAY + " x "
|
||||
+ ChatColor.DARK_AQUA + amounts.get(skills.indexOf(skill)) + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||
}
|
||||
case 10:
|
||||
if (context.getSessionData(CK.REW_CUSTOM) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "";
|
||||
LinkedList<String> customRews = (LinkedList<String>) context.getSessionData(CK.REW_CUSTOM);
|
||||
for (String s : customRews) {
|
||||
text += ChatColor.RESET + "" + ChatColor.DARK_PURPLE + " - " + ChatColor.LIGHT_PURPLE + s
|
||||
+ "\n";
|
||||
}
|
||||
case 8:
|
||||
if (plugin.getDependencies().getHeroes() != null) {
|
||||
if (context.getSessionData(CK.REW_HEROES_CLASSES) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "";
|
||||
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 += ChatColor.GRAY + " - " + ChatColor.AQUA
|
||||
+ amounts.get(heroClasses.indexOf(heroClass)) + " " + ChatColor.DARK_AQUA
|
||||
+ heroClass + " " + Lang.get("experience") + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||
}
|
||||
case 9:
|
||||
if (plugin.getDependencies().getPhatLoots() != null) {
|
||||
if (context.getSessionData(CK.REW_PHAT_LOOTS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "";
|
||||
List<String> phatLoots = (List<String>) context.getSessionData(CK.REW_PHAT_LOOTS);
|
||||
for (String phatLoot : phatLoots) {
|
||||
text += ChatColor.GRAY + " - " + ChatColor.AQUA + phatLoot + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||
}
|
||||
case 10:
|
||||
if (context.getSessionData(CK.REW_CUSTOM) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "";
|
||||
LinkedList<String> customRews = (LinkedList<String>) context.getSessionData(CK.REW_CUSTOM);
|
||||
for (String s : customRews) {
|
||||
text += ChatColor.RESET + "" + ChatColor.DARK_PURPLE + " - " + ChatColor.LIGHT_PURPLE + s
|
||||
+ "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
return text;
|
||||
}
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -287,42 +287,42 @@ public class RewardsPrompt extends QuestsNumericPrompt {
|
||||
@Override
|
||||
protected Prompt acceptValidatedInput(ConversationContext context, Number input) {
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
return new MoneyPrompt();
|
||||
case 2:
|
||||
return new QuestPointsPrompt();
|
||||
case 3:
|
||||
return new ItemListPrompt();
|
||||
case 4:
|
||||
return new ExperiencePrompt();
|
||||
case 5:
|
||||
return new CommandsListPrompt();
|
||||
case 6:
|
||||
return new PermissionsPrompt();
|
||||
case 7:
|
||||
if (plugin.getDependencies().getMcmmoClassic() != null) {
|
||||
return new mcMMOListPrompt();
|
||||
} else {
|
||||
return new RewardsPrompt(plugin, context, factory);
|
||||
}
|
||||
case 8:
|
||||
if (plugin.getDependencies().getHeroes() != null) {
|
||||
return new HeroesListPrompt();
|
||||
} else {
|
||||
return new RewardsPrompt(plugin, context, factory);
|
||||
}
|
||||
case 9:
|
||||
if (plugin.getDependencies().getPhatLoots() != null) {
|
||||
return new PhatLootsPrompt();
|
||||
} else {
|
||||
return new RewardsPrompt(plugin, context, factory);
|
||||
}
|
||||
case 10:
|
||||
return new CustomRewardsPrompt();
|
||||
case 11:
|
||||
return factory.returnToMenu(context);
|
||||
default:
|
||||
return null;
|
||||
case 1:
|
||||
return new MoneyPrompt();
|
||||
case 2:
|
||||
return new QuestPointsPrompt();
|
||||
case 3:
|
||||
return new ItemListPrompt();
|
||||
case 4:
|
||||
return new ExperiencePrompt();
|
||||
case 5:
|
||||
return new CommandsListPrompt();
|
||||
case 6:
|
||||
return new PermissionsPrompt();
|
||||
case 7:
|
||||
if (plugin.getDependencies().getMcmmoClassic() != null) {
|
||||
return new mcMMOListPrompt();
|
||||
} else {
|
||||
return new RewardsPrompt(plugin, context, factory);
|
||||
}
|
||||
case 8:
|
||||
if (plugin.getDependencies().getHeroes() != null) {
|
||||
return new HeroesListPrompt();
|
||||
} else {
|
||||
return new RewardsPrompt(plugin, context, factory);
|
||||
}
|
||||
case 9:
|
||||
if (plugin.getDependencies().getPhatLoots() != null) {
|
||||
return new PhatLootsPrompt();
|
||||
} else {
|
||||
return new RewardsPrompt(plugin, context, factory);
|
||||
}
|
||||
case 10:
|
||||
return new CustomRewardsPrompt();
|
||||
case 11:
|
||||
return factory.returnToMenu(context);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************************************/
|
||||
|
||||
package me.blackvein.quests.prompts.quests;
|
||||
package me.blackvein.quests.convo.quests.prompts;
|
||||
|
||||
import java.util.AbstractMap;
|
||||
import java.util.Arrays;
|
||||
@ -33,14 +33,14 @@ import me.blackvein.quests.CustomObjective;
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.actions.Action;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenNumericPromptEvent;
|
||||
import me.blackvein.quests.prompts.QuestsNumericPrompt;
|
||||
import me.blackvein.quests.util.CK;
|
||||
import me.blackvein.quests.util.ConfigUtil;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import me.blackvein.quests.util.MiscUtil;
|
||||
|
||||
public class StageMainPrompt extends QuestsNumericPrompt {
|
||||
public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
private final Quests plugin;
|
||||
private final int stageNum;
|
||||
@ -71,297 +71,297 @@ public class StageMainPrompt extends QuestsNumericPrompt {
|
||||
|
||||
public ChatColor getNumberColor(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
return ChatColor.BLUE;
|
||||
case 9:
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY;
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
case 9:
|
||||
}
|
||||
case 10:
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY;
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
}
|
||||
case 11:
|
||||
if (context.getSessionData(pref + CK.S_DELAY) == null) {
|
||||
return ChatColor.GRAY;
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
}
|
||||
case 12:
|
||||
if (context.getSessionData(pref + CK.S_START_MESSAGE) == null) {
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY;
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
}
|
||||
case 10:
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
}
|
||||
case 13:
|
||||
if (context.getSessionData(pref + CK.S_COMPLETE_MESSAGE) == null) {
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY;
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
}
|
||||
case 11:
|
||||
if (context.getSessionData(pref + CK.S_DELAY) == null) {
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
}
|
||||
case 14:
|
||||
if (context.getSessionData(pref + CK.S_OVERRIDE_DISPLAY) == null) {
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY;
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
}
|
||||
case 12:
|
||||
if (context.getSessionData(pref + CK.S_START_MESSAGE) == null) {
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY;
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
}
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
}
|
||||
case 13:
|
||||
if (context.getSessionData(pref + CK.S_COMPLETE_MESSAGE) == null) {
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY;
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
}
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
}
|
||||
case 14:
|
||||
if (context.getSessionData(pref + CK.S_OVERRIDE_DISPLAY) == null) {
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY;
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
}
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
}
|
||||
case 15:
|
||||
return ChatColor.RED;
|
||||
case 16:
|
||||
return ChatColor.GREEN;
|
||||
default:
|
||||
return null;
|
||||
} else {
|
||||
return ChatColor.BLUE;
|
||||
}
|
||||
case 15:
|
||||
return ChatColor.RED;
|
||||
case 16:
|
||||
return ChatColor.GREEN;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getSelectionText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return ChatColor.GOLD + Lang.get("stageEditorBlocks");
|
||||
case 2:
|
||||
return ChatColor.GOLD + Lang.get("stageEditorItems");
|
||||
case 3:
|
||||
return ChatColor.GOLD + Lang.get("stageEditorNPCs");
|
||||
case 4:
|
||||
return ChatColor.GOLD + Lang.get("stageEditorMobs");
|
||||
case 5:
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorKillPlayers");
|
||||
case 6:
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorReachLocs");
|
||||
case 7:
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorPassword");
|
||||
case 8:
|
||||
return ChatColor.DARK_PURPLE + Lang.get("stageEditorCustom");
|
||||
case 9:
|
||||
case 1:
|
||||
return ChatColor.GOLD + Lang.get("stageEditorBlocks");
|
||||
case 2:
|
||||
return ChatColor.GOLD + Lang.get("stageEditorItems");
|
||||
case 3:
|
||||
return ChatColor.GOLD + Lang.get("stageEditorNPCs");
|
||||
case 4:
|
||||
return ChatColor.GOLD + Lang.get("stageEditorMobs");
|
||||
case 5:
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorKillPlayers");
|
||||
case 6:
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorReachLocs");
|
||||
case 7:
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorPassword");
|
||||
case 8:
|
||||
return ChatColor.DARK_PURPLE + Lang.get("stageEditorCustom");
|
||||
case 9:
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY + Lang.get("stageEditorEvents");
|
||||
} else {
|
||||
return ChatColor.AQUA + Lang.get("stageEditorEvents");
|
||||
}
|
||||
case 10:
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY + Lang.get("delay");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("delay");
|
||||
}
|
||||
case 11:
|
||||
if (context.getSessionData(pref + CK.S_DELAY) == null) {
|
||||
return ChatColor.GRAY + Lang.get("stageEditorDelayMessage");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorDelayMessage");
|
||||
}
|
||||
case 12:
|
||||
if (context.getSessionData(pref + CK.S_START_MESSAGE) == null) {
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY + Lang.get("stageEditorEvents");
|
||||
} else {
|
||||
return ChatColor.AQUA + Lang.get("stageEditorEvents");
|
||||
}
|
||||
case 10:
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY + Lang.get("delay");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("delay");
|
||||
}
|
||||
case 11:
|
||||
if (context.getSessionData(pref + CK.S_DELAY) == null) {
|
||||
return ChatColor.GRAY + Lang.get("stageEditorDelayMessage");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorDelayMessage");
|
||||
}
|
||||
case 12:
|
||||
if (context.getSessionData(pref + CK.S_START_MESSAGE) == null) {
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY + Lang.get("stageEditorStartMessage");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorStartMessage");
|
||||
}
|
||||
return ChatColor.GRAY + Lang.get("stageEditorStartMessage");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorStartMessage");
|
||||
}
|
||||
case 13:
|
||||
if (context.getSessionData(pref + CK.S_COMPLETE_MESSAGE) == null) {
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY + Lang.get("stageEditorCompleteMessage");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorCompleteMessage");
|
||||
}
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorStartMessage");
|
||||
}
|
||||
case 13:
|
||||
if (context.getSessionData(pref + CK.S_COMPLETE_MESSAGE) == null) {
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY + Lang.get("stageEditorCompleteMessage");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorCompleteMessage");
|
||||
}
|
||||
case 14:
|
||||
if (context.getSessionData(pref + CK.S_OVERRIDE_DISPLAY) == null) {
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY + Lang.get("stageEditorObjectiveOverride");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorObjectiveOverride");
|
||||
}
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorCompleteMessage");
|
||||
}
|
||||
case 14:
|
||||
if (context.getSessionData(pref + CK.S_OVERRIDE_DISPLAY) == null) {
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY + Lang.get("stageEditorObjectiveOverride");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorObjectiveOverride");
|
||||
}
|
||||
case 15:
|
||||
return ChatColor.RED + Lang.get("stageEditorDelete");
|
||||
case 16:
|
||||
return ChatColor.GREEN + Lang.get("done");
|
||||
default:
|
||||
return null;
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("stageEditorObjectiveOverride");
|
||||
}
|
||||
case 15:
|
||||
return ChatColor.RED + Lang.get("stageEditorDelete");
|
||||
case 16:
|
||||
return ChatColor.GREEN + Lang.get("done");
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public String getAdditionalText(ConversationContext context, int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
if (context.getSessionData(pref + CK.S_BREAK_NAMES) == null
|
||||
&& context.getSessionData(pref + CK.S_DAMAGE_NAMES) == null
|
||||
&& context.getSessionData(pref + CK.S_PLACE_NAMES) == null
|
||||
&& context.getSessionData(pref + CK.S_USE_NAMES) == null
|
||||
&& context.getSessionData(pref + CK.S_CUT_NAMES) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
case 1:
|
||||
if (context.getSessionData(pref + CK.S_BREAK_NAMES) == null
|
||||
&& context.getSessionData(pref + CK.S_DAMAGE_NAMES) == null
|
||||
&& context.getSessionData(pref + CK.S_PLACE_NAMES) == null
|
||||
&& context.getSessionData(pref + CK.S_USE_NAMES) == null
|
||||
&& context.getSessionData(pref + CK.S_CUT_NAMES) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
}
|
||||
case 2:
|
||||
if (context.getSessionData(pref + CK.S_CRAFT_ITEMS) == null
|
||||
&& context.getSessionData(pref + CK.S_SMELT_ITEMS) == null
|
||||
&& context.getSessionData(pref + CK.S_ENCHANT_TYPES) == null
|
||||
&& context.getSessionData(pref + CK.S_BREW_ITEMS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
}
|
||||
case 3:
|
||||
if (context.getSessionData(pref + CK.S_DELIVERY_NPCS) == null
|
||||
&& context.getSessionData(pref + CK.S_NPCS_TO_TALK_TO) == null
|
||||
&& context.getSessionData(pref + CK.S_NPCS_TO_KILL) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
}
|
||||
case 4:
|
||||
if (context.getSessionData(pref + CK.S_MOB_TYPES) == null
|
||||
&& context.getSessionData(pref + CK.S_FISH) == null
|
||||
&& context.getSessionData(pref + CK.S_TAME_TYPES) == null
|
||||
&& context.getSessionData(pref + CK.S_SHEAR_COLORS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
}
|
||||
case 5:
|
||||
if (context.getSessionData(pref + CK.S_PLAYER_KILL) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
Integer players = (Integer) context.getSessionData(pref + CK.S_PLAYER_KILL);
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + players + " " + Lang.get("stageEditorPlayers")
|
||||
+ ChatColor.GRAY + ")";
|
||||
}
|
||||
case 6:
|
||||
if (context.getSessionData(pref + CK.S_REACH_LOCATIONS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "\n";
|
||||
LinkedList<String> locations
|
||||
= (LinkedList<String>) context.getSessionData(pref + CK.S_REACH_LOCATIONS);
|
||||
LinkedList<Integer> radii
|
||||
= (LinkedList<Integer>) context.getSessionData(pref + CK.S_REACH_LOCATIONS_RADIUS);
|
||||
LinkedList<String> names
|
||||
= (LinkedList<String>) context.getSessionData(pref + CK.S_REACH_LOCATIONS_NAMES);
|
||||
for (int i = 0; i < locations.size(); i++) {
|
||||
text += ChatColor.GRAY + " - " + Lang.get("stageEditorReachRadii1") + " " + ChatColor.BLUE
|
||||
+ radii.get(i) + ChatColor.GRAY + " " + Lang.get("stageEditorReachRadii2") + " "
|
||||
+ ChatColor.AQUA + names.get(i) + ChatColor.GRAY + " (" + ChatColor.DARK_AQUA
|
||||
+ locations.get(i) + ChatColor.GRAY + ")\n";
|
||||
}
|
||||
case 2:
|
||||
if (context.getSessionData(pref + CK.S_CRAFT_ITEMS) == null
|
||||
&& context.getSessionData(pref + CK.S_SMELT_ITEMS) == null
|
||||
&& context.getSessionData(pref + CK.S_ENCHANT_TYPES) == null
|
||||
&& context.getSessionData(pref + CK.S_BREW_ITEMS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
}
|
||||
case 3:
|
||||
if (context.getSessionData(pref + CK.S_DELIVERY_NPCS) == null
|
||||
&& context.getSessionData(pref + CK.S_NPCS_TO_TALK_TO) == null
|
||||
&& context.getSessionData(pref + CK.S_NPCS_TO_KILL) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
}
|
||||
case 4:
|
||||
if (context.getSessionData(pref + CK.S_MOB_TYPES) == null
|
||||
&& context.getSessionData(pref + CK.S_FISH) == null
|
||||
&& context.getSessionData(pref + CK.S_TAME_TYPES) == null
|
||||
&& context.getSessionData(pref + CK.S_SHEAR_COLORS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
}
|
||||
case 5:
|
||||
if (context.getSessionData(pref + CK.S_PLAYER_KILL) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
Integer players = (Integer) context.getSessionData(pref + CK.S_PLAYER_KILL);
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + players + " " + Lang.get("stageEditorPlayers")
|
||||
+ ChatColor.GRAY + ")";
|
||||
}
|
||||
case 6:
|
||||
if (context.getSessionData(pref + CK.S_REACH_LOCATIONS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "\n";
|
||||
LinkedList<String> locations
|
||||
= (LinkedList<String>) context.getSessionData(pref + CK.S_REACH_LOCATIONS);
|
||||
LinkedList<Integer> radii
|
||||
= (LinkedList<Integer>) context.getSessionData(pref + CK.S_REACH_LOCATIONS_RADIUS);
|
||||
LinkedList<String> names
|
||||
= (LinkedList<String>) context.getSessionData(pref + CK.S_REACH_LOCATIONS_NAMES);
|
||||
for (int i = 0; i < locations.size(); i++) {
|
||||
text += ChatColor.GRAY + " - " + Lang.get("stageEditorReachRadii1") + " " + ChatColor.BLUE
|
||||
+ radii.get(i) + ChatColor.GRAY + " " + Lang.get("stageEditorReachRadii2") + " "
|
||||
+ ChatColor.AQUA + names.get(i) + ChatColor.GRAY + " (" + ChatColor.DARK_AQUA
|
||||
+ locations.get(i) + ChatColor.GRAY + ")\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 7:
|
||||
if (context.getSessionData(pref + CK.S_PASSWORD_PHRASES) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "\n";
|
||||
LinkedList<LinkedList<String>> passPhrases
|
||||
= (LinkedList<LinkedList<String>>) context.getSessionData(pref + CK.S_PASSWORD_PHRASES);
|
||||
LinkedList<String> passDisplays
|
||||
= (LinkedList<String>) context.getSessionData(pref + CK.S_PASSWORD_DISPLAYS);
|
||||
for (int i = 0; i < passPhrases.size(); i++) {
|
||||
text += ChatColor.AQUA + " - \"" + passDisplays.get(i) + "\"\n";
|
||||
LinkedList<String> phrases = passPhrases.get(i);
|
||||
for (String phrase : phrases) {
|
||||
text += ChatColor.DARK_AQUA + " - " + phrase + "\n";
|
||||
}
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 8:
|
||||
if (context.getSessionData(pref + CK.S_CUSTOM_OBJECTIVES) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "\n";
|
||||
LinkedList<String> customObjs
|
||||
= (LinkedList<String>) context.getSessionData(pref + CK.S_CUSTOM_OBJECTIVES);
|
||||
for (String s : customObjs) {
|
||||
text += ChatColor.LIGHT_PURPLE + " - " + ChatColor.GOLD + s + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 9:
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("stageEditorOptional") + ")";
|
||||
}
|
||||
case 10:
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("stageEditorOptional") + ")";
|
||||
} else {
|
||||
if (context.getSessionData(pref + CK.S_DELAY) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
long time = (Long) context.getSessionData(pref + CK.S_DELAY);
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + MiscUtil.getTime(time) + ChatColor.GRAY + ")";
|
||||
return text;
|
||||
}
|
||||
case 7:
|
||||
if (context.getSessionData(pref + CK.S_PASSWORD_PHRASES) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "\n";
|
||||
LinkedList<LinkedList<String>> passPhrases
|
||||
= (LinkedList<LinkedList<String>>) context.getSessionData(pref + CK.S_PASSWORD_PHRASES);
|
||||
LinkedList<String> passDisplays
|
||||
= (LinkedList<String>) context.getSessionData(pref + CK.S_PASSWORD_DISPLAYS);
|
||||
for (int i = 0; i < passPhrases.size(); i++) {
|
||||
text += ChatColor.AQUA + " - \"" + passDisplays.get(i) + "\"\n";
|
||||
LinkedList<String> phrases = passPhrases.get(i);
|
||||
for (String phrase : phrases) {
|
||||
text += ChatColor.DARK_AQUA + " - " + phrase + "\n";
|
||||
}
|
||||
}
|
||||
case 11:
|
||||
return text;
|
||||
}
|
||||
case 8:
|
||||
if (context.getSessionData(pref + CK.S_CUSTOM_OBJECTIVES) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
String text = "\n";
|
||||
LinkedList<String> customObjs
|
||||
= (LinkedList<String>) context.getSessionData(pref + CK.S_CUSTOM_OBJECTIVES);
|
||||
for (String s : customObjs) {
|
||||
text += ChatColor.LIGHT_PURPLE + " - " + ChatColor.GOLD + s + "\n";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
case 9:
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("stageEditorOptional") + ")";
|
||||
}
|
||||
case 10:
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("stageEditorOptional") + ")";
|
||||
} else {
|
||||
if (context.getSessionData(pref + CK.S_DELAY) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noDelaySet") + ")";
|
||||
} else if (context.getSessionData(pref + CK.S_DELAY_MESSAGE) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + "\""
|
||||
+ context.getSessionData(pref + CK.S_DELAY_MESSAGE) + "\"" + ChatColor.GRAY + ")";
|
||||
long time = (Long) context.getSessionData(pref + CK.S_DELAY);
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + MiscUtil.getTime(time) + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 12:
|
||||
if (context.getSessionData(pref + CK.S_START_MESSAGE) == null) {
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("stageEditorOptional") + ")";
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
}
|
||||
}
|
||||
case 11:
|
||||
if (context.getSessionData(pref + CK.S_DELAY) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noDelaySet") + ")";
|
||||
} else if (context.getSessionData(pref + CK.S_DELAY_MESSAGE) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + "\""
|
||||
+ context.getSessionData(pref + CK.S_DELAY_MESSAGE) + "\"" + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 12:
|
||||
if (context.getSessionData(pref + CK.S_START_MESSAGE) == null) {
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("stageEditorOptional") + ")";
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + "\""
|
||||
+ context.getSessionData(pref + CK.S_START_MESSAGE) + "\"" + ChatColor.GRAY + ")";
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
}
|
||||
case 13:
|
||||
if (context.getSessionData(pref + CK.S_COMPLETE_MESSAGE) == null) {
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("stageEditorOptional") + ")";
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
}
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + "\""
|
||||
+ context.getSessionData(pref + CK.S_START_MESSAGE) + "\"" + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 13:
|
||||
if (context.getSessionData(pref + CK.S_COMPLETE_MESSAGE) == null) {
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("stageEditorOptional") + ")";
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + "\""
|
||||
+ context.getSessionData(pref + CK.S_COMPLETE_MESSAGE) + "\"" + ChatColor.GRAY + ")";
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
}
|
||||
case 14:
|
||||
if (context.getSessionData(pref + CK.S_OVERRIDE_DISPLAY) == null) {
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("stageEditorOptional") + ")";
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
}
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + "\""
|
||||
+ context.getSessionData(pref + CK.S_COMPLETE_MESSAGE) + "\"" + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 14:
|
||||
if (context.getSessionData(pref + CK.S_OVERRIDE_DISPLAY) == null) {
|
||||
if (!hasObjective) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("stageEditorOptional") + ")";
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + "\""
|
||||
+ context.getSessionData(pref + CK.S_OVERRIDE_DISPLAY) + "\"" + ChatColor.GRAY + ")";
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
}
|
||||
case 15:
|
||||
case 16:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + "\""
|
||||
+ context.getSessionData(pref + CK.S_OVERRIDE_DISPLAY) + "\"" + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 15:
|
||||
case 16:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -386,70 +386,70 @@ public class StageMainPrompt extends QuestsNumericPrompt {
|
||||
@Override
|
||||
protected Prompt acceptValidatedInput(ConversationContext context, Number input) {
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
return new BlocksPrompt(plugin, stageNum, factory);
|
||||
case 2:
|
||||
return new ItemsPrompt(plugin, stageNum, factory);
|
||||
case 3:
|
||||
return new NPCsPrompt(plugin, stageNum, factory);
|
||||
case 4:
|
||||
return new MobsPrompt(plugin, stageNum, factory);
|
||||
case 5:
|
||||
return new KillPlayerPrompt();
|
||||
case 6:
|
||||
return new ReachListPrompt();
|
||||
case 7:
|
||||
return new PasswordListPrompt();
|
||||
case 8:
|
||||
return new CustomObjectivesPrompt();
|
||||
case 9:
|
||||
if (hasObjective) {
|
||||
return new EventListPrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
}
|
||||
case 10:
|
||||
if (hasObjective) {
|
||||
return new DelayPrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
}
|
||||
case 11:
|
||||
if (context.getSessionData(pref + CK.S_DELAY) == null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNoDelaySet"));
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
} else {
|
||||
return new DelayMessagePrompt();
|
||||
}
|
||||
case 12:
|
||||
if (hasObjective) {
|
||||
return new StartMessagePrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
}
|
||||
case 13:
|
||||
if (hasObjective) {
|
||||
return new CompleteMessagePrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
}
|
||||
case 14:
|
||||
if (hasObjective) {
|
||||
return new OverrideDisplayPrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
}
|
||||
case 15:
|
||||
return new DeletePrompt();
|
||||
case 16:
|
||||
return new StageMenuPrompt(plugin, context, factory);
|
||||
default:
|
||||
case 1:
|
||||
return new BlocksPrompt(plugin, stageNum, context, factory);
|
||||
case 2:
|
||||
return new ItemsPrompt(plugin, stageNum, factory);
|
||||
case 3:
|
||||
return new NPCsPrompt(plugin, stageNum, factory);
|
||||
case 4:
|
||||
return new MobsPrompt(plugin, stageNum, factory);
|
||||
case 5:
|
||||
return new KillPlayerPrompt();
|
||||
case 6:
|
||||
return new ReachListPrompt();
|
||||
case 7:
|
||||
return new PasswordListPrompt();
|
||||
case 8:
|
||||
return new CustomObjectivesPrompt();
|
||||
case 9:
|
||||
if (hasObjective) {
|
||||
return new EventListPrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
}
|
||||
case 10:
|
||||
if (hasObjective) {
|
||||
return new DelayPrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
}
|
||||
case 11:
|
||||
if (context.getSessionData(pref + CK.S_DELAY) == null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNoDelaySet"));
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
} else {
|
||||
return new DelayMessagePrompt();
|
||||
}
|
||||
case 12:
|
||||
if (hasObjective) {
|
||||
return new StartMessagePrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
}
|
||||
case 13:
|
||||
if (hasObjective) {
|
||||
return new CompleteMessagePrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
}
|
||||
case 14:
|
||||
if (hasObjective) {
|
||||
return new OverrideDisplayPrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
}
|
||||
case 15:
|
||||
return new DeletePrompt();
|
||||
case 16:
|
||||
return new StageMenuPrompt(plugin, context, factory);
|
||||
default:
|
||||
return new StageMainPrompt(plugin, stageNum, context, factory);
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************************************/
|
||||
|
||||
package me.blackvein.quests.prompts.quests;
|
||||
package me.blackvein.quests.convo.quests.prompts;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
@ -18,12 +18,12 @@ import org.bukkit.conversations.Prompt;
|
||||
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenNumericPromptEvent;
|
||||
import me.blackvein.quests.prompts.QuestsNumericPrompt;
|
||||
import me.blackvein.quests.util.CK;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
|
||||
public class StageMenuPrompt extends QuestsNumericPrompt {
|
||||
public class StageMenuPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
private final Quests plugin;
|
||||
private final QuestFactory factory;
|
@ -13,12 +13,23 @@
|
||||
package me.blackvein.quests.events;
|
||||
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public abstract class QuestsEvent extends Event {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
|
||||
public QuestsEvent() {
|
||||
}
|
||||
|
||||
public QuestsEvent(boolean async) {
|
||||
super(async);
|
||||
}
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,8 @@
|
||||
|
||||
package me.blackvein.quests.events.command;
|
||||
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.events.QuestsEvent;
|
||||
|
||||
@ -19,6 +21,7 @@ import me.blackvein.quests.events.QuestsEvent;
|
||||
* Represents a Quests command-related event
|
||||
*/
|
||||
public abstract class QuestsCommandEvent extends QuestsEvent {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
protected Quester quester;
|
||||
|
||||
public QuestsCommandEvent(final Quester quester) {
|
||||
@ -38,4 +41,12 @@ public abstract class QuestsCommandEvent extends QuestsEvent {
|
||||
public final Quester getQuester() {
|
||||
return quester;
|
||||
}
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
|
@ -13,22 +13,33 @@
|
||||
package me.blackvein.quests.events.editor.actions;
|
||||
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.Prompt;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.actions.ActionFactory;
|
||||
import me.blackvein.quests.events.QuestsEvent;
|
||||
|
||||
/**
|
||||
* Represents an Actions Editor-related event
|
||||
*/
|
||||
public abstract class ActionsEditorEvent extends QuestsEvent {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
protected ConversationContext context;
|
||||
protected ActionFactory factory;
|
||||
protected Prompt prompt;
|
||||
|
||||
public ActionsEditorEvent(final ConversationContext context) {
|
||||
public ActionsEditorEvent(final ConversationContext context, ActionFactory factory, final Prompt prompt) {
|
||||
this.context = context;
|
||||
this.factory = factory;
|
||||
this.prompt = prompt;
|
||||
}
|
||||
|
||||
public ActionsEditorEvent(final ConversationContext context, boolean async) {
|
||||
public ActionsEditorEvent(final ConversationContext context, ActionFactory factory, final Prompt prompt,
|
||||
boolean async) {
|
||||
super(async);
|
||||
this.context = context;
|
||||
this.factory = factory;
|
||||
this.prompt = prompt;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -36,7 +47,34 @@ public abstract class ActionsEditorEvent extends QuestsEvent {
|
||||
*
|
||||
* @return ConversationContext which is involved in this event
|
||||
*/
|
||||
public final ConversationContext getConversationContext() {
|
||||
public ConversationContext getConversationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the factory involved in this event
|
||||
*
|
||||
* @return ActionFactory which is involved in this event
|
||||
*/
|
||||
public ActionFactory getActionFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the prompt involved in this event
|
||||
*
|
||||
* @return Prompt which is involved in this event
|
||||
*/
|
||||
public Prompt getPrompt() {
|
||||
return prompt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
|
@ -1,34 +0,0 @@
|
||||
/*******************************************************************************************************
|
||||
* Continued by PikaMug (formerly HappyPikachu) with permission from _Blackvein_. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************************************/
|
||||
|
||||
package me.blackvein.quests.events.editor.actions;
|
||||
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public class ActionsEditorPostOpenMainPromptEvent extends ActionsEditorEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
public ActionsEditorPostOpenMainPromptEvent(ConversationContext context) {
|
||||
super(context);
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
/*******************************************************************************************************
|
||||
* Continued by PikaMug (formerly HappyPikachu) with permission from _Blackvein_. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************************************/
|
||||
|
||||
package me.blackvein.quests.events.editor.actions;
|
||||
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.actions.ActionFactory;
|
||||
import me.blackvein.quests.convo.actions.ActionsEditorNumericPrompt;
|
||||
|
||||
public class ActionsEditorPostOpenNumericPromptEvent extends ActionsEditorEvent {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private ActionFactory factory;
|
||||
private ActionsEditorNumericPrompt prompt;
|
||||
|
||||
public ActionsEditorPostOpenNumericPromptEvent(ConversationContext context, ActionFactory factory,
|
||||
ActionsEditorNumericPrompt prompt) {
|
||||
super(context, factory, prompt);
|
||||
this.context = context;
|
||||
this.factory = factory;
|
||||
this.prompt = prompt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the context involved in this event
|
||||
*
|
||||
* @return ConversationContext which is involved in this event
|
||||
*/
|
||||
public ConversationContext getConversationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the factory involved in this event
|
||||
*
|
||||
* @return ActionFactory which is involved in this event
|
||||
*/
|
||||
public ActionFactory getActionFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the numeric prompt involved in this event
|
||||
*
|
||||
* @return Prompt which is involved in this event
|
||||
*/
|
||||
public ActionsEditorNumericPrompt getPrompt() {
|
||||
return prompt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
/*******************************************************************************************************
|
||||
* Continued by PikaMug (formerly HappyPikachu) with permission from _Blackvein_. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************************************/
|
||||
|
||||
package me.blackvein.quests.events.editor.actions;
|
||||
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.actions.ActionFactory;
|
||||
import me.blackvein.quests.convo.actions.ActionsEditorStringPrompt;
|
||||
|
||||
public class ActionsEditorPostOpenStringPromptEvent extends ActionsEditorEvent {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private ActionFactory factory;
|
||||
private ActionsEditorStringPrompt prompt;
|
||||
|
||||
public ActionsEditorPostOpenStringPromptEvent(ConversationContext context, ActionFactory factory,
|
||||
ActionsEditorStringPrompt prompt) {
|
||||
super(context, factory, prompt);
|
||||
this.context = context;
|
||||
this.factory = factory;
|
||||
this.prompt = prompt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the context involved in this event
|
||||
*
|
||||
* @return ConversationContext which is involved in this event
|
||||
*/
|
||||
public ConversationContext getConversationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the factory involved in this event
|
||||
*
|
||||
* @return ActionFactory which is involved in this event
|
||||
*/
|
||||
public ActionFactory getActionFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the string prompt involved in this event
|
||||
*
|
||||
* @return Prompt which is involved in this event
|
||||
*/
|
||||
public ActionsEditorStringPrompt getPrompt() {
|
||||
return prompt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
@ -14,24 +14,31 @@ package me.blackvein.quests.events.editor.quests;
|
||||
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.Prompt;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
import me.blackvein.quests.events.QuestsEvent;
|
||||
|
||||
/**
|
||||
* Represents a Quests Editor-related event
|
||||
*/
|
||||
public abstract class QuestsEditorEvent extends QuestsEvent {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
protected ConversationContext context;
|
||||
protected QuestFactory factory;
|
||||
protected Prompt prompt;
|
||||
|
||||
public QuestsEditorEvent(final ConversationContext context, final Prompt prompt) {
|
||||
public QuestsEditorEvent(final ConversationContext context, QuestFactory factory, final Prompt prompt) {
|
||||
this.context = context;
|
||||
this.factory = factory;
|
||||
this.prompt = prompt;
|
||||
}
|
||||
|
||||
public QuestsEditorEvent(final ConversationContext context, final Prompt prompt, boolean async) {
|
||||
public QuestsEditorEvent(final ConversationContext context, QuestFactory factory, final Prompt prompt,
|
||||
boolean async) {
|
||||
super(async);
|
||||
this.context = context;
|
||||
this.factory = factory;
|
||||
this.prompt = prompt;
|
||||
}
|
||||
|
||||
@ -40,10 +47,19 @@ public abstract class QuestsEditorEvent extends QuestsEvent {
|
||||
*
|
||||
* @return ConversationContext which is involved in this event
|
||||
*/
|
||||
public final ConversationContext getConversationContext() {
|
||||
public ConversationContext getConversationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the factory involved in this event
|
||||
*
|
||||
* @return QuestFactory which is involved in this event
|
||||
*/
|
||||
public QuestFactory getQuestFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the prompt involved in this event
|
||||
*
|
||||
@ -52,4 +68,13 @@ public abstract class QuestsEditorEvent extends QuestsEvent {
|
||||
public Prompt getPrompt() {
|
||||
return prompt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
|
@ -15,36 +15,55 @@ package me.blackvein.quests.events.editor.quests;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.prompts.QuestsNumericPrompt;
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||
|
||||
public class QuestsEditorPostOpenNumericPromptEvent extends QuestsEditorEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private QuestFactory factory;
|
||||
private QuestsNumericPrompt prompt;
|
||||
private QuestsEditorNumericPrompt prompt;
|
||||
|
||||
public QuestsEditorPostOpenNumericPromptEvent(ConversationContext context, QuestFactory factory,
|
||||
QuestsNumericPrompt prompt) {
|
||||
super(context, prompt);
|
||||
QuestsEditorNumericPrompt prompt) {
|
||||
super(context, factory, prompt);
|
||||
this.context = context;
|
||||
this.factory = factory;
|
||||
this.prompt = prompt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the context involved in this event
|
||||
*
|
||||
* @return ConversationContext which is involved in this event
|
||||
*/
|
||||
public ConversationContext getConversationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the factory involved in this event
|
||||
*
|
||||
* @return QuestFactory which is involved in this event
|
||||
*/
|
||||
public QuestFactory getQuestFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
public QuestsNumericPrompt getPrompt() {
|
||||
/**
|
||||
* Returns the numeric prompt involved in this event
|
||||
*
|
||||
* @return Prompt which is involved in this event
|
||||
*/
|
||||
public QuestsEditorNumericPrompt getPrompt() {
|
||||
return prompt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
|
@ -15,36 +15,55 @@ package me.blackvein.quests.events.editor.quests;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.prompts.QuestsStringPrompt;
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorStringPrompt;
|
||||
|
||||
public class QuestsEditorPostOpenStringPromptEvent extends QuestsEditorEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private QuestFactory factory;
|
||||
private QuestsStringPrompt prompt;
|
||||
private QuestsEditorStringPrompt prompt;
|
||||
|
||||
public QuestsEditorPostOpenStringPromptEvent(ConversationContext context, QuestFactory factory,
|
||||
QuestsStringPrompt prompt) {
|
||||
super(context, prompt);
|
||||
QuestsEditorStringPrompt prompt) {
|
||||
super(context, factory, prompt);
|
||||
this.context = context;
|
||||
this.factory = factory;
|
||||
this.prompt = prompt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the context involved in this event
|
||||
*
|
||||
* @return ConversationContext which is involved in this event
|
||||
*/
|
||||
public ConversationContext getConversationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the factory involved in this event
|
||||
*
|
||||
* @return QuestFactory which is involved in this event
|
||||
*/
|
||||
public QuestFactory getQuestFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
public QuestsStringPrompt getPrompt() {
|
||||
/**
|
||||
* Returns the string prompt involved in this event
|
||||
*
|
||||
* @return Prompt which is involved in this event
|
||||
*/
|
||||
public QuestsEditorStringPrompt getPrompt() {
|
||||
return prompt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,8 @@
|
||||
|
||||
package me.blackvein.quests.events.quest;
|
||||
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.events.QuestsEvent;
|
||||
|
||||
@ -19,6 +21,7 @@ import me.blackvein.quests.events.QuestsEvent;
|
||||
* Represents a quest-related event
|
||||
*/
|
||||
public abstract class QuestEvent extends QuestsEvent {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
protected Quest quest;
|
||||
|
||||
public QuestEvent(final Quest quest) {
|
||||
@ -38,4 +41,12 @@ public abstract class QuestEvent extends QuestsEvent {
|
||||
public final Quest getQuest() {
|
||||
return quest;
|
||||
}
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ import me.blackvein.quests.Quester;
|
||||
* Called when a quest is quit by a quester
|
||||
*/
|
||||
public class QuestQuitEvent extends QuestEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private Quester quester;
|
||||
private boolean cancel = false;
|
||||
|
||||
@ -51,10 +51,10 @@ public class QuestQuitEvent extends QuestEvent implements Cancellable {
|
||||
}
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ import me.blackvein.quests.Quester;
|
||||
* Called when a quest is taken by a quester
|
||||
*/
|
||||
public class QuestTakeEvent extends QuestEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private Quester quester;
|
||||
private boolean cancel = false;
|
||||
|
||||
@ -51,10 +51,10 @@ public class QuestTakeEvent extends QuestEvent implements Cancellable {
|
||||
}
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,8 @@
|
||||
|
||||
package me.blackvein.quests.events.quester;
|
||||
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.events.QuestsEvent;
|
||||
|
||||
@ -19,6 +21,7 @@ import me.blackvein.quests.events.QuestsEvent;
|
||||
* Represents a quester-related event
|
||||
*/
|
||||
public abstract class QuesterEvent extends QuestsEvent {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
protected Quester quester;
|
||||
|
||||
public QuesterEvent(final Quester quester) {
|
||||
@ -39,4 +42,12 @@ public abstract class QuesterEvent extends QuestsEvent {
|
||||
public final Quester getQuester() {
|
||||
return quester;
|
||||
}
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ import me.blackvein.quests.Stage;
|
||||
* Called after an online quester changes stage
|
||||
*/
|
||||
public class QuesterPostChangeStageEvent extends QuesterEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private Quest quest;
|
||||
private Stage current;
|
||||
private Stage next;
|
||||
@ -52,10 +52,10 @@ public class QuesterPostChangeStageEvent extends QuesterEvent {
|
||||
}
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ import me.blackvein.quests.Quester;
|
||||
* Called after an online quester completes a quest
|
||||
*/
|
||||
public class QuesterPostCompleteQuestEvent extends QuesterEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private Quest quest;
|
||||
|
||||
public QuesterPostCompleteQuestEvent(Quester quester, Quest quest) {
|
||||
@ -39,10 +39,10 @@ public class QuesterPostCompleteQuestEvent extends QuesterEvent {
|
||||
}
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ import me.blackvein.quests.Quester;
|
||||
* Called after a quester fails a quest
|
||||
*/
|
||||
public class QuesterPostFailQuestEvent extends QuesterEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private Quest quest;
|
||||
|
||||
public QuesterPostFailQuestEvent(Quester quester, Quest quest) {
|
||||
@ -39,10 +39,10 @@ public class QuesterPostFailQuestEvent extends QuesterEvent {
|
||||
}
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ import me.blackvein.quests.Quester;
|
||||
* Called after an online quester starts a quest
|
||||
*/
|
||||
public class QuesterPostStartQuestEvent extends QuesterEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private Quest quest;
|
||||
|
||||
public QuesterPostStartQuestEvent(Quester quester, Quest quest) {
|
||||
@ -39,10 +39,10 @@ public class QuesterPostStartQuestEvent extends QuesterEvent {
|
||||
}
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ import me.blackvein.quests.Stage;
|
||||
* Called before an online quester changes stage
|
||||
*/
|
||||
public class QuesterPreChangeStageEvent extends QuesterEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private Quest quest;
|
||||
private Stage current;
|
||||
private Stage next;
|
||||
@ -64,10 +64,10 @@ public class QuesterPreChangeStageEvent extends QuesterEvent implements Cancella
|
||||
}
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ import me.blackvein.quests.Quester;
|
||||
* Called before an online quester completes a quest
|
||||
*/
|
||||
public class QuesterPreCompleteQuestEvent extends QuesterEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private Quest quest;
|
||||
private boolean cancel = false;
|
||||
|
||||
@ -51,10 +51,10 @@ public class QuesterPreCompleteQuestEvent extends QuesterEvent implements Cancel
|
||||
}
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ import me.blackvein.quests.Quester;
|
||||
* Called before a quester fails a quest
|
||||
*/
|
||||
public class QuesterPreFailQuestEvent extends QuesterEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private Quest quest;
|
||||
private boolean cancel = false;
|
||||
|
||||
@ -51,10 +51,10 @@ public class QuesterPreFailQuestEvent extends QuesterEvent implements Cancellabl
|
||||
}
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ import net.citizensnpcs.api.npc.NPC;
|
||||
* Called before a quester opens a quest selection GUI
|
||||
*/
|
||||
public class QuesterPreOpenGUIEvent extends QuesterEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private NPC npc;
|
||||
LinkedList<Quest> quests;
|
||||
private boolean cancel = false;
|
||||
@ -65,10 +65,10 @@ public class QuesterPreOpenGUIEvent extends QuesterEvent implements Cancellable
|
||||
}
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ import me.blackvein.quests.Quester;
|
||||
* Called before a quester starts a quest
|
||||
*/
|
||||
public class QuesterPreStartQuestEvent extends QuesterEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private Quest quest;
|
||||
private boolean cancel = false;
|
||||
|
||||
@ -51,10 +51,10 @@ public class QuesterPreStartQuestEvent extends QuesterEvent implements Cancellab
|
||||
}
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user