mirror of https://github.com/PikaMug/Quests.git
Refactor prompt names
This commit is contained in:
parent
4a428c014f
commit
656b99703b
|
@ -17,10 +17,10 @@ import me.blackvein.quests.actions.IAction;
|
|||
import me.blackvein.quests.convo.QuestsNumericPrompt;
|
||||
import me.blackvein.quests.convo.actions.ActionsEditorNumericPrompt;
|
||||
import me.blackvein.quests.convo.actions.ActionsEditorStringPrompt;
|
||||
import me.blackvein.quests.convo.actions.tasks.EffectPrompt;
|
||||
import me.blackvein.quests.convo.actions.tasks.PlayerPrompt;
|
||||
import me.blackvein.quests.convo.actions.tasks.TimerPrompt;
|
||||
import me.blackvein.quests.convo.actions.tasks.WeatherPrompt;
|
||||
import me.blackvein.quests.convo.actions.tasks.ActionEffectPrompt;
|
||||
import me.blackvein.quests.convo.actions.tasks.ActionPlayerPrompt;
|
||||
import me.blackvein.quests.convo.actions.tasks.ActionTimerPrompt;
|
||||
import me.blackvein.quests.convo.actions.tasks.ActionWeatherPrompt;
|
||||
import me.blackvein.quests.convo.generic.ItemStackPrompt;
|
||||
import me.blackvein.quests.entity.BukkitQuestMob;
|
||||
import me.blackvein.quests.events.editor.actions.ActionsEditorPostOpenNumericPromptEvent;
|
||||
|
@ -203,13 +203,13 @@ public class ActionMainPrompt extends ActionsEditorNumericPrompt {
|
|||
case 1:
|
||||
return new ActionNamePrompt(context);
|
||||
case 2:
|
||||
return new PlayerPrompt(context);
|
||||
return new ActionPlayerPrompt(context);
|
||||
case 3:
|
||||
return new TimerPrompt(context);
|
||||
return new ActionTimerPrompt(context);
|
||||
case 4:
|
||||
return new EffectPrompt(context);
|
||||
return new ActionEffectPrompt(context);
|
||||
case 5:
|
||||
return new WeatherPrompt(context);
|
||||
return new ActionWeatherPrompt(context);
|
||||
case 6:
|
||||
return new ActionMobListPrompt(context);
|
||||
case 7:
|
||||
|
@ -1141,7 +1141,8 @@ public class ActionMainPrompt extends ActionsEditorNumericPrompt {
|
|||
public String getTitle(final ConversationContext context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public ChatColor getNumberColor(final ConversationContext context, final int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
|
@ -1152,7 +1153,8 @@ public class ActionMainPrompt extends ActionsEditorNumericPrompt {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public String getSelectionText(final ConversationContext context, final int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
|
@ -1229,7 +1231,8 @@ public class ActionMainPrompt extends ActionsEditorNumericPrompt {
|
|||
public String getTitle(final ConversationContext context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public ChatColor getNumberColor(final ConversationContext context, final int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
|
@ -1240,7 +1243,8 @@ public class ActionMainPrompt extends ActionsEditorNumericPrompt {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public String getSelectionText(final ConversationContext context, final int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
|
|
|
@ -292,7 +292,7 @@ public class ActionMenuPrompt extends ActionsEditorNumericPrompt {
|
|||
return null;
|
||||
}
|
||||
if (!input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
final LinkedList<String> used = new LinkedList<String>();
|
||||
final LinkedList<String> used = new LinkedList<>();
|
||||
final IAction a = plugin.getAction(input);
|
||||
if (a != null) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
|
@ -342,7 +342,8 @@ public class ActionMenuPrompt extends ActionsEditorNumericPrompt {
|
|||
public String getTitle(final ConversationContext context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public ChatColor getNumberColor(final ConversationContext context, final int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
|
@ -353,7 +354,8 @@ public class ActionMenuPrompt extends ActionsEditorNumericPrompt {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public String getSelectionText(final ConversationContext context, final int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
|
|
|
@ -37,11 +37,11 @@ import java.util.Map;
|
|||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
public class EffectPrompt extends ActionsEditorNumericPrompt {
|
||||
public class ActionEffectPrompt extends ActionsEditorNumericPrompt {
|
||||
|
||||
private final Quests plugin;
|
||||
|
||||
public EffectPrompt(final ConversationContext context) {
|
||||
public ActionEffectPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
this.plugin = (Quests)context.getPlugin();
|
||||
}
|
||||
|
@ -145,27 +145,27 @@ public class EffectPrompt extends ActionsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
return new EffectSoundListPrompt(context);
|
||||
return new ActionEffectSoundListPrompt(context);
|
||||
case 2:
|
||||
if (context.getForWhom() instanceof Player) {
|
||||
final Map<UUID, Block> selectedExplosionLocations = plugin.getActionFactory().getSelectedExplosionLocations();
|
||||
selectedExplosionLocations.put(((Player) context.getForWhom()).getUniqueId(), null);
|
||||
plugin.getActionFactory().setSelectedExplosionLocations(selectedExplosionLocations);
|
||||
return new EffectExplosionPrompt(context);
|
||||
return new ActionEffectExplosionPrompt(context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("consoleError"));
|
||||
return new EffectPrompt(context);
|
||||
return new ActionEffectPrompt(context);
|
||||
}
|
||||
case 3:
|
||||
return new ActionMainPrompt(context);
|
||||
default:
|
||||
return new EffectPrompt(context);
|
||||
return new ActionEffectPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class EffectSoundListPrompt extends ActionsEditorNumericPrompt {
|
||||
public class ActionEffectSoundListPrompt extends ActionsEditorNumericPrompt {
|
||||
|
||||
public EffectSoundListPrompt(final ConversationContext context) {
|
||||
public ActionEffectSoundListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
|
||||
}
|
||||
|
@ -265,27 +265,27 @@ public class EffectPrompt extends ActionsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
return new EffectSoundPrompt(context);
|
||||
return new ActionEffectSoundPrompt(context);
|
||||
case 2:
|
||||
if (context.getSessionData(CK.E_EFFECTS) == null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorMustAddEffects"));
|
||||
return new EffectSoundListPrompt(context);
|
||||
return new ActionEffectSoundListPrompt(context);
|
||||
} else {
|
||||
if (context.getForWhom() instanceof Player) {
|
||||
final Map<UUID, Block> selectedEffectLocations = plugin.getActionFactory().getSelectedEffectLocations();
|
||||
selectedEffectLocations.put(((Player) context.getForWhom()).getUniqueId(), null);
|
||||
plugin.getActionFactory().setSelectedEffectLocations(selectedEffectLocations);
|
||||
return new EffectSoundLocationPrompt(context);
|
||||
return new ActionEffectSoundLocationPrompt(context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("consoleError"));
|
||||
return new EffectSoundListPrompt(context);
|
||||
return new ActionEffectSoundListPrompt(context);
|
||||
}
|
||||
}
|
||||
case 3:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("eventEditorEffectsCleared"));
|
||||
context.setSessionData(CK.E_EFFECTS, null);
|
||||
context.setSessionData(CK.E_EFFECTS_LOCATIONS, null);
|
||||
return new EffectSoundListPrompt(context);
|
||||
return new ActionEffectSoundListPrompt(context);
|
||||
case 4:
|
||||
final int one;
|
||||
final int two;
|
||||
|
@ -305,17 +305,17 @@ public class EffectPrompt extends ActionsEditorNumericPrompt {
|
|||
return new ActionMainPrompt(context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new EffectSoundListPrompt(context);
|
||||
return new ActionEffectSoundListPrompt(context);
|
||||
}
|
||||
default:
|
||||
return new EffectSoundListPrompt(context);
|
||||
return new ActionEffectSoundListPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class EffectSoundPrompt extends ActionsEditorStringPrompt {
|
||||
public class ActionEffectSoundPrompt extends ActionsEditorStringPrompt {
|
||||
|
||||
public EffectSoundPrompt(final ConversationContext context) {
|
||||
public ActionEffectSoundPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -371,11 +371,11 @@ public class EffectPrompt extends ActionsEditorNumericPrompt {
|
|||
selectedEffectLocations.remove(((Player)context.getForWhom()).getUniqueId());
|
||||
plugin.getActionFactory().setSelectedEffectLocations(selectedEffectLocations);
|
||||
}
|
||||
return new EffectSoundListPrompt(context);
|
||||
return new ActionEffectSoundListPrompt(context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorInvalidEffect")
|
||||
.replace("<input>", input));
|
||||
return new EffectSoundPrompt(context);
|
||||
return new ActionEffectSoundPrompt(context);
|
||||
}
|
||||
} else {
|
||||
if (context.getForWhom() instanceof Player) {
|
||||
|
@ -384,14 +384,14 @@ public class EffectPrompt extends ActionsEditorNumericPrompt {
|
|||
selectedEffectLocations.remove(((Player)context.getForWhom()).getUniqueId());
|
||||
plugin.getActionFactory().setSelectedEffectLocations(selectedEffectLocations);
|
||||
}
|
||||
return new EffectSoundListPrompt(context);
|
||||
return new ActionEffectSoundListPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class EffectSoundLocationPrompt extends ActionsEditorStringPrompt {
|
||||
public class ActionEffectSoundLocationPrompt extends ActionsEditorStringPrompt {
|
||||
|
||||
public EffectSoundLocationPrompt(final ConversationContext context) {
|
||||
public ActionEffectSoundLocationPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -439,23 +439,23 @@ public class EffectPrompt extends ActionsEditorNumericPrompt {
|
|||
selectedEffectLocations.remove(player.getUniqueId());
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("eventEditorSelectBlockFirst"));
|
||||
return new EffectSoundLocationPrompt(context);
|
||||
return new ActionEffectSoundLocationPrompt(context);
|
||||
}
|
||||
return new EffectSoundListPrompt(context);
|
||||
return new ActionEffectSoundListPrompt(context);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
final Map<UUID, Block> selectedEffectLocations = plugin.getActionFactory().getSelectedEffectLocations();
|
||||
selectedEffectLocations.remove(player.getUniqueId());
|
||||
plugin.getActionFactory().setSelectedEffectLocations(selectedEffectLocations);
|
||||
return new EffectSoundListPrompt(context);
|
||||
return new ActionEffectSoundListPrompt(context);
|
||||
} else {
|
||||
return new EffectSoundLocationPrompt(context);
|
||||
return new ActionEffectSoundLocationPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class EffectExplosionPrompt extends ActionsEditorStringPrompt {
|
||||
public class ActionEffectExplosionPrompt extends ActionsEditorStringPrompt {
|
||||
|
||||
public EffectExplosionPrompt(final ConversationContext context) {
|
||||
public ActionEffectExplosionPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -504,7 +504,7 @@ public class EffectPrompt extends ActionsEditorNumericPrompt {
|
|||
plugin.getActionFactory().setSelectedExplosionLocations(selectedExplosionLocations);
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("eventEditorSelectBlockFirst"));
|
||||
return new EffectExplosionPrompt(context);
|
||||
return new ActionEffectExplosionPrompt(context);
|
||||
}
|
||||
return new ActionMainPrompt(context);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
|
@ -519,7 +519,7 @@ public class EffectPrompt extends ActionsEditorNumericPrompt {
|
|||
plugin.getActionFactory().setSelectedExplosionLocations(selectedExplosionLocations);
|
||||
return new ActionMainPrompt(context);
|
||||
} else {
|
||||
return new EffectExplosionPrompt(context);
|
||||
return new ActionEffectExplosionPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -42,11 +42,11 @@ import java.util.Map;
|
|||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
||||
public class ActionPlayerPrompt extends ActionsEditorNumericPrompt {
|
||||
|
||||
private final Quests plugin;
|
||||
|
||||
public PlayerPrompt(final ConversationContext context) {
|
||||
public ActionPlayerPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
this.plugin = (Quests)context.getPlugin();
|
||||
}
|
||||
|
@ -233,33 +233,33 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
return new PlayerMessagePrompt(context);
|
||||
return new ActionPlayerMessagePrompt(context);
|
||||
case 2:
|
||||
return new PlayerItemListPrompt(context);
|
||||
return new ActionPlayerItemListPrompt(context);
|
||||
case 3:
|
||||
return new PlayerPotionListPrompt(context);
|
||||
return new ActionPlayerPotionListPrompt(context);
|
||||
case 4:
|
||||
return new PlayerHungerPrompt(context);
|
||||
return new ActionPlayerHungerPrompt(context);
|
||||
case 5:
|
||||
return new PlayerSaturationPrompt(context);
|
||||
return new ActionPlayerSaturationPrompt(context);
|
||||
case 6:
|
||||
return new PlayerHealthPrompt(context);
|
||||
return new ActionPlayerHealthPrompt(context);
|
||||
case 7:
|
||||
if (context.getForWhom() instanceof Player) {
|
||||
final Map<UUID, Block> selectedTeleportLocations = plugin.getActionFactory().getSelectedTeleportLocations();
|
||||
selectedTeleportLocations.put(((Player) context.getForWhom()).getUniqueId(), null);
|
||||
plugin.getActionFactory().setSelectedTeleportLocations(selectedTeleportLocations);
|
||||
return new PlayerTeleportPrompt(context);
|
||||
return new ActionPlayerTeleportPrompt(context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("consoleError"));
|
||||
return new PlayerPrompt(context);
|
||||
return new ActionPlayerPrompt(context);
|
||||
}
|
||||
case 8:
|
||||
if (!plugin.hasLimitedAccess(context.getForWhom())) {
|
||||
return new PlayerCommandsPrompt(context);
|
||||
return new ActionPlayerCommandsPrompt(context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("noPermission"));
|
||||
return new PlayerPrompt(context);
|
||||
return new ActionPlayerPrompt(context);
|
||||
}
|
||||
case 9:
|
||||
final Boolean b = (Boolean) context.getSessionData(CK.E_CLEAR_INVENTORY);
|
||||
|
@ -268,17 +268,17 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||
} else {
|
||||
context.setSessionData(CK.E_CLEAR_INVENTORY, true);
|
||||
}
|
||||
return new PlayerPrompt(context);
|
||||
return new ActionPlayerPrompt(context);
|
||||
case 10:
|
||||
return new ActionMainPrompt(context);
|
||||
default:
|
||||
return new PlayerPrompt(context);
|
||||
return new ActionPlayerPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class PlayerMessagePrompt extends ActionsEditorStringPrompt {
|
||||
public class ActionPlayerMessagePrompt extends ActionsEditorStringPrompt {
|
||||
|
||||
public PlayerMessagePrompt(final ConversationContext context) {
|
||||
public ActionPlayerMessagePrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -315,9 +315,9 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||
}
|
||||
}
|
||||
|
||||
public class PlayerItemListPrompt extends ActionsEditorNumericPrompt {
|
||||
public class ActionPlayerItemListPrompt extends ActionsEditorNumericPrompt {
|
||||
|
||||
public PlayerItemListPrompt(final ConversationContext context) {
|
||||
public ActionPlayerItemListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -421,22 +421,22 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new ItemStackPrompt(context, PlayerItemListPrompt.this);
|
||||
return new ItemStackPrompt(context, ActionPlayerItemListPrompt.this);
|
||||
case 2:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("eventEditorItemsCleared"));
|
||||
context.setSessionData(CK.E_ITEMS, null);
|
||||
return new PlayerItemListPrompt(context);
|
||||
return new ActionPlayerItemListPrompt(context);
|
||||
case 3:
|
||||
return new ActionMainPrompt(context);
|
||||
default:
|
||||
return new PlayerItemListPrompt(context);
|
||||
return new ActionPlayerItemListPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class PlayerPotionListPrompt extends ActionsEditorNumericPrompt {
|
||||
public class ActionPlayerPotionListPrompt extends ActionsEditorNumericPrompt {
|
||||
|
||||
public PlayerPotionListPrompt(final ConversationContext context) {
|
||||
public ActionPlayerPotionListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -553,32 +553,32 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
return new PlayerPotionTypesPrompt(context);
|
||||
return new ActionPlayerPotionTypesPrompt(context);
|
||||
case 2:
|
||||
if (context.getSessionData(CK.E_POTION_TYPES) == null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorMustSetPotionTypesFirst"));
|
||||
return new PlayerPotionListPrompt(context);
|
||||
return new ActionPlayerPotionListPrompt(context);
|
||||
} else {
|
||||
return new PlayerPotionDurationsPrompt(context);
|
||||
return new ActionPlayerPotionDurationsPrompt(context);
|
||||
}
|
||||
case 3:
|
||||
if (context.getSessionData(CK.E_POTION_TYPES) == null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||
+ Lang.get("eventEditorMustSetPotionTypesAndDurationsFirst"));
|
||||
return new PlayerPotionListPrompt(context);
|
||||
return new ActionPlayerPotionListPrompt(context);
|
||||
} else if (context.getSessionData(CK.E_POTION_DURATIONS) == null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||
+ Lang.get("eventEditorMustSetPotionDurationsFirst"));
|
||||
return new PlayerPotionListPrompt(context);
|
||||
return new ActionPlayerPotionListPrompt(context);
|
||||
} else {
|
||||
return new PlayerPotionMagnitudesPrompt(context);
|
||||
return new ActionPlayerPotionMagnitudesPrompt(context);
|
||||
}
|
||||
case 4:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("eventEditorPotionsCleared"));
|
||||
context.setSessionData(CK.E_POTION_TYPES, null);
|
||||
context.setSessionData(CK.E_POTION_DURATIONS, null);
|
||||
context.setSessionData(CK.E_POTION_STRENGTH, null);
|
||||
return new PlayerPotionListPrompt(context);
|
||||
return new ActionPlayerPotionListPrompt(context);
|
||||
case 5:
|
||||
final int one;
|
||||
final int two;
|
||||
|
@ -605,17 +605,17 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||
return new ActionMainPrompt(context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorListSizeMismatch"));
|
||||
return new PlayerPotionListPrompt(context);
|
||||
return new ActionPlayerPotionListPrompt(context);
|
||||
}
|
||||
default:
|
||||
return new PlayerPotionListPrompt(context);
|
||||
return new ActionPlayerPotionListPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class PlayerPotionTypesPrompt extends ActionsEditorStringPrompt {
|
||||
public class ActionPlayerPotionTypesPrompt extends ActionsEditorStringPrompt {
|
||||
|
||||
public PlayerPotionTypesPrompt(final ConversationContext context) {
|
||||
public ActionPlayerPotionTypesPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -661,17 +661,17 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorInvalidPotionType")
|
||||
.replace("<input>", s));
|
||||
return new PlayerPotionTypesPrompt(context);
|
||||
return new ActionPlayerPotionTypesPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
return new PlayerPotionListPrompt(context);
|
||||
return new ActionPlayerPotionListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class PlayerPotionDurationsPrompt extends ActionsEditorStringPrompt {
|
||||
public class ActionPlayerPotionDurationsPrompt extends ActionsEditorStringPrompt {
|
||||
|
||||
public PlayerPotionDurationsPrompt(final ConversationContext context) {
|
||||
public ActionPlayerPotionDurationsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -708,24 +708,24 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||
if (l < 1000) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidMinimum")
|
||||
.replace("<number>", "1"));
|
||||
return new PlayerPotionDurationsPrompt(context);
|
||||
return new ActionPlayerPotionDurationsPrompt(context);
|
||||
}
|
||||
effDurations.add(l / 50L);
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber")
|
||||
.replace("<input>", s));
|
||||
return new PlayerPotionDurationsPrompt(context);
|
||||
return new ActionPlayerPotionDurationsPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(CK.E_POTION_DURATIONS, effDurations);
|
||||
}
|
||||
return new PlayerPotionListPrompt(context);
|
||||
return new ActionPlayerPotionListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class PlayerPotionMagnitudesPrompt extends ActionsEditorStringPrompt {
|
||||
public class ActionPlayerPotionMagnitudesPrompt extends ActionsEditorStringPrompt {
|
||||
|
||||
public PlayerPotionMagnitudesPrompt(final ConversationContext context) {
|
||||
public ActionPlayerPotionMagnitudesPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -761,24 +761,24 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||
if (i < 1) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidMinimum")
|
||||
.replace("<number>", "1"));
|
||||
return new PlayerPotionMagnitudesPrompt(context);
|
||||
return new ActionPlayerPotionMagnitudesPrompt(context);
|
||||
}
|
||||
magAmounts.add(i);
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber")
|
||||
.replace("<input>", s));
|
||||
return new PlayerPotionMagnitudesPrompt(context);
|
||||
return new ActionPlayerPotionMagnitudesPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(CK.E_POTION_STRENGTH, magAmounts);
|
||||
}
|
||||
return new PlayerPotionListPrompt(context);
|
||||
return new ActionPlayerPotionListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class PlayerHungerPrompt extends ActionsEditorStringPrompt {
|
||||
public class ActionPlayerHungerPrompt extends ActionsEditorStringPrompt {
|
||||
|
||||
public PlayerHungerPrompt(final ConversationContext context) {
|
||||
public ActionPlayerHungerPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -812,14 +812,14 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||
if (i < 0) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||
+ Lang.get("invalidMinimum").replace("<number>", "0"));
|
||||
return new PlayerHungerPrompt(context);
|
||||
return new ActionPlayerHungerPrompt(context);
|
||||
} else {
|
||||
context.setSessionData(CK.E_HUNGER, i);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||
+ Lang.get("reqNotANumber").replace("<input>", input));
|
||||
return new PlayerHungerPrompt(context);
|
||||
return new ActionPlayerHungerPrompt(context);
|
||||
}
|
||||
} else {
|
||||
context.setSessionData(CK.E_HUNGER, null);
|
||||
|
@ -828,9 +828,9 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||
}
|
||||
}
|
||||
|
||||
public class PlayerSaturationPrompt extends ActionsEditorStringPrompt {
|
||||
public class ActionPlayerSaturationPrompt extends ActionsEditorStringPrompt {
|
||||
|
||||
public PlayerSaturationPrompt(final ConversationContext context) {
|
||||
public ActionPlayerSaturationPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -864,14 +864,14 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||
if (i < 0) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||
+ Lang.get("invalidMinimum").replace("<number>", "0"));
|
||||
return new PlayerSaturationPrompt(context);
|
||||
return new ActionPlayerSaturationPrompt(context);
|
||||
} else {
|
||||
context.setSessionData(CK.E_SATURATION, i);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||
+ Lang.get("reqNotANumber").replace("<input>", input));
|
||||
return new PlayerSaturationPrompt(context);
|
||||
return new ActionPlayerSaturationPrompt(context);
|
||||
}
|
||||
} else {
|
||||
context.setSessionData(CK.E_SATURATION, null);
|
||||
|
@ -880,9 +880,9 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||
}
|
||||
}
|
||||
|
||||
public class PlayerHealthPrompt extends ActionsEditorStringPrompt {
|
||||
public class ActionPlayerHealthPrompt extends ActionsEditorStringPrompt {
|
||||
|
||||
public PlayerHealthPrompt(final ConversationContext context) {
|
||||
public ActionPlayerHealthPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -916,14 +916,14 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||
if (i < 0) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||
+ Lang.get("invalidMinimum").replace("<number>", "0"));
|
||||
return new PlayerHealthPrompt(context);
|
||||
return new ActionPlayerHealthPrompt(context);
|
||||
} else {
|
||||
context.setSessionData(CK.E_HEALTH, i);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||
+ Lang.get("reqNotANumber").replace("<input>", input));
|
||||
return new PlayerHealthPrompt(context);
|
||||
return new ActionPlayerHealthPrompt(context);
|
||||
}
|
||||
} else {
|
||||
context.setSessionData(CK.E_HEALTH, null);
|
||||
|
@ -932,9 +932,9 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||
}
|
||||
}
|
||||
|
||||
public class PlayerTeleportPrompt extends ActionsEditorStringPrompt {
|
||||
public class ActionPlayerTeleportPrompt extends ActionsEditorStringPrompt {
|
||||
|
||||
public PlayerTeleportPrompt(final ConversationContext context) {
|
||||
public ActionPlayerTeleportPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -974,7 +974,7 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||
plugin.getActionFactory().setSelectedTeleportLocations(selectedTeleportLocations);
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("eventEditorSelectBlockFirst"));
|
||||
return new PlayerTeleportPrompt(context);
|
||||
return new ActionPlayerTeleportPrompt(context);
|
||||
}
|
||||
return new ActionMainPrompt(context);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
|
@ -991,14 +991,14 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||
plugin.getActionFactory().setSelectedTeleportLocations(selectedTeleportLocations);
|
||||
return new ActionMainPrompt(context);
|
||||
} else {
|
||||
return new PlayerTeleportPrompt(context);
|
||||
return new ActionPlayerTeleportPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class PlayerCommandsPrompt extends ActionsEditorStringPrompt {
|
||||
public class ActionPlayerCommandsPrompt extends ActionsEditorStringPrompt {
|
||||
|
||||
public PlayerCommandsPrompt(final ConversationContext context) {
|
||||
public ActionPlayerCommandsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
|
@ -26,11 +26,11 @@ import org.bukkit.conversations.ConversationContext;
|
|||
import org.bukkit.conversations.Prompt;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class TimerPrompt extends ActionsEditorNumericPrompt {
|
||||
public class ActionTimerPrompt extends ActionsEditorNumericPrompt {
|
||||
|
||||
private final Quests plugin;
|
||||
|
||||
public TimerPrompt(final ConversationContext context) {
|
||||
public ActionTimerPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
this.plugin = (Quests)context.getPlugin();
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ public class TimerPrompt extends ActionsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
return new TimerFailPrompt(context);
|
||||
return new ActionTimerFailPrompt(context);
|
||||
case 2:
|
||||
final Boolean b = (Boolean) context.getSessionData(CK.E_CANCEL_TIMER);
|
||||
if (Boolean.TRUE.equals(b)) {
|
||||
|
@ -133,17 +133,17 @@ public class TimerPrompt extends ActionsEditorNumericPrompt {
|
|||
} else {
|
||||
context.setSessionData(CK.E_CANCEL_TIMER, true);
|
||||
}
|
||||
return new TimerPrompt(context);
|
||||
return new ActionTimerPrompt(context);
|
||||
case 3:
|
||||
return new ActionMainPrompt(context);
|
||||
default:
|
||||
return new TimerPrompt(context);
|
||||
return new ActionTimerPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class TimerFailPrompt extends ActionsEditorStringPrompt {
|
||||
public class ActionTimerFailPrompt extends ActionsEditorStringPrompt {
|
||||
|
||||
public TimerFailPrompt(final ConversationContext context) {
|
||||
public ActionTimerFailPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -178,9 +178,9 @@ public class TimerPrompt extends ActionsEditorNumericPrompt {
|
|||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||
+ Lang.get("reqNotANumber").replace("<input>", input));
|
||||
return new TimerFailPrompt(context);
|
||||
return new ActionTimerFailPrompt(context);
|
||||
}
|
||||
return new TimerPrompt(context);
|
||||
return new ActionTimerPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -37,11 +37,11 @@ import java.util.Map;
|
|||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
public class WeatherPrompt extends ActionsEditorNumericPrompt {
|
||||
public class ActionWeatherPrompt extends ActionsEditorNumericPrompt {
|
||||
|
||||
private final Quests plugin;
|
||||
|
||||
public WeatherPrompt(final ConversationContext context) {
|
||||
public ActionWeatherPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
this.plugin = (Quests)context.getPlugin();
|
||||
}
|
||||
|
@ -153,30 +153,30 @@ public class WeatherPrompt extends ActionsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
return new StormPrompt(context);
|
||||
return new ActionStormPrompt(context);
|
||||
case 2:
|
||||
return new ThunderPrompt(context);
|
||||
return new ActionThunderPrompt(context);
|
||||
case 3:
|
||||
if (context.getForWhom() instanceof Player) {
|
||||
final Map<UUID, Block> selectedLightningLocations
|
||||
= plugin.getActionFactory().getSelectedLightningLocations();
|
||||
selectedLightningLocations.put(((Player) context.getForWhom()).getUniqueId(), null);
|
||||
plugin.getActionFactory().setSelectedLightningLocations(selectedLightningLocations);
|
||||
return new LightningPrompt(context);
|
||||
return new ActionLightningPrompt(context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("consoleError"));
|
||||
return new WeatherPrompt(context);
|
||||
return new ActionWeatherPrompt(context);
|
||||
}
|
||||
case 4:
|
||||
return new ActionMainPrompt(context);
|
||||
default:
|
||||
return new WeatherPrompt(context);
|
||||
return new ActionWeatherPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class StormPrompt extends ActionsEditorNumericPrompt {
|
||||
public class ActionStormPrompt extends ActionsEditorNumericPrompt {
|
||||
|
||||
public StormPrompt(final ConversationContext context) {
|
||||
public ActionStormPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -270,33 +270,33 @@ public class WeatherPrompt extends ActionsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
return new StormWorldPrompt(context);
|
||||
return new ActionStormWorldPrompt(context);
|
||||
case 2:
|
||||
if (context.getSessionData(CK.E_WORLD_STORM) == null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorSetWorldFirst"));
|
||||
return new StormPrompt(context);
|
||||
return new ActionStormPrompt(context);
|
||||
} else {
|
||||
return new StormDurationPrompt(context);
|
||||
return new ActionStormDurationPrompt(context);
|
||||
}
|
||||
case 3:
|
||||
if (context.getSessionData(CK.E_WORLD_STORM) != null
|
||||
&& context.getSessionData(CK.E_WORLD_STORM_DURATION) == null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorMustSetStormDuration"));
|
||||
return new StormPrompt(context);
|
||||
return new ActionStormPrompt(context);
|
||||
} else {
|
||||
return new ActionMainPrompt(context);
|
||||
}
|
||||
case 4:
|
||||
return new ActionMainPrompt(context);
|
||||
default:
|
||||
return new StormPrompt(context);
|
||||
return new ActionStormPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class StormWorldPrompt extends ActionsEditorStringPrompt {
|
||||
public class ActionStormWorldPrompt extends ActionsEditorStringPrompt {
|
||||
|
||||
public StormWorldPrompt(final ConversationContext context) {
|
||||
public ActionStormWorldPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -340,16 +340,16 @@ public class WeatherPrompt extends ActionsEditorNumericPrompt {
|
|||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorInvalidWorld")
|
||||
.replace("<input>", input));
|
||||
return new StormWorldPrompt(context);
|
||||
return new ActionStormWorldPrompt(context);
|
||||
}
|
||||
}
|
||||
return new StormPrompt(context);
|
||||
return new ActionStormPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class StormDurationPrompt extends ActionsEditorStringPrompt {
|
||||
public class ActionStormDurationPrompt extends ActionsEditorStringPrompt {
|
||||
|
||||
public StormDurationPrompt(final ConversationContext context) {
|
||||
public ActionStormDurationPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -379,7 +379,7 @@ public class WeatherPrompt extends ActionsEditorNumericPrompt {
|
|||
if (i < 1) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||
+ Lang.get("invalidMinimum").replace("<number>", "1"));
|
||||
return new StormDurationPrompt(context);
|
||||
return new ActionStormDurationPrompt(context);
|
||||
} else {
|
||||
context.setSessionData(CK.E_WORLD_STORM_DURATION, i);
|
||||
}
|
||||
|
@ -387,13 +387,13 @@ public class WeatherPrompt extends ActionsEditorNumericPrompt {
|
|||
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||
+ Lang.get("reqNotANumber").replace("<input>", input));
|
||||
}
|
||||
return new StormPrompt(context);
|
||||
return new ActionStormPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class ThunderPrompt extends ActionsEditorNumericPrompt {
|
||||
public class ActionThunderPrompt extends ActionsEditorNumericPrompt {
|
||||
|
||||
public ThunderPrompt(final ConversationContext context) {
|
||||
public ActionThunderPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -487,36 +487,36 @@ public class WeatherPrompt extends ActionsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
return new ThunderWorldPrompt(context);
|
||||
return new ActionThunderWorldPrompt(context);
|
||||
case 2:
|
||||
if (context.getSessionData(CK.E_WORLD_THUNDER) == null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorSetWorldFirst"));
|
||||
return new ThunderPrompt(context);
|
||||
return new ActionThunderPrompt(context);
|
||||
} else {
|
||||
return new ThunderDurationPrompt(context);
|
||||
return new ActionThunderDurationPrompt(context);
|
||||
}
|
||||
case 3:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("eventEditorThunderCleared"));
|
||||
context.setSessionData(CK.E_WORLD_THUNDER, null);
|
||||
context.setSessionData(CK.E_WORLD_THUNDER_DURATION, null);
|
||||
return new ThunderPrompt(context);
|
||||
return new ActionThunderPrompt(context);
|
||||
case 4:
|
||||
if (context.getSessionData(CK.E_WORLD_THUNDER) != null
|
||||
&& context.getSessionData(CK.E_WORLD_THUNDER_DURATION) == null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorMustSetThunderDuration"));
|
||||
return new ThunderPrompt(context);
|
||||
return new ActionThunderPrompt(context);
|
||||
} else {
|
||||
return new ActionMainPrompt(context);
|
||||
}
|
||||
default:
|
||||
return new ThunderPrompt(context);
|
||||
return new ActionThunderPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ThunderWorldPrompt extends ActionsEditorStringPrompt {
|
||||
public class ActionThunderWorldPrompt extends ActionsEditorStringPrompt {
|
||||
|
||||
public ThunderWorldPrompt(final ConversationContext context) {
|
||||
public ActionThunderWorldPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -560,16 +560,16 @@ public class WeatherPrompt extends ActionsEditorNumericPrompt {
|
|||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorInvalidWorld")
|
||||
.replace("<input>", input));
|
||||
return new ThunderWorldPrompt(context);
|
||||
return new ActionThunderWorldPrompt(context);
|
||||
}
|
||||
}
|
||||
return new ThunderPrompt(context);
|
||||
return new ActionThunderPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class ThunderDurationPrompt extends ActionsEditorStringPrompt {
|
||||
public class ActionThunderDurationPrompt extends ActionsEditorStringPrompt {
|
||||
|
||||
public ThunderDurationPrompt(final ConversationContext context) {
|
||||
public ActionThunderDurationPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -599,7 +599,7 @@ public class WeatherPrompt extends ActionsEditorNumericPrompt {
|
|||
if (i < 1) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||
+ Lang.get("invalidMinimum").replace("<number>", "1"));
|
||||
return new ThunderDurationPrompt(context);
|
||||
return new ActionThunderDurationPrompt(context);
|
||||
} else {
|
||||
context.setSessionData(CK.E_WORLD_THUNDER_DURATION, i);
|
||||
}
|
||||
|
@ -607,13 +607,13 @@ public class WeatherPrompt extends ActionsEditorNumericPrompt {
|
|||
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||
+ Lang.get("reqNotANumber").replace("<input>", input));
|
||||
}
|
||||
return new ThunderPrompt(context);
|
||||
return new ActionThunderPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class LightningPrompt extends ActionsEditorStringPrompt {
|
||||
public class ActionLightningPrompt extends ActionsEditorStringPrompt {
|
||||
|
||||
public LightningPrompt(final ConversationContext context) {
|
||||
public ActionLightningPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -663,7 +663,7 @@ public class WeatherPrompt extends ActionsEditorNumericPrompt {
|
|||
plugin.getActionFactory().setSelectedLightningLocations(selectedLightningLocations);
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("eventEditorSelectBlockFirst"));
|
||||
return new LightningPrompt(context);
|
||||
return new ActionLightningPrompt(context);
|
||||
}
|
||||
return new ActionMainPrompt(context);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
|
@ -680,7 +680,7 @@ public class WeatherPrompt extends ActionsEditorNumericPrompt {
|
|||
plugin.getActionFactory().setSelectedLightningLocations(selectedLightningLocations);
|
||||
return new ActionMainPrompt(context);
|
||||
} else {
|
||||
return new LightningPrompt(context);
|
||||
return new ActionLightningPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -19,9 +19,9 @@ import me.blackvein.quests.quests.IStage;
|
|||
import me.blackvein.quests.convo.QuestsNumericPrompt;
|
||||
import me.blackvein.quests.convo.conditions.ConditionsEditorNumericPrompt;
|
||||
import me.blackvein.quests.convo.conditions.ConditionsEditorStringPrompt;
|
||||
import me.blackvein.quests.convo.conditions.tasks.EntityPrompt;
|
||||
import me.blackvein.quests.convo.conditions.tasks.PlayerPrompt;
|
||||
import me.blackvein.quests.convo.conditions.tasks.WorldPrompt;
|
||||
import me.blackvein.quests.convo.conditions.tasks.ConditionEntityPrompt;
|
||||
import me.blackvein.quests.convo.conditions.tasks.ConditionPlayerPrompt;
|
||||
import me.blackvein.quests.convo.conditions.tasks.ConditionWorldPrompt;
|
||||
import me.blackvein.quests.events.editor.conditions.ConditionsEditorPostOpenNumericPromptEvent;
|
||||
import me.blackvein.quests.events.editor.conditions.ConditionsEditorPostOpenStringPromptEvent;
|
||||
import me.blackvein.quests.util.CK;
|
||||
|
@ -146,11 +146,11 @@ public class ConditionMainPrompt extends ConditionsEditorNumericPrompt {
|
|||
case 1:
|
||||
return new ConditionNamePrompt(context);
|
||||
case 2:
|
||||
return new EntityPrompt(context);
|
||||
return new ConditionEntityPrompt(context);
|
||||
case 3:
|
||||
return new PlayerPrompt(context);
|
||||
return new ConditionPlayerPrompt(context);
|
||||
case 4:
|
||||
return new WorldPrompt(context);
|
||||
return new ConditionWorldPrompt(context);
|
||||
case 5:
|
||||
return new ConditionPlaceholderListPrompt(context);
|
||||
case 6:
|
||||
|
@ -508,7 +508,8 @@ public class ConditionMainPrompt extends ConditionsEditorNumericPrompt {
|
|||
public String getTitle(final ConversationContext context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public ChatColor getNumberColor(final ConversationContext context, final int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
|
@ -519,7 +520,8 @@ public class ConditionMainPrompt extends ConditionsEditorNumericPrompt {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public String getSelectionText(final ConversationContext context, final int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
|
@ -594,7 +596,8 @@ public class ConditionMainPrompt extends ConditionsEditorNumericPrompt {
|
|||
public String getTitle(final ConversationContext context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public ChatColor getNumberColor(final ConversationContext context, final int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
|
@ -605,7 +608,8 @@ public class ConditionMainPrompt extends ConditionsEditorNumericPrompt {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public String getSelectionText(final ConversationContext context, final int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
|
|
|
@ -343,7 +343,8 @@ public class ConditionMenuPrompt extends ConditionsEditorNumericPrompt {
|
|||
public String getTitle(final ConversationContext context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public ChatColor getNumberColor(final ConversationContext context, final int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
|
@ -354,7 +355,8 @@ public class ConditionMenuPrompt extends ConditionsEditorNumericPrompt {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public String getSelectionText(final ConversationContext context, final int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
|
|
|
@ -16,12 +16,8 @@ import me.blackvein.quests.Quests;
|
|||
import me.blackvein.quests.convo.conditions.ConditionsEditorNumericPrompt;
|
||||
import me.blackvein.quests.convo.conditions.ConditionsEditorStringPrompt;
|
||||
import me.blackvein.quests.convo.conditions.main.ConditionMainPrompt;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorStringPrompt;
|
||||
import me.blackvein.quests.events.editor.conditions.ConditionsEditorPostOpenNumericPromptEvent;
|
||||
import me.blackvein.quests.events.editor.conditions.ConditionsEditorPostOpenStringPromptEvent;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenNumericPromptEvent;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenStringPromptEvent;
|
||||
import me.blackvein.quests.util.CK;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import me.blackvein.quests.util.MiscUtil;
|
||||
|
@ -40,11 +36,11 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public class EntityPrompt extends ConditionsEditorNumericPrompt {
|
||||
public class ConditionEntityPrompt extends ConditionsEditorNumericPrompt {
|
||||
|
||||
private final Quests plugin;
|
||||
|
||||
public EntityPrompt(final ConversationContext context) {
|
||||
public ConditionEntityPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
this.plugin = (Quests)context.getPlugin();
|
||||
}
|
||||
|
@ -152,7 +148,7 @@ public class EntityPrompt extends ConditionsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new EntitiesPrompt(context);
|
||||
return new ConditionEntitiesPrompt(context);
|
||||
case 2:
|
||||
return new ConditionNpcsPrompt(context);
|
||||
case 3:
|
||||
|
@ -163,13 +159,13 @@ public class EntityPrompt extends ConditionsEditorNumericPrompt {
|
|||
return Prompt.END_OF_CONVERSATION;
|
||||
}
|
||||
default:
|
||||
return new EntityPrompt(context);
|
||||
return new ConditionEntityPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class EntitiesPrompt extends ConditionsEditorStringPrompt {
|
||||
public class ConditionEntitiesPrompt extends ConditionsEditorStringPrompt {
|
||||
|
||||
public EntitiesPrompt(final ConversationContext context) {
|
||||
public ConditionEntitiesPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -228,16 +224,16 @@ public class EntityPrompt extends ConditionsEditorNumericPrompt {
|
|||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidMob")
|
||||
.replace("<input>", s));
|
||||
return new EntitiesPrompt(context);
|
||||
return new ConditionEntitiesPrompt(context);
|
||||
}
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidMob")
|
||||
.replace("<input>", s));
|
||||
return new EntitiesPrompt(context);
|
||||
return new ConditionEntitiesPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
return new EntityPrompt(context);
|
||||
return new ConditionEntityPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -306,7 +302,7 @@ public class EntityPrompt extends ConditionsEditorNumericPrompt {
|
|||
selectingNpcs.remove(((Player) context.getForWhom()).getUniqueId());
|
||||
plugin.getQuestFactory().setSelectingNpcs(selectingNpcs);
|
||||
}
|
||||
return new EntityPrompt(context);
|
||||
return new ConditionEntityPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -16,12 +16,8 @@ import me.blackvein.quests.convo.conditions.ConditionsEditorNumericPrompt;
|
|||
import me.blackvein.quests.convo.conditions.ConditionsEditorStringPrompt;
|
||||
import me.blackvein.quests.convo.conditions.main.ConditionMainPrompt;
|
||||
import me.blackvein.quests.convo.generic.ItemStackPrompt;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorStringPrompt;
|
||||
import me.blackvein.quests.events.editor.conditions.ConditionsEditorPostOpenNumericPromptEvent;
|
||||
import me.blackvein.quests.events.editor.conditions.ConditionsEditorPostOpenStringPromptEvent;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenNumericPromptEvent;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenStringPromptEvent;
|
||||
import me.blackvein.quests.util.CK;
|
||||
import me.blackvein.quests.util.ItemUtil;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
|
@ -34,9 +30,9 @@ import org.jetbrains.annotations.NotNull;
|
|||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class PlayerPrompt extends ConditionsEditorNumericPrompt {
|
||||
public class ConditionPlayerPrompt extends ConditionsEditorNumericPrompt {
|
||||
|
||||
public PlayerPrompt(final ConversationContext context) {
|
||||
public ConditionPlayerPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -174,11 +170,11 @@ public class PlayerPrompt extends ConditionsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new PermissionsPrompt(context);
|
||||
return new ConditionPermissionsPrompt(context);
|
||||
case 2:
|
||||
return new ItemsInMainHandListPrompt(context);
|
||||
return new ConditionItemsInMainHandListPrompt(context);
|
||||
case 3:
|
||||
return new ItemsWearListPrompt(context);
|
||||
return new ConditionItemsWearListPrompt(context);
|
||||
case 4:
|
||||
try {
|
||||
return new ConditionMainPrompt(context);
|
||||
|
@ -187,13 +183,13 @@ public class PlayerPrompt extends ConditionsEditorNumericPrompt {
|
|||
return Prompt.END_OF_CONVERSATION;
|
||||
}
|
||||
default:
|
||||
return new PlayerPrompt(context);
|
||||
return new ConditionPlayerPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class PermissionsPrompt extends ConditionsEditorStringPrompt {
|
||||
public class ConditionPermissionsPrompt extends ConditionsEditorStringPrompt {
|
||||
|
||||
public PermissionsPrompt(final ConversationContext context) {
|
||||
public ConditionPermissionsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -230,13 +226,13 @@ public class PlayerPrompt extends ConditionsEditorNumericPrompt {
|
|||
}
|
||||
context.setSessionData(CK.C_WHILE_PERMISSION, permissions);
|
||||
}
|
||||
return new PlayerPrompt(context);
|
||||
return new ConditionPlayerPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class ItemsInMainHandListPrompt extends ConditionsEditorNumericPrompt {
|
||||
public class ConditionItemsInMainHandListPrompt extends ConditionsEditorNumericPrompt {
|
||||
|
||||
public ItemsInMainHandListPrompt(final ConversationContext context) {
|
||||
public ConditionItemsInMainHandListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -346,22 +342,22 @@ public class PlayerPrompt extends ConditionsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new ItemStackPrompt(context, ItemsInMainHandListPrompt.this);
|
||||
return new ItemStackPrompt(context, ConditionItemsInMainHandListPrompt.this);
|
||||
case 2:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("conditionEditorConditionCleared"));
|
||||
context.setSessionData(CK.C_WHILE_HOLDING_MAIN_HAND, null);
|
||||
return new ItemsInMainHandListPrompt(context);
|
||||
return new ConditionItemsInMainHandListPrompt(context);
|
||||
case 3:
|
||||
return new PlayerPrompt(context);
|
||||
return new ConditionPlayerPrompt(context);
|
||||
default:
|
||||
return new ItemsInMainHandListPrompt(context);
|
||||
return new ConditionItemsInMainHandListPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ItemsWearListPrompt extends ConditionsEditorNumericPrompt {
|
||||
public class ConditionItemsWearListPrompt extends ConditionsEditorNumericPrompt {
|
||||
|
||||
public ItemsWearListPrompt(final ConversationContext context) {
|
||||
public ConditionItemsWearListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -471,15 +467,15 @@ public class PlayerPrompt extends ConditionsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new ItemStackPrompt(context, ItemsWearListPrompt.this);
|
||||
return new ItemStackPrompt(context, ConditionItemsWearListPrompt.this);
|
||||
case 2:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("conditionEditorConditionCleared"));
|
||||
context.setSessionData(CK.C_WHILE_WEARING, null);
|
||||
return new ItemsWearListPrompt(context);
|
||||
return new ConditionItemsWearListPrompt(context);
|
||||
case 3:
|
||||
return new PlayerPrompt(context);
|
||||
return new ConditionPlayerPrompt(context);
|
||||
default:
|
||||
return new ItemsWearListPrompt(context);
|
||||
return new ConditionItemsWearListPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -17,12 +17,8 @@ import me.blackvein.quests.Quests;
|
|||
import me.blackvein.quests.convo.conditions.ConditionsEditorNumericPrompt;
|
||||
import me.blackvein.quests.convo.conditions.ConditionsEditorStringPrompt;
|
||||
import me.blackvein.quests.convo.conditions.main.ConditionMainPrompt;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorStringPrompt;
|
||||
import me.blackvein.quests.events.editor.conditions.ConditionsEditorPostOpenNumericPromptEvent;
|
||||
import me.blackvein.quests.events.editor.conditions.ConditionsEditorPostOpenStringPromptEvent;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenNumericPromptEvent;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenStringPromptEvent;
|
||||
import me.blackvein.quests.reflect.worldguard.WorldGuardAPI;
|
||||
import me.blackvein.quests.util.CK;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
|
@ -40,11 +36,11 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldPrompt extends ConditionsEditorNumericPrompt {
|
||||
public class ConditionWorldPrompt extends ConditionsEditorNumericPrompt {
|
||||
|
||||
private final Quests plugin;
|
||||
|
||||
public WorldPrompt(final ConversationContext context) {
|
||||
public ConditionWorldPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
this.plugin = (Quests)context.getPlugin();
|
||||
}
|
||||
|
@ -182,16 +178,16 @@ public class WorldPrompt extends ConditionsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new WorldsPrompt(context);
|
||||
return new ConditionWorldsPrompt(context);
|
||||
case 2:
|
||||
return new TicksListPrompt(context);
|
||||
return new ConditionTicksListPrompt(context);
|
||||
case 3:
|
||||
return new BiomesPrompt(context);
|
||||
return new ConditionBiomesPrompt(context);
|
||||
case 4:
|
||||
if (plugin.getDependencies().getWorldGuardApi() != null) {
|
||||
return new RegionsPrompt(context);
|
||||
return new ConditionRegionsPrompt(context);
|
||||
} else {
|
||||
return new WorldPrompt(context);
|
||||
return new ConditionWorldPrompt(context);
|
||||
}
|
||||
case 5:
|
||||
try {
|
||||
|
@ -201,13 +197,13 @@ public class WorldPrompt extends ConditionsEditorNumericPrompt {
|
|||
return Prompt.END_OF_CONVERSATION;
|
||||
}
|
||||
default:
|
||||
return new WorldPrompt(context);
|
||||
return new ConditionWorldPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class WorldsPrompt extends ConditionsEditorStringPrompt {
|
||||
public class ConditionWorldsPrompt extends ConditionsEditorStringPrompt {
|
||||
|
||||
public WorldsPrompt(final ConversationContext context) {
|
||||
public ConditionWorldsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -254,18 +250,18 @@ public class WorldPrompt extends ConditionsEditorNumericPrompt {
|
|||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("conditionEditorInvalidWorld")
|
||||
.replace("<input>", s));
|
||||
return new WorldsPrompt(context);
|
||||
return new ConditionWorldsPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(CK.C_WHILE_WITHIN_WORLD, worlds);
|
||||
}
|
||||
return new WorldPrompt(context);
|
||||
return new ConditionWorldPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class TicksListPrompt extends ConditionsEditorNumericPrompt {
|
||||
public class ConditionTicksListPrompt extends ConditionsEditorNumericPrompt {
|
||||
|
||||
public TicksListPrompt(final ConversationContext context) {
|
||||
public ConditionTicksListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
|
||||
}
|
||||
|
@ -356,14 +352,14 @@ public class WorldPrompt extends ConditionsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
return new TickStartPrompt(context);
|
||||
return new ConditionTickStartPrompt(context);
|
||||
case 2:
|
||||
return new TickEndPrompt(context);
|
||||
return new ConditionTickEndPrompt(context);
|
||||
case 3:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("conditionEditorConditionCleared"));
|
||||
context.setSessionData(CK.C_WHILE_WITHIN_TICKS_START, null);
|
||||
context.setSessionData(CK.C_WHILE_WITHIN_TICKS_END, null);
|
||||
return new WorldPrompt(context);
|
||||
return new ConditionWorldPrompt(context);
|
||||
case 4:
|
||||
if ((context.getSessionData(CK.C_WHILE_WITHIN_TICKS_START) != null
|
||||
&& context.getSessionData(CK.C_WHILE_WITHIN_TICKS_END) != null)
|
||||
|
@ -372,17 +368,17 @@ public class WorldPrompt extends ConditionsEditorNumericPrompt {
|
|||
return new ConditionMainPrompt(context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new WorldPrompt.TicksListPrompt(context);
|
||||
return new ConditionTicksListPrompt(context);
|
||||
}
|
||||
default:
|
||||
return new WorldPrompt.TicksListPrompt(context);
|
||||
return new ConditionTicksListPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class TickStartPrompt extends ConditionsEditorStringPrompt {
|
||||
public class ConditionTickStartPrompt extends ConditionsEditorStringPrompt {
|
||||
|
||||
public TickStartPrompt(final ConversationContext context) {
|
||||
public ConditionTickStartPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -418,23 +414,23 @@ public class WorldPrompt extends ConditionsEditorNumericPrompt {
|
|||
if (i < 0 || i > 24000) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidRange")
|
||||
.replace("<least>", "0").replace("<greatest>", "24000"));
|
||||
return new TickStartPrompt(context);
|
||||
return new ConditionTickStartPrompt(context);
|
||||
} else {
|
||||
context.setSessionData(CK.C_WHILE_WITHIN_TICKS_START, i);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber")
|
||||
.replace("<input>", input));
|
||||
return new TickStartPrompt(context);
|
||||
return new ConditionTickStartPrompt(context);
|
||||
}
|
||||
}
|
||||
return new TicksListPrompt(context);
|
||||
return new ConditionTicksListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class TickEndPrompt extends ConditionsEditorStringPrompt {
|
||||
public class ConditionTickEndPrompt extends ConditionsEditorStringPrompt {
|
||||
|
||||
public TickEndPrompt(final ConversationContext context) {
|
||||
public ConditionTickEndPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -470,23 +466,23 @@ public class WorldPrompt extends ConditionsEditorNumericPrompt {
|
|||
if (i < 0 || i > 24000) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidRange")
|
||||
.replace("<least>", "0").replace("<greatest>", "24000"));
|
||||
return new TickEndPrompt(context);
|
||||
return new ConditionTickEndPrompt(context);
|
||||
} else {
|
||||
context.setSessionData(CK.C_WHILE_WITHIN_TICKS_END, i);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber")
|
||||
.replace("<input>", input));
|
||||
return new TickEndPrompt(context);
|
||||
return new ConditionTickEndPrompt(context);
|
||||
}
|
||||
}
|
||||
return new TicksListPrompt(context);
|
||||
return new ConditionTicksListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class BiomesPrompt extends ConditionsEditorStringPrompt {
|
||||
public class ConditionBiomesPrompt extends ConditionsEditorStringPrompt {
|
||||
|
||||
public BiomesPrompt(final ConversationContext context) {
|
||||
public ConditionBiomesPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -533,18 +529,18 @@ public class WorldPrompt extends ConditionsEditorNumericPrompt {
|
|||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("conditionEditorInvalidBiome")
|
||||
.replace("<input>", s));
|
||||
return new BiomesPrompt(context);
|
||||
return new ConditionBiomesPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(CK.C_WHILE_WITHIN_BIOME, biomes);
|
||||
}
|
||||
return new WorldPrompt(context);
|
||||
return new ConditionWorldPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class RegionsPrompt extends ConditionsEditorStringPrompt {
|
||||
public class ConditionRegionsPrompt extends ConditionsEditorStringPrompt {
|
||||
|
||||
public RegionsPrompt(final ConversationContext context) {
|
||||
public ConditionRegionsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -618,12 +614,12 @@ public class WorldPrompt extends ConditionsEditorNumericPrompt {
|
|||
String error = Lang.get("questWGInvalidRegion");
|
||||
error = error.replace("<region>", ChatColor.RED + r + ChatColor.YELLOW);
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + error);
|
||||
return new RegionsPrompt(context);
|
||||
return new ConditionRegionsPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(CK.C_WHILE_WITHIN_REGION, regions);
|
||||
}
|
||||
return new WorldPrompt(context);
|
||||
return new ConditionWorldPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -18,11 +18,11 @@ import me.blackvein.quests.convo.QuestsNumericPrompt;
|
|||
import me.blackvein.quests.convo.generic.ItemStackPrompt;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorStringPrompt;
|
||||
import me.blackvein.quests.convo.quests.options.OptionsPrompt;
|
||||
import me.blackvein.quests.convo.quests.planner.PlannerPrompt;
|
||||
import me.blackvein.quests.convo.quests.requirements.RequirementsPrompt;
|
||||
import me.blackvein.quests.convo.quests.rewards.RewardsPrompt;
|
||||
import me.blackvein.quests.convo.quests.stages.StageMenuPrompt;
|
||||
import me.blackvein.quests.convo.quests.options.QuestOptionsPrompt;
|
||||
import me.blackvein.quests.convo.quests.planner.QuestPlannerPrompt;
|
||||
import me.blackvein.quests.convo.quests.requirements.QuestRequirementsPrompt;
|
||||
import me.blackvein.quests.convo.quests.rewards.QuestRewardsPrompt;
|
||||
import me.blackvein.quests.convo.quests.stages.QuestStageMenuPrompt;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenNumericPromptEvent;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenStringPromptEvent;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
|
@ -298,15 +298,15 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
|||
return new QuestMainPrompt(context);
|
||||
}
|
||||
case 8:
|
||||
return new RequirementsPrompt(context);
|
||||
return new QuestRequirementsPrompt(context);
|
||||
case 9:
|
||||
return new PlannerPrompt(context);
|
||||
return new QuestPlannerPrompt(context);
|
||||
case 10:
|
||||
return new StageMenuPrompt(context);
|
||||
return new QuestStageMenuPrompt(context);
|
||||
case 11:
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
case 12:
|
||||
return new OptionsPrompt(context);
|
||||
return new QuestOptionsPrompt(context);
|
||||
case 13:
|
||||
return new QuestSavePrompt(context);
|
||||
case 14:
|
||||
|
@ -503,7 +503,7 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
|||
if (!input.equalsIgnoreCase(Lang.get("cmdCancel")) && !input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
try {
|
||||
final UUID uuid = UUID.fromString(input);
|
||||
if (plugin.getDependencies().getNPCName(uuid) == null) {
|
||||
if (plugin.getDependencies().getNPCEntity(uuid) == null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorInvalidNPC"));
|
||||
return new QuestNPCStartPrompt(context);
|
||||
}
|
||||
|
@ -796,7 +796,8 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
|||
public String getTitle(final ConversationContext context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public ChatColor getNumberColor(final ConversationContext context, final int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
|
@ -807,7 +808,8 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public String getSelectionText(final ConversationContext context, final int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
|
@ -855,7 +857,7 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
|||
} else if (context.getSessionData(CK.Q_FINISH_MESSAGE) == null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorNeedFinishMessage"));
|
||||
return new QuestMainPrompt(context);
|
||||
} else if (new StageMenuPrompt(context).getStages(context) == 0) {
|
||||
} else if (new QuestStageMenuPrompt(context).getStages(context) == 0) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorNeedStages"));
|
||||
return new QuestMainPrompt(context);
|
||||
}
|
||||
|
@ -920,7 +922,8 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
|||
public String getTitle(final ConversationContext context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public ChatColor getNumberColor(final ConversationContext context, final int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
|
@ -931,7 +934,8 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public String getSelectionText(final ConversationContext context, final int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
|
|
|
@ -326,7 +326,8 @@ public class QuestMenuPrompt extends QuestsEditorNumericPrompt {
|
|||
public String getTitle(final ConversationContext context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public ChatColor getNumberColor(final ConversationContext context, final int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
|
@ -337,7 +338,8 @@ public class QuestMenuPrompt extends QuestsEditorNumericPrompt {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public String getSelectionText(final ConversationContext context, final int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
|
|
|
@ -14,7 +14,7 @@ package me.blackvein.quests.convo.quests.objectives;
|
|||
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorStringPrompt;
|
||||
import me.blackvein.quests.convo.quests.stages.StageMainPrompt;
|
||||
import me.blackvein.quests.convo.quests.stages.QuestStageMainPrompt;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenNumericPromptEvent;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenStringPromptEvent;
|
||||
import me.blackvein.quests.util.CK;
|
||||
|
@ -29,11 +29,11 @@ import org.jetbrains.annotations.NotNull;
|
|||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestBlocksPrompt extends QuestsEditorNumericPrompt {
|
||||
private final int stageNum;
|
||||
private final String pref;
|
||||
|
||||
public BlocksPrompt(final int stageNum, final ConversationContext context) {
|
||||
public QuestBlocksPrompt(final int stageNum, final ConversationContext context) {
|
||||
super(context);
|
||||
this.stageNum = stageNum;
|
||||
this.pref = "stage" + stageNum;
|
||||
|
@ -186,28 +186,28 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new BlocksBreakListPrompt(context);
|
||||
return new QuestBlocksBreakListPrompt(context);
|
||||
case 2:
|
||||
return new BlocksDamageListPrompt(context);
|
||||
return new QuestBlocksDamageListPrompt(context);
|
||||
case 3:
|
||||
return new BlocksPlaceListPrompt(context);
|
||||
return new QuestBlocksPlaceListPrompt(context);
|
||||
case 4:
|
||||
return new BlocksUseListPrompt(context);
|
||||
return new QuestBlocksUseListPrompt(context);
|
||||
case 5:
|
||||
try {
|
||||
return new StageMainPrompt(stageNum, context);
|
||||
return new QuestStageMainPrompt(stageNum, context);
|
||||
} catch (final Exception e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
}
|
||||
default:
|
||||
return new BlocksPrompt(stageNum, context);
|
||||
return new QuestBlocksPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
|
||||
public class BlocksBreakListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestBlocksBreakListPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public BlocksBreakListPrompt(final ConversationContext context) {
|
||||
public QuestBlocksBreakListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -334,17 +334,17 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new BlockBreakNamesPrompt(context);
|
||||
return new QuestBlockBreakNamesPrompt(context);
|
||||
case 2:
|
||||
return new BlockBreakAmountsPrompt(context);
|
||||
return new QuestBlockBreakAmountsPrompt(context);
|
||||
case 3:
|
||||
return new BlockBreakDurabilityPrompt(context);
|
||||
return new QuestBlockBreakDurabilityPrompt(context);
|
||||
case 4:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("stageEditorObjectiveCleared"));
|
||||
context.setSessionData(pref + CK.S_BREAK_NAMES, null);
|
||||
context.setSessionData(pref + CK.S_BREAK_AMOUNTS, null);
|
||||
context.setSessionData(pref + CK.S_BREAK_DURABILITY, null);
|
||||
return new BlocksBreakListPrompt(context);
|
||||
return new QuestBlocksBreakListPrompt(context);
|
||||
case 5:
|
||||
final int one;
|
||||
final int two;
|
||||
|
@ -374,20 +374,20 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
durability.add((short) 0);
|
||||
}
|
||||
context.setSessionData(pref + CK.S_BREAK_DURABILITY, durability);
|
||||
return new BlocksPrompt(stageNum, context);
|
||||
return new QuestBlocksPrompt(stageNum, context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new BlocksBreakListPrompt(context);
|
||||
return new QuestBlocksBreakListPrompt(context);
|
||||
}
|
||||
default:
|
||||
return new BlocksPrompt(stageNum, context);
|
||||
return new QuestBlocksPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class BlockBreakNamesPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestBlockBreakNamesPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public BlockBreakNamesPrompt(final ConversationContext context) {
|
||||
public QuestBlockBreakNamesPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -430,17 +430,17 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotSolid")
|
||||
.replace("<input>", s));
|
||||
return new BlockBreakNamesPrompt(context);
|
||||
return new QuestBlockBreakNamesPrompt(context);
|
||||
}
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidBlockName")
|
||||
.replace("<input>", s));
|
||||
return new BlockBreakNamesPrompt(context);
|
||||
return new QuestBlockBreakNamesPrompt(context);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
|
||||
.replace("<data>", s));
|
||||
return new BlockBreakNamesPrompt(context);
|
||||
return new QuestBlockBreakNamesPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(pref + CK.S_BREAK_NAMES, names);
|
||||
|
@ -458,13 +458,13 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
context.setSessionData(pref + CK.S_BREAK_AMOUNTS, amounts);
|
||||
}
|
||||
return new BlocksBreakListPrompt(context);
|
||||
return new QuestBlocksBreakListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class BlockBreakAmountsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestBlockBreakAmountsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public BlockBreakAmountsPrompt(final ConversationContext context) {
|
||||
public QuestBlockBreakAmountsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -505,23 +505,23 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||
+ Lang.get("invalidMinimum").replace("<number>", "1"));
|
||||
return new BlockBreakAmountsPrompt(context);
|
||||
return new QuestBlockBreakAmountsPrompt(context);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
|
||||
.replace("<data>", s));
|
||||
return new BlockBreakAmountsPrompt(context);
|
||||
return new QuestBlockBreakAmountsPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(pref + CK.S_BREAK_AMOUNTS, amounts);
|
||||
}
|
||||
return new BlocksBreakListPrompt(context);
|
||||
return new QuestBlocksBreakListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class BlockBreakDurabilityPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestBlockBreakDurabilityPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public BlockBreakDurabilityPrompt(final ConversationContext context) {
|
||||
public QuestBlockBreakDurabilityPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -562,23 +562,23 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||
+ Lang.get("invalidMinimum").replace("<number>", "0"));
|
||||
return new BlockBreakDurabilityPrompt(context);
|
||||
return new QuestBlockBreakDurabilityPrompt(context);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
|
||||
.replace("<data>", s));
|
||||
return new BlockBreakDurabilityPrompt(context);
|
||||
return new QuestBlockBreakDurabilityPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(pref + CK.S_BREAK_DURABILITY, durability);
|
||||
}
|
||||
return new BlocksBreakListPrompt(context);
|
||||
return new QuestBlocksBreakListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class BlocksDamageListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestBlocksDamageListPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public BlocksDamageListPrompt(final ConversationContext context) {
|
||||
public QuestBlocksDamageListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -704,17 +704,17 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new BlockDamageNamesPrompt(context);
|
||||
return new QuestBlockDamageNamesPrompt(context);
|
||||
case 2:
|
||||
return new BlockDamageAmountsPrompt(context);
|
||||
return new QuestBlockDamageAmountsPrompt(context);
|
||||
case 3:
|
||||
return new BlockDamageDurabilityPrompt(context);
|
||||
return new QuestBlockDamageDurabilityPrompt(context);
|
||||
case 4:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("stageEditorObjectiveCleared"));
|
||||
context.setSessionData(pref + CK.S_DAMAGE_NAMES, null);
|
||||
context.setSessionData(pref + CK.S_DAMAGE_AMOUNTS, null);
|
||||
context.setSessionData(pref + CK.S_DAMAGE_DURABILITY, null);
|
||||
return new BlocksDamageListPrompt(context);
|
||||
return new QuestBlocksDamageListPrompt(context);
|
||||
case 5:
|
||||
final int one;
|
||||
final int two;
|
||||
|
@ -744,20 +744,20 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
durability.add((short) 0);
|
||||
}
|
||||
context.setSessionData(pref + CK.S_DAMAGE_DURABILITY, durability);
|
||||
return new BlocksPrompt(stageNum, context);
|
||||
return new QuestBlocksPrompt(stageNum, context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new BlocksDamageListPrompt(context);
|
||||
return new QuestBlocksDamageListPrompt(context);
|
||||
}
|
||||
default:
|
||||
return new BlocksPrompt(stageNum, context);
|
||||
return new QuestBlocksPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class BlockDamageNamesPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestBlockDamageNamesPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public BlockDamageNamesPrompt(final ConversationContext context) {
|
||||
public QuestBlockDamageNamesPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -800,17 +800,17 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotSolid")
|
||||
.replace("<input>", s));
|
||||
return new BlockDamageNamesPrompt(context);
|
||||
return new QuestBlockDamageNamesPrompt(context);
|
||||
}
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidBlockName")
|
||||
.replace("<input>", s));
|
||||
return new BlockDamageNamesPrompt(context);
|
||||
return new QuestBlockDamageNamesPrompt(context);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
|
||||
.replace("<data>", s));
|
||||
return new BlockDamageNamesPrompt(context);
|
||||
return new QuestBlockDamageNamesPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(pref + CK.S_DAMAGE_NAMES, names);
|
||||
|
@ -828,13 +828,13 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
context.setSessionData(pref + CK.S_DAMAGE_AMOUNTS, amounts);
|
||||
}
|
||||
return new BlocksDamageListPrompt(context);
|
||||
return new QuestBlocksDamageListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class BlockDamageAmountsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestBlockDamageAmountsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public BlockDamageAmountsPrompt(final ConversationContext context) {
|
||||
public QuestBlockDamageAmountsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -874,23 +874,23 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||
+ Lang.get("invalidMinimum").replace("<number>", "1"));
|
||||
return new BlockDamageAmountsPrompt(context);
|
||||
return new QuestBlockDamageAmountsPrompt(context);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
|
||||
.replace("<data>", s));
|
||||
return new BlockDamageAmountsPrompt(context);
|
||||
return new QuestBlockDamageAmountsPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(pref + CK.S_DAMAGE_AMOUNTS, amounts);
|
||||
}
|
||||
return new BlocksDamageListPrompt(context);
|
||||
return new QuestBlocksDamageListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class BlockDamageDurabilityPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestBlockDamageDurabilityPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public BlockDamageDurabilityPrompt(final ConversationContext context) {
|
||||
public QuestBlockDamageDurabilityPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -930,23 +930,23 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||
+ Lang.get("invalidMinimum").replace("<number>", "0"));
|
||||
return new BlockDamageDurabilityPrompt(context);
|
||||
return new QuestBlockDamageDurabilityPrompt(context);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
|
||||
.replace("<data>", s));
|
||||
return new BlockDamageDurabilityPrompt(context);
|
||||
return new QuestBlockDamageDurabilityPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(pref + CK.S_DAMAGE_DURABILITY, durability);
|
||||
}
|
||||
return new BlocksDamageListPrompt(context);
|
||||
return new QuestBlocksDamageListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class BlocksPlaceListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestBlocksPlaceListPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public BlocksPlaceListPrompt(final ConversationContext context) {
|
||||
public QuestBlocksPlaceListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1072,17 +1072,17 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new BlockPlaceNamesPrompt(context);
|
||||
return new QuestBlockPlaceNamesPrompt(context);
|
||||
case 2:
|
||||
return new BlockPlaceAmountsPrompt(context);
|
||||
return new QuestBlockPlaceAmountsPrompt(context);
|
||||
case 3:
|
||||
return new BlockPlaceDurabilityPrompt(context);
|
||||
return new QuestBlockPlaceDurabilityPrompt(context);
|
||||
case 4:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("stageEditorObjectiveCleared"));
|
||||
context.setSessionData(pref + CK.S_PLACE_NAMES, null);
|
||||
context.setSessionData(pref + CK.S_PLACE_AMOUNTS, null);
|
||||
context.setSessionData(pref + CK.S_PLACE_DURABILITY, null);
|
||||
return new BlocksPlaceListPrompt(context);
|
||||
return new QuestBlocksPlaceListPrompt(context);
|
||||
case 5:
|
||||
final int one;
|
||||
final int two;
|
||||
|
@ -1112,20 +1112,20 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
durability.add((short) 0);
|
||||
}
|
||||
context.setSessionData(pref + CK.S_PLACE_DURABILITY, durability);
|
||||
return new BlocksPrompt(stageNum, context);
|
||||
return new QuestBlocksPrompt(stageNum, context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new BlocksPlaceListPrompt(context);
|
||||
return new QuestBlocksPlaceListPrompt(context);
|
||||
}
|
||||
default:
|
||||
return new BlocksPrompt(stageNum, context);
|
||||
return new QuestBlocksPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class BlockPlaceNamesPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestBlockPlaceNamesPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public BlockPlaceNamesPrompt(final ConversationContext context) {
|
||||
public QuestBlockPlaceNamesPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1168,17 +1168,17 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotSolid")
|
||||
.replace("<input>", s));
|
||||
return new BlockPlaceNamesPrompt(context);
|
||||
return new QuestBlockPlaceNamesPrompt(context);
|
||||
}
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidBlockName")
|
||||
.replace("<input>", s));
|
||||
return new BlockPlaceNamesPrompt(context);
|
||||
return new QuestBlockPlaceNamesPrompt(context);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
|
||||
.replace("<data>", s));
|
||||
return new BlockPlaceNamesPrompt(context);
|
||||
return new QuestBlockPlaceNamesPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(pref + CK.S_PLACE_NAMES, names);
|
||||
|
@ -1196,13 +1196,13 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
context.setSessionData(pref + CK.S_PLACE_AMOUNTS, amounts);
|
||||
}
|
||||
return new BlocksPlaceListPrompt(context);
|
||||
return new QuestBlocksPlaceListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class BlockPlaceAmountsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestBlockPlaceAmountsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public BlockPlaceAmountsPrompt(final ConversationContext context) {
|
||||
public QuestBlockPlaceAmountsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1242,23 +1242,23 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||
+ Lang.get("invalidMinimum").replace("<number>", "1"));
|
||||
return new BlockPlaceAmountsPrompt(context);
|
||||
return new QuestBlockPlaceAmountsPrompt(context);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
|
||||
.replace("<data>", s));
|
||||
return new BlockPlaceAmountsPrompt(context);
|
||||
return new QuestBlockPlaceAmountsPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(pref + CK.S_PLACE_AMOUNTS, amounts);
|
||||
}
|
||||
return new BlocksPlaceListPrompt(context);
|
||||
return new QuestBlocksPlaceListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class BlockPlaceDurabilityPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestBlockPlaceDurabilityPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public BlockPlaceDurabilityPrompt(final ConversationContext context) {
|
||||
public QuestBlockPlaceDurabilityPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1298,23 +1298,23 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||
+ Lang.get("invalidMinimum").replace("<number>", "0"));
|
||||
return new BlockPlaceDurabilityPrompt(context);
|
||||
return new QuestBlockPlaceDurabilityPrompt(context);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
|
||||
.replace("<data>", s));
|
||||
return new BlockPlaceDurabilityPrompt(context);
|
||||
return new QuestBlockPlaceDurabilityPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(pref + CK.S_PLACE_DURABILITY, durability);
|
||||
}
|
||||
return new BlocksPlaceListPrompt(context);
|
||||
return new QuestBlocksPlaceListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class BlocksUseListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestBlocksUseListPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public BlocksUseListPrompt(final ConversationContext context) {
|
||||
public QuestBlocksUseListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1438,17 +1438,17 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new BlockUseNamesPrompt(context);
|
||||
return new QuestBlockUseNamesPrompt(context);
|
||||
case 2:
|
||||
return new BlockUseAmountsPrompt(context);
|
||||
return new QuestBlockUseAmountsPrompt(context);
|
||||
case 3:
|
||||
return new BlockUseDurabilityPrompt(context);
|
||||
return new QuestBlockUseDurabilityPrompt(context);
|
||||
case 4:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("stageEditorObjectiveCleared"));
|
||||
context.setSessionData(pref + CK.S_USE_NAMES, null);
|
||||
context.setSessionData(pref + CK.S_USE_AMOUNTS, null);
|
||||
context.setSessionData(pref + CK.S_USE_DURABILITY, null);
|
||||
return new BlocksUseListPrompt(context);
|
||||
return new QuestBlocksUseListPrompt(context);
|
||||
case 5:
|
||||
final int one;
|
||||
final int two;
|
||||
|
@ -1478,20 +1478,20 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
durability.add((short) 0);
|
||||
}
|
||||
context.setSessionData(pref + CK.S_USE_DURABILITY, durability);
|
||||
return new BlocksPrompt(stageNum, context);
|
||||
return new QuestBlocksPrompt(stageNum, context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new BlocksUseListPrompt(context);
|
||||
return new QuestBlocksUseListPrompt(context);
|
||||
}
|
||||
default:
|
||||
return new BlocksPrompt(stageNum, context);
|
||||
return new QuestBlocksPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class BlockUseNamesPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestBlockUseNamesPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public BlockUseNamesPrompt(final ConversationContext context) {
|
||||
public QuestBlockUseNamesPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1534,17 +1534,17 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotSolid")
|
||||
.replace("<input>", s));
|
||||
return new BlockUseNamesPrompt(context);
|
||||
return new QuestBlockUseNamesPrompt(context);
|
||||
}
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidBlockName")
|
||||
.replace("<input>", s));
|
||||
return new BlockUseNamesPrompt(context);
|
||||
return new QuestBlockUseNamesPrompt(context);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
|
||||
.replace("<data>", s));
|
||||
return new BlockUseNamesPrompt(context);
|
||||
return new QuestBlockUseNamesPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(pref + CK.S_USE_NAMES, names);
|
||||
|
@ -1562,13 +1562,13 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
context.setSessionData(pref + CK.S_USE_AMOUNTS, amounts);
|
||||
}
|
||||
return new BlocksUseListPrompt(context);
|
||||
return new QuestBlocksUseListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class BlockUseAmountsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestBlockUseAmountsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public BlockUseAmountsPrompt(final ConversationContext context) {
|
||||
public QuestBlockUseAmountsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1608,23 +1608,23 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||
+ Lang.get("invalidMinimum").replace("<number>", "1"));
|
||||
return new BlockUseAmountsPrompt(context);
|
||||
return new QuestBlockUseAmountsPrompt(context);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
|
||||
.replace("<data>", s));
|
||||
return new BlockUseAmountsPrompt(context);
|
||||
return new QuestBlockUseAmountsPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(pref + CK.S_USE_AMOUNTS, amounts);
|
||||
}
|
||||
return new BlocksUseListPrompt(context);
|
||||
return new QuestBlocksUseListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class BlockUseDurabilityPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestBlockUseDurabilityPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public BlockUseDurabilityPrompt(final ConversationContext context) {
|
||||
public QuestBlockUseDurabilityPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1664,17 +1664,17 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||
+ Lang.get("invalidMinimum").replace("<number>", "0"));
|
||||
return new BlockUseDurabilityPrompt(context);
|
||||
return new QuestBlockUseDurabilityPrompt(context);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
|
||||
.replace("<data>", s));
|
||||
return new BlockUseDurabilityPrompt(context);
|
||||
return new QuestBlockUseDurabilityPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(pref + CK.S_USE_DURABILITY, durability);
|
||||
}
|
||||
return new BlocksUseListPrompt(context);
|
||||
return new QuestBlocksUseListPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -14,7 +14,7 @@ package me.blackvein.quests.convo.quests.objectives;
|
|||
|
||||
import me.blackvein.quests.convo.generic.ItemStackPrompt;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||
import me.blackvein.quests.convo.quests.stages.StageMainPrompt;
|
||||
import me.blackvein.quests.convo.quests.stages.QuestStageMainPrompt;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenNumericPromptEvent;
|
||||
import me.blackvein.quests.util.CK;
|
||||
import me.blackvein.quests.util.ItemUtil;
|
||||
|
@ -28,11 +28,11 @@ import org.jetbrains.annotations.NotNull;
|
|||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemsPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestItemsPrompt extends QuestsEditorNumericPrompt {
|
||||
private final int stageNum;
|
||||
private final String pref;
|
||||
|
||||
public ItemsPrompt(final int stageNum, final ConversationContext context) {
|
||||
public QuestItemsPrompt(final int stageNum, final ConversationContext context) {
|
||||
super(context);
|
||||
this.stageNum = stageNum;
|
||||
this.pref = "stage" + stageNum;
|
||||
|
@ -216,30 +216,30 @@ public class ItemsPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new ItemsCraftListPrompt(context);
|
||||
return new QuestItemsCraftListPrompt(context);
|
||||
case 2:
|
||||
return new ItemsSmeltListPrompt(context);
|
||||
return new QuestItemsSmeltListPrompt(context);
|
||||
case 3:
|
||||
return new ItemsEnchantListPrompt(context);
|
||||
return new QuestItemsEnchantListPrompt(context);
|
||||
case 4:
|
||||
return new ItemsBrewListPrompt(context);
|
||||
return new QuestItemsBrewListPrompt(context);
|
||||
case 5:
|
||||
return new ItemsConsumeListPrompt(context);
|
||||
return new QuestItemsConsumeListPrompt(context);
|
||||
case 6:
|
||||
try {
|
||||
return new StageMainPrompt(stageNum, context);
|
||||
return new QuestStageMainPrompt(stageNum, context);
|
||||
} catch (final Exception e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
}
|
||||
default:
|
||||
return new ItemsPrompt(stageNum, context);
|
||||
return new QuestItemsPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
|
||||
public class ItemsCraftListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestItemsCraftListPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public ItemsCraftListPrompt(final ConversationContext context) {
|
||||
public QuestItemsCraftListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -348,20 +348,20 @@ public class ItemsPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new ItemStackPrompt(context, ItemsCraftListPrompt.this);
|
||||
return new ItemStackPrompt(context, QuestItemsCraftListPrompt.this);
|
||||
case 2:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("stageEditorObjectiveCleared"));
|
||||
context.setSessionData(pref + CK.S_CRAFT_ITEMS, null);
|
||||
return new ItemsCraftListPrompt(context);
|
||||
return new QuestItemsCraftListPrompt(context);
|
||||
default:
|
||||
return new ItemsPrompt(stageNum, context);
|
||||
return new QuestItemsPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ItemsSmeltListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestItemsSmeltListPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public ItemsSmeltListPrompt(final ConversationContext context) {
|
||||
public QuestItemsSmeltListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -470,20 +470,20 @@ public class ItemsPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new ItemStackPrompt(context, ItemsSmeltListPrompt.this);
|
||||
return new ItemStackPrompt(context, QuestItemsSmeltListPrompt.this);
|
||||
case 2:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("stageEditorObjectiveCleared"));
|
||||
context.setSessionData(pref + CK.S_SMELT_ITEMS, null);
|
||||
return new ItemsSmeltListPrompt(context);
|
||||
return new QuestItemsSmeltListPrompt(context);
|
||||
default:
|
||||
return new ItemsPrompt(stageNum, context);
|
||||
return new QuestItemsPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ItemsEnchantListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestItemsEnchantListPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public ItemsEnchantListPrompt(final ConversationContext context) {
|
||||
public QuestItemsEnchantListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -592,20 +592,20 @@ public class ItemsPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new ItemStackPrompt(context, ItemsEnchantListPrompt.this);
|
||||
return new ItemStackPrompt(context, QuestItemsEnchantListPrompt.this);
|
||||
case 2:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("stageEditorObjectiveCleared"));
|
||||
context.setSessionData(pref + CK.S_ENCHANT_ITEMS, null);
|
||||
return new ItemsEnchantListPrompt(context);
|
||||
return new QuestItemsEnchantListPrompt(context);
|
||||
default:
|
||||
return new ItemsPrompt(stageNum, context);
|
||||
return new QuestItemsPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ItemsBrewListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestItemsBrewListPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public ItemsBrewListPrompt(final ConversationContext context) {
|
||||
public QuestItemsBrewListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -713,20 +713,20 @@ public class ItemsPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new ItemStackPrompt(context, ItemsBrewListPrompt.this);
|
||||
return new ItemStackPrompt(context, QuestItemsBrewListPrompt.this);
|
||||
case 2:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("stageEditorObjectiveCleared"));
|
||||
context.setSessionData(pref + CK.S_BREW_ITEMS, null);
|
||||
return new ItemsBrewListPrompt(context);
|
||||
return new QuestItemsBrewListPrompt(context);
|
||||
default:
|
||||
return new ItemsPrompt(stageNum, context);
|
||||
return new QuestItemsPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ItemsConsumeListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestItemsConsumeListPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public ItemsConsumeListPrompt(final ConversationContext context) {
|
||||
public QuestItemsConsumeListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -835,13 +835,13 @@ public class ItemsPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new ItemStackPrompt(context, ItemsConsumeListPrompt.this);
|
||||
return new ItemStackPrompt(context, QuestItemsConsumeListPrompt.this);
|
||||
case 2:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("stageEditorObjectiveCleared"));
|
||||
context.setSessionData(pref + CK.S_CONSUME_ITEMS, null);
|
||||
return new ItemsConsumeListPrompt(context);
|
||||
return new QuestItemsConsumeListPrompt(context);
|
||||
default:
|
||||
return new ItemsPrompt(stageNum, context);
|
||||
return new QuestItemsPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -15,7 +15,7 @@ package me.blackvein.quests.convo.quests.objectives;
|
|||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorStringPrompt;
|
||||
import me.blackvein.quests.convo.quests.stages.StageMainPrompt;
|
||||
import me.blackvein.quests.convo.quests.stages.QuestStageMainPrompt;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenNumericPromptEvent;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenStringPromptEvent;
|
||||
import me.blackvein.quests.util.CK;
|
||||
|
@ -42,12 +42,12 @@ import java.util.Map;
|
|||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
public class MobsPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestMobsPrompt extends QuestsEditorNumericPrompt {
|
||||
private final Quests plugin;
|
||||
private final int stageNum;
|
||||
private final String pref;
|
||||
|
||||
public MobsPrompt(final int stageNum, final ConversationContext context) {
|
||||
public QuestMobsPrompt(final int stageNum, final ConversationContext context) {
|
||||
super(context);
|
||||
this.plugin = (Quests)context.getPlugin();
|
||||
this.stageNum = stageNum;
|
||||
|
@ -228,30 +228,30 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new MobsKillListPrompt(context);
|
||||
return new QuestMobsKillListPrompt(context);
|
||||
case 2:
|
||||
return new MobsTameListPrompt(context);
|
||||
return new QuestMobsTameListPrompt(context);
|
||||
case 3:
|
||||
return new MobsFishPrompt(context);
|
||||
return new QuestMobsFishPrompt(context);
|
||||
case 4:
|
||||
return new MobsCowsPrompt(context);
|
||||
return new QuestMobsCowsPrompt(context);
|
||||
case 5:
|
||||
return new MobsShearListPrompt(context);
|
||||
return new QuestMobsShearListPrompt(context);
|
||||
case 6:
|
||||
try {
|
||||
return new StageMainPrompt(stageNum, context);
|
||||
return new QuestStageMainPrompt(stageNum, context);
|
||||
} catch (final Exception e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
}
|
||||
default:
|
||||
return new MobsPrompt(stageNum, context);
|
||||
return new QuestMobsPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
|
||||
public class MobsKillListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestMobsKillListPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public MobsKillListPrompt(final ConversationContext context) {
|
||||
public QuestMobsKillListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -418,23 +418,23 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new MobsTypesPrompt(context);
|
||||
return new QuestMobsTypesPrompt(context);
|
||||
case 2:
|
||||
return new MobsAmountsPrompt(context);
|
||||
return new QuestMobsAmountsPrompt(context);
|
||||
case 3:
|
||||
if (context.getForWhom() instanceof Player) {
|
||||
final Map<UUID, Block> temp = plugin.getQuestFactory().getSelectedKillLocations();
|
||||
temp.put(((Player) context.getForWhom()).getUniqueId(), null);
|
||||
plugin.getQuestFactory().setSelectedKillLocations(temp);
|
||||
return new MobsLocationPrompt(context);
|
||||
return new QuestMobsLocationPrompt(context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("consoleError"));
|
||||
return new MobsKillListPrompt(context);
|
||||
return new QuestMobsKillListPrompt(context);
|
||||
}
|
||||
case 4:
|
||||
return new MobsRadiiPrompt(context);
|
||||
return new QuestMobsRadiiPrompt(context);
|
||||
case 5:
|
||||
return new MobsLocationNamesPrompt(context);
|
||||
return new QuestMobsLocationNamesPrompt(context);
|
||||
case 6:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("stageEditorObjectiveCleared"));
|
||||
context.setSessionData(pref + CK.S_MOB_TYPES, null);
|
||||
|
@ -442,7 +442,7 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
context.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS, null);
|
||||
context.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS_RADIUS, null);
|
||||
context.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS_NAMES, null);
|
||||
return new MobsKillListPrompt(context);
|
||||
return new QuestMobsKillListPrompt(context);
|
||||
case 7:
|
||||
final int one;
|
||||
final int two;
|
||||
|
@ -483,27 +483,27 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
if (one == two) {
|
||||
if (three != 0 || four != 0 || five != 0) {
|
||||
if (two == three && three == four && four == five) {
|
||||
return new MobsPrompt(stageNum, context);
|
||||
return new QuestMobsPrompt(stageNum, context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new MobsKillListPrompt(context);
|
||||
return new QuestMobsKillListPrompt(context);
|
||||
}
|
||||
} else {
|
||||
return new MobsPrompt(stageNum, context);
|
||||
return new QuestMobsPrompt(stageNum, context);
|
||||
}
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new MobsKillListPrompt(context);
|
||||
return new QuestMobsKillListPrompt(context);
|
||||
}
|
||||
default:
|
||||
return new MobsPrompt(stageNum, context);
|
||||
return new QuestMobsPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MobsTypesPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestMobsTypesPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public MobsTypesPrompt(final ConversationContext context) {
|
||||
public QuestMobsTypesPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -559,7 +559,7 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidMob")
|
||||
.replace("<input>", s));
|
||||
return new MobsTypesPrompt(context);
|
||||
return new QuestMobsTypesPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(pref + CK.S_MOB_TYPES, mobTypes);
|
||||
|
@ -577,13 +577,13 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
context.setSessionData(pref + CK.S_MOB_AMOUNTS, amounts);
|
||||
}
|
||||
return new MobsKillListPrompt(context);
|
||||
return new QuestMobsKillListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class MobsAmountsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestMobsAmountsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public MobsAmountsPrompt(final ConversationContext context) {
|
||||
public QuestMobsAmountsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -621,24 +621,24 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
if (i < 1) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidMinimum")
|
||||
.replace("<number>", "1"));
|
||||
return new MobsAmountsPrompt(context);
|
||||
return new QuestMobsAmountsPrompt(context);
|
||||
}
|
||||
mobAmounts.add(i);
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber")
|
||||
.replace("<input>", input));
|
||||
return new MobsAmountsPrompt(context);
|
||||
return new QuestMobsAmountsPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(pref + CK.S_MOB_AMOUNTS, mobAmounts);
|
||||
}
|
||||
return new MobsKillListPrompt(context);
|
||||
return new QuestMobsKillListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class MobsLocationPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestMobsLocationPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public MobsLocationPrompt(final ConversationContext context) {
|
||||
public QuestMobsLocationPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -689,23 +689,23 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
plugin.getQuestFactory().setSelectedKillLocations(temp);
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("stageEditorNoBlock"));
|
||||
return new MobsLocationPrompt(context);
|
||||
return new QuestMobsLocationPrompt(context);
|
||||
}
|
||||
return new MobsKillListPrompt(context);
|
||||
return new QuestMobsKillListPrompt(context);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
final Map<UUID, Block> temp = plugin.getQuestFactory().getSelectedKillLocations();
|
||||
temp.remove(player.getUniqueId());
|
||||
plugin.getQuestFactory().setSelectedKillLocations(temp);
|
||||
return new MobsKillListPrompt(context);
|
||||
return new QuestMobsKillListPrompt(context);
|
||||
} else {
|
||||
return new MobsLocationPrompt(context);
|
||||
return new QuestMobsLocationPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MobsRadiiPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestMobsRadiiPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public MobsRadiiPrompt(final ConversationContext context) {
|
||||
public QuestMobsRadiiPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -743,24 +743,24 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
if (i < 1) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidMinimum")
|
||||
.replace("<number>", "1"));
|
||||
return new MobsRadiiPrompt(context);
|
||||
return new QuestMobsRadiiPrompt(context);
|
||||
}
|
||||
radii.add(i);
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidItemName")
|
||||
.replace("<input>", s));
|
||||
return new MobsRadiiPrompt(context);
|
||||
return new QuestMobsRadiiPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS_RADIUS, radii);
|
||||
}
|
||||
return new MobsKillListPrompt(context);
|
||||
return new QuestMobsKillListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class MobsLocationNamesPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestMobsLocationNamesPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public MobsLocationNamesPrompt(final ConversationContext context) {
|
||||
public QuestMobsLocationNamesPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -794,13 +794,13 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
final LinkedList<String> locNames = new LinkedList<>(Arrays.asList(input.split(Lang.get("charSemi"))));
|
||||
context.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS_NAMES, locNames);
|
||||
}
|
||||
return new MobsKillListPrompt(context);
|
||||
return new QuestMobsKillListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class MobsTameListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestMobsTameListPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public MobsTameListPrompt(final ConversationContext context) {
|
||||
public QuestMobsTameListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -907,14 +907,14 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new MobsTameTypesPrompt(context);
|
||||
return new QuestMobsTameTypesPrompt(context);
|
||||
case 2:
|
||||
return new MobsTameAmountsPrompt(context);
|
||||
return new QuestMobsTameAmountsPrompt(context);
|
||||
case 3:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("stageEditorObjectiveCleared"));
|
||||
context.setSessionData(pref + CK.S_TAME_TYPES, null);
|
||||
context.setSessionData(pref + CK.S_TAME_AMOUNTS, null);
|
||||
return new MobsTameListPrompt(context);
|
||||
return new QuestMobsTameListPrompt(context);
|
||||
case 4:
|
||||
final int one;
|
||||
final int two;
|
||||
|
@ -931,20 +931,20 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
two = 0;
|
||||
}
|
||||
if (one == two) {
|
||||
return new MobsPrompt(stageNum, context);
|
||||
return new QuestMobsPrompt(stageNum, context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new MobsTameListPrompt(context);
|
||||
return new QuestMobsTameListPrompt(context);
|
||||
}
|
||||
default:
|
||||
return new MobsPrompt(stageNum, context);
|
||||
return new QuestMobsPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MobsTameTypesPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestMobsTameTypesPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public MobsTameTypesPrompt(final ConversationContext context) {
|
||||
public QuestMobsTameTypesPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1019,23 +1019,23 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidMob")
|
||||
.replace("<input>", s));
|
||||
return new MobsTameTypesPrompt(context);
|
||||
return new QuestMobsTameTypesPrompt(context);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidMob")
|
||||
.replace("<input>", s));
|
||||
return new MobsTameTypesPrompt(context);
|
||||
return new QuestMobsTameTypesPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
return new MobsTameListPrompt(context);
|
||||
return new QuestMobsTameListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class MobsTameAmountsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestMobsTameAmountsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public MobsTameAmountsPrompt(final ConversationContext context) {
|
||||
public QuestMobsTameAmountsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1073,24 +1073,24 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
if (i < 1) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidMinimum")
|
||||
.replace("<number>", "1"));
|
||||
return new MobsTameAmountsPrompt(context);
|
||||
return new QuestMobsTameAmountsPrompt(context);
|
||||
}
|
||||
mobAmounts.add(i);
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber")
|
||||
.replace("<input>", input));
|
||||
return new MobsTameAmountsPrompt(context);
|
||||
return new QuestMobsTameAmountsPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(pref + CK.S_TAME_AMOUNTS, mobAmounts);
|
||||
}
|
||||
return new MobsTameListPrompt(context);
|
||||
return new QuestMobsTameListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class MobsFishPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestMobsFishPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public MobsFishPrompt(final ConversationContext context) {
|
||||
public QuestMobsFishPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1125,25 +1125,25 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
final int i = Integer.parseInt(input);
|
||||
if (i < 0) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorPositiveAmount"));
|
||||
return new MobsFishPrompt(context);
|
||||
return new QuestMobsFishPrompt(context);
|
||||
} else if (i > 0) {
|
||||
context.setSessionData(pref + CK.S_FISH, i);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber")
|
||||
.replace("<input>", input));
|
||||
return new MobsFishPrompt(context);
|
||||
return new QuestMobsFishPrompt(context);
|
||||
}
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(pref + CK.S_FISH, null);
|
||||
}
|
||||
return new MobsPrompt(stageNum, context);
|
||||
return new QuestMobsPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
|
||||
public class MobsCowsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestMobsCowsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public MobsCowsPrompt(final ConversationContext context) {
|
||||
public QuestMobsCowsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1178,25 +1178,25 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
final int i = Integer.parseInt(input);
|
||||
if (i < 0) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorPositiveAmount"));
|
||||
return new MobsCowsPrompt(context);
|
||||
return new QuestMobsCowsPrompt(context);
|
||||
} else if (i > 0) {
|
||||
context.setSessionData(pref + CK.S_COW_MILK, i);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber")
|
||||
.replace("<input>", input));
|
||||
return new MobsCowsPrompt(context);
|
||||
return new QuestMobsCowsPrompt(context);
|
||||
}
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(pref + CK.S_COW_MILK, null);
|
||||
}
|
||||
return new MobsPrompt(stageNum, context);
|
||||
return new QuestMobsPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
|
||||
public class MobsShearListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestMobsShearListPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public MobsShearListPrompt(final ConversationContext context) {
|
||||
public QuestMobsShearListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1304,14 +1304,14 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new MobsShearColorsPrompt(context);
|
||||
return new QuestMobsShearColorsPrompt(context);
|
||||
case 2:
|
||||
return new MobsShearAmountsPrompt(context);
|
||||
return new QuestMobsShearAmountsPrompt(context);
|
||||
case 3:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("stageEditorObjectiveCleared"));
|
||||
context.setSessionData(pref + CK.S_SHEAR_COLORS, null);
|
||||
context.setSessionData(pref + CK.S_SHEAR_AMOUNTS, null);
|
||||
return new MobsShearListPrompt(context);
|
||||
return new QuestMobsShearListPrompt(context);
|
||||
case 4:
|
||||
final int one;
|
||||
final int two;
|
||||
|
@ -1328,20 +1328,20 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
two = 0;
|
||||
}
|
||||
if (one == two) {
|
||||
return new MobsPrompt(stageNum, context);
|
||||
return new QuestMobsPrompt(stageNum, context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new MobsShearListPrompt(context);
|
||||
return new QuestMobsShearListPrompt(context);
|
||||
}
|
||||
default:
|
||||
return new MobsPrompt(stageNum, context);
|
||||
return new QuestMobsPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MobsShearColorsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestMobsShearColorsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public MobsShearColorsPrompt(final ConversationContext context) {
|
||||
public QuestMobsShearColorsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1403,17 +1403,17 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidDye")
|
||||
.replace("<input>", s));
|
||||
return new MobsShearColorsPrompt(context);
|
||||
return new QuestMobsShearColorsPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
return new MobsShearListPrompt(context);
|
||||
return new QuestMobsShearListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class MobsShearAmountsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestMobsShearAmountsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public MobsShearAmountsPrompt(final ConversationContext context) {
|
||||
public QuestMobsShearAmountsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1451,18 +1451,18 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
if (i < 1) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidMinimum")
|
||||
.replace("<number>", "1"));
|
||||
return new MobsShearAmountsPrompt(context);
|
||||
return new QuestMobsShearAmountsPrompt(context);
|
||||
}
|
||||
shearAmounts.add(i);
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber")
|
||||
.replace("<input>", input));
|
||||
return new MobsShearAmountsPrompt(context);
|
||||
return new QuestMobsShearAmountsPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(pref + CK.S_SHEAR_AMOUNTS, shearAmounts);
|
||||
}
|
||||
return new MobsShearListPrompt(context);
|
||||
return new QuestMobsShearListPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -16,7 +16,7 @@ import me.blackvein.quests.Quests;
|
|||
import me.blackvein.quests.convo.generic.ItemStackPrompt;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorStringPrompt;
|
||||
import me.blackvein.quests.convo.quests.stages.StageMainPrompt;
|
||||
import me.blackvein.quests.convo.quests.stages.QuestStageMainPrompt;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenNumericPromptEvent;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenStringPromptEvent;
|
||||
import me.blackvein.quests.util.CK;
|
||||
|
@ -35,12 +35,12 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public class NpcsPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestNpcsPrompt extends QuestsEditorNumericPrompt {
|
||||
private final Quests plugin;
|
||||
private final int stageNum;
|
||||
private final String pref;
|
||||
|
||||
public NpcsPrompt(final int stageNum, final ConversationContext context) {
|
||||
public QuestNpcsPrompt(final int stageNum, final ConversationContext context) {
|
||||
super(context);
|
||||
this.plugin = (Quests)context.getPlugin();
|
||||
this.stageNum = stageNum;
|
||||
|
@ -189,40 +189,40 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
|
|||
switch(input.intValue()) {
|
||||
case 1:
|
||||
if (plugin.getDependencies().getCitizens() != null || plugin.getDependencies().getZnpcs() != null) {
|
||||
return new NpcsDeliveryListPrompt(context);
|
||||
return new QuestNpcsDeliveryListPrompt(context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNoCitizens"));
|
||||
return new StageMainPrompt(stageNum, context);
|
||||
return new QuestStageMainPrompt(stageNum, context);
|
||||
}
|
||||
case 2:
|
||||
if (plugin.getDependencies().getCitizens() != null || plugin.getDependencies().getZnpcs() != null) {
|
||||
return new NpcsIdsToTalkToPrompt(context);
|
||||
return new QuestNpcsIdsToTalkToPrompt(context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNoCitizens"));
|
||||
return new StageMainPrompt(stageNum, context);
|
||||
return new QuestStageMainPrompt(stageNum, context);
|
||||
}
|
||||
case 3:
|
||||
if (plugin.getDependencies().getCitizens() != null || plugin.getDependencies().getZnpcs() != null) {
|
||||
return new NpcsKillListPrompt(context);
|
||||
return new QuestNpcsKillListPrompt(context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNoCitizens"));
|
||||
return new StageMainPrompt(stageNum, context);
|
||||
return new QuestStageMainPrompt(stageNum, context);
|
||||
}
|
||||
case 4:
|
||||
try {
|
||||
return new StageMainPrompt(stageNum, context);
|
||||
return new QuestStageMainPrompt(stageNum, context);
|
||||
} catch (final Exception e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
}
|
||||
default:
|
||||
return new NpcsPrompt(stageNum, context);
|
||||
return new QuestNpcsPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
|
||||
public class NpcsDeliveryListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestNpcsDeliveryListPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public NpcsDeliveryListPrompt(final ConversationContext context) {
|
||||
public QuestNpcsDeliveryListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -370,17 +370,17 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new ItemStackPrompt(context, NpcsDeliveryListPrompt.this);
|
||||
return new ItemStackPrompt(context, QuestNpcsDeliveryListPrompt.this);
|
||||
case 2:
|
||||
return new NpcDeliveryNpcsPrompt(context);
|
||||
return new QuestNpcDeliveryNpcsPrompt(context);
|
||||
case 3:
|
||||
return new NpcDeliveryMessagesPrompt(context);
|
||||
return new QuestNpcDeliveryMessagesPrompt(context);
|
||||
case 4:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("cleared"));
|
||||
context.setSessionData(pref + CK.S_DELIVERY_ITEMS, null);
|
||||
context.setSessionData(pref + CK.S_DELIVERY_NPCS, null);
|
||||
context.setSessionData(pref + CK.S_DELIVERY_MESSAGES, null);
|
||||
return new NpcsDeliveryListPrompt(context);
|
||||
return new QuestNpcsDeliveryListPrompt(context);
|
||||
case 5:
|
||||
final int one;
|
||||
final int two;
|
||||
|
@ -399,23 +399,23 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
|
|||
if (one == two) {
|
||||
if (context.getSessionData(pref + CK.S_DELIVERY_MESSAGES) == null && one != 0) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNoDeliveryMessage"));
|
||||
return new NpcsDeliveryListPrompt(context);
|
||||
return new QuestNpcsDeliveryListPrompt(context);
|
||||
} else {
|
||||
return new NpcsPrompt(stageNum, context);
|
||||
return new QuestNpcsPrompt(stageNum, context);
|
||||
}
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new NpcsDeliveryListPrompt(context);
|
||||
return new QuestNpcsDeliveryListPrompt(context);
|
||||
}
|
||||
default:
|
||||
return new NpcsPrompt(stageNum, context);
|
||||
return new QuestNpcsPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class NpcDeliveryNpcsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestNpcDeliveryNpcsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public NpcDeliveryNpcsPrompt(final ConversationContext context) {
|
||||
public QuestNpcDeliveryNpcsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -460,17 +460,17 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
|
|||
for (final String s : args) {
|
||||
try {
|
||||
final UUID uuid = UUID.fromString(s);
|
||||
if (plugin.getDependencies().getNPCName(uuid) != null && npcs != null) {
|
||||
if (plugin.getDependencies().getNPCEntity(uuid) != null && npcs != null) {
|
||||
npcs.add(uuid.toString());
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidNPC")
|
||||
.replace("<input>", s));
|
||||
return new NpcDeliveryNpcsPrompt(context);
|
||||
return new QuestNpcDeliveryNpcsPrompt(context);
|
||||
}
|
||||
} catch (final IllegalArgumentException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfUniqueIds")
|
||||
.replace("<data>", s));
|
||||
return new NpcDeliveryNpcsPrompt(context);
|
||||
return new QuestNpcDeliveryNpcsPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(pref + CK.S_DELIVERY_NPCS, npcs);
|
||||
|
@ -487,13 +487,13 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
|
|||
final Set<UUID> selectingNpcs = plugin.getQuestFactory().getSelectingNpcs();
|
||||
selectingNpcs.remove(((Player) context.getForWhom()).getUniqueId());
|
||||
plugin.getQuestFactory().setSelectingNpcs(selectingNpcs);
|
||||
return new NpcsDeliveryListPrompt(context);
|
||||
return new QuestNpcsDeliveryListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class NpcDeliveryMessagesPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestNpcDeliveryMessagesPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public NpcDeliveryMessagesPrompt(final ConversationContext context) {
|
||||
public QuestNpcDeliveryMessagesPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -527,13 +527,13 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
|
|||
final LinkedList<String> messages = new LinkedList<>(Arrays.asList(args));
|
||||
context.setSessionData(pref + CK.S_DELIVERY_MESSAGES, messages);
|
||||
}
|
||||
return new NpcsDeliveryListPrompt(context);
|
||||
return new QuestNpcsDeliveryListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class NpcsIdsToTalkToPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestNpcsIdsToTalkToPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public NpcsIdsToTalkToPrompt(final ConversationContext context) {
|
||||
public QuestNpcsIdsToTalkToPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -578,17 +578,17 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
|
|||
for (final String s : args) {
|
||||
try {
|
||||
final UUID uuid = UUID.fromString(s);
|
||||
if (plugin.getDependencies().getNPCName(uuid) != null && npcs != null) {
|
||||
if (plugin.getDependencies().getNPCEntity(uuid) != null && npcs != null) {
|
||||
npcs.add(uuid.toString());
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidNPC")
|
||||
.replace("<input>", s));
|
||||
return new NpcsIdsToTalkToPrompt(context);
|
||||
return new QuestNpcsIdsToTalkToPrompt(context);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfUniqueIds")
|
||||
.replace("<data>", s));
|
||||
return new NpcsIdsToTalkToPrompt(context);
|
||||
return new QuestNpcsIdsToTalkToPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(pref + CK.S_NPCS_TO_TALK_TO, npcs);
|
||||
|
@ -600,13 +600,13 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
|
|||
selectingNpcs.remove(((Player) context.getForWhom()).getUniqueId());
|
||||
plugin.getQuestFactory().setSelectingNpcs(selectingNpcs);
|
||||
}
|
||||
return new StageMainPrompt(stageNum, context);
|
||||
return new QuestStageMainPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
|
||||
public class NpcsKillListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestNpcsKillListPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public NpcsKillListPrompt(final ConversationContext context) {
|
||||
public QuestNpcsKillListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -721,14 +721,14 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new NpcIdsToKillPrompt(context);
|
||||
return new QuestNpcIdsToKillPrompt(context);
|
||||
case 2:
|
||||
return new NpcAmountsToKillPrompt(context);
|
||||
return new QuestNpcAmountsToKillPrompt(context);
|
||||
case 3:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("stageEditorObjectiveCleared"));
|
||||
context.setSessionData(pref + CK.S_NPCS_TO_KILL, null);
|
||||
context.setSessionData(pref + CK.S_NPCS_TO_KILL_AMOUNTS, null);
|
||||
return new NpcsKillListPrompt(context);
|
||||
return new QuestNpcsKillListPrompt(context);
|
||||
case 4:
|
||||
final int one;
|
||||
final int two;
|
||||
|
@ -746,20 +746,20 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
|
|||
two = 0;
|
||||
}
|
||||
if (one == two) {
|
||||
return new StageMainPrompt(stageNum, context);
|
||||
return new QuestStageMainPrompt(stageNum, context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new NpcsKillListPrompt(context);
|
||||
return new QuestNpcsKillListPrompt(context);
|
||||
}
|
||||
default:
|
||||
return new NpcsPrompt(stageNum, context);
|
||||
return new QuestNpcsPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class NpcIdsToKillPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestNpcIdsToKillPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public NpcIdsToKillPrompt(final ConversationContext context) {
|
||||
public QuestNpcIdsToKillPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -804,17 +804,17 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
|
|||
for (final String s : args) {
|
||||
try {
|
||||
final UUID uuid = UUID.fromString(s);
|
||||
if (plugin.getDependencies().getNPCName(uuid) != null && npcs != null) {
|
||||
if (plugin.getDependencies().getNPCEntity(uuid) != null && npcs != null) {
|
||||
npcs.add(uuid.toString());
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidNPC")
|
||||
.replace("<input>", s));
|
||||
return new NpcIdsToKillPrompt(context);
|
||||
return new QuestNpcIdsToKillPrompt(context);
|
||||
}
|
||||
} catch (final IllegalArgumentException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfUniqueIds")
|
||||
.replace("<data>", s));
|
||||
return new NpcIdsToKillPrompt(context);
|
||||
return new QuestNpcIdsToKillPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(pref + CK.S_NPCS_TO_KILL, npcs);
|
||||
|
@ -835,13 +835,13 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
|
|||
final Set<UUID> selectingNpcs = plugin.getQuestFactory().getSelectingNpcs();
|
||||
selectingNpcs.remove(((Player) context.getForWhom()).getUniqueId());
|
||||
plugin.getQuestFactory().setSelectingNpcs(selectingNpcs);
|
||||
return new NpcsKillListPrompt(context);
|
||||
return new QuestNpcsKillListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class NpcAmountsToKillPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestNpcAmountsToKillPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public NpcAmountsToKillPrompt(final ConversationContext context) {
|
||||
public QuestNpcAmountsToKillPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -881,17 +881,17 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
|
|||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidMinimum")
|
||||
.replace("<number>", "1"));
|
||||
return new NpcAmountsToKillPrompt(context);
|
||||
return new QuestNpcAmountsToKillPrompt(context);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfUniqueIds")
|
||||
.replace("<data>", s));
|
||||
return new NpcAmountsToKillPrompt(context);
|
||||
return new QuestNpcAmountsToKillPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(pref + CK.S_NPCS_TO_KILL_AMOUNTS, amounts);
|
||||
}
|
||||
return new NpcsKillListPrompt(context);
|
||||
return new QuestNpcsKillListPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -28,13 +28,13 @@ import org.jetbrains.annotations.NotNull;
|
|||
|
||||
import java.util.Objects;
|
||||
|
||||
public class OptionsPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestOptionsPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
private final Quests plugin;
|
||||
private String tempKey;
|
||||
private Prompt tempPrompt;
|
||||
|
||||
public OptionsPrompt(final ConversationContext context) {
|
||||
public QuestOptionsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
this.plugin = (Quests)context.getPlugin();
|
||||
}
|
||||
|
@ -106,18 +106,19 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
return new OptionsGeneralPrompt(context);
|
||||
return new QuestOptionsGeneralPrompt(context);
|
||||
case 2:
|
||||
return new OptionsMultiplayerPrompt(context);
|
||||
return new QuestOptionsMultiplayerPrompt(context);
|
||||
case 3:
|
||||
return plugin.getQuestFactory().returnToMenu(context);
|
||||
default:
|
||||
return new OptionsPrompt(context);
|
||||
return new QuestOptionsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class OptionsPluginPrompt extends QuestsEditorStringPrompt {
|
||||
public OptionsPluginPrompt(final ConversationContext context) {
|
||||
public class QuestOptionsPluginPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public QuestOptionsPluginPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -165,7 +166,7 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
|
|||
if (input.equalsIgnoreCase("Quests")) {
|
||||
context.getForWhom().sendRawMessage(" " + ChatColor.AQUA + ChatColor.UNDERLINE
|
||||
+ "https://www.youtube.com/watch?v=gvdf5n-zI14");
|
||||
return new OptionsPluginPrompt(context);
|
||||
return new QuestOptionsPluginPrompt(context);
|
||||
}
|
||||
String properCase = null;
|
||||
for (final PartyProvider partyProvider : plugin.getDependencies().getPartyProviders()) {
|
||||
|
@ -177,7 +178,7 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
|
|||
String text = Lang.get("optNotAPluginName");
|
||||
text = text.replace("<plugin>", ChatColor.LIGHT_PURPLE + input + ChatColor.RED);
|
||||
context.getForWhom().sendRawMessage(text);
|
||||
return new OptionsPluginPrompt(context);
|
||||
return new QuestOptionsPluginPrompt(context);
|
||||
}
|
||||
context.setSessionData(CK.OPT_EXTERNAL_PARTY_PLUGIN, properCase);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
|
@ -188,8 +189,9 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
}
|
||||
|
||||
public class OptionsTrueFalsePrompt extends QuestsEditorStringPrompt {
|
||||
public OptionsTrueFalsePrompt(final ConversationContext context) {
|
||||
public class QuestOptionsTrueFalsePrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public QuestOptionsTrueFalsePrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -209,7 +211,8 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
|
|||
return Lang.get("optBooleanQuery").replace("<true>", Lang.get("true"))
|
||||
.replace("<false>", Lang.get("false"));
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public String getSelectionText(final ConversationContext context, final int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
|
@ -251,7 +254,7 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
|
|||
context.setSessionData(tempKey, false);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidInput"));
|
||||
return new OptionsTrueFalsePrompt(context);
|
||||
return new QuestOptionsTrueFalsePrompt(context);
|
||||
}
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(tempKey, null);
|
||||
|
@ -261,8 +264,9 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
}
|
||||
|
||||
public class OptionsLevelPrompt extends QuestsEditorStringPrompt {
|
||||
public OptionsLevelPrompt(final ConversationContext context) {
|
||||
public class QuestOptionsLevelPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public QuestOptionsLevelPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -281,7 +285,8 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
|
|||
public String getQueryText(final ConversationContext context) {
|
||||
return Lang.get("optNumberQuery");
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public String getSelectionText(final ConversationContext context, final int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
|
@ -300,7 +305,8 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public String getAdditionalText(final ConversationContext context, final int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
|
@ -360,8 +366,9 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
}
|
||||
|
||||
public class OptionsDistancePrompt extends QuestsEditorStringPrompt {
|
||||
public OptionsDistancePrompt(final ConversationContext context) {
|
||||
public class QuestOptionsDistancePrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public QuestOptionsDistancePrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -407,8 +414,9 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
}
|
||||
|
||||
public class OptionsGeneralPrompt extends QuestsEditorNumericPrompt {
|
||||
public OptionsGeneralPrompt(final ConversationContext context) {
|
||||
public class QuestOptionsGeneralPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public QuestOptionsGeneralPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -529,25 +537,25 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
|
|||
switch (input.intValue()) {
|
||||
case 1:
|
||||
tempKey = CK.OPT_ALLOW_COMMANDS;
|
||||
tempPrompt = new OptionsGeneralPrompt(context);
|
||||
return new OptionsTrueFalsePrompt(context);
|
||||
tempPrompt = new QuestOptionsGeneralPrompt(context);
|
||||
return new QuestOptionsTrueFalsePrompt(context);
|
||||
case 2:
|
||||
tempKey = CK.OPT_ALLOW_QUITTING;
|
||||
tempPrompt = new OptionsGeneralPrompt(context);
|
||||
return new OptionsTrueFalsePrompt(context);
|
||||
tempPrompt = new QuestOptionsGeneralPrompt(context);
|
||||
return new QuestOptionsTrueFalsePrompt(context);
|
||||
case 3:
|
||||
tempKey = CK.OPT_IGNORE_SILK_TOUCH;
|
||||
tempPrompt = new OptionsGeneralPrompt(context);
|
||||
return new OptionsTrueFalsePrompt(context);
|
||||
tempPrompt = new QuestOptionsGeneralPrompt(context);
|
||||
return new QuestOptionsTrueFalsePrompt(context);
|
||||
case 4:
|
||||
tempKey = CK.OPT_IGNORE_BLOCK_REPLACE;
|
||||
tempPrompt = new OptionsGeneralPrompt(context);
|
||||
return new OptionsTrueFalsePrompt(context);
|
||||
tempPrompt = new QuestOptionsGeneralPrompt(context);
|
||||
return new QuestOptionsTrueFalsePrompt(context);
|
||||
case 5:
|
||||
tempKey = null;
|
||||
tempPrompt = null;
|
||||
try {
|
||||
return new OptionsPrompt(context);
|
||||
return new QuestOptionsPrompt(context);
|
||||
} catch (final Exception e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
|
@ -558,8 +566,9 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
}
|
||||
|
||||
public class OptionsMultiplayerPrompt extends QuestsEditorNumericPrompt {
|
||||
public OptionsMultiplayerPrompt(final ConversationContext context) {
|
||||
public class QuestOptionsMultiplayerPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public QuestOptionsMultiplayerPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -707,33 +716,33 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
|
|||
switch (input.intValue()) {
|
||||
case 1:
|
||||
tempKey = CK.OPT_EXTERNAL_PARTY_PLUGIN;
|
||||
tempPrompt = new OptionsMultiplayerPrompt(context);
|
||||
return new OptionsPluginPrompt(context);
|
||||
tempPrompt = new QuestOptionsMultiplayerPrompt(context);
|
||||
return new QuestOptionsPluginPrompt(context);
|
||||
case 2:
|
||||
tempKey = CK.OPT_USE_PARTIES_PLUGIN;
|
||||
tempPrompt = new OptionsMultiplayerPrompt(context);
|
||||
return new OptionsTrueFalsePrompt(context);
|
||||
tempPrompt = new QuestOptionsMultiplayerPrompt(context);
|
||||
return new QuestOptionsTrueFalsePrompt(context);
|
||||
case 3:
|
||||
tempKey = CK.OPT_SHARE_PROGRESS_LEVEL;
|
||||
tempPrompt = new OptionsMultiplayerPrompt(context);
|
||||
return new OptionsLevelPrompt(context);
|
||||
tempPrompt = new QuestOptionsMultiplayerPrompt(context);
|
||||
return new QuestOptionsLevelPrompt(context);
|
||||
case 4:
|
||||
tempKey = CK.OPT_SHARE_SAME_QUEST_ONLY;
|
||||
tempPrompt = new OptionsMultiplayerPrompt(context);
|
||||
return new OptionsTrueFalsePrompt(context);
|
||||
tempPrompt = new QuestOptionsMultiplayerPrompt(context);
|
||||
return new QuestOptionsTrueFalsePrompt(context);
|
||||
case 5:
|
||||
tempKey = CK.OPT_SHARE_DISTANCE;
|
||||
tempPrompt = new OptionsMultiplayerPrompt(context);
|
||||
return new OptionsDistancePrompt(context);
|
||||
tempPrompt = new QuestOptionsMultiplayerPrompt(context);
|
||||
return new QuestOptionsDistancePrompt(context);
|
||||
case 6:
|
||||
tempKey = CK.OPT_HANDLE_OFFLINE_PLAYERS;
|
||||
tempPrompt = new OptionsMultiplayerPrompt(context);
|
||||
return new OptionsTrueFalsePrompt(context);
|
||||
tempPrompt = new QuestOptionsMultiplayerPrompt(context);
|
||||
return new QuestOptionsTrueFalsePrompt(context);
|
||||
case 7:
|
||||
tempKey = null;
|
||||
tempPrompt = null;
|
||||
try {
|
||||
return new OptionsPrompt(context);
|
||||
return new QuestOptionsPrompt(context);
|
||||
} catch (final Exception e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
|
@ -30,13 +30,13 @@ import java.util.Calendar;
|
|||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
|
||||
public class DateTimePrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestDateTimePrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
private final Quests plugin;
|
||||
private final Prompt oldPrompt;
|
||||
private final String source;
|
||||
|
||||
public DateTimePrompt(final ConversationContext context, final Prompt old, final String origin) {
|
||||
public QuestDateTimePrompt(final ConversationContext context, final Prompt old, final String origin) {
|
||||
super(context);
|
||||
this.plugin = (Quests)context.getPlugin();
|
||||
oldPrompt = old;
|
||||
|
@ -220,21 +220,21 @@ public class DateTimePrompt extends QuestsEditorNumericPrompt {
|
|||
context.setSessionData("tempMinute", cal.get(Calendar.MINUTE));
|
||||
context.setSessionData("tempSecond", cal.get(Calendar.SECOND));
|
||||
context.setSessionData("tempZone", cal.getTimeZone().getID());
|
||||
return new DateTimePrompt(context, oldPrompt, source);
|
||||
return new QuestDateTimePrompt(context, oldPrompt, source);
|
||||
case 1:
|
||||
return new YearPrompt(context);
|
||||
return new QuestYearPrompt(context);
|
||||
case 2:
|
||||
return new MonthPrompt(context);
|
||||
return new QuestMonthPrompt(context);
|
||||
case 3:
|
||||
return new DayPrompt(context);
|
||||
return new QuestDayPrompt(context);
|
||||
case 4:
|
||||
return new HourPrompt(context);
|
||||
return new QuestHourPrompt(context);
|
||||
case 5:
|
||||
return new MinutePrompt(context);
|
||||
return new QuestMinutePrompt(context);
|
||||
case 6:
|
||||
return new SecondPrompt(context);
|
||||
return new QuestSecondPrompt(context);
|
||||
case 7:
|
||||
return new OffsetPrompt(context);
|
||||
return new QuestOffsetPrompt(context);
|
||||
case 8:
|
||||
context.setSessionData("tempYear", null);
|
||||
context.setSessionData("tempMonth", null);
|
||||
|
@ -278,18 +278,18 @@ public class DateTimePrompt extends QuestsEditorNumericPrompt {
|
|||
|| context.getSessionData("tempMinute") != null || context.getSessionData("tempSecond") != null
|
||||
|| context.getSessionData("tempZone") != null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new DateTimePrompt(context, oldPrompt, source);
|
||||
return new QuestDateTimePrompt(context, oldPrompt, source);
|
||||
} else {
|
||||
return oldPrompt;
|
||||
}
|
||||
default:
|
||||
return new DateTimePrompt(context, oldPrompt, source);
|
||||
return new QuestDateTimePrompt(context, oldPrompt, source);
|
||||
}
|
||||
}
|
||||
|
||||
public class YearPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestYearPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public YearPrompt(final ConversationContext context) {
|
||||
public QuestYearPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -325,24 +325,24 @@ public class DateTimePrompt extends QuestsEditorNumericPrompt {
|
|||
if (amt < 1000 || amt > 9999) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidRange")
|
||||
.replace("<least>", "1000").replace("<greatest>", "9999"));
|
||||
return new YearPrompt(context);
|
||||
return new QuestYearPrompt(context);
|
||||
} else {
|
||||
context.setSessionData("tempYear", Integer.parseInt(input));
|
||||
return new DateTimePrompt(context, oldPrompt, source);
|
||||
return new QuestDateTimePrompt(context, oldPrompt, source);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidInput"));
|
||||
return new YearPrompt(context);
|
||||
return new QuestYearPrompt(context);
|
||||
}
|
||||
} else {
|
||||
return new DateTimePrompt(context, oldPrompt, source);
|
||||
return new QuestDateTimePrompt(context, oldPrompt, source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MonthPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestMonthPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public MonthPrompt(final ConversationContext context) {
|
||||
public QuestMonthPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -378,24 +378,24 @@ public class DateTimePrompt extends QuestsEditorNumericPrompt {
|
|||
if (amt < 1 || amt > 12) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidRange")
|
||||
.replace("<least>", "1").replace("<greatest>", "12"));
|
||||
return new MonthPrompt(context);
|
||||
return new QuestMonthPrompt(context);
|
||||
} else {
|
||||
context.setSessionData("tempMonth", Integer.parseInt(input) - 1);
|
||||
return new DateTimePrompt(context, oldPrompt, source);
|
||||
return new QuestDateTimePrompt(context, oldPrompt, source);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidInput"));
|
||||
return new MonthPrompt(context);
|
||||
return new QuestMonthPrompt(context);
|
||||
}
|
||||
} else {
|
||||
return new DateTimePrompt(context, oldPrompt, source);
|
||||
return new QuestDateTimePrompt(context, oldPrompt, source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class DayPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestDayPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public DayPrompt(final ConversationContext context) {
|
||||
public QuestDayPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -431,24 +431,24 @@ public class DateTimePrompt extends QuestsEditorNumericPrompt {
|
|||
if (amt < 1 || amt > 31) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidRange")
|
||||
.replace("<least>", "1").replace("<greatest>", "31"));
|
||||
return new DayPrompt(context);
|
||||
return new QuestDayPrompt(context);
|
||||
} else {
|
||||
context.setSessionData("tempDay", Integer.parseInt(input));
|
||||
return new DateTimePrompt(context, oldPrompt, source);
|
||||
return new QuestDateTimePrompt(context, oldPrompt, source);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidInput"));
|
||||
return new DayPrompt(context);
|
||||
return new QuestDayPrompt(context);
|
||||
}
|
||||
} else {
|
||||
return new DateTimePrompt(context, oldPrompt, source);
|
||||
return new QuestDateTimePrompt(context, oldPrompt, source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class HourPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestHourPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public HourPrompt(final ConversationContext context) {
|
||||
public QuestHourPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -484,24 +484,24 @@ public class DateTimePrompt extends QuestsEditorNumericPrompt {
|
|||
if (amt < 0 || amt > 23) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidRange")
|
||||
.replace("<least>", "0").replace("<greatest>", "23"));
|
||||
return new HourPrompt(context);
|
||||
return new QuestHourPrompt(context);
|
||||
} else {
|
||||
context.setSessionData("tempHour", Integer.parseInt(input));
|
||||
return new DateTimePrompt(context, oldPrompt, source);
|
||||
return new QuestDateTimePrompt(context, oldPrompt, source);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidInput"));
|
||||
return new HourPrompt(context);
|
||||
return new QuestHourPrompt(context);
|
||||
}
|
||||
} else {
|
||||
return new DateTimePrompt(context, oldPrompt, source);
|
||||
return new QuestDateTimePrompt(context, oldPrompt, source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MinutePrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestMinutePrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public MinutePrompt(final ConversationContext context) {
|
||||
public QuestMinutePrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -537,24 +537,24 @@ public class DateTimePrompt extends QuestsEditorNumericPrompt {
|
|||
if (amt < 0 || amt > 59) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidRange")
|
||||
.replace("<least>", "0").replace("<greatest>", "59"));
|
||||
return new MinutePrompt(context);
|
||||
return new QuestMinutePrompt(context);
|
||||
} else {
|
||||
context.setSessionData("tempMinute", Integer.parseInt(input));
|
||||
return new DateTimePrompt(context, oldPrompt, source);
|
||||
return new QuestDateTimePrompt(context, oldPrompt, source);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidInput"));
|
||||
return new MinutePrompt(context);
|
||||
return new QuestMinutePrompt(context);
|
||||
}
|
||||
} else {
|
||||
return new DateTimePrompt(context, oldPrompt, source);
|
||||
return new QuestDateTimePrompt(context, oldPrompt, source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SecondPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestSecondPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public SecondPrompt(final ConversationContext context) {
|
||||
public QuestSecondPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -590,24 +590,24 @@ public class DateTimePrompt extends QuestsEditorNumericPrompt {
|
|||
if (amt < 0 || amt > 59) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidRange")
|
||||
.replace("<least>", "0").replace("<greatest>", "59"));
|
||||
return new SecondPrompt(context);
|
||||
return new QuestSecondPrompt(context);
|
||||
} else {
|
||||
context.setSessionData("tempSecond", Integer.parseInt(input));
|
||||
return new DateTimePrompt(context, oldPrompt, source);
|
||||
return new QuestDateTimePrompt(context, oldPrompt, source);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidInput"));
|
||||
return new SecondPrompt(context);
|
||||
return new QuestSecondPrompt(context);
|
||||
}
|
||||
} else {
|
||||
return new DateTimePrompt(context, oldPrompt, source);
|
||||
return new QuestDateTimePrompt(context, oldPrompt, source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class OffsetPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestOffsetPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public OffsetPrompt(final ConversationContext context) {
|
||||
public QuestOffsetPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -643,33 +643,33 @@ public class DateTimePrompt extends QuestsEditorNumericPrompt {
|
|||
if (amt < -12.0 || amt > 14.0) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidRange")
|
||||
.replace("<least>", "-12:00").replace("<greatest>", "14:00"));
|
||||
return new OffsetPrompt(context);
|
||||
return new QuestOffsetPrompt(context);
|
||||
} else {
|
||||
final String[] t = TimeZone.getAvailableIDs((int) Math.round(amt * 60.0 * 60.0 * 1000.0));
|
||||
if (t.length > 1) {
|
||||
return new ZonePrompt(context, t);
|
||||
return new QuestZonePrompt(context, t);
|
||||
} else if (t.length > 0) {
|
||||
context.setSessionData("tempZone", t[0]);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidInput"));
|
||||
}
|
||||
return new DateTimePrompt(context, oldPrompt, source);
|
||||
return new QuestDateTimePrompt(context, oldPrompt, source);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidInput"));
|
||||
return new OffsetPrompt(context);
|
||||
return new QuestOffsetPrompt(context);
|
||||
}
|
||||
} else {
|
||||
return new DateTimePrompt(context, oldPrompt, source);
|
||||
return new QuestDateTimePrompt(context, oldPrompt, source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ZonePrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestZonePrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
String[] zones;
|
||||
|
||||
public ZonePrompt(final ConversationContext context, final String[] timezones) {
|
||||
public QuestZonePrompt(final ConversationContext context, final String[] timezones) {
|
||||
super(context);
|
||||
zones = timezones;
|
||||
}
|
||||
|
@ -709,13 +709,13 @@ public class DateTimePrompt extends QuestsEditorNumericPrompt {
|
|||
for (final String z : zones) {
|
||||
if (z.toLowerCase().startsWith(input.toLowerCase())) {
|
||||
context.setSessionData("tempZone", z);
|
||||
return new DateTimePrompt(context, oldPrompt, source);
|
||||
return new QuestDateTimePrompt(context, oldPrompt, source);
|
||||
}
|
||||
}
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidInput"));
|
||||
return new ZonePrompt(context, zones);
|
||||
return new QuestZonePrompt(context, zones);
|
||||
} else {
|
||||
return new DateTimePrompt(context, oldPrompt, source);
|
||||
return new QuestDateTimePrompt(context, oldPrompt, source);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -33,11 +33,11 @@ import java.util.Locale;
|
|||
import java.util.Objects;
|
||||
import java.util.TimeZone;
|
||||
|
||||
public class PlannerPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestPlannerPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
private final Quests plugin;
|
||||
|
||||
public PlannerPrompt(final ConversationContext context) {
|
||||
public QuestPlannerPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
this.plugin = (Quests)context.getPlugin();
|
||||
}
|
||||
|
@ -179,30 +179,30 @@ public class PlannerPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
return new DateTimePrompt(context, PlannerPrompt.this, "start");
|
||||
return new QuestDateTimePrompt(context, QuestPlannerPrompt.this, "start");
|
||||
case 2:
|
||||
return new DateTimePrompt(context, PlannerPrompt.this, "end");
|
||||
return new QuestDateTimePrompt(context, QuestPlannerPrompt.this, "end");
|
||||
case 3:
|
||||
if (context.getSessionData(CK.PLN_START_DATE) != null && context.getSessionData(CK.PLN_END_DATE) != null) {
|
||||
return new PlannerRepeatPrompt(context);
|
||||
return new QuestPlannerRepeatPrompt(context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||
return new PlannerPrompt(context);
|
||||
return new QuestPlannerPrompt(context);
|
||||
}
|
||||
case 4:
|
||||
return new PlannerCooldownPrompt(context);
|
||||
return new QuestPlannerCooldownPrompt(context);
|
||||
case 5:
|
||||
return new PlannerOverridePrompt(context);
|
||||
return new QuestPlannerOverridePrompt(context);
|
||||
case 6:
|
||||
return plugin.getQuestFactory().returnToMenu(context);
|
||||
default:
|
||||
return new PlannerPrompt(context);
|
||||
return new QuestPlannerPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class PlannerRepeatPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestPlannerRepeatPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public PlannerRepeatPrompt(final ConversationContext context) {
|
||||
public QuestPlannerRepeatPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -233,11 +233,11 @@ public class PlannerPrompt extends QuestsEditorNumericPrompt {
|
|||
return null;
|
||||
}
|
||||
if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
return new PlannerPrompt(context);
|
||||
return new QuestPlannerPrompt(context);
|
||||
}
|
||||
if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.PLN_REPEAT_CYCLE, null);
|
||||
return new PlannerPrompt(context);
|
||||
return new QuestPlannerPrompt(context);
|
||||
}
|
||||
final long delay;
|
||||
try {
|
||||
|
@ -251,15 +251,15 @@ public class PlannerPrompt extends QuestsEditorNumericPrompt {
|
|||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber")
|
||||
.replace("<input>", input));
|
||||
return new PlannerRepeatPrompt(context);
|
||||
return new QuestPlannerRepeatPrompt(context);
|
||||
}
|
||||
return new PlannerPrompt(context);
|
||||
return new QuestPlannerPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class PlannerCooldownPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestPlannerCooldownPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public PlannerCooldownPrompt(final ConversationContext context) {
|
||||
public QuestPlannerCooldownPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -290,11 +290,11 @@ public class PlannerPrompt extends QuestsEditorNumericPrompt {
|
|||
return null;
|
||||
}
|
||||
if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
return new PlannerPrompt(context);
|
||||
return new QuestPlannerPrompt(context);
|
||||
}
|
||||
if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.PLN_COOLDOWN, null);
|
||||
return new PlannerPrompt(context);
|
||||
return new QuestPlannerPrompt(context);
|
||||
}
|
||||
final long delay;
|
||||
try {
|
||||
|
@ -308,14 +308,14 @@ public class PlannerPrompt extends QuestsEditorNumericPrompt {
|
|||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber")
|
||||
.replace("<input>", input));
|
||||
return new PlannerCooldownPrompt(context);
|
||||
return new QuestPlannerCooldownPrompt(context);
|
||||
}
|
||||
return new PlannerPrompt(context);
|
||||
return new QuestPlannerPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class PlannerOverridePrompt extends QuestsEditorStringPrompt {
|
||||
public PlannerOverridePrompt(final ConversationContext context) {
|
||||
public class QuestPlannerOverridePrompt extends QuestsEditorStringPrompt {
|
||||
public QuestPlannerOverridePrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -337,7 +337,8 @@ public class PlannerPrompt extends QuestsEditorNumericPrompt {
|
|||
text = text.replace("<false>", Lang.get("false"));
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public String getSelectionText(final ConversationContext context, final int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
|
@ -381,13 +382,13 @@ public class PlannerPrompt extends QuestsEditorNumericPrompt {
|
|||
context.setSessionData(CK.PLN_OVERRIDE, false);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidInput"));
|
||||
return new PlannerOverridePrompt(context);
|
||||
return new QuestPlannerOverridePrompt(context);
|
||||
}
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.PLN_OVERRIDE, null);
|
||||
return new PlannerPrompt(context);
|
||||
return new QuestPlannerPrompt(context);
|
||||
}
|
||||
return new PlannerPrompt(context);
|
||||
return new QuestPlannerPrompt(context);
|
||||
}
|
||||
}
|
||||
|
|
@ -47,14 +47,14 @@ import java.util.Objects;
|
|||
import java.util.TreeSet;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestRequirementsPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
private final Quests plugin;
|
||||
private final String classPrefix;
|
||||
private boolean hasRequirement = false;
|
||||
private final int size = 12;
|
||||
|
||||
public RequirementsPrompt(final ConversationContext context) {
|
||||
public QuestRequirementsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
this.plugin = (Quests)context.getPlugin();
|
||||
this.classPrefix = getClass().getSimpleName();
|
||||
|
@ -376,36 +376,36 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
switch (input.intValue()) {
|
||||
case 1:
|
||||
if (plugin.getDependencies().getVaultEconomy() != null) {
|
||||
return new RequirementsMoneyPrompt(context);
|
||||
return new QuestRequirementsMoneyPrompt(context);
|
||||
} else {
|
||||
return new RequirementsPrompt(context);
|
||||
return new QuestRequirementsPrompt(context);
|
||||
}
|
||||
case 2:
|
||||
return new RequirementsQuestPointsPrompt(context);
|
||||
return new QuestRequirementsQuestPointsPrompt(context);
|
||||
case 3:
|
||||
return new RequirementsItemListPrompt(context);
|
||||
return new QuestRequirementsItemListPrompt(context);
|
||||
case 4:
|
||||
return new RequirementsExperiencePrompt(context);
|
||||
return new QuestRequirementsExperiencePrompt(context);
|
||||
case 5:
|
||||
return new RequirementsPermissionsPrompt(context);
|
||||
return new QuestRequirementsPermissionsPrompt(context);
|
||||
case 6:
|
||||
return new RequirementsQuestListPrompt(context, true);
|
||||
return new QuestRequirementsQuestListPrompt(context, true);
|
||||
case 7:
|
||||
return new RequirementsQuestListPrompt(context, false);
|
||||
return new QuestRequirementsQuestListPrompt(context, false);
|
||||
case 8:
|
||||
if (plugin.getDependencies().getMcmmoClassic() != null) {
|
||||
return new RequirementsMcMMOListPrompt(context);
|
||||
return new QuestRequirementsMcMMOListPrompt(context);
|
||||
} else {
|
||||
return new RequirementsPrompt(context);
|
||||
return new QuestRequirementsPrompt(context);
|
||||
}
|
||||
case 9:
|
||||
if (plugin.getDependencies().getHeroes() != null) {
|
||||
return new RequirementsHeroesListPrompt(context);
|
||||
return new QuestRequirementsHeroesListPrompt(context);
|
||||
} else {
|
||||
return new RequirementsPrompt(context);
|
||||
return new QuestRequirementsPrompt(context);
|
||||
}
|
||||
case 10:
|
||||
return new CustomRequirementModulePrompt(context);
|
||||
return new QuestCustomRequirementModulePrompt(context);
|
||||
case 11:
|
||||
if (hasRequirement) {
|
||||
return new OverridePrompt.Builder()
|
||||
|
@ -415,12 +415,12 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
.build();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||
return new RequirementsPrompt(context);
|
||||
return new QuestRequirementsPrompt(context);
|
||||
}
|
||||
case 12:
|
||||
return plugin.getQuestFactory().returnToMenu(context);
|
||||
default:
|
||||
return new RequirementsPrompt(context);
|
||||
return new QuestRequirementsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -442,9 +442,9 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
return false;
|
||||
}
|
||||
|
||||
public class RequirementsMoneyPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestRequirementsMoneyPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public RequirementsMoneyPrompt(final ConversationContext context) {
|
||||
public QuestRequirementsMoneyPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -489,24 +489,24 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
context.setSessionData(CK.REQ_MONEY, i);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("inputPosNum"));
|
||||
return new RequirementsMoneyPrompt(context);
|
||||
return new QuestRequirementsMoneyPrompt(context);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber")
|
||||
.replace("<input>", input));
|
||||
return new RequirementsMoneyPrompt(context);
|
||||
return new QuestRequirementsMoneyPrompt(context);
|
||||
}
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.REQ_MONEY, null);
|
||||
return new RequirementsPrompt(context);
|
||||
return new QuestRequirementsPrompt(context);
|
||||
}
|
||||
return new RequirementsPrompt(context);
|
||||
return new QuestRequirementsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class RequirementsQuestPointsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestRequirementsQuestPointsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public RequirementsQuestPointsPrompt(final ConversationContext context) {
|
||||
public QuestRequirementsQuestPointsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -543,24 +543,24 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
context.setSessionData(CK.REQ_QUEST_POINTS, i);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("inputPosNum"));
|
||||
return new RequirementsQuestPointsPrompt(context);
|
||||
return new QuestRequirementsQuestPointsPrompt(context);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber")
|
||||
.replace("<input>", input));
|
||||
return new RequirementsQuestPointsPrompt(context);
|
||||
return new QuestRequirementsQuestPointsPrompt(context);
|
||||
}
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.REQ_QUEST_POINTS, null);
|
||||
return new RequirementsPrompt(context);
|
||||
return new QuestRequirementsPrompt(context);
|
||||
}
|
||||
return new RequirementsPrompt(context);
|
||||
return new QuestRequirementsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class RequirementsItemListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestRequirementsItemListPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public RequirementsItemListPrompt(final ConversationContext context) {
|
||||
public QuestRequirementsItemListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -702,19 +702,19 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
return new ItemStackPrompt(context, RequirementsItemListPrompt.this);
|
||||
return new ItemStackPrompt(context, QuestRequirementsItemListPrompt.this);
|
||||
case 2:
|
||||
if (context.getSessionData(CK.REQ_ITEMS) == null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqMustAddItem"));
|
||||
return new RequirementsItemListPrompt(context);
|
||||
return new QuestRequirementsItemListPrompt(context);
|
||||
} else {
|
||||
return new RemoveItemsPrompt(context);
|
||||
return new QuestRemoveItemsPrompt(context);
|
||||
}
|
||||
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 RequirementsItemListPrompt(context);
|
||||
return new QuestRequirementsItemListPrompt(context);
|
||||
case 4:
|
||||
final int missing;
|
||||
final List<ItemStack> items = (List<ItemStack>) context.getSessionData(CK.REQ_ITEMS);
|
||||
|
@ -731,16 +731,16 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
}
|
||||
context.setSessionData(CK.REQ_ITEMS_REMOVE, remove);
|
||||
return new RequirementsPrompt(context);
|
||||
return new QuestRequirementsPrompt(context);
|
||||
default:
|
||||
return new RequirementsPrompt(context);
|
||||
return new QuestRequirementsPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class RemoveItemsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestRemoveItemsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public RemoveItemsPrompt(final ConversationContext context) {
|
||||
public QuestRemoveItemsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -782,18 +782,18 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
booleans.add(false);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidInput"));
|
||||
return new RemoveItemsPrompt(context);
|
||||
return new QuestRemoveItemsPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(CK.REQ_ITEMS_REMOVE, booleans);
|
||||
}
|
||||
return new RequirementsItemListPrompt(context);
|
||||
return new QuestRequirementsItemListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class RequirementsExperiencePrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestRequirementsExperiencePrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public RequirementsExperiencePrompt(final ConversationContext context) {
|
||||
public QuestRequirementsExperiencePrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -830,24 +830,24 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
context.setSessionData(CK.REQ_EXP, i);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("inputPosNum"));
|
||||
return new RequirementsExperiencePrompt(context);
|
||||
return new QuestRequirementsExperiencePrompt(context);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber")
|
||||
.replace("<input>", input));
|
||||
return new RequirementsExperiencePrompt(context);
|
||||
return new QuestRequirementsExperiencePrompt(context);
|
||||
}
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.REQ_EXP, null);
|
||||
return new RequirementsPrompt(context);
|
||||
return new QuestRequirementsPrompt(context);
|
||||
}
|
||||
return new RequirementsPrompt(context);
|
||||
return new QuestRequirementsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class RequirementsPermissionsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestRequirementsPermissionsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public RequirementsPermissionsPrompt(final ConversationContext context) {
|
||||
public QuestRequirementsPermissionsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -884,15 +884,15 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.REQ_PERMISSION, null);
|
||||
}
|
||||
return new RequirementsPrompt(context);
|
||||
return new QuestRequirementsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class RequirementsQuestListPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestRequirementsQuestListPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
private final boolean isRequiredQuest;
|
||||
|
||||
public RequirementsQuestListPrompt(final ConversationContext context, final boolean isRequired) {
|
||||
public QuestRequirementsQuestListPrompt(final ConversationContext context, final boolean isRequired) {
|
||||
super(context);
|
||||
this.isRequiredQuest = isRequired;
|
||||
}
|
||||
|
@ -933,11 +933,11 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
String text = Lang.get("reqNotAQuestName");
|
||||
text = text.replace("<quest>", ChatColor.LIGHT_PURPLE + s + ChatColor.RED);
|
||||
context.getForWhom().sendRawMessage(text);
|
||||
return new RequirementsQuestListPrompt(context, isRequiredQuest);
|
||||
return new QuestRequirementsQuestListPrompt(context, isRequiredQuest);
|
||||
}
|
||||
if (questIds.contains(plugin.getQuestTemp(s).getId())) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listDuplicate"));
|
||||
return new RequirementsQuestListPrompt(context, isRequiredQuest);
|
||||
return new QuestRequirementsQuestListPrompt(context, isRequiredQuest);
|
||||
}
|
||||
questIds.add(plugin.getQuestTemp(s).getId());
|
||||
}
|
||||
|
@ -953,13 +953,13 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
context.setSessionData(CK.REQ_QUEST_BLOCK, null);
|
||||
}
|
||||
}
|
||||
return new RequirementsPrompt(context);
|
||||
return new QuestRequirementsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class RequirementsMcMMOListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestRequirementsMcMMOListPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public RequirementsMcMMOListPrompt(final ConversationContext context) {
|
||||
public QuestRequirementsMcMMOListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1060,20 +1060,20 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new McMMOSkillsPrompt(context);
|
||||
return new QuestMcMMOSkillsPrompt(context);
|
||||
case 2:
|
||||
return new McMMOAmountsPrompt(context);
|
||||
return new QuestMcMMOAmountsPrompt(context);
|
||||
case 3:
|
||||
return new RequirementsPrompt(context);
|
||||
return new QuestRequirementsPrompt(context);
|
||||
default:
|
||||
return new RequirementsMcMMOListPrompt(context);
|
||||
return new QuestRequirementsMcMMOListPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class McMMOSkillsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestMcMMOSkillsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public McMMOSkillsPrompt(final ConversationContext context) {
|
||||
public QuestMcMMOSkillsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1120,30 +1120,30 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
skills.add(formatted);
|
||||
} else if (skills.contains(formatted)) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("listDuplicate"));
|
||||
return new McMMOSkillsPrompt(context);
|
||||
return new QuestMcMMOSkillsPrompt(context);
|
||||
} else {
|
||||
String text = Lang.get("reqMcMMOError");
|
||||
text = text.replace("<input>", ChatColor.RED + s + ChatColor.YELLOW);
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + text);
|
||||
return new McMMOSkillsPrompt(context);
|
||||
return new QuestMcMMOSkillsPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(CK.REQ_MCMMO_SKILLS, skills);
|
||||
return new RequirementsMcMMOListPrompt(context);
|
||||
return new QuestRequirementsMcMMOListPrompt(context);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqMcMMOCleared"));
|
||||
context.setSessionData(CK.REQ_MCMMO_SKILLS, null);
|
||||
return new RequirementsMcMMOListPrompt(context);
|
||||
return new QuestRequirementsMcMMOListPrompt(context);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
return new RequirementsMcMMOListPrompt(context);
|
||||
return new QuestRequirementsMcMMOListPrompt(context);
|
||||
}
|
||||
return new McMMOSkillsPrompt(context);
|
||||
return new QuestMcMMOSkillsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class McMMOAmountsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestMcMMOAmountsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public McMMOAmountsPrompt(final ConversationContext context) {
|
||||
public QuestMcMMOAmountsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1183,25 +1183,25 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
String text = Lang.get("reqNotANumber");
|
||||
text = text.replace("<input>", ChatColor.RED + s + ChatColor.YELLOW);
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + text);
|
||||
return new McMMOAmountsPrompt(context);
|
||||
return new QuestMcMMOAmountsPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(CK.REQ_MCMMO_SKILL_AMOUNTS, amounts);
|
||||
return new RequirementsMcMMOListPrompt(context);
|
||||
return new QuestRequirementsMcMMOListPrompt(context);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqMcMMOAmountsCleared"));
|
||||
context.setSessionData(CK.REQ_MCMMO_SKILL_AMOUNTS, null);
|
||||
return new RequirementsMcMMOListPrompt(context);
|
||||
return new QuestRequirementsMcMMOListPrompt(context);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
return new RequirementsMcMMOListPrompt(context);
|
||||
return new QuestRequirementsMcMMOListPrompt(context);
|
||||
}
|
||||
return new McMMOAmountsPrompt(context);
|
||||
return new QuestMcMMOAmountsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class RequirementsHeroesListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestRequirementsHeroesListPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public RequirementsHeroesListPrompt(final ConversationContext context) {
|
||||
public QuestRequirementsHeroesListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1288,20 +1288,20 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new HeroesPrimaryPrompt(context);
|
||||
return new QuestHeroesPrimaryPrompt(context);
|
||||
case 2:
|
||||
return new HeroesSecondaryPrompt(context);
|
||||
return new QuestHeroesSecondaryPrompt(context);
|
||||
case 3:
|
||||
return new RequirementsPrompt(context);
|
||||
return new QuestRequirementsPrompt(context);
|
||||
default:
|
||||
return new RequirementsHeroesListPrompt(context);
|
||||
return new QuestRequirementsHeroesListPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class HeroesPrimaryPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestHeroesPrimaryPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public HeroesPrimaryPrompt(final ConversationContext context) {
|
||||
public QuestHeroesPrimaryPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1353,30 +1353,30 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
if (hc != null) {
|
||||
if (hc.isPrimary()) {
|
||||
context.setSessionData(CK.REQ_HEROES_PRIMARY_CLASS, hc.getName());
|
||||
return new RequirementsHeroesListPrompt(context);
|
||||
return new QuestRequirementsHeroesListPrompt(context);
|
||||
} else {
|
||||
String text = Lang.get("reqHeroesNotPrimary");
|
||||
text = text.replace("<class>", ChatColor.LIGHT_PURPLE + hc.getName() + ChatColor.RED);
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + text);
|
||||
return new HeroesPrimaryPrompt(context);
|
||||
return new QuestHeroesPrimaryPrompt(context);
|
||||
}
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqHeroesClassNotFound"));
|
||||
return new HeroesPrimaryPrompt(context);
|
||||
return new QuestHeroesPrimaryPrompt(context);
|
||||
}
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.REQ_HEROES_PRIMARY_CLASS, null);
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqHeroesPrimaryCleared"));
|
||||
return new RequirementsHeroesListPrompt(context);
|
||||
return new QuestRequirementsHeroesListPrompt(context);
|
||||
} else {
|
||||
return new RequirementsHeroesListPrompt(context);
|
||||
return new QuestRequirementsHeroesListPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class HeroesSecondaryPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestHeroesSecondaryPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public HeroesSecondaryPrompt(final ConversationContext context) {
|
||||
public QuestHeroesSecondaryPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1428,30 +1428,30 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
if (hc != null) {
|
||||
if (hc.isSecondary()) {
|
||||
context.setSessionData(CK.REQ_HEROES_SECONDARY_CLASS, hc.getName());
|
||||
return new RequirementsHeroesListPrompt(context);
|
||||
return new QuestRequirementsHeroesListPrompt(context);
|
||||
} else {
|
||||
String text = Lang.get("reqHeroesNotSecondary");
|
||||
text = text.replace("<class>", ChatColor.LIGHT_PURPLE + hc.getName() + ChatColor.RED);
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + text);
|
||||
return new HeroesSecondaryPrompt(context);
|
||||
return new QuestHeroesSecondaryPrompt(context);
|
||||
}
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqHeroesClassNotFound"));
|
||||
return new HeroesSecondaryPrompt(context);
|
||||
return new QuestHeroesSecondaryPrompt(context);
|
||||
}
|
||||
} else if (input.equalsIgnoreCase(Lang.get("clear"))) {
|
||||
context.setSessionData(CK.REQ_HEROES_SECONDARY_CLASS, null);
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqHeroesSecondaryCleared"));
|
||||
return new RequirementsHeroesListPrompt(context);
|
||||
return new QuestRequirementsHeroesListPrompt(context);
|
||||
} else {
|
||||
return new RequirementsHeroesListPrompt(context);
|
||||
return new QuestRequirementsHeroesListPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class CustomRequirementModulePrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestCustomRequirementModulePrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public CustomRequirementModulePrompt(final ConversationContext context) {
|
||||
public QuestCustomRequirementModulePrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1534,27 +1534,27 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
}
|
||||
if (found != null) {
|
||||
return new CustomRequirementsPrompt(found, context);
|
||||
return new QuestCustomRequirementsPrompt(found, context);
|
||||
}
|
||||
} else if (input != null && input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
return new RequirementsPrompt(context);
|
||||
return new QuestRequirementsPrompt(context);
|
||||
} else if (input != null && input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.REQ_CUSTOM, null);
|
||||
context.setSessionData(CK.REQ_CUSTOM_DATA, null);
|
||||
context.setSessionData(CK.REQ_CUSTOM_DATA_TEMP, null);
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqCustomCleared"));
|
||||
return new RequirementsPrompt(context);
|
||||
return new QuestRequirementsPrompt(context);
|
||||
}
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqCustomNotFound"));
|
||||
return new CustomRequirementModulePrompt(context);
|
||||
return new QuestCustomRequirementModulePrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class CustomRequirementsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestCustomRequirementsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
private final String moduleName;
|
||||
|
||||
public CustomRequirementsPrompt(final String moduleName, final ConversationContext context) {
|
||||
public QuestCustomRequirementsPrompt(final String moduleName, final ConversationContext context) {
|
||||
super(context);
|
||||
this.moduleName = moduleName;
|
||||
}
|
||||
|
@ -1653,7 +1653,7 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
} else {
|
||||
// Already added, so inform user
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqCustomAlreadyAdded"));
|
||||
return new CustomRequirementsPrompt(moduleName, context);
|
||||
return new QuestCustomRequirementsPrompt(moduleName, context);
|
||||
}
|
||||
} else {
|
||||
// The custom requirement hasn't been added yet, so let's do it
|
||||
|
@ -1667,11 +1667,11 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
// Send user to the custom data prompt if there is any needed
|
||||
if (!found.getData().isEmpty()) {
|
||||
context.setSessionData(CK.REQ_CUSTOM_DATA_DESCRIPTIONS, found.getDescriptions());
|
||||
return new RequirementCustomDataListPrompt();
|
||||
return new QuestRequirementCustomDataListPrompt();
|
||||
}
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqCustomNotFound"));
|
||||
return new CustomRequirementsPrompt(moduleName, context);
|
||||
return new QuestCustomRequirementsPrompt(moduleName, context);
|
||||
}
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.REQ_CUSTOM, null);
|
||||
|
@ -1679,11 +1679,11 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
context.setSessionData(CK.REQ_CUSTOM_DATA_TEMP, null);
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqCustomCleared"));
|
||||
}
|
||||
return new RequirementsPrompt(context);
|
||||
return new QuestRequirementsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
private class RequirementCustomDataListPrompt extends StringPrompt {
|
||||
private class QuestRequirementCustomDataListPrompt extends StringPrompt {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
|
@ -1729,38 +1729,37 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
try {
|
||||
numInput = Integer.parseInt(input);
|
||||
} catch (final NumberFormatException nfe) {
|
||||
return new RequirementCustomDataListPrompt();
|
||||
return new QuestRequirementCustomDataListPrompt();
|
||||
}
|
||||
if (numInput < 1 || numInput > dataMap.size() + 1) {
|
||||
return new RequirementCustomDataListPrompt();
|
||||
return new QuestRequirementCustomDataListPrompt();
|
||||
}
|
||||
if (numInput < dataMap.size() + 1) {
|
||||
final LinkedList<String> dataMapKeys = new LinkedList<>(dataMap.keySet());
|
||||
Collections.sort(dataMapKeys);
|
||||
final String selectedKey = dataMapKeys.get(numInput - 1);
|
||||
context.setSessionData(CK.REQ_CUSTOM_DATA_TEMP, selectedKey);
|
||||
return new RequirementCustomDataPrompt();
|
||||
return new QuestRequirementCustomDataPrompt();
|
||||
} else {
|
||||
if (dataMap.containsValue(null)) {
|
||||
return new RequirementCustomDataListPrompt();
|
||||
return new QuestRequirementCustomDataListPrompt();
|
||||
} else {
|
||||
context.setSessionData(CK.REQ_CUSTOM_DATA_DESCRIPTIONS, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
return new RequirementsPrompt(context);
|
||||
return new QuestRequirementsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
private class RequirementCustomDataPrompt extends StringPrompt {
|
||||
private class QuestRequirementCustomDataPrompt extends StringPrompt {
|
||||
|
||||
@Override
|
||||
public @NotNull String getPromptText(final ConversationContext context) {
|
||||
String text = "";
|
||||
final String temp = (String) context.getSessionData(CK.REQ_CUSTOM_DATA_TEMP);
|
||||
@SuppressWarnings("unchecked")
|
||||
final
|
||||
Map<String, String> descriptions
|
||||
final Map<String, String> descriptions
|
||||
= (Map<String, String>) context.getSessionData(CK.REQ_CUSTOM_DATA_DESCRIPTIONS);
|
||||
if (temp != null && descriptions != null) {
|
||||
if (descriptions.get(temp) != null) {
|
||||
|
@ -1776,15 +1775,14 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
@Override
|
||||
public Prompt acceptInput(final ConversationContext context, final String input) {
|
||||
@SuppressWarnings("unchecked")
|
||||
final
|
||||
LinkedList<Map<String, Object>> dataMapList
|
||||
final LinkedList<Map<String, Object>> dataMapList
|
||||
= (LinkedList<Map<String, Object>>) context.getSessionData(CK.REQ_CUSTOM_DATA);
|
||||
if (dataMapList != null) {
|
||||
final Map<String, Object> dataMap = dataMapList.getLast();
|
||||
dataMap.put((String) context.getSessionData(CK.REQ_CUSTOM_DATA_TEMP), input);
|
||||
context.setSessionData(CK.REQ_CUSTOM_DATA_TEMP, null);
|
||||
}
|
||||
return new RequirementCustomDataListPrompt();
|
||||
return new QuestRequirementCustomDataListPrompt();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -46,14 +46,14 @@ import java.util.Objects;
|
|||
import java.util.TreeSet;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestRewardsPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
private final Quests plugin;
|
||||
private final String classPrefix;
|
||||
private boolean hasReward = false;
|
||||
private final int size = 12;
|
||||
|
||||
public RewardsPrompt(final ConversationContext context) {
|
||||
public QuestRewardsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
this.plugin = (Quests)context.getPlugin();
|
||||
this.classPrefix = getClass().getSimpleName();
|
||||
|
@ -395,46 +395,46 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
switch (input.intValue()) {
|
||||
case 1:
|
||||
if (plugin.getDependencies().getVaultEconomy() != null) {
|
||||
return new RewardsMoneyPrompt(context);
|
||||
return new QuestRewardsMoneyPrompt(context);
|
||||
} else {
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
}
|
||||
case 2:
|
||||
return new RewardsQuestPointsPrompt(context);
|
||||
return new QuestRewardsQuestPointsPrompt(context);
|
||||
case 3:
|
||||
return new RewardsItemListPrompt(context);
|
||||
return new QuestRewardsItemListPrompt(context);
|
||||
case 4:
|
||||
return new RewardsExperiencePrompt(context);
|
||||
return new QuestRewardsExperiencePrompt(context);
|
||||
case 5:
|
||||
if (!plugin.hasLimitedAccess(context.getForWhom())) {
|
||||
return new RewardsCommandsPrompt(context);
|
||||
return new QuestRewardsCommandsPrompt(context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("noPermission"));
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
}
|
||||
case 6:
|
||||
if (!plugin.hasLimitedAccess(context.getForWhom())) {
|
||||
return new RewardsPermissionsListPrompt(context);
|
||||
return new QuestRewardsPermissionsListPrompt(context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("noPermission"));
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
}
|
||||
case 7:
|
||||
if (plugin.getDependencies().getMcmmoClassic() != null) {
|
||||
return new RewardsMcMMOListPrompt(context);
|
||||
return new QuestRewardsMcMMOListPrompt(context);
|
||||
} else {
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
}
|
||||
case 8:
|
||||
if (plugin.getDependencies().getHeroes() != null) {
|
||||
return new RewardsHeroesListPrompt(context);
|
||||
return new QuestRewardsHeroesListPrompt(context);
|
||||
} else {
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
}
|
||||
case 9:
|
||||
return new RewardsPartiesExperiencePrompt(context);
|
||||
return new QuestRewardsPartiesExperiencePrompt(context);
|
||||
case 10:
|
||||
return new CustomRewardModulePrompt(context);
|
||||
return new QuestCustomRewardModulePrompt(context);
|
||||
case 11:
|
||||
if (hasReward) {
|
||||
return new OverridePrompt.Builder()
|
||||
|
@ -443,12 +443,12 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
.build();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
}
|
||||
case 12:
|
||||
return plugin.getQuestFactory().returnToMenu(context);
|
||||
default:
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -470,9 +470,9 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
return false;
|
||||
}
|
||||
|
||||
public class RewardsMoneyPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestRewardsMoneyPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public RewardsMoneyPrompt(final ConversationContext context) {
|
||||
public QuestRewardsMoneyPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -514,24 +514,24 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
context.setSessionData(CK.REW_MONEY, i);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("inputPosNum"));
|
||||
return new RewardsMoneyPrompt(context);
|
||||
return new QuestRewardsMoneyPrompt(context);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber")
|
||||
.replace("<input>", input));
|
||||
return new RewardsMoneyPrompt(context);
|
||||
return new QuestRewardsMoneyPrompt(context);
|
||||
}
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.REW_MONEY, null);
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
}
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class RewardsQuestPointsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestRewardsQuestPointsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public RewardsQuestPointsPrompt(final ConversationContext context) {
|
||||
public QuestRewardsQuestPointsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -568,24 +568,24 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
context.setSessionData(CK.REW_QUEST_POINTS, i);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("inputPosNum"));
|
||||
return new RewardsQuestPointsPrompt(context);
|
||||
return new QuestRewardsQuestPointsPrompt(context);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber")
|
||||
.replace("<input>", input));
|
||||
return new RewardsQuestPointsPrompt(context);
|
||||
return new QuestRewardsQuestPointsPrompt(context);
|
||||
}
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.REW_QUEST_POINTS, null);
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
}
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class RewardsItemListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestRewardsItemListPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public RewardsItemListPrompt(final ConversationContext context) {
|
||||
public QuestRewardsItemListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -693,22 +693,22 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new ItemStackPrompt(context, RewardsItemListPrompt.this);
|
||||
return new ItemStackPrompt(context, QuestRewardsItemListPrompt.this);
|
||||
case 2:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("rewItemsCleared"));
|
||||
context.setSessionData(CK.REW_ITEMS, null);
|
||||
return new RewardsItemListPrompt(context);
|
||||
return new QuestRewardsItemListPrompt(context);
|
||||
case 3:
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
default:
|
||||
return new RewardsItemListPrompt(context);
|
||||
return new QuestRewardsItemListPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class RewardsExperiencePrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestRewardsExperiencePrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public RewardsExperiencePrompt(final ConversationContext context) {
|
||||
public QuestRewardsExperiencePrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -745,24 +745,24 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
context.setSessionData(CK.REW_EXP, i);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("inputPosNum"));
|
||||
return new RewardsExperiencePrompt(context);
|
||||
return new QuestRewardsExperiencePrompt(context);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber")
|
||||
.replace("<input>", input));
|
||||
return new RewardsExperiencePrompt(context);
|
||||
return new QuestRewardsExperiencePrompt(context);
|
||||
}
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.REW_EXP, null);
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
}
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class RewardsCommandsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestRewardsCommandsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public RewardsCommandsPrompt(final ConversationContext context) {
|
||||
public QuestRewardsCommandsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -825,13 +825,13 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.REW_COMMAND, null);
|
||||
}
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class RewardsPermissionsListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestRewardsPermissionsListPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public RewardsPermissionsListPrompt(final ConversationContext context) {
|
||||
public QuestRewardsPermissionsListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -952,16 +952,16 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch (input.intValue()) {
|
||||
case 1:
|
||||
return new PermissionsPrompt(context);
|
||||
return new QuestPermissionsPrompt(context);
|
||||
case 2:
|
||||
return new PermissionsWorldsPrompt(context);
|
||||
return new QuestPermissionsWorldsPrompt(context);
|
||||
case 3:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("rewPermissionsCleared"));
|
||||
context.setSessionData(CK.REW_PERMISSION, null);
|
||||
context.setSessionData(CK.REW_PERMISSION_WORLDS, null);
|
||||
return new RewardsPermissionsListPrompt(context);
|
||||
return new QuestRewardsPermissionsListPrompt(context);
|
||||
case 4:
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
@ -969,9 +969,9 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
|
||||
}
|
||||
|
||||
public class PermissionsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestPermissionsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public PermissionsPrompt(final ConversationContext context) {
|
||||
public QuestPermissionsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1037,13 +1037,13 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.REW_PERMISSION, null);
|
||||
}
|
||||
return new RewardsPermissionsListPrompt(context);
|
||||
return new QuestRewardsPermissionsListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class PermissionsWorldsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestPermissionsWorldsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public PermissionsWorldsPrompt(final ConversationContext context) {
|
||||
public QuestPermissionsWorldsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1081,20 +1081,20 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
&& context.getPlugin().getServer().getWorld(w) == null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorInvalidWorld")
|
||||
.replace("<input>", w));
|
||||
return new PermissionsWorldsPrompt(context);
|
||||
return new QuestPermissionsWorldsPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(CK.REW_PERMISSION_WORLDS, worlds);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.REW_PERMISSION_WORLDS, null);
|
||||
}
|
||||
return new RewardsPermissionsListPrompt(context);
|
||||
return new QuestRewardsPermissionsListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class RewardsMcMMOListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestRewardsMcMMOListPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public RewardsMcMMOListPrompt(final ConversationContext context) {
|
||||
public QuestRewardsMcMMOListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1201,19 +1201,19 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new McMMOSkillsPrompt(context);
|
||||
return new QuestMcMMOSkillsPrompt(context);
|
||||
case 2:
|
||||
if (context.getSessionData(CK.REW_MCMMO_SKILLS) == null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("rewSetMcMMOSkillsFirst"));
|
||||
return new RewardsMcMMOListPrompt(context);
|
||||
return new QuestRewardsMcMMOListPrompt(context);
|
||||
} else {
|
||||
return new McMMOAmountsPrompt(context);
|
||||
return new QuestMcMMOAmountsPrompt(context);
|
||||
}
|
||||
case 3:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("rewMcMMOCleared"));
|
||||
context.setSessionData(CK.REW_MCMMO_SKILLS, null);
|
||||
context.setSessionData(CK.REW_MCMMO_AMOUNTS, null);
|
||||
return new RewardsMcMMOListPrompt(context);
|
||||
return new QuestRewardsMcMMOListPrompt(context);
|
||||
case 4:
|
||||
final int one;
|
||||
final int two;
|
||||
|
@ -1230,20 +1230,20 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
two = 0;
|
||||
}
|
||||
if (one == two) {
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new RewardsMcMMOListPrompt(context);
|
||||
return new QuestRewardsMcMMOListPrompt(context);
|
||||
}
|
||||
default:
|
||||
return new RewardsMcMMOListPrompt(context);
|
||||
return new QuestRewardsMcMMOListPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class McMMOSkillsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestMcMMOSkillsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public McMMOSkillsPrompt(final ConversationContext context) {
|
||||
public QuestMcMMOSkillsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1287,24 +1287,24 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
skills.add(MiscUtil.getCapitalized(s));
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listDuplicate"));
|
||||
return new McMMOSkillsPrompt(context);
|
||||
return new QuestMcMMOSkillsPrompt(context);
|
||||
}
|
||||
} else {
|
||||
String text = Lang.get("reqMcMMOError");
|
||||
text = text.replace("<input>", ChatColor.LIGHT_PURPLE + s + ChatColor.RED);
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + text);
|
||||
return new McMMOSkillsPrompt(context);
|
||||
return new QuestMcMMOSkillsPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(CK.REW_MCMMO_SKILLS, skills);
|
||||
}
|
||||
return new RewardsMcMMOListPrompt(context);
|
||||
return new QuestRewardsMcMMOListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class McMMOAmountsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestMcMMOAmountsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public McMMOAmountsPrompt(final ConversationContext context) {
|
||||
public QuestMcMMOAmountsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1344,18 +1344,18 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
String text = Lang.get("reqNotANumber");
|
||||
text = text.replace("<input>", ChatColor.LIGHT_PURPLE + s + ChatColor.RED);
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + text);
|
||||
return new McMMOAmountsPrompt(context);
|
||||
return new QuestMcMMOAmountsPrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(CK.REW_MCMMO_AMOUNTS, amounts);
|
||||
}
|
||||
return new RewardsMcMMOListPrompt(context);
|
||||
return new QuestRewardsMcMMOListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class RewardsHeroesListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestRewardsHeroesListPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
public RewardsHeroesListPrompt(final ConversationContext context) {
|
||||
public QuestRewardsHeroesListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1462,19 +1462,19 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
protected Prompt acceptValidatedInput(final @NotNull ConversationContext context, final Number input) {
|
||||
switch(input.intValue()) {
|
||||
case 1:
|
||||
return new HeroesClassesPrompt(context);
|
||||
return new QuestHeroesClassesPrompt(context);
|
||||
case 2:
|
||||
if (context.getSessionData(CK.REW_HEROES_CLASSES) == null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("rewSetHeroesClassesFirst"));
|
||||
return new RewardsHeroesListPrompt(context);
|
||||
return new QuestRewardsHeroesListPrompt(context);
|
||||
} else {
|
||||
return new HeroesExperiencePrompt(context);
|
||||
return new QuestHeroesExperiencePrompt(context);
|
||||
}
|
||||
case 3:
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("rewHeroesCleared"));
|
||||
context.setSessionData(CK.REW_HEROES_CLASSES, null);
|
||||
context.setSessionData(CK.REW_HEROES_AMOUNTS, null);
|
||||
return new RewardsHeroesListPrompt(context);
|
||||
return new QuestRewardsHeroesListPrompt(context);
|
||||
case 4:
|
||||
final int one;
|
||||
final int two;
|
||||
|
@ -1491,20 +1491,20 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
two = 0;
|
||||
}
|
||||
if (one == two) {
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("rewHeroesListsNotSameSize"));
|
||||
return new RewardsHeroesListPrompt(context);
|
||||
return new QuestRewardsHeroesListPrompt(context);
|
||||
}
|
||||
default:
|
||||
return new RewardsHeroesListPrompt(context);
|
||||
return new QuestRewardsHeroesListPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class HeroesClassesPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestHeroesClassesPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public HeroesClassesPrompt(final ConversationContext context) {
|
||||
public QuestHeroesClassesPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1558,20 +1558,20 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
String text = Lang.get("rewHeroesInvalidClass");
|
||||
text = text.replace("<input>", ChatColor.LIGHT_PURPLE + s + ChatColor.RED);
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + text);
|
||||
return new HeroesClassesPrompt(context);
|
||||
return new QuestHeroesClassesPrompt(context);
|
||||
} else {
|
||||
classes.add(hc.getName());
|
||||
}
|
||||
}
|
||||
context.setSessionData(CK.REW_HEROES_CLASSES, classes);
|
||||
}
|
||||
return new RewardsHeroesListPrompt(context);
|
||||
return new QuestRewardsHeroesListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class HeroesExperiencePrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestHeroesExperiencePrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public HeroesExperiencePrompt(final ConversationContext context) {
|
||||
public QuestHeroesExperiencePrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1614,18 +1614,18 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
String text = Lang.get("reqNotANumber");
|
||||
text = text.replace("<input>", ChatColor.LIGHT_PURPLE + s + ChatColor.RED);
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + text);
|
||||
return new HeroesExperiencePrompt(context);
|
||||
return new QuestHeroesExperiencePrompt(context);
|
||||
}
|
||||
}
|
||||
context.setSessionData(CK.REW_HEROES_AMOUNTS, amounts);
|
||||
}
|
||||
return new RewardsHeroesListPrompt(context);
|
||||
return new QuestRewardsHeroesListPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class RewardsPartiesExperiencePrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestRewardsPartiesExperiencePrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public RewardsPartiesExperiencePrompt(final ConversationContext context) {
|
||||
public QuestRewardsPartiesExperiencePrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1662,24 +1662,24 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
context.setSessionData(CK.REW_PARTIES_EXPERIENCE, i);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("inputPosNum"));
|
||||
return new RewardsPartiesExperiencePrompt(context);
|
||||
return new QuestRewardsPartiesExperiencePrompt(context);
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber")
|
||||
.replace("<input>", input));
|
||||
return new RewardsPartiesExperiencePrompt(context);
|
||||
return new QuestRewardsPartiesExperiencePrompt(context);
|
||||
}
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.REW_PARTIES_EXPERIENCE, null);
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
}
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class CustomRewardModulePrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestCustomRewardModulePrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
public CustomRewardModulePrompt(final ConversationContext context) {
|
||||
public QuestCustomRewardModulePrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
@ -1762,27 +1762,27 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
}
|
||||
if (found != null) {
|
||||
return new CustomRewardsPrompt(found, context);
|
||||
return new QuestCustomRewardsPrompt(found, context);
|
||||
}
|
||||
} else if (input != null && input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
} else if (input != null && input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.REW_CUSTOM, null);
|
||||
context.setSessionData(CK.REW_CUSTOM_DATA, null);
|
||||
context.setSessionData(CK.REW_CUSTOM_DATA_TEMP, null);
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("rewCustomCleared"));
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
}
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("rewCustomNotFound"));
|
||||
return new CustomRewardModulePrompt(context);
|
||||
return new QuestCustomRewardModulePrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
public class CustomRewardsPrompt extends QuestsEditorStringPrompt {
|
||||
public class QuestCustomRewardsPrompt extends QuestsEditorStringPrompt {
|
||||
|
||||
private final String moduleName;
|
||||
|
||||
public CustomRewardsPrompt(final String moduleName, final ConversationContext context) {
|
||||
public QuestCustomRewardsPrompt(final String moduleName, final ConversationContext context) {
|
||||
super(context);
|
||||
this.moduleName = moduleName;
|
||||
}
|
||||
|
@ -1881,7 +1881,7 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
} else {
|
||||
// Already added, so inform user
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("rewCustomAlreadyAdded"));
|
||||
return new CustomRewardsPrompt(moduleName, context);
|
||||
return new QuestCustomRewardsPrompt(moduleName, context);
|
||||
}
|
||||
} else {
|
||||
// The custom reward hasn't been added yet, so let's do it
|
||||
|
@ -1895,11 +1895,11 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
// Send user to the custom data prompt if there is any needed
|
||||
if (!found.getData().isEmpty()) {
|
||||
context.setSessionData(CK.REW_CUSTOM_DATA_DESCRIPTIONS, found.getDescriptions());
|
||||
return new RewardCustomDataListPrompt();
|
||||
return new QuestRewardCustomDataListPrompt();
|
||||
}
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("rewCustomNotFound"));
|
||||
return new CustomRewardsPrompt(moduleName, context);
|
||||
return new QuestCustomRewardsPrompt(moduleName, context);
|
||||
}
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.REW_CUSTOM, null);
|
||||
|
@ -1907,11 +1907,11 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
context.setSessionData(CK.REW_CUSTOM_DATA_TEMP, null);
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("rewCustomCleared"));
|
||||
}
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
private class RewardCustomDataListPrompt extends StringPrompt {
|
||||
private class QuestRewardCustomDataListPrompt extends StringPrompt {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
|
@ -1957,30 +1957,30 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
try {
|
||||
numInput = Integer.parseInt(input);
|
||||
} catch (final NumberFormatException nfe) {
|
||||
return new RewardCustomDataListPrompt();
|
||||
return new QuestRewardCustomDataListPrompt();
|
||||
}
|
||||
if (numInput < 1 || numInput > dataMap.size() + 1) {
|
||||
return new RewardCustomDataListPrompt();
|
||||
return new QuestRewardCustomDataListPrompt();
|
||||
}
|
||||
if (numInput < dataMap.size() + 1) {
|
||||
final LinkedList<String> dataMapKeys = new LinkedList<>(dataMap.keySet());
|
||||
Collections.sort(dataMapKeys);
|
||||
final String selectedKey = dataMapKeys.get(numInput - 1);
|
||||
context.setSessionData(CK.REW_CUSTOM_DATA_TEMP, selectedKey);
|
||||
return new RewardCustomDataPrompt();
|
||||
return new QuestRewardCustomDataPrompt();
|
||||
} else {
|
||||
if (dataMap.containsValue(null)) {
|
||||
return new RewardCustomDataListPrompt();
|
||||
return new QuestRewardCustomDataListPrompt();
|
||||
} else {
|
||||
context.setSessionData(CK.REW_CUSTOM_DATA_DESCRIPTIONS, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
return new RewardsPrompt(context);
|
||||
return new QuestRewardsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
private class RewardCustomDataPrompt extends StringPrompt {
|
||||
private class QuestRewardCustomDataPrompt extends StringPrompt {
|
||||
|
||||
@Override
|
||||
public @NotNull String getPromptText(final ConversationContext context) {
|
||||
|
@ -2012,7 +2012,7 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
dataMap.put((String) context.getSessionData(CK.REW_CUSTOM_DATA_TEMP), input);
|
||||
context.setSessionData(CK.REW_CUSTOM_DATA_TEMP, null);
|
||||
}
|
||||
return new RewardCustomDataListPrompt();
|
||||
return new QuestRewardCustomDataListPrompt();
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -23,12 +23,12 @@ import me.blackvein.quests.util.CK;
|
|||
import me.blackvein.quests.util.Lang;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class StageMenuPrompt extends QuestsEditorNumericPrompt {
|
||||
public class QuestStageMenuPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
private final Quests plugin;
|
||||
private final int size = 2;
|
||||
|
||||
public StageMenuPrompt(final ConversationContext context) {
|
||||
public QuestStageMenuPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
this.plugin = (Quests)context.getPlugin();
|
||||
}
|
||||
|
@ -100,14 +100,14 @@ public class StageMenuPrompt extends QuestsEditorNumericPrompt {
|
|||
final int stages = getStages(context);
|
||||
if (i > 0) {
|
||||
if (i < (stages + 1)) {
|
||||
return new StageMainPrompt((i), context);
|
||||
return new QuestStageMainPrompt((i), context);
|
||||
} else if (i == (stages + 1)) {
|
||||
return new StageMainPrompt((stages + 1), context);
|
||||
return new QuestStageMainPrompt((stages + 1), context);
|
||||
} else if (i == (stages + 2)) {
|
||||
return plugin.getQuestFactory().returnToMenu(context);
|
||||
}
|
||||
}
|
||||
return new StageMenuPrompt(context);
|
||||
return new QuestStageMenuPrompt(context);
|
||||
}
|
||||
|
||||
public int getStages(final ConversationContext context) {
|
|
@ -15,7 +15,7 @@ package me.blackvein.quests.quests;
|
|||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.convo.quests.main.QuestMainPrompt;
|
||||
import me.blackvein.quests.convo.quests.menu.QuestMenuPrompt;
|
||||
import me.blackvein.quests.convo.quests.stages.StageMenuPrompt;
|
||||
import me.blackvein.quests.convo.quests.stages.QuestStageMenuPrompt;
|
||||
import me.blackvein.quests.interfaces.ReloadCallback;
|
||||
import me.blackvein.quests.module.ICustomObjective;
|
||||
import me.blackvein.quests.util.CK;
|
||||
|
@ -673,7 +673,7 @@ public class BukkitQuestFactory implements QuestFactory, ConversationAbandonedLi
|
|||
final ConfigurationSection stages = section.createSection("stages");
|
||||
final ConfigurationSection ordered = stages.createSection("ordered");
|
||||
String pref;
|
||||
for (int i = 1; i <= new StageMenuPrompt(context).getStages(context); i++) {
|
||||
for (int i = 1; i <= new QuestStageMenuPrompt(context).getStages(context); i++) {
|
||||
pref = "stage" + i;
|
||||
final ConfigurationSection stage = ordered.createSection("" + i);
|
||||
stage.set("break-block-names", context.getSessionData(pref + CK.S_BREAK_NAMES) != null
|
||||
|
|
Loading…
Reference in New Issue