diff --git a/main/src/main/java/me/blackvein/quests/QuestFactory.java b/main/src/main/java/me/blackvein/quests/QuestFactory.java index 551007171..4f800f5bf 100644 --- a/main/src/main/java/me/blackvein/quests/QuestFactory.java +++ b/main/src/main/java/me/blackvein/quests/QuestFactory.java @@ -57,7 +57,7 @@ import me.blackvein.quests.prompts.OptionsPrompt; import me.blackvein.quests.prompts.RequirementsPrompt; import me.blackvein.quests.prompts.RewardsPrompt; import me.blackvein.quests.prompts.PlannerPrompt; -import me.blackvein.quests.prompts.StagesPrompt; +import me.blackvein.quests.prompts.StageMenuPrompt; import me.blackvein.quests.util.CK; import me.blackvein.quests.util.ConfigUtil; import me.blackvein.quests.util.ItemUtil; @@ -475,7 +475,7 @@ public class QuestFactory implements ConversationAbandonedListener { case 10: return new PlannerPrompt(plugin, QuestFactory.this); case 11: - return new StagesPrompt(plugin, QuestFactory.this); + return new StageMenuPrompt(plugin, QuestFactory.this); case 12: return new RewardsPrompt(plugin, QuestFactory.this); case 13: @@ -1356,7 +1356,7 @@ public class QuestFactory implements ConversationAbandonedListener { } else if (context.getSessionData(CK.Q_FINISH_MESSAGE) == null) { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorNeedFinishMessage")); return new QuestMainPrompt(); - } else if (new StagesPrompt(plugin, QuestFactory.this).getStages(context) == 0) { + } else if (new StageMenuPrompt(plugin, QuestFactory.this).getStages(context) == 0) { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorNeedStages")); return new QuestMainPrompt(); } @@ -1754,7 +1754,7 @@ public class QuestFactory implements ConversationAbandonedListener { String delayMessage; String startMessage; String completeMessage; - for (int i = 1; i <= new StagesPrompt(plugin, this).getStages(cc); i++) { + for (int i = 1; i <= new StageMenuPrompt(plugin, this).getStages(cc); i++) { pref = "stage" + i; ConfigurationSection stage = ordered.createSection("" + i); breakNames = null; diff --git a/main/src/main/java/me/blackvein/quests/events/editor/quests/QuestsEditorPostOpenCreateStagePromptEvent.java b/main/src/main/java/me/blackvein/quests/events/editor/quests/QuestsEditorPostOpenStageMainPromptEvent.java similarity index 76% rename from main/src/main/java/me/blackvein/quests/events/editor/quests/QuestsEditorPostOpenCreateStagePromptEvent.java rename to main/src/main/java/me/blackvein/quests/events/editor/quests/QuestsEditorPostOpenStageMainPromptEvent.java index f6875794a..5295c8020 100644 --- a/main/src/main/java/me/blackvein/quests/events/editor/quests/QuestsEditorPostOpenCreateStagePromptEvent.java +++ b/main/src/main/java/me/blackvein/quests/events/editor/quests/QuestsEditorPostOpenStageMainPromptEvent.java @@ -5,12 +5,12 @@ import org.bukkit.event.HandlerList; import me.blackvein.quests.QuestFactory; -public class QuestsEditorPostOpenCreateStagePromptEvent extends QuestsEditorEvent { +public class QuestsEditorPostOpenStageMainPromptEvent extends QuestsEditorEvent { private static final HandlerList handlers = new HandlerList(); private final QuestFactory factory; private final int stageNum; - public QuestsEditorPostOpenCreateStagePromptEvent(QuestFactory factory, int stageNum, ConversationContext context) { + public QuestsEditorPostOpenStageMainPromptEvent(QuestFactory factory, int stageNum, ConversationContext context) { super(context); this.context = context; this.factory = factory; diff --git a/main/src/main/java/me/blackvein/quests/events/editor/quests/QuestsEditorPostOpenStagesPromptEvent.java b/main/src/main/java/me/blackvein/quests/events/editor/quests/QuestsEditorPostOpenStageMenuPromptEvent.java similarity index 74% rename from main/src/main/java/me/blackvein/quests/events/editor/quests/QuestsEditorPostOpenStagesPromptEvent.java rename to main/src/main/java/me/blackvein/quests/events/editor/quests/QuestsEditorPostOpenStageMenuPromptEvent.java index c2e26c8a7..91438d2cc 100644 --- a/main/src/main/java/me/blackvein/quests/events/editor/quests/QuestsEditorPostOpenStagesPromptEvent.java +++ b/main/src/main/java/me/blackvein/quests/events/editor/quests/QuestsEditorPostOpenStageMenuPromptEvent.java @@ -5,11 +5,11 @@ import org.bukkit.event.HandlerList; import me.blackvein.quests.QuestFactory; -public class QuestsEditorPostOpenStagesPromptEvent extends QuestsEditorEvent { +public class QuestsEditorPostOpenStageMenuPromptEvent extends QuestsEditorEvent { private static final HandlerList handlers = new HandlerList(); private final QuestFactory factory; - public QuestsEditorPostOpenStagesPromptEvent(QuestFactory factory, ConversationContext context) { + public QuestsEditorPostOpenStageMenuPromptEvent(QuestFactory factory, ConversationContext context) { super(context); this.context = context; this.factory = factory; diff --git a/main/src/main/java/me/blackvein/quests/prompts/BlocksPrompt.java b/main/src/main/java/me/blackvein/quests/prompts/BlocksPrompt.java index 781ffad37..cfa54eddd 100644 --- a/main/src/main/java/me/blackvein/quests/prompts/BlocksPrompt.java +++ b/main/src/main/java/me/blackvein/quests/prompts/BlocksPrompt.java @@ -131,7 +131,7 @@ public class BlocksPrompt extends FixedSetPrompt { return new CutBlockListPrompt(); } try { - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } catch (Exception e) { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError")); return Prompt.END_OF_CONVERSATION; diff --git a/main/src/main/java/me/blackvein/quests/prompts/ItemsPrompt.java b/main/src/main/java/me/blackvein/quests/prompts/ItemsPrompt.java index 9065cf72d..75f8d8f8b 100644 --- a/main/src/main/java/me/blackvein/quests/prompts/ItemsPrompt.java +++ b/main/src/main/java/me/blackvein/quests/prompts/ItemsPrompt.java @@ -132,7 +132,7 @@ public class ItemsPrompt extends FixedSetPrompt { return new BrewListPrompt(); } try { - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } catch (Exception e) { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError")); return Prompt.END_OF_CONVERSATION; diff --git a/main/src/main/java/me/blackvein/quests/prompts/MobsPrompt.java b/main/src/main/java/me/blackvein/quests/prompts/MobsPrompt.java index 86c1e71b6..e7f512f22 100644 --- a/main/src/main/java/me/blackvein/quests/prompts/MobsPrompt.java +++ b/main/src/main/java/me/blackvein/quests/prompts/MobsPrompt.java @@ -138,7 +138,7 @@ public class MobsPrompt extends FixedSetPrompt { return new ShearListPrompt(); } try { - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } catch (Exception e) { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError")); return Prompt.END_OF_CONVERSATION; @@ -302,13 +302,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 CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } else { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize")); return new MobListPrompt(); } } else { - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } } else { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize")); @@ -540,7 +540,7 @@ public class MobsPrompt extends FixedSetPrompt { } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { context.setSessionData(pref + CK.S_FISH, null); } - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } } @@ -617,7 +617,7 @@ public class MobsPrompt extends FixedSetPrompt { two = 0; } if (one == two) { - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } else { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize")); return new TameListPrompt(); @@ -787,7 +787,7 @@ public class MobsPrompt extends FixedSetPrompt { two = 0; } if (one == two) { - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } else { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize")); return new ShearListPrompt(); diff --git a/main/src/main/java/me/blackvein/quests/prompts/NPCsPrompt.java b/main/src/main/java/me/blackvein/quests/prompts/NPCsPrompt.java index 84f8eb3d6..6c97be935 100644 --- a/main/src/main/java/me/blackvein/quests/prompts/NPCsPrompt.java +++ b/main/src/main/java/me/blackvein/quests/prompts/NPCsPrompt.java @@ -127,25 +127,25 @@ public class NPCsPrompt extends FixedSetPrompt { return new DeliveryListPrompt(); } else { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNoCitizens")); - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } } else if (input.equalsIgnoreCase("2")) { if (plugin.getDependencies().getCitizens() != null) { return new NPCIDsToTalkToPrompt(); } else { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNoCitizens")); - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } } else if (input.equalsIgnoreCase("3")) { if (plugin.getDependencies().getCitizens() != null) { return new NPCKillListPrompt(); } else { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNoCitizens")); - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } } try { - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } catch (Exception e) { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError")); return Prompt.END_OF_CONVERSATION; @@ -390,7 +390,7 @@ public class NPCsPrompt extends FixedSetPrompt { } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { context.setSessionData(pref + CK.S_NPCS_TO_TALK_TO, null); } - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } } @@ -469,7 +469,7 @@ public class NPCsPrompt extends FixedSetPrompt { two = 0; } if (one == two) { - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } else { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize")); return new NPCKillListPrompt(); diff --git a/main/src/main/java/me/blackvein/quests/prompts/CreateStagePrompt.java b/main/src/main/java/me/blackvein/quests/prompts/StageMainPrompt.java similarity index 96% rename from main/src/main/java/me/blackvein/quests/prompts/CreateStagePrompt.java rename to main/src/main/java/me/blackvein/quests/prompts/StageMainPrompt.java index 1608b8c5f..55eba24bd 100644 --- a/main/src/main/java/me/blackvein/quests/prompts/CreateStagePrompt.java +++ b/main/src/main/java/me/blackvein/quests/prompts/StageMainPrompt.java @@ -34,13 +34,13 @@ 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.events.editor.quests.QuestsEditorPostOpenCreateStagePromptEvent; +import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenStageMainPromptEvent; 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 CreateStagePrompt extends NumericPrompt { +public class StageMainPrompt extends NumericPrompt { private final Quests plugin; private final int stageNum; @@ -49,7 +49,7 @@ public class CreateStagePrompt extends NumericPrompt { private boolean hasObjective = false; private final int size = 17; - public CreateStagePrompt(Quests plugin, int stageNum, QuestFactory qf) { + public StageMainPrompt(Quests plugin, int stageNum, QuestFactory qf) { this.plugin = plugin; this.stageNum = stageNum; this.pref = "stage" + stageNum; @@ -401,8 +401,8 @@ public class CreateStagePrompt extends NumericPrompt { context.setSessionData(pref, Boolean.TRUE); checkObjective(context); - QuestsEditorPostOpenCreateStagePromptEvent event - = new QuestsEditorPostOpenCreateStagePromptEvent(questFactory, stageNum, context); + QuestsEditorPostOpenStageMainPromptEvent event + = new QuestsEditorPostOpenStageMainPromptEvent(questFactory, stageNum, context); plugin.getServer().getPluginManager().callEvent(event); String text = ChatColor.LIGHT_PURPLE + "- " + ChatColor.AQUA @@ -438,32 +438,32 @@ public class CreateStagePrompt extends NumericPrompt { return new EventListPrompt(); } else { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption")); - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } case 10: if (hasObjective) { return new DelayPrompt(); } else { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption")); - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } case 11: if (context.getSessionData(pref + CK.S_DELAY) == null) { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNoDelaySet")); - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } else { return new DelayMessagePrompt(); } case 12: if (plugin.getDependencies().getDenizenAPI() == null) { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNoDenizen")); - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } else { if (hasObjective) { return new DenizenPrompt(); } else { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption")); - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } } case 13: @@ -471,28 +471,28 @@ public class CreateStagePrompt extends NumericPrompt { return new StartMessagePrompt(); } else { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption")); - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } case 14: if (hasObjective) { return new CompleteMessagePrompt(); } else { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption")); - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } case 15: if (hasObjective) { return new OverrideDisplayPrompt(); } else { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption")); - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } case 16: return new DeletePrompt(); case 17: - return new StagesPrompt(plugin, questFactory); + return new StageMenuPrompt(plugin, questFactory); default: - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } } @@ -616,7 +616,7 @@ public class CreateStagePrompt extends NumericPrompt { two = 0; } if (one == two) { - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } else { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize")); return new PasswordListPrompt(); @@ -713,7 +713,7 @@ public class CreateStagePrompt extends NumericPrompt { context.setSessionData(pref + CK.S_OVERRIDE_DISPLAY, null); context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("stageEditorObjectiveOverrideCleared")); } - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } } @@ -744,7 +744,7 @@ public class CreateStagePrompt extends NumericPrompt { } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { context.setSessionData(pref + CK.S_PLAYER_KILL, null); } - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } } @@ -850,7 +850,7 @@ public class CreateStagePrompt extends NumericPrompt { three = 0; } if (one == two && two == three) { - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } else { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize")); return new ReachListPrompt(); @@ -1061,7 +1061,7 @@ public class CreateStagePrompt extends NumericPrompt { } else if (input.equalsIgnoreCase("6")) { return new CommandEventPrompt(); } else if (input.equalsIgnoreCase("7")) { - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } else { return new EventListPrompt(); } @@ -1451,12 +1451,12 @@ public class CreateStagePrompt extends NumericPrompt { public Prompt acceptInput(ConversationContext context, String input) { Player player = (Player) context.getForWhom(); if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) { - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { context.setSessionData(pref + CK.S_DELAY, null); player.sendMessage(ChatColor.GREEN + Lang.get("stageEditorDelayCleared")); - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } long stageDelay; try { @@ -1471,7 +1471,7 @@ public class CreateStagePrompt extends NumericPrompt { return new DelayPrompt(); } else { context.setSessionData(pref + CK.S_DELAY, stageDelay); - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } } } @@ -1489,11 +1489,11 @@ public class CreateStagePrompt extends NumericPrompt { if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false && input.equalsIgnoreCase(Lang.get("cmdClear")) == false) { context.setSessionData(pref + CK.S_DELAY_MESSAGE, input); - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { context.setSessionData(pref + CK.S_DELAY_MESSAGE, null); player.sendMessage(ChatColor.YELLOW + Lang.get("stageEditorMessageCleared")); - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } else { return new DelayMessagePrompt(); } @@ -1518,7 +1518,7 @@ public class CreateStagePrompt extends NumericPrompt { && input.equalsIgnoreCase(Lang.get("cmdClear")) == false) { if (plugin.getDependencies().getDenizenAPI().containsScript(input)) { context.setSessionData(pref + CK.S_DENIZEN, input.toUpperCase()); - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } else { player.sendMessage(ChatColor.RED + Lang.get("stageEditorInvalidScript")); return new DenizenPrompt(); @@ -1526,9 +1526,9 @@ public class CreateStagePrompt extends NumericPrompt { } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { context.setSessionData(pref + CK.S_DENIZEN, null); player.sendMessage(ChatColor.YELLOW + Lang.get("stageEditorDenizenCleared")); - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } else { - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } } } @@ -1550,11 +1550,11 @@ public class CreateStagePrompt extends NumericPrompt { public Prompt acceptInput(ConversationContext context, String input) { Player player = (Player) context.getForWhom(); if (input.equalsIgnoreCase("1") || input.equalsIgnoreCase("Yes")) { - new StagesPrompt(plugin, questFactory).deleteStage(context, stageNum); + new StageMenuPrompt(plugin, questFactory).deleteStage(context, stageNum); player.sendMessage(ChatColor.YELLOW + Lang.get("stageEditorDeleteSucces")); - return new StagesPrompt(plugin, questFactory); + return new StageMenuPrompt(plugin, questFactory); } else if (input.equalsIgnoreCase("2") || input.equalsIgnoreCase("No")) { - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } else { player.sendMessage(ChatColor.RED + Lang.get("invalidOption")); return new DeletePrompt(); @@ -1575,13 +1575,13 @@ public class CreateStagePrompt extends NumericPrompt { if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false && input.equalsIgnoreCase(Lang.get("cmdClear")) == false) { context.setSessionData(pref + CK.S_START_MESSAGE, input); - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { context.setSessionData(pref + CK.S_START_MESSAGE, null); player.sendMessage(ChatColor.YELLOW + Lang.get("stageEditorMessageCleared")); - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } else { - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } } } @@ -1599,13 +1599,13 @@ public class CreateStagePrompt extends NumericPrompt { if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false && input.equalsIgnoreCase(Lang.get("cmdClear")) == false) { context.setSessionData(pref + CK.S_COMPLETE_MESSAGE, input); - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { context.setSessionData(pref + CK.S_COMPLETE_MESSAGE, null); player.sendMessage(ChatColor.YELLOW + Lang.get("stageEditorMessageCleared")); - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } else { - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } } } @@ -1700,7 +1700,7 @@ public class CreateStagePrompt extends NumericPrompt { context.setSessionData(pref + CK.S_CUSTOM_OBJECTIVES_DATA_TEMP, null); context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("stageEditorCustomCleared")); } - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } } @@ -1747,7 +1747,7 @@ public class CreateStagePrompt extends NumericPrompt { context.setSessionData(pref + CK.S_CUSTOM_OBJECTIVES_DATA_DESCRIPTIONS, found.getDescriptions()); return new ObjectiveCustomDataListPrompt(); } else { - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } } catch (NumberFormatException e) { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber") @@ -1841,7 +1841,7 @@ public class CreateStagePrompt extends NumericPrompt { } } context.setSessionData(pref + CK.S_CUSTOM_OBJECTIVES_DATA_DESCRIPTIONS, null); - return new CreateStagePrompt(plugin, stageNum, questFactory); + return new StageMainPrompt(plugin, stageNum, questFactory); } } } diff --git a/main/src/main/java/me/blackvein/quests/prompts/StagesPrompt.java b/main/src/main/java/me/blackvein/quests/prompts/StageMenuPrompt.java similarity index 97% rename from main/src/main/java/me/blackvein/quests/prompts/StagesPrompt.java rename to main/src/main/java/me/blackvein/quests/prompts/StageMenuPrompt.java index 4b010df34..a55e23fcc 100644 --- a/main/src/main/java/me/blackvein/quests/prompts/StagesPrompt.java +++ b/main/src/main/java/me/blackvein/quests/prompts/StageMenuPrompt.java @@ -19,17 +19,17 @@ import org.bukkit.conversations.Prompt; import me.blackvein.quests.QuestFactory; import me.blackvein.quests.Quests; -import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenStagesPromptEvent; +import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenStageMenuPromptEvent; import me.blackvein.quests.util.CK; import me.blackvein.quests.util.Lang; -public class StagesPrompt extends NumericPrompt { +public class StageMenuPrompt extends NumericPrompt { private final Quests plugin; private final QuestFactory questFactory; private int size = 2; - public StagesPrompt(Quests plugin, QuestFactory qf) { + public StageMenuPrompt(Quests plugin, QuestFactory qf) { this.plugin = plugin; questFactory = qf; } @@ -72,7 +72,7 @@ public class StagesPrompt extends NumericPrompt { @Override public String getPromptText(ConversationContext context) { - QuestsEditorPostOpenStagesPromptEvent event = new QuestsEditorPostOpenStagesPromptEvent(questFactory, context); + QuestsEditorPostOpenStageMenuPromptEvent event = new QuestsEditorPostOpenStageMenuPromptEvent(questFactory, context); plugin.getServer().getPluginManager().callEvent(event); String text = ChatColor.LIGHT_PURPLE + "- " + getTitle() + " -\n"; @@ -89,14 +89,14 @@ public class StagesPrompt extends NumericPrompt { int stages = getStages(context); if (i > 0) { if (i < (stages + 1) && i > 0) { - return new CreateStagePrompt(plugin, (i), questFactory); + return new StageMainPrompt(plugin, (i), questFactory); } else if (i == (stages + 1)) { - return new CreateStagePrompt(plugin, (stages + 1), questFactory); + return new StageMainPrompt(plugin, (stages + 1), questFactory); } else if (i == (stages + 2)) { return questFactory.returnToMenu(); } } - return new StagesPrompt(plugin, questFactory); + return new StageMenuPrompt(plugin, questFactory); } public int getStages(ConversationContext context) {