mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-25 03:55:35 +01:00
Refactor to core module, part 5
This commit is contained in:
parent
4cfde2b126
commit
25910ac66d
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>me.blackvein.quests</groupId>
|
<groupId>me.blackvein.quests</groupId>
|
||||||
|
@ -806,8 +806,8 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
|||||||
loadQuests();
|
loadQuests();
|
||||||
loadActions();
|
loadActions();
|
||||||
loadConditions();
|
loadConditions();
|
||||||
getLogger().log(Level.INFO, "Loaded " + quests.size() + " Quest(s), " + actions.size() + " IAction(s), "
|
getLogger().log(Level.INFO, "Loaded " + quests.size() + " Quest(s), " + actions.size() + " Action(s), "
|
||||||
+ conditions.size() + " ICondition(s) and " + Lang.size() + " Phrase(s)");
|
+ conditions.size() + " Condition(s) and " + Lang.size() + " Phrase(s)");
|
||||||
for (final Player p : getServer().getOnlinePlayers()) {
|
for (final Player p : getServer().getOnlinePlayers()) {
|
||||||
final IQuester quester = new Quester(Quests.this, p.getUniqueId());
|
final IQuester quester = new Quester(Quests.this, p.getUniqueId());
|
||||||
if (!quester.hasData()) {
|
if (!quester.hasData()) {
|
||||||
|
@ -117,7 +117,7 @@ public class ActionMainPrompt extends ActionsEditorNumericPrompt {
|
|||||||
return ChatColor.YELLOW + Lang.get("stageEditorDenizenScript");
|
return ChatColor.YELLOW + Lang.get("stageEditorDenizenScript");
|
||||||
}
|
}
|
||||||
case 8:
|
case 8:
|
||||||
return ChatColor.YELLOW + Lang.get("eventEditorFailQuest") + ":";
|
return ChatColor.YELLOW + Lang.get("eventEditorFailQuest");
|
||||||
case 9:
|
case 9:
|
||||||
return ChatColor.GREEN + Lang.get("save");
|
return ChatColor.GREEN + Lang.get("save");
|
||||||
case 10:
|
case 10:
|
||||||
@ -173,7 +173,8 @@ public class ActionMainPrompt extends ActionsEditorNumericPrompt {
|
|||||||
if (context.getSessionData(CK.E_FAIL_QUEST) == null) {
|
if (context.getSessionData(CK.E_FAIL_QUEST) == null) {
|
||||||
context.setSessionData(CK.E_FAIL_QUEST, Lang.get("noWord"));
|
context.setSessionData(CK.E_FAIL_QUEST, Lang.get("noWord"));
|
||||||
}
|
}
|
||||||
return "" + ChatColor.AQUA + context.getSessionData(CK.E_FAIL_QUEST);
|
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.E_FAIL_QUEST) + ChatColor.GRAY
|
||||||
|
+ ")";
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -377,11 +378,11 @@ public class ActionMainPrompt extends ActionsEditorNumericPrompt {
|
|||||||
= new ActionsEditorPostOpenNumericPromptEvent(context, this);
|
= new ActionsEditorPostOpenNumericPromptEvent(context, this);
|
||||||
plugin.getServer().getPluginManager().callEvent(event);
|
plugin.getServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
final StringBuilder text = new StringBuilder(ChatColor.GOLD + getTitle(context) + "\n");
|
final StringBuilder text = new StringBuilder(ChatColor.GOLD + getTitle(context));
|
||||||
for (int i = 1; i <= size; i++) {
|
for (int i = 1; i <= size; i++) {
|
||||||
text.append(getNumberColor(context, i)).append(ChatColor.BOLD).append(i).append(ChatColor.RESET)
|
text.append("\n").append(getNumberColor(context, i)).append(ChatColor.BOLD).append(i)
|
||||||
.append(" - ").append(getSelectionText(context, i)).append(" ")
|
.append(ChatColor.RESET).append(" - ").append(getSelectionText(context, i)).append(" ")
|
||||||
.append(getAdditionalText(context, i)).append("\n");
|
.append(getAdditionalText(context, i));
|
||||||
}
|
}
|
||||||
return text.toString();
|
return text.toString();
|
||||||
}
|
}
|
||||||
@ -499,46 +500,46 @@ public class ActionMainPrompt extends ActionsEditorNumericPrompt {
|
|||||||
switch (number) {
|
switch (number) {
|
||||||
case 1:
|
case 1:
|
||||||
return "(" + (questMob.getName() == null ? Lang.get("noneSet") : ChatColor.AQUA + questMob.getName())
|
return "(" + (questMob.getName() == null ? Lang.get("noneSet") : ChatColor.AQUA + questMob.getName())
|
||||||
+ ChatColor.GRAY + ")\n";
|
+ ChatColor.GRAY + ")";
|
||||||
case 2:
|
case 2:
|
||||||
return "(" + (questMob.getType() == null ? Lang.get("noneSet") : ChatColor.AQUA
|
return "(" + (questMob.getType() == null ? Lang.get("noneSet") : ChatColor.AQUA
|
||||||
+ questMob.getType().name()) + ChatColor.GRAY + ")\n";
|
+ questMob.getType().name()) + ChatColor.GRAY + ")";
|
||||||
case 3:
|
case 3:
|
||||||
return "(" + (questMob.getSpawnLocation() == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
return "(" + (questMob.getSpawnLocation() == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
||||||
+ ConfigUtil.getLocationInfo(questMob.getSpawnLocation())) + ChatColor.GRAY + ")\n";
|
+ ConfigUtil.getLocationInfo(questMob.getSpawnLocation())) + ChatColor.GRAY + ")";
|
||||||
case 4:
|
case 4:
|
||||||
return "(" + (questMob.getSpawnAmounts() == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
return "(" + (questMob.getSpawnAmounts() == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
||||||
+ "" + questMob.getSpawnAmounts()) + ChatColor.GRAY + ")\n";
|
+ "" + questMob.getSpawnAmounts()) + ChatColor.GRAY + ")";
|
||||||
case 5:
|
case 5:
|
||||||
return "(" + (questMob.getInventory()[0] == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
return "(" + (questMob.getInventory()[0] == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
||||||
+ ItemUtil.getDisplayString(questMob.getInventory()[0])) + ChatColor.GRAY + ")\n";
|
+ ItemUtil.getDisplayString(questMob.getInventory()[0])) + ChatColor.GRAY + ")";
|
||||||
case 6:
|
case 6:
|
||||||
return "(" + (questMob.getDropChances()[0] == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
return "(" + (questMob.getDropChances()[0] == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
||||||
+ "" + questMob.getDropChances()[0]) + ChatColor.GRAY + ")\n";
|
+ "" + questMob.getDropChances()[0]) + ChatColor.GRAY + ")";
|
||||||
case 7:
|
case 7:
|
||||||
return "(" + (questMob.getInventory()[1] == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
return "(" + (questMob.getInventory()[1] == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
||||||
+ ItemUtil.getDisplayString(questMob.getInventory()[1])) + ChatColor.GRAY + ")\n";
|
+ ItemUtil.getDisplayString(questMob.getInventory()[1])) + ChatColor.GRAY + ")";
|
||||||
case 8:
|
case 8:
|
||||||
return "(" + (questMob.getDropChances()[1] == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
return "(" + (questMob.getDropChances()[1] == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
||||||
+ "" + questMob.getDropChances()[1]) + ChatColor.GRAY + ")\n";
|
+ "" + questMob.getDropChances()[1]) + ChatColor.GRAY + ")";
|
||||||
case 9:
|
case 9:
|
||||||
return "(" + (questMob.getInventory()[2] == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
return "(" + (questMob.getInventory()[2] == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
||||||
+ ItemUtil.getDisplayString(questMob.getInventory()[2])) + ChatColor.GRAY + ")\n";
|
+ ItemUtil.getDisplayString(questMob.getInventory()[2])) + ChatColor.GRAY + ")";
|
||||||
case 10:
|
case 10:
|
||||||
return "(" + (questMob.getDropChances()[2] == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
return "(" + (questMob.getDropChances()[2] == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
||||||
+ "" + questMob.getDropChances()[2]) + ChatColor.GRAY + ")\n";
|
+ "" + questMob.getDropChances()[2]) + ChatColor.GRAY + ")";
|
||||||
case 11:
|
case 11:
|
||||||
return "(" + (questMob.getInventory()[3] == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
return "(" + (questMob.getInventory()[3] == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
||||||
+ ItemUtil.getDisplayString(questMob.getInventory()[3])) + ChatColor.GRAY + ")\n";
|
+ ItemUtil.getDisplayString(questMob.getInventory()[3])) + ChatColor.GRAY + ")";
|
||||||
case 12:
|
case 12:
|
||||||
return "(" + (questMob.getDropChances()[3] == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
return "(" + (questMob.getDropChances()[3] == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
||||||
+ "" + questMob.getDropChances()[3]) + ChatColor.GRAY + ")\n";
|
+ "" + questMob.getDropChances()[3]) + ChatColor.GRAY + ")";
|
||||||
case 13:
|
case 13:
|
||||||
return "(" + (questMob.getInventory()[4] == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
return "(" + (questMob.getInventory()[4] == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
||||||
+ ItemUtil.getDisplayString(questMob.getInventory()[4])) + ChatColor.GRAY + ")\n";
|
+ ItemUtil.getDisplayString(questMob.getInventory()[4])) + ChatColor.GRAY + ")";
|
||||||
case 14:
|
case 14:
|
||||||
return "(" + (questMob.getDropChances()[4] == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
return "(" + (questMob.getDropChances()[4] == null ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA
|
||||||
+ "" + questMob.getDropChances()[4]) + ChatColor.GRAY + ")\n";
|
+ "" + questMob.getDropChances()[4]) + ChatColor.GRAY + ")";
|
||||||
case 15:
|
case 15:
|
||||||
case 16:
|
case 16:
|
||||||
return "";
|
return "";
|
||||||
@ -567,9 +568,9 @@ public class ActionMainPrompt extends ActionsEditorNumericPrompt {
|
|||||||
|
|
||||||
final StringBuilder text = new StringBuilder(ChatColor.GOLD + getTitle(context));
|
final StringBuilder text = new StringBuilder(ChatColor.GOLD + getTitle(context));
|
||||||
for (int i = 1; i <= size; i++) {
|
for (int i = 1; i <= size; i++) {
|
||||||
text.append("\n").append(getNumberColor(context, i)).append(ChatColor.BOLD).append(i).append(ChatColor.RESET)
|
text.append("\n").append(getNumberColor(context, i)).append(ChatColor.BOLD).append(i)
|
||||||
.append(" - ").append(getSelectionText(context, i)).append(ChatColor.GRAY).append(" ")
|
.append(ChatColor.RESET).append(" - ").append(getSelectionText(context, i))
|
||||||
.append(getAdditionalText(context, i));
|
.append(ChatColor.GRAY).append(" ").append(getAdditionalText(context, i));
|
||||||
}
|
}
|
||||||
return text.toString();
|
return text.toString();
|
||||||
}
|
}
|
||||||
@ -733,7 +734,7 @@ public class ActionMainPrompt extends ActionsEditorNumericPrompt {
|
|||||||
if (context.getPlugin() != null) {
|
if (context.getPlugin() != null) {
|
||||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
final StringBuilder mobs = new StringBuilder(ChatColor.LIGHT_PURPLE + getTitle(context) + "\n");
|
final StringBuilder mobs = new StringBuilder(ChatColor.LIGHT_PURPLE + getTitle(context) + "\n");
|
||||||
final EntityType[] mobArr = EntityType.values();
|
final EntityType[] mobArr = EntityType.values();
|
||||||
for (int i = 0; i < mobArr.length; i++) {
|
for (int i = 0; i < mobArr.length; i++) {
|
||||||
@ -973,10 +974,11 @@ public class ActionMainPrompt extends ActionsEditorNumericPrompt {
|
|||||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
final StringBuilder text = new StringBuilder(ChatColor.DARK_AQUA + "- " + getTitle(context) + " -\n");
|
final StringBuilder text = new StringBuilder(ChatColor.DARK_AQUA + "- " + getTitle(context) + " -");
|
||||||
if (plugin.getDependencies().getDenizenApi().getScriptNames() != null) {
|
if (plugin.getDependencies().getDenizenApi() != null
|
||||||
|
&& plugin.getDependencies().getDenizenApi().getScriptNames() != null) {
|
||||||
for (final String s : plugin.getDependencies().getDenizenApi().getScriptNames()) {
|
for (final String s : plugin.getDependencies().getDenizenApi().getScriptNames()) {
|
||||||
text.append(ChatColor.AQUA).append("- ").append(s).append("\n");
|
text.append("\n").append(ChatColor.AQUA).append("- ").append(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return text.toString() + ChatColor.YELLOW + getQueryText(context);
|
return text.toString() + ChatColor.YELLOW + getQueryText(context);
|
||||||
@ -1164,7 +1166,8 @@ public class ActionMainPrompt extends ActionsEditorNumericPrompt {
|
|||||||
|
|
||||||
final StringBuilder text = new StringBuilder(ChatColor.YELLOW + getQueryText(context));
|
final StringBuilder text = new StringBuilder(ChatColor.YELLOW + getQueryText(context));
|
||||||
for (int i = 1; i <= size; i++) {
|
for (int i = 1; i <= size; i++) {
|
||||||
text.append("\n").append(getNumberColor(context, i)).append(ChatColor.BOLD).append(i).append(ChatColor.RESET).append(" - ").append(getSelectionText(context, i));
|
text.append("\n").append(getNumberColor(context, i)).append(ChatColor.BOLD).append(i)
|
||||||
|
.append(ChatColor.RESET).append(" - ").append(getSelectionText(context, i));
|
||||||
}
|
}
|
||||||
return QuestsNumericPrompt.sendClickableSelection(text.toString(), context);
|
return QuestsNumericPrompt.sendClickableSelection(text.toString(), context);
|
||||||
}
|
}
|
||||||
|
@ -93,15 +93,15 @@ public class EffectPrompt extends ActionsEditorNumericPrompt {
|
|||||||
if (context.getSessionData(CK.E_EFFECTS) == null) {
|
if (context.getSessionData(CK.E_EFFECTS) == null) {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||||
} else {
|
} else {
|
||||||
final StringBuilder text = new StringBuilder("\n");
|
final StringBuilder text = new StringBuilder();
|
||||||
final LinkedList<String> effects = (LinkedList<String>) context.getSessionData(CK.E_EFFECTS);
|
final LinkedList<String> effects = (LinkedList<String>) context.getSessionData(CK.E_EFFECTS);
|
||||||
final LinkedList<String> locations
|
final LinkedList<String> locations
|
||||||
= (LinkedList<String>) context.getSessionData(CK.E_EFFECTS_LOCATIONS);
|
= (LinkedList<String>) context.getSessionData(CK.E_EFFECTS_LOCATIONS);
|
||||||
if (effects != null && locations != null) {
|
if (effects != null && locations != null) {
|
||||||
for (final String effect : effects) {
|
for (final String effect : effects) {
|
||||||
text.append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA).append(effect)
|
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA).append(effect)
|
||||||
.append(ChatColor.GRAY).append(" at ").append(ChatColor.DARK_AQUA)
|
.append(ChatColor.GRAY).append(" at ").append(ChatColor.DARK_AQUA)
|
||||||
.append(locations.get(effects.indexOf(effect))).append("\n");
|
.append(locations.get(effects.indexOf(effect)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return text.toString();
|
return text.toString();
|
||||||
@ -110,11 +110,11 @@ public class EffectPrompt extends ActionsEditorNumericPrompt {
|
|||||||
if (context.getSessionData(CK.E_EXPLOSIONS) == null) {
|
if (context.getSessionData(CK.E_EXPLOSIONS) == null) {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||||
} else {
|
} else {
|
||||||
final StringBuilder text = new StringBuilder("\n");
|
final StringBuilder text = new StringBuilder();
|
||||||
final LinkedList<String> locations = (LinkedList<String>) context.getSessionData(CK.E_EXPLOSIONS);
|
final LinkedList<String> locations = (LinkedList<String>) context.getSessionData(CK.E_EXPLOSIONS);
|
||||||
if (locations != null) {
|
if (locations != null) {
|
||||||
for (final String loc : locations) {
|
for (final String loc : locations) {
|
||||||
text.append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA).append(loc).append("\n");
|
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA).append(loc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return text.toString();
|
return text.toString();
|
||||||
@ -221,9 +221,9 @@ public class EffectPrompt extends ActionsEditorNumericPrompt {
|
|||||||
if (context.getSessionData(CK.E_EFFECTS) == null) {
|
if (context.getSessionData(CK.E_EFFECTS) == null) {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||||
} else {
|
} else {
|
||||||
final StringBuilder text = new StringBuilder("\n");
|
final StringBuilder text = new StringBuilder();
|
||||||
for (final String s : (List<String>) Objects.requireNonNull(context.getSessionData(CK.E_EFFECTS))) {
|
for (final String s : (List<String>) Objects.requireNonNull(context.getSessionData(CK.E_EFFECTS))) {
|
||||||
text.append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA).append(s).append("\n");
|
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA).append(s);
|
||||||
}
|
}
|
||||||
return text.toString();
|
return text.toString();
|
||||||
}
|
}
|
||||||
@ -231,10 +231,10 @@ public class EffectPrompt extends ActionsEditorNumericPrompt {
|
|||||||
if (context.getSessionData(CK.E_EFFECTS_LOCATIONS) == null) {
|
if (context.getSessionData(CK.E_EFFECTS_LOCATIONS) == null) {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||||
} else {
|
} else {
|
||||||
final StringBuilder text = new StringBuilder("\n");
|
final StringBuilder text = new StringBuilder();
|
||||||
for (final String s : (List<String>) Objects.requireNonNull(context
|
for (final String s : (List<String>) Objects.requireNonNull(context
|
||||||
.getSessionData(CK.E_EFFECTS_LOCATIONS))) {
|
.getSessionData(CK.E_EFFECTS_LOCATIONS))) {
|
||||||
text.append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA).append(s).append("\n");
|
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA).append(s);
|
||||||
}
|
}
|
||||||
return text.toString();
|
return text.toString();
|
||||||
}
|
}
|
||||||
@ -335,7 +335,7 @@ public class EffectPrompt extends ActionsEditorNumericPrompt {
|
|||||||
final ActionsEditorPostOpenStringPromptEvent event
|
final ActionsEditorPostOpenStringPromptEvent event
|
||||||
= new ActionsEditorPostOpenStringPromptEvent(context, this);
|
= new ActionsEditorPostOpenStringPromptEvent(context, this);
|
||||||
plugin.getServer().getPluginManager().callEvent(event);
|
plugin.getServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
final StringBuilder effects = new StringBuilder(ChatColor.LIGHT_PURPLE + getTitle(context) + "\n");
|
final StringBuilder effects = new StringBuilder(ChatColor.LIGHT_PURPLE + getTitle(context) + "\n");
|
||||||
final Effect[] values = Effect.values();
|
final Effect[] values = Effect.values();
|
||||||
for (int i = 0; i < values.length; i++) {
|
for (int i = 0; i < values.length; i++) {
|
||||||
@ -345,7 +345,7 @@ public class EffectPrompt extends ActionsEditorNumericPrompt {
|
|||||||
} else {
|
} else {
|
||||||
effects.append(MiscUtil.snakeCaseToUpperCamelCase(eff.name())).append("\n");
|
effects.append(MiscUtil.snakeCaseToUpperCamelCase(eff.name())).append("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return effects.toString() + ChatColor.YELLOW + getQueryText(context);
|
return effects.toString() + ChatColor.YELLOW + getQueryText(context);
|
||||||
}
|
}
|
||||||
|
@ -89,21 +89,21 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||||||
case 1:
|
case 1:
|
||||||
return ChatColor.YELLOW + Lang.get("eventEditorSetMessage");
|
return ChatColor.YELLOW + Lang.get("eventEditorSetMessage");
|
||||||
case 2:
|
case 2:
|
||||||
return ChatColor.YELLOW + Lang.get("eventEditorClearInv");
|
|
||||||
case 3:
|
|
||||||
return ChatColor.YELLOW + Lang.get("eventEditorSetItems");
|
return ChatColor.YELLOW + Lang.get("eventEditorSetItems");
|
||||||
case 4:
|
case 3:
|
||||||
return ChatColor.YELLOW + Lang.get("eventEditorSetPotionEffects");
|
return ChatColor.YELLOW + Lang.get("eventEditorSetPotionEffects");
|
||||||
case 5:
|
case 4:
|
||||||
return ChatColor.YELLOW + Lang.get("eventEditorSetHunger");
|
return ChatColor.YELLOW + Lang.get("eventEditorSetHunger");
|
||||||
case 6:
|
case 5:
|
||||||
return ChatColor.YELLOW + Lang.get("eventEditorSetSaturation");
|
return ChatColor.YELLOW + Lang.get("eventEditorSetSaturation");
|
||||||
case 7:
|
case 6:
|
||||||
return ChatColor.YELLOW + Lang.get("eventEditorSetHealth");
|
return ChatColor.YELLOW + Lang.get("eventEditorSetHealth");
|
||||||
case 8:
|
case 7:
|
||||||
return ChatColor.YELLOW + Lang.get("eventEditorSetTeleport");
|
return ChatColor.YELLOW + Lang.get("eventEditorSetTeleport");
|
||||||
case 9:
|
case 8:
|
||||||
return ChatColor.YELLOW + Lang.get("eventEditorSetCommands");
|
return ChatColor.YELLOW + Lang.get("eventEditorSetCommands");
|
||||||
|
case 9:
|
||||||
|
return ChatColor.YELLOW + Lang.get("eventEditorClearInv");
|
||||||
case 10:
|
case 10:
|
||||||
return ChatColor.GREEN + Lang.get("done");
|
return ChatColor.GREEN + Lang.get("done");
|
||||||
default:
|
default:
|
||||||
@ -122,27 +122,25 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.E_MESSAGE) + ChatColor.GRAY + ")";
|
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.E_MESSAGE) + ChatColor.GRAY + ")";
|
||||||
}
|
}
|
||||||
case 2:
|
case 2:
|
||||||
return ChatColor.AQUA + "" + context.getSessionData(CK.E_CLEAR_INVENTORY);
|
|
||||||
case 3:
|
|
||||||
if (context.getSessionData(CK.E_ITEMS) == null) {
|
if (context.getSessionData(CK.E_ITEMS) == null) {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||||
} else {
|
} else {
|
||||||
final StringBuilder text = new StringBuilder("\n");
|
final StringBuilder text = new StringBuilder();
|
||||||
final LinkedList<ItemStack> items = (LinkedList<ItemStack>) context.getSessionData(CK.E_ITEMS);
|
final LinkedList<ItemStack> items = (LinkedList<ItemStack>) context.getSessionData(CK.E_ITEMS);
|
||||||
if (items != null) {
|
if (items != null) {
|
||||||
for (final ItemStack is : items) {
|
for (final ItemStack is : items) {
|
||||||
if (is != null) {
|
if (is != null) {
|
||||||
text.append(ChatColor.GRAY).append(" - ").append(ItemUtil.getString(is)).append("\n");
|
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ItemUtil.getString(is));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return text.toString();
|
return text.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case 4:
|
case 3:
|
||||||
if (context.getSessionData(CK.E_POTION_TYPES) == null) {
|
if (context.getSessionData(CK.E_POTION_TYPES) == null) {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||||
} else {
|
} else {
|
||||||
final StringBuilder text = new StringBuilder("\n");
|
final StringBuilder text = new StringBuilder();
|
||||||
final LinkedList<String> types = (LinkedList<String>) context.getSessionData(CK.E_POTION_TYPES);
|
final LinkedList<String> types = (LinkedList<String>) context.getSessionData(CK.E_POTION_TYPES);
|
||||||
final LinkedList<Long> durations = (LinkedList<Long>) context.getSessionData(CK.E_POTION_DURATIONS);
|
final LinkedList<Long> durations = (LinkedList<Long>) context.getSessionData(CK.E_POTION_DURATIONS);
|
||||||
final LinkedList<Integer> mags = (LinkedList<Integer>) context.getSessionData(CK.E_POTION_STRENGTH);
|
final LinkedList<Integer> mags = (LinkedList<Integer>) context.getSessionData(CK.E_POTION_STRENGTH);
|
||||||
@ -150,53 +148,56 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||||||
if (types != null && durations != null && mags != null) {
|
if (types != null && durations != null && mags != null) {
|
||||||
for (final String type : types) {
|
for (final String type : types) {
|
||||||
index++;
|
index++;
|
||||||
text.append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA).append(type)
|
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA).append(type)
|
||||||
.append(ChatColor.DARK_PURPLE).append(" ").append(RomanNumeral.getNumeral(mags
|
.append(ChatColor.DARK_PURPLE).append(" ").append(RomanNumeral.getNumeral(mags
|
||||||
.get(index))).append(ChatColor.GRAY).append(" -> ").append(ChatColor.DARK_AQUA)
|
.get(index))).append(ChatColor.GRAY).append(" -> ").append(ChatColor.DARK_AQUA)
|
||||||
.append(MiscUtil.getTime(durations.get(index) * 50L)).append("\n");
|
.append(MiscUtil.getTime(durations.get(index) * 50L));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return text.toString();
|
return text.toString();
|
||||||
}
|
}
|
||||||
case 5:
|
case 4:
|
||||||
if (context.getSessionData(CK.E_HUNGER) == null) {
|
if (context.getSessionData(CK.E_HUNGER) == null) {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||||
} else {
|
} else {
|
||||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.E_HUNGER) + ChatColor.GRAY
|
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.E_HUNGER) + ChatColor.GRAY
|
||||||
+ ")";
|
+ ")";
|
||||||
}
|
}
|
||||||
case 6:
|
case 5:
|
||||||
if (context.getSessionData(CK.E_SATURATION) == null) {
|
if (context.getSessionData(CK.E_SATURATION) == null) {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||||
} else {
|
} else {
|
||||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.E_SATURATION) + ChatColor.GRAY
|
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.E_SATURATION) + ChatColor.GRAY
|
||||||
+ ")";
|
+ ")";
|
||||||
}
|
}
|
||||||
case 7:
|
case 6:
|
||||||
if (context.getSessionData(CK.E_HEALTH) == null) {
|
if (context.getSessionData(CK.E_HEALTH) == null) {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||||
} else {
|
} else {
|
||||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.E_HEALTH) + ChatColor.GRAY
|
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.E_HEALTH) + ChatColor.GRAY
|
||||||
+ ")";
|
+ ")";
|
||||||
}
|
}
|
||||||
case 8:
|
case 7:
|
||||||
if (context.getSessionData(CK.E_TELEPORT) == null) {
|
if (context.getSessionData(CK.E_TELEPORT) == null) {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||||
} else {
|
} else {
|
||||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.E_TELEPORT) + ChatColor.GRAY
|
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.E_TELEPORT) + ChatColor.GRAY
|
||||||
+ ")";
|
+ ")";
|
||||||
}
|
}
|
||||||
case 9:
|
case 8:
|
||||||
if (context.getSessionData(CK.E_COMMANDS) == null) {
|
if (context.getSessionData(CK.E_COMMANDS) == null) {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||||
} else {
|
} else {
|
||||||
final StringBuilder text = new StringBuilder("\n");
|
final StringBuilder text = new StringBuilder();
|
||||||
for (final String s : (LinkedList<String>) Objects.requireNonNull(context
|
for (final String s : (LinkedList<String>) Objects.requireNonNull(context
|
||||||
.getSessionData(CK.E_COMMANDS))) {
|
.getSessionData(CK.E_COMMANDS))) {
|
||||||
text.append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA).append(s).append("\n");
|
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA).append(s);
|
||||||
}
|
}
|
||||||
return text.toString();
|
return text.toString();
|
||||||
}
|
}
|
||||||
|
case 9:
|
||||||
|
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.E_CLEAR_INVENTORY) + ChatColor.GRAY
|
||||||
|
+ ")";
|
||||||
case 10:
|
case 10:
|
||||||
return "";
|
return "";
|
||||||
default:
|
default:
|
||||||
@ -229,26 +230,16 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||||||
case 1:
|
case 1:
|
||||||
return new PlayerMessagePrompt(context);
|
return new PlayerMessagePrompt(context);
|
||||||
case 2:
|
case 2:
|
||||||
final String s = (String) context.getSessionData(CK.E_CLEAR_INVENTORY);
|
|
||||||
if (s != null) {
|
|
||||||
if (s.equalsIgnoreCase(Lang.get("yesWord"))) {
|
|
||||||
context.setSessionData(CK.E_CLEAR_INVENTORY, Lang.get("noWord"));
|
|
||||||
} else {
|
|
||||||
context.setSessionData(CK.E_CLEAR_INVENTORY, Lang.get("yesWord"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new ActionMainPrompt(context);
|
|
||||||
case 3:
|
|
||||||
return new PlayerItemListPrompt(context);
|
return new PlayerItemListPrompt(context);
|
||||||
|
case 3:
|
||||||
|
return new PlayerPotionListPrompt(context);
|
||||||
case 4:
|
case 4:
|
||||||
return new PlayerPotionEffectPrompt(context);
|
|
||||||
case 5:
|
|
||||||
return new PlayerHungerPrompt(context);
|
return new PlayerHungerPrompt(context);
|
||||||
case 6:
|
case 5:
|
||||||
return new PlayerSaturationPrompt(context);
|
return new PlayerSaturationPrompt(context);
|
||||||
case 7:
|
case 6:
|
||||||
return new PlayerHealthPrompt(context);
|
return new PlayerHealthPrompt(context);
|
||||||
case 8:
|
case 7:
|
||||||
if (context.getForWhom() instanceof Player) {
|
if (context.getForWhom() instanceof Player) {
|
||||||
final Map<UUID, Block> selectedTeleportLocations = plugin.getActionFactory().getSelectedTeleportLocations();
|
final Map<UUID, Block> selectedTeleportLocations = plugin.getActionFactory().getSelectedTeleportLocations();
|
||||||
selectedTeleportLocations.put(((Player) context.getForWhom()).getUniqueId(), null);
|
selectedTeleportLocations.put(((Player) context.getForWhom()).getUniqueId(), null);
|
||||||
@ -258,13 +249,23 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("consoleError"));
|
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("consoleError"));
|
||||||
return new PlayerPrompt(context);
|
return new PlayerPrompt(context);
|
||||||
}
|
}
|
||||||
case 9:
|
case 8:
|
||||||
if (!plugin.hasLimitedAccess(context.getForWhom())) {
|
if (!plugin.hasLimitedAccess(context.getForWhom())) {
|
||||||
return new PlayerCommandsPrompt(context);
|
return new PlayerCommandsPrompt(context);
|
||||||
} else {
|
} else {
|
||||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("noPermission"));
|
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("noPermission"));
|
||||||
return new PlayerPrompt(context);
|
return new PlayerPrompt(context);
|
||||||
}
|
}
|
||||||
|
case 9:
|
||||||
|
final String s = (String) context.getSessionData(CK.E_CLEAR_INVENTORY);
|
||||||
|
if (s != null) {
|
||||||
|
if (s.equalsIgnoreCase(Lang.get("yesWord"))) {
|
||||||
|
context.setSessionData(CK.E_CLEAR_INVENTORY, Lang.get("noWord"));
|
||||||
|
} else {
|
||||||
|
context.setSessionData(CK.E_CLEAR_INVENTORY, Lang.get("yesWord"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new PlayerPrompt(context);
|
||||||
case 10:
|
case 10:
|
||||||
return new ActionMainPrompt(context);
|
return new ActionMainPrompt(context);
|
||||||
default:
|
default:
|
||||||
@ -364,11 +365,11 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||||||
if (context.getSessionData(CK.E_ITEMS) == null) {
|
if (context.getSessionData(CK.E_ITEMS) == null) {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||||
} else {
|
} else {
|
||||||
final StringBuilder text = new StringBuilder("\n");
|
final StringBuilder text = new StringBuilder();
|
||||||
for (final ItemStack is : (List<ItemStack>) Objects.requireNonNull(context
|
for (final ItemStack is : (List<ItemStack>) Objects.requireNonNull(context
|
||||||
.getSessionData(CK.E_ITEMS))) {
|
.getSessionData(CK.E_ITEMS))) {
|
||||||
text.append(ChatColor.GRAY).append(" - ").append(ItemUtil.getDisplayString(is))
|
text.append("\n").append(ChatColor.GRAY).append(" - ")
|
||||||
.append("\n");
|
.append(ItemUtil.getDisplayString(is));
|
||||||
}
|
}
|
||||||
return text.toString();
|
return text.toString();
|
||||||
}
|
}
|
||||||
@ -430,9 +431,9 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PlayerPotionEffectPrompt extends ActionsEditorNumericPrompt {
|
public class PlayerPotionListPrompt extends ActionsEditorNumericPrompt {
|
||||||
|
|
||||||
public PlayerPotionEffectPrompt(final ConversationContext context) {
|
public PlayerPotionListPrompt(final ConversationContext context) {
|
||||||
super(context);
|
super(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -490,10 +491,10 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||||||
if (context.getSessionData(CK.E_POTION_TYPES) == null) {
|
if (context.getSessionData(CK.E_POTION_TYPES) == null) {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||||
} else {
|
} else {
|
||||||
final StringBuilder text = new StringBuilder("\n");
|
final StringBuilder text = new StringBuilder();
|
||||||
for (final String s : (LinkedList<String>) Objects.requireNonNull(context
|
for (final String s : (LinkedList<String>) Objects.requireNonNull(context
|
||||||
.getSessionData(CK.E_POTION_TYPES))) {
|
.getSessionData(CK.E_POTION_TYPES))) {
|
||||||
text.append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA).append(s).append("\n");
|
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA).append(s);
|
||||||
}
|
}
|
||||||
return text.toString();
|
return text.toString();
|
||||||
}
|
}
|
||||||
@ -501,11 +502,11 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||||||
if (context.getSessionData(CK.E_POTION_DURATIONS) == null) {
|
if (context.getSessionData(CK.E_POTION_DURATIONS) == null) {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||||
} else {
|
} else {
|
||||||
final StringBuilder text = new StringBuilder("\n");
|
final StringBuilder text = new StringBuilder();
|
||||||
for (final Long l : (LinkedList<Long>) Objects.requireNonNull(context
|
for (final Long l : (LinkedList<Long>) Objects.requireNonNull(context
|
||||||
.getSessionData(CK.E_POTION_DURATIONS))) {
|
.getSessionData(CK.E_POTION_DURATIONS))) {
|
||||||
text.append(ChatColor.GRAY).append(" - ").append(ChatColor.DARK_AQUA)
|
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.DARK_AQUA)
|
||||||
.append(MiscUtil.getTime(l * 50L)).append("\n");
|
.append(MiscUtil.getTime(l * 50L));
|
||||||
}
|
}
|
||||||
return text.toString();
|
return text.toString();
|
||||||
}
|
}
|
||||||
@ -513,11 +514,11 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||||||
if (context.getSessionData(CK.E_POTION_STRENGTH) == null) {
|
if (context.getSessionData(CK.E_POTION_STRENGTH) == null) {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||||
} else {
|
} else {
|
||||||
final StringBuilder text = new StringBuilder("\n");
|
final StringBuilder text = new StringBuilder();
|
||||||
for (final int i : (LinkedList<Integer>) Objects.requireNonNull(context
|
for (final int i : (LinkedList<Integer>) Objects.requireNonNull(context
|
||||||
.getSessionData(CK.E_POTION_STRENGTH))) {
|
.getSessionData(CK.E_POTION_STRENGTH))) {
|
||||||
text.append(ChatColor.GRAY).append(" - ").append(ChatColor.DARK_PURPLE).append(i)
|
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.DARK_PURPLE)
|
||||||
.append("\n");
|
.append(i);
|
||||||
}
|
}
|
||||||
return text.toString();
|
return text.toString();
|
||||||
}
|
}
|
||||||
@ -553,7 +554,7 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||||||
case 2:
|
case 2:
|
||||||
if (context.getSessionData(CK.E_POTION_TYPES) == null) {
|
if (context.getSessionData(CK.E_POTION_TYPES) == null) {
|
||||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorMustSetPotionTypesFirst"));
|
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorMustSetPotionTypesFirst"));
|
||||||
return new PlayerPotionEffectPrompt(context);
|
return new PlayerPotionListPrompt(context);
|
||||||
} else {
|
} else {
|
||||||
return new PlayerPotionDurationsPrompt(context);
|
return new PlayerPotionDurationsPrompt(context);
|
||||||
}
|
}
|
||||||
@ -561,11 +562,11 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||||||
if (context.getSessionData(CK.E_POTION_TYPES) == null) {
|
if (context.getSessionData(CK.E_POTION_TYPES) == null) {
|
||||||
context.getForWhom().sendRawMessage(ChatColor.RED
|
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||||
+ Lang.get("eventEditorMustSetPotionTypesAndDurationsFirst"));
|
+ Lang.get("eventEditorMustSetPotionTypesAndDurationsFirst"));
|
||||||
return new PlayerPotionEffectPrompt(context);
|
return new PlayerPotionListPrompt(context);
|
||||||
} else if (context.getSessionData(CK.E_POTION_DURATIONS) == null) {
|
} else if (context.getSessionData(CK.E_POTION_DURATIONS) == null) {
|
||||||
context.getForWhom().sendRawMessage(ChatColor.RED
|
context.getForWhom().sendRawMessage(ChatColor.RED
|
||||||
+ Lang.get("eventEditorMustSetPotionDurationsFirst"));
|
+ Lang.get("eventEditorMustSetPotionDurationsFirst"));
|
||||||
return new PlayerPotionEffectPrompt(context);
|
return new PlayerPotionListPrompt(context);
|
||||||
} else {
|
} else {
|
||||||
return new PlayerPotionMagnitudesPrompt(context);
|
return new PlayerPotionMagnitudesPrompt(context);
|
||||||
}
|
}
|
||||||
@ -574,7 +575,7 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||||||
context.setSessionData(CK.E_POTION_TYPES, null);
|
context.setSessionData(CK.E_POTION_TYPES, null);
|
||||||
context.setSessionData(CK.E_POTION_DURATIONS, null);
|
context.setSessionData(CK.E_POTION_DURATIONS, null);
|
||||||
context.setSessionData(CK.E_POTION_STRENGTH, null);
|
context.setSessionData(CK.E_POTION_STRENGTH, null);
|
||||||
return new PlayerPotionEffectPrompt(context);
|
return new PlayerPotionListPrompt(context);
|
||||||
case 5:
|
case 5:
|
||||||
final int one;
|
final int one;
|
||||||
final int two;
|
final int two;
|
||||||
@ -601,10 +602,10 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||||||
return new ActionMainPrompt(context);
|
return new ActionMainPrompt(context);
|
||||||
} else {
|
} else {
|
||||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorListSizeMismatch"));
|
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorListSizeMismatch"));
|
||||||
return new PlayerPotionEffectPrompt(context);
|
return new PlayerPotionListPrompt(context);
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return new PlayerPotionEffectPrompt(context);
|
return new PlayerPotionListPrompt(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -631,9 +632,9 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||||||
= new ActionsEditorPostOpenStringPromptEvent(context, this);
|
= new ActionsEditorPostOpenStringPromptEvent(context, this);
|
||||||
plugin.getServer().getPluginManager().callEvent(event);
|
plugin.getServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
final StringBuilder effs = new StringBuilder(ChatColor.LIGHT_PURPLE + getTitle(context) + "\n");
|
final StringBuilder effs = new StringBuilder(ChatColor.LIGHT_PURPLE + getTitle(context));
|
||||||
for (final PotionEffectType pet : PotionEffectType.values()) {
|
for (final PotionEffectType pet : PotionEffectType.values()) {
|
||||||
effs.append(pet != null ? ChatColor.DARK_PURPLE + pet.getName() + "\n" : "");
|
effs.append(pet != null ? "\n" + ChatColor.DARK_PURPLE + pet.getName() : "");
|
||||||
}
|
}
|
||||||
return effs.toString() + ChatColor.YELLOW + getQueryText(context);
|
return effs.toString() + ChatColor.YELLOW + getQueryText(context);
|
||||||
}
|
}
|
||||||
@ -656,7 +657,7 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new PlayerPotionEffectPrompt(context);
|
return new PlayerPotionListPrompt(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -710,7 +711,7 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||||||
}
|
}
|
||||||
context.setSessionData(CK.E_POTION_DURATIONS, effDurations);
|
context.setSessionData(CK.E_POTION_DURATIONS, effDurations);
|
||||||
}
|
}
|
||||||
return new PlayerPotionEffectPrompt(context);
|
return new PlayerPotionListPrompt(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -763,7 +764,7 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||||||
}
|
}
|
||||||
context.setSessionData(CK.E_POTION_STRENGTH, magAmounts);
|
context.setSessionData(CK.E_POTION_STRENGTH, magAmounts);
|
||||||
}
|
}
|
||||||
return new PlayerPotionEffectPrompt(context);
|
return new PlayerPotionListPrompt(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ public class TimerPrompt extends ActionsEditorNumericPrompt {
|
|||||||
case 1:
|
case 1:
|
||||||
return ChatColor.YELLOW + Lang.get("eventEditorSetTimer");
|
return ChatColor.YELLOW + Lang.get("eventEditorSetTimer");
|
||||||
case 2:
|
case 2:
|
||||||
return ChatColor.YELLOW + Lang.get("eventEditorCancelTimer") + ":";
|
return ChatColor.YELLOW + Lang.get("eventEditorCancelTimer");
|
||||||
case 3:
|
case 3:
|
||||||
return ChatColor.GREEN + Lang.get("done");
|
return ChatColor.GREEN + Lang.get("done");
|
||||||
default:
|
default:
|
||||||
@ -89,7 +89,8 @@ public class TimerPrompt extends ActionsEditorNumericPrompt {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
case 2:
|
case 2:
|
||||||
return ChatColor.AQUA + "" + context.getSessionData(CK.E_CANCEL_TIMER);
|
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.E_CANCEL_TIMER) + ChatColor.GRAY
|
||||||
|
+ ")";
|
||||||
case 3:
|
case 3:
|
||||||
return "";
|
return "";
|
||||||
default:
|
default:
|
||||||
|
@ -117,11 +117,11 @@ public class WeatherPrompt extends ActionsEditorNumericPrompt {
|
|||||||
if (context.getSessionData(CK.E_LIGHTNING) == null) {
|
if (context.getSessionData(CK.E_LIGHTNING) == null) {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||||
} else {
|
} else {
|
||||||
final StringBuilder text = new StringBuilder("\n");
|
final StringBuilder text = new StringBuilder();
|
||||||
final LinkedList<String> locations = (LinkedList<String>) context.getSessionData(CK.E_LIGHTNING);
|
final LinkedList<String> locations = (LinkedList<String>) context.getSessionData(CK.E_LIGHTNING);
|
||||||
if (locations != null) {
|
if (locations != null) {
|
||||||
for (final String loc : locations) {
|
for (final String loc : locations) {
|
||||||
text.append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA).append(loc).append("\n");
|
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA).append(loc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return text.toString();
|
return text.toString();
|
||||||
@ -315,10 +315,10 @@ public class WeatherPrompt extends ActionsEditorNumericPrompt {
|
|||||||
= new ActionsEditorPostOpenStringPromptEvent(context, this);
|
= new ActionsEditorPostOpenStringPromptEvent(context, this);
|
||||||
plugin.getServer().getPluginManager().callEvent(event);
|
plugin.getServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
StringBuilder effects = new StringBuilder(ChatColor.LIGHT_PURPLE + getTitle(context) + "\n"
|
StringBuilder effects = new StringBuilder(ChatColor.LIGHT_PURPLE + getTitle(context)
|
||||||
+ ChatColor.DARK_PURPLE);
|
+ ChatColor.DARK_PURPLE);
|
||||||
for (final World w : plugin.getServer().getWorlds()) {
|
for (final World w : plugin.getServer().getWorlds()) {
|
||||||
effects.append(w.getName()).append(", ");
|
effects.append("\n").append(w.getName()).append(", ");
|
||||||
}
|
}
|
||||||
effects = new StringBuilder(effects.substring(0, effects.length()));
|
effects = new StringBuilder(effects.substring(0, effects.length()));
|
||||||
return ChatColor.YELLOW + effects.toString() + getQueryText(context);
|
return ChatColor.YELLOW + effects.toString() + getQueryText(context);
|
||||||
@ -532,10 +532,10 @@ public class WeatherPrompt extends ActionsEditorNumericPrompt {
|
|||||||
= new ActionsEditorPostOpenStringPromptEvent(context, this);
|
= new ActionsEditorPostOpenStringPromptEvent(context, this);
|
||||||
plugin.getServer().getPluginManager().callEvent(event);
|
plugin.getServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
StringBuilder effects = new StringBuilder(ChatColor.LIGHT_PURPLE + getTitle(context) + "\n"
|
StringBuilder effects = new StringBuilder(ChatColor.LIGHT_PURPLE + getTitle(context)
|
||||||
+ ChatColor.DARK_PURPLE);
|
+ ChatColor.DARK_PURPLE);
|
||||||
for (final World w : plugin.getServer().getWorlds()) {
|
for (final World w : plugin.getServer().getWorlds()) {
|
||||||
effects.append(w.getName()).append(", ");
|
effects.append("\n").append(w.getName()).append(", ");
|
||||||
}
|
}
|
||||||
effects = new StringBuilder(effects.substring(0, effects.length()));
|
effects = new StringBuilder(effects.substring(0, effects.length()));
|
||||||
return ChatColor.YELLOW + effects.toString() + getQueryText(context);
|
return ChatColor.YELLOW + effects.toString() + getQueryText(context);
|
||||||
|
@ -333,11 +333,11 @@ public class ConditionMainPrompt extends ConditionsEditorNumericPrompt {
|
|||||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
final StringBuilder text = new StringBuilder(ChatColor.AQUA + getTitle(context) + "\n");
|
final StringBuilder text = new StringBuilder(ChatColor.AQUA + getTitle(context));
|
||||||
for (int i = 1; i <= size; i++) {
|
for (int i = 1; i <= size; i++) {
|
||||||
text.append(getNumberColor(context, i)).append(ChatColor.BOLD).append(i).append(ChatColor.RESET)
|
text.append("\n").append(getNumberColor(context, i)).append(ChatColor.BOLD).append(i)
|
||||||
.append(" - ").append(getSelectionText(context, i)).append(" ")
|
.append(ChatColor.RESET).append(" - ").append(getSelectionText(context, i)).append(" ")
|
||||||
.append(getAdditionalText(context, i)).append("\n");
|
.append(getAdditionalText(context, i));
|
||||||
}
|
}
|
||||||
return text.toString();
|
return text.toString();
|
||||||
}
|
}
|
||||||
|
@ -187,7 +187,7 @@ public class EntityPrompt extends QuestsEditorNumericPrompt {
|
|||||||
= new QuestsEditorPostOpenStringPromptEvent(context, this);
|
= new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
final StringBuilder mobs = new StringBuilder(ChatColor.LIGHT_PURPLE + getTitle(context) + "\n");
|
final StringBuilder mobs = new StringBuilder(ChatColor.LIGHT_PURPLE + getTitle(context) + "\n");
|
||||||
final List<EntityType> mobArr = new LinkedList<>(Arrays.asList(EntityType.values()));
|
final List<EntityType> mobArr = new LinkedList<>(Arrays.asList(EntityType.values()));
|
||||||
final List<EntityType> toRemove = new LinkedList<>();
|
final List<EntityType> toRemove = new LinkedList<>();
|
||||||
@ -201,7 +201,7 @@ public class EntityPrompt extends QuestsEditorNumericPrompt {
|
|||||||
for (int i = 0; i < mobArr.size(); i++) {
|
for (int i = 0; i < mobArr.size(); i++) {
|
||||||
mobs.append(ChatColor.AQUA).append(MiscUtil.snakeCaseToUpperCamelCase(mobArr.get(i).name()));
|
mobs.append(ChatColor.AQUA).append(MiscUtil.snakeCaseToUpperCamelCase(mobArr.get(i).name()));
|
||||||
if (i < (mobArr.size() - 1)) {
|
if (i < (mobArr.size() - 1)) {
|
||||||
mobs.append(ChatColor.GRAY).append(", ");
|
mobs.append(ChatColor.GRAY).append(", ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mobs.append("\n").append(ChatColor.YELLOW).append(getQueryText(context));
|
mobs.append("\n").append(ChatColor.YELLOW).append(getQueryText(context));
|
||||||
@ -266,8 +266,7 @@ public class EntityPrompt extends QuestsEditorNumericPrompt {
|
|||||||
final Set<UUID> selectingNpcs = plugin.getQuestFactory().getSelectingNpcs();
|
final Set<UUID> selectingNpcs = plugin.getQuestFactory().getSelectingNpcs();
|
||||||
selectingNpcs.add(((Player) context.getForWhom()).getUniqueId());
|
selectingNpcs.add(((Player) context.getForWhom()).getUniqueId());
|
||||||
plugin.getQuestFactory().setSelectingNpcs(selectingNpcs);
|
plugin.getQuestFactory().setSelectingNpcs(selectingNpcs);
|
||||||
return ChatColor.YELLOW + getQueryText(context) + "\n"
|
return ChatColor.YELLOW + getQueryText(context) + "\n" + ChatColor.GOLD + Lang.get("npcHint");
|
||||||
+ ChatColor.GOLD + Lang.get("npcHint");
|
|
||||||
} else {
|
} else {
|
||||||
return ChatColor.YELLOW + getQueryText(context);
|
return ChatColor.YELLOW + getQueryText(context);
|
||||||
}
|
}
|
||||||
|
@ -263,13 +263,13 @@ public class PlayerPrompt extends QuestsEditorNumericPrompt {
|
|||||||
if (context.getSessionData(CK.C_WHILE_HOLDING_MAIN_HAND) == null) {
|
if (context.getSessionData(CK.C_WHILE_HOLDING_MAIN_HAND) == null) {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||||
} else {
|
} else {
|
||||||
final StringBuilder text = new StringBuilder("\n");
|
final StringBuilder text = new StringBuilder();
|
||||||
final List<ItemStack> whileHoldingMainHand
|
final List<ItemStack> whileHoldingMainHand
|
||||||
= (List<ItemStack>) context.getSessionData(CK.C_WHILE_HOLDING_MAIN_HAND);
|
= (List<ItemStack>) context.getSessionData(CK.C_WHILE_HOLDING_MAIN_HAND);
|
||||||
if (whileHoldingMainHand != null) {
|
if (whileHoldingMainHand != null) {
|
||||||
for (final ItemStack is : whileHoldingMainHand) {
|
for (final ItemStack is : whileHoldingMainHand) {
|
||||||
text.append(ChatColor.GRAY).append(" - ").append(ItemUtil.getDisplayString(is))
|
text.append("\n").append(ChatColor.GRAY).append(" - ")
|
||||||
.append("\n");
|
.append(ItemUtil.getDisplayString(is));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return text.toString();
|
return text.toString();
|
||||||
|
Loading…
Reference in New Issue
Block a user