mirror of https://github.com/PikaMug/Quests.git
Cleanup and fix prompt inheritance. Bump version
This commit is contained in:
parent
be0dce3cbe
commit
0d106297ad
|
@ -4911,7 +4911,13 @@ public class Quester implements IQuester {
|
|||
}
|
||||
return mq;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Whether this Quester meets condition of given quest
|
||||
*
|
||||
* @param quest The quest to check
|
||||
* @return Whether to send Quester reason for failure
|
||||
*/
|
||||
public boolean meetsCondition(final IQuest quest, final boolean giveReason) {
|
||||
final IStage stage = getCurrentStage(quest);
|
||||
if (stage != null && stage.getCondition() != null && !stage.getCondition().check(this, quest)) {
|
||||
|
@ -4937,7 +4943,12 @@ public class Quester implements IQuester {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Whether this Quester is currently selecting a block in editor
|
||||
*
|
||||
* @return true if selecting
|
||||
*/
|
||||
public boolean isSelectingBlock() {
|
||||
final UUID uuid = getPlayer().getUniqueId();
|
||||
return plugin.getQuestFactory().getSelectedBlockStarts().containsKey(uuid)
|
||||
|
@ -4949,7 +4960,12 @@ public class Quester implements IQuester {
|
|||
|| plugin.getActionFactory().getSelectedLightningLocations().containsKey(uuid)
|
||||
|| plugin.getActionFactory().getSelectedTeleportLocations().containsKey(uuid);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Whether this Quester is in the specified WorldGuard region
|
||||
*
|
||||
* @return true if in specified WorldGuard region
|
||||
*/
|
||||
public boolean isInRegion(final String regionID) {
|
||||
if (getPlayer() == null) {
|
||||
return false;
|
||||
|
|
|
@ -964,7 +964,8 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||
}
|
||||
final Player player = (Player) context.getForWhom();
|
||||
if (input.equalsIgnoreCase(Lang.get("cmdDone"))) {
|
||||
final Map<UUID, Block> selectedTeleportLocations = plugin.getActionFactory().getSelectedTeleportLocations();
|
||||
final Map<UUID, Block> selectedTeleportLocations = plugin.getActionFactory()
|
||||
.getSelectedTeleportLocations();
|
||||
final Block block = selectedTeleportLocations.get(player.getUniqueId());
|
||||
if (block != null) {
|
||||
final Location loc = block.getLocation();
|
||||
|
@ -978,12 +979,14 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||
return new ActionMainPrompt(context);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(CK.E_TELEPORT, null);
|
||||
final Map<UUID, Block> selectedTeleportLocations = plugin.getActionFactory().getSelectedTeleportLocations();
|
||||
final Map<UUID, Block> selectedTeleportLocations = plugin.getActionFactory()
|
||||
.getSelectedTeleportLocations();
|
||||
selectedTeleportLocations.remove(player.getUniqueId());
|
||||
plugin.getActionFactory().setSelectedTeleportLocations(selectedTeleportLocations);
|
||||
return new ActionMainPrompt(context);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
final Map<UUID, Block> selectedTeleportLocations = plugin.getActionFactory().getSelectedTeleportLocations();
|
||||
final Map<UUID, Block> selectedTeleportLocations = plugin.getActionFactory()
|
||||
.getSelectedTeleportLocations();
|
||||
selectedTeleportLocations.remove(player.getUniqueId());
|
||||
plugin.getActionFactory().setSelectedTeleportLocations(selectedTeleportLocations);
|
||||
return new ActionMainPrompt(context);
|
||||
|
|
|
@ -235,7 +235,8 @@ public class ConditionMenuPrompt extends ConditionsEditorNumericPrompt {
|
|||
final ConditionsEditorPostOpenStringPromptEvent event
|
||||
= new ConditionsEditorPostOpenStringPromptEvent(context, this);
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
final List<String> names = plugin.getLoadedConditions().stream().map(ICondition::getName).collect(Collectors.toList());
|
||||
final List<String> names = plugin.getLoadedConditions().stream().map(ICondition::getName)
|
||||
.collect(Collectors.toList());
|
||||
return sendClickableMenu(getTitle(context), names, getQueryText(context), context);
|
||||
}
|
||||
|
||||
|
|
|
@ -13,9 +13,13 @@
|
|||
package me.blackvein.quests.convo.conditions.tasks;
|
||||
|
||||
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;
|
||||
|
@ -36,7 +40,7 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public class EntityPrompt extends QuestsEditorNumericPrompt {
|
||||
public class EntityPrompt extends ConditionsEditorNumericPrompt {
|
||||
|
||||
private final Quests plugin;
|
||||
|
||||
|
@ -130,8 +134,8 @@ public class EntityPrompt extends QuestsEditorNumericPrompt {
|
|||
@Override
|
||||
public @NotNull String getBasicPromptText(final @NotNull ConversationContext context) {
|
||||
if (context.getPlugin() != null) {
|
||||
final QuestsEditorPostOpenNumericPromptEvent event
|
||||
= new QuestsEditorPostOpenNumericPromptEvent(context, this);
|
||||
final ConditionsEditorPostOpenNumericPromptEvent event
|
||||
= new ConditionsEditorPostOpenNumericPromptEvent(context, this);
|
||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
|
@ -163,7 +167,7 @@ public class EntityPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
}
|
||||
|
||||
public class EntitiesPrompt extends QuestsEditorStringPrompt {
|
||||
public class EntitiesPrompt extends ConditionsEditorStringPrompt {
|
||||
|
||||
public EntitiesPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
|
@ -182,8 +186,8 @@ public class EntityPrompt extends QuestsEditorNumericPrompt {
|
|||
@Override
|
||||
public @NotNull String getPromptText(final @NotNull ConversationContext context) {
|
||||
if (context.getPlugin() != null) {
|
||||
final QuestsEditorPostOpenStringPromptEvent event
|
||||
= new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
final ConditionsEditorPostOpenStringPromptEvent event
|
||||
= new ConditionsEditorPostOpenStringPromptEvent(context, this);
|
||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
|
@ -237,7 +241,7 @@ public class EntityPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
}
|
||||
|
||||
public class ConditionNpcsPrompt extends QuestsEditorStringPrompt {
|
||||
public class ConditionNpcsPrompt extends ConditionsEditorStringPrompt {
|
||||
|
||||
public ConditionNpcsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
|
@ -256,8 +260,8 @@ public class EntityPrompt extends QuestsEditorNumericPrompt {
|
|||
@Override
|
||||
public @NotNull String getPromptText(final ConversationContext context) {
|
||||
if (context.getPlugin() != null) {
|
||||
final QuestsEditorPostOpenStringPromptEvent event
|
||||
= new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
final ConditionsEditorPostOpenStringPromptEvent event
|
||||
= new ConditionsEditorPostOpenStringPromptEvent(context, this);
|
||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
|
@ -282,7 +286,7 @@ public class EntityPrompt extends QuestsEditorNumericPrompt {
|
|||
for (final String s : input.split(" ")) {
|
||||
try {
|
||||
final UUID u = UUID.fromString(s);
|
||||
if (plugin.getDependencies().getNPCName(u) == null) {
|
||||
if (plugin.getDependencies().getNPCEntity(u) == null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorInvalidNPC"));
|
||||
return new ConditionNpcsPrompt(context);
|
||||
}
|
||||
|
|
|
@ -12,10 +12,14 @@
|
|||
|
||||
package me.blackvein.quests.convo.conditions.tasks;
|
||||
|
||||
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;
|
||||
|
@ -30,7 +34,7 @@ import org.jetbrains.annotations.NotNull;
|
|||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class PlayerPrompt extends QuestsEditorNumericPrompt {
|
||||
public class PlayerPrompt extends ConditionsEditorNumericPrompt {
|
||||
|
||||
public PlayerPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
|
@ -152,8 +156,8 @@ public class PlayerPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
|
||||
if (context.getPlugin() != null) {
|
||||
final QuestsEditorPostOpenNumericPromptEvent event
|
||||
= new QuestsEditorPostOpenNumericPromptEvent(context, this);
|
||||
final ConditionsEditorPostOpenNumericPromptEvent event
|
||||
= new ConditionsEditorPostOpenNumericPromptEvent(context, this);
|
||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
|
@ -187,7 +191,7 @@ public class PlayerPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
}
|
||||
|
||||
public class PermissionsPrompt extends QuestsEditorStringPrompt {
|
||||
public class PermissionsPrompt extends ConditionsEditorStringPrompt {
|
||||
|
||||
public PermissionsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
|
@ -206,8 +210,8 @@ public class PlayerPrompt extends QuestsEditorNumericPrompt {
|
|||
@Override
|
||||
public @NotNull String getPromptText(final @NotNull ConversationContext context) {
|
||||
if (context.getPlugin() != null) {
|
||||
final QuestsEditorPostOpenStringPromptEvent event
|
||||
= new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
final ConditionsEditorPostOpenStringPromptEvent event
|
||||
= new ConditionsEditorPostOpenStringPromptEvent(context, this);
|
||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
|
@ -230,7 +234,7 @@ public class PlayerPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
}
|
||||
|
||||
public class ItemsInMainHandListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class ItemsInMainHandListPrompt extends ConditionsEditorNumericPrompt {
|
||||
|
||||
public ItemsInMainHandListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
|
@ -324,8 +328,8 @@ public class PlayerPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
|
||||
if (context.getPlugin() != null) {
|
||||
final QuestsEditorPostOpenNumericPromptEvent event
|
||||
= new QuestsEditorPostOpenNumericPromptEvent(context, this);
|
||||
final ConditionsEditorPostOpenNumericPromptEvent event
|
||||
= new ConditionsEditorPostOpenNumericPromptEvent(context, this);
|
||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
|
@ -355,7 +359,7 @@ public class PlayerPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
}
|
||||
|
||||
public class ItemsWearListPrompt extends QuestsEditorNumericPrompt {
|
||||
public class ItemsWearListPrompt extends ConditionsEditorNumericPrompt {
|
||||
|
||||
public ItemsWearListPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
|
@ -449,8 +453,8 @@ public class PlayerPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
|
||||
if (context.getPlugin() != null) {
|
||||
final QuestsEditorPostOpenNumericPromptEvent event
|
||||
= new QuestsEditorPostOpenNumericPromptEvent(context, this);
|
||||
final ConditionsEditorPostOpenNumericPromptEvent event
|
||||
= new ConditionsEditorPostOpenNumericPromptEvent(context, this);
|
||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,10 +15,12 @@ package me.blackvein.quests.convo.conditions.tasks;
|
|||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
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;
|
||||
|
@ -38,7 +40,7 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldPrompt extends QuestsEditorNumericPrompt {
|
||||
public class WorldPrompt extends ConditionsEditorNumericPrompt {
|
||||
|
||||
private final Quests plugin;
|
||||
|
||||
|
@ -162,8 +164,8 @@ public class WorldPrompt extends QuestsEditorNumericPrompt {
|
|||
@Override
|
||||
public @NotNull String getBasicPromptText(final @NotNull ConversationContext context) {
|
||||
if (context.getPlugin() != null) {
|
||||
final QuestsEditorPostOpenNumericPromptEvent event
|
||||
= new QuestsEditorPostOpenNumericPromptEvent(context, this);
|
||||
final ConditionsEditorPostOpenNumericPromptEvent event
|
||||
= new ConditionsEditorPostOpenNumericPromptEvent(context, this);
|
||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
|
@ -199,7 +201,7 @@ public class WorldPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
}
|
||||
|
||||
public class WorldsPrompt extends QuestsEditorStringPrompt {
|
||||
public class WorldsPrompt extends ConditionsEditorStringPrompt {
|
||||
|
||||
public WorldsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
|
@ -218,8 +220,8 @@ public class WorldPrompt extends QuestsEditorNumericPrompt {
|
|||
@Override
|
||||
public @NotNull String getPromptText(final @NotNull ConversationContext context) {
|
||||
if (context.getPlugin() != null) {
|
||||
final QuestsEditorPostOpenStringPromptEvent event
|
||||
= new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
final ConditionsEditorPostOpenStringPromptEvent event
|
||||
= new ConditionsEditorPostOpenStringPromptEvent(context, this);
|
||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
|
@ -372,7 +374,7 @@ public class WorldPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
}
|
||||
|
||||
public class TickStartPrompt extends QuestsEditorStringPrompt {
|
||||
public class TickStartPrompt extends ConditionsEditorStringPrompt {
|
||||
|
||||
public TickStartPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
|
@ -391,8 +393,8 @@ public class WorldPrompt extends QuestsEditorNumericPrompt {
|
|||
@Override
|
||||
public @NotNull String getPromptText(final @NotNull ConversationContext context) {
|
||||
if (context.getPlugin() != null) {
|
||||
final QuestsEditorPostOpenStringPromptEvent event
|
||||
= new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
final ConditionsEditorPostOpenStringPromptEvent event
|
||||
= new ConditionsEditorPostOpenStringPromptEvent(context, this);
|
||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
|
@ -424,7 +426,7 @@ public class WorldPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
}
|
||||
|
||||
public class TickEndPrompt extends QuestsEditorStringPrompt {
|
||||
public class TickEndPrompt extends ConditionsEditorStringPrompt {
|
||||
|
||||
public TickEndPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
|
@ -443,8 +445,8 @@ public class WorldPrompt extends QuestsEditorNumericPrompt {
|
|||
@Override
|
||||
public @NotNull String getPromptText(final @NotNull ConversationContext context) {
|
||||
if (context.getPlugin() != null) {
|
||||
final QuestsEditorPostOpenStringPromptEvent event
|
||||
= new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
final ConditionsEditorPostOpenStringPromptEvent event
|
||||
= new ConditionsEditorPostOpenStringPromptEvent(context, this);
|
||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
|
@ -476,7 +478,7 @@ public class WorldPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
}
|
||||
|
||||
public class BiomesPrompt extends QuestsEditorStringPrompt {
|
||||
public class BiomesPrompt extends ConditionsEditorStringPrompt {
|
||||
|
||||
public BiomesPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
|
@ -495,8 +497,8 @@ public class WorldPrompt extends QuestsEditorNumericPrompt {
|
|||
@Override
|
||||
public @NotNull String getPromptText(final @NotNull ConversationContext context) {
|
||||
if (context.getPlugin() != null) {
|
||||
final QuestsEditorPostOpenStringPromptEvent event
|
||||
= new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
final ConditionsEditorPostOpenStringPromptEvent event
|
||||
= new ConditionsEditorPostOpenStringPromptEvent(context, this);
|
||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
|
@ -534,7 +536,7 @@ public class WorldPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
}
|
||||
|
||||
public class RegionsPrompt extends QuestsEditorStringPrompt {
|
||||
public class RegionsPrompt extends ConditionsEditorStringPrompt {
|
||||
|
||||
public RegionsPrompt(final ConversationContext context) {
|
||||
super(context);
|
||||
|
@ -553,8 +555,8 @@ public class WorldPrompt extends QuestsEditorNumericPrompt {
|
|||
@Override
|
||||
public @NotNull String getPromptText(final @NotNull ConversationContext context) {
|
||||
if (context.getPlugin() != null) {
|
||||
final QuestsEditorPostOpenStringPromptEvent event
|
||||
= new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
final ConditionsEditorPostOpenStringPromptEvent event
|
||||
= new ConditionsEditorPostOpenStringPromptEvent(context, this);
|
||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
|
|
|
@ -437,7 +437,8 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
|||
|
||||
@Override
|
||||
public @NotNull String getPromptText(final @NotNull ConversationContext context) {
|
||||
final QuestsEditorPostOpenStringPromptEvent event = new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
final QuestsEditorPostOpenStringPromptEvent event
|
||||
= new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
return ChatColor.YELLOW + getQueryText(context);
|
||||
|
@ -548,7 +549,8 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
|||
|
||||
@Override
|
||||
public @NotNull String getPromptText(final @NotNull ConversationContext context) {
|
||||
final QuestsEditorPostOpenStringPromptEvent event = new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
final QuestsEditorPostOpenStringPromptEvent event
|
||||
= new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
return ChatColor.YELLOW + getQueryText(context);
|
||||
|
@ -742,7 +744,8 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
|
||||
if (context.getPlugin() != null) {
|
||||
final QuestsEditorPostOpenNumericPromptEvent event = new QuestsEditorPostOpenNumericPromptEvent(context, this);
|
||||
final QuestsEditorPostOpenNumericPromptEvent event
|
||||
= new QuestsEditorPostOpenNumericPromptEvent(context, this);
|
||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
|
@ -754,7 +757,8 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
|||
text.append(" ").append(ChatColor.GRAY).append("(").append(Lang.get("noneSet")).append(")\n");
|
||||
}
|
||||
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 text.toString();
|
||||
}
|
||||
|
|
|
@ -221,7 +221,8 @@ public class QuestMenuPrompt extends QuestsEditorNumericPrompt {
|
|||
final QuestsEditorPostOpenStringPromptEvent event
|
||||
= new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
final List<String> names = plugin.getLoadedQuests().stream().map(IQuest::getName).collect(Collectors.toList());
|
||||
final List<String> names = plugin.getLoadedQuests().stream().map(IQuest::getName)
|
||||
.collect(Collectors.toList());
|
||||
return sendClickableMenu(getTitle(context), names, getQueryText(context), context);
|
||||
}
|
||||
|
||||
|
@ -265,7 +266,8 @@ public class QuestMenuPrompt extends QuestsEditorNumericPrompt {
|
|||
final QuestsEditorPostOpenStringPromptEvent event
|
||||
= new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
final List<String> names = plugin.getLoadedQuests().stream().map(IQuest::getName).collect(Collectors.toList());
|
||||
final List<String> names = plugin.getLoadedQuests().stream().map(IQuest::getName)
|
||||
.collect(Collectors.toList());
|
||||
return sendClickableMenu(getTitle(context), names, getQueryText(context), context);
|
||||
}
|
||||
|
||||
|
|
|
@ -1585,7 +1585,8 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
@Override
|
||||
public @NotNull String getPromptText(final @NotNull ConversationContext context) {
|
||||
if (context.getPlugin() != null) {
|
||||
final QuestsEditorPostOpenStringPromptEvent event = new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
final QuestsEditorPostOpenStringPromptEvent event
|
||||
= new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
|
|
|
@ -142,7 +142,8 @@ public class ItemsPrompt extends QuestsEditorNumericPrompt {
|
|||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
final StringBuilder text = new StringBuilder();
|
||||
final LinkedList<ItemStack> items = (LinkedList<ItemStack>) context.getSessionData(pref + CK.S_BREW_ITEMS);
|
||||
final LinkedList<ItemStack> items
|
||||
= (LinkedList<ItemStack>) context.getSessionData(pref + CK.S_BREW_ITEMS);
|
||||
if (items != null) {
|
||||
for (final ItemStack item : items) {
|
||||
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.BLUE)
|
||||
|
@ -701,7 +702,9 @@ public class ItemsPrompt extends QuestsEditorNumericPrompt {
|
|||
|
||||
final StringBuilder text = new StringBuilder(ChatColor.GOLD + "- " + getTitle(context) + " -");
|
||||
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)).append(" ").append(getAdditionalText(context, i));
|
||||
text.append("\n").append(getNumberColor(context, i)).append(ChatColor.BOLD).append(i)
|
||||
.append(ChatColor.RESET).append(" - ").append(getSelectionText(context, i)).append(" ")
|
||||
.append(getAdditionalText(context, i));
|
||||
}
|
||||
return text.toString();
|
||||
}
|
||||
|
|
|
@ -112,7 +112,8 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
} else {
|
||||
final StringBuilder text = new StringBuilder();
|
||||
final LinkedList<String> mobs = (LinkedList<String>) context.getSessionData(pref + CK.S_MOB_TYPES);
|
||||
final LinkedList<Integer> amounts = (LinkedList<Integer>) context.getSessionData(pref + CK.S_MOB_AMOUNTS);
|
||||
final LinkedList<Integer> amounts
|
||||
= (LinkedList<Integer>) context.getSessionData(pref + CK.S_MOB_AMOUNTS);
|
||||
if (mobs != null && amounts != null) {
|
||||
if (context.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS) == null) {
|
||||
for (int i = 0; i < mobs.size(); i++) {
|
||||
|
@ -133,13 +134,14 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
if (locations != null && radii != null && names != null) {
|
||||
for (int i = 0; i < mobs.size(); i++) {
|
||||
String msg = Lang.get("blocksWithin");
|
||||
msg = msg.replace("<amount>", ChatColor.DARK_PURPLE + "" + radii.get(i) + ChatColor.GRAY);
|
||||
msg = msg.replace("<amount>", ChatColor.DARK_PURPLE + "" + radii.get(i)
|
||||
+ ChatColor.GRAY);
|
||||
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.BLUE)
|
||||
.append(MiscUtil.getPrettyMobName(Objects.requireNonNull(MiscUtil
|
||||
.getProperMobType(mobs.get(i))))).append(ChatColor.GRAY).append(" x ")
|
||||
.append(ChatColor.DARK_AQUA).append(amounts.get(i)).append(ChatColor.GRAY).append(msg)
|
||||
.append(ChatColor.YELLOW).append(names.get(i)).append(" (").append(locations.get(i))
|
||||
.append(")");
|
||||
.append(ChatColor.DARK_AQUA).append(amounts.get(i)).append(ChatColor.GRAY)
|
||||
.append(msg).append(ChatColor.YELLOW).append(names.get(i)).append(" (")
|
||||
.append(locations.get(i)).append(")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -152,7 +154,8 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
} else {
|
||||
final StringBuilder text = new StringBuilder();
|
||||
final LinkedList<String> mobs = (LinkedList<String>) context.getSessionData(pref + CK.S_TAME_TYPES);
|
||||
final LinkedList<Integer> amounts = (LinkedList<Integer>) context.getSessionData(pref + CK.S_TAME_AMOUNTS);
|
||||
final LinkedList<Integer> amounts
|
||||
= (LinkedList<Integer>) context.getSessionData(pref + CK.S_TAME_AMOUNTS);
|
||||
if (mobs != null && amounts != null) {
|
||||
for (int i = 0; i < mobs.size(); i++) {
|
||||
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.BLUE)
|
||||
|
@ -396,7 +399,8 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
@Override
|
||||
public @NotNull String getBasicPromptText(final @NotNull ConversationContext context) {
|
||||
if (context.getPlugin() != null) {
|
||||
final QuestsEditorPostOpenNumericPromptEvent event = new QuestsEditorPostOpenNumericPromptEvent(context, this);
|
||||
final QuestsEditorPostOpenNumericPromptEvent event
|
||||
= new QuestsEditorPostOpenNumericPromptEvent(context, this);
|
||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
|
@ -621,7 +625,8 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
mobAmounts.add(i);
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber").replace("<input>", input));
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber")
|
||||
.replace("<input>", input));
|
||||
return new MobsAmountsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
@ -717,7 +722,8 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
@Override
|
||||
public @NotNull String getPromptText(final @NotNull ConversationContext context) {
|
||||
if (context.getPlugin() != null) {
|
||||
final QuestsEditorPostOpenStringPromptEvent event = new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
final QuestsEditorPostOpenStringPromptEvent event
|
||||
= new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
|
@ -882,7 +888,8 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
@Override
|
||||
public @NotNull String getBasicPromptText(final @NotNull ConversationContext context) {
|
||||
if (context.getPlugin() != null) {
|
||||
final QuestsEditorPostOpenNumericPromptEvent event = new QuestsEditorPostOpenNumericPromptEvent(context, this);
|
||||
final QuestsEditorPostOpenNumericPromptEvent event
|
||||
= new QuestsEditorPostOpenNumericPromptEvent(context, this);
|
||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
|
@ -1258,7 +1265,8 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
|||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
final StringBuilder text = new StringBuilder();
|
||||
final List<Integer> shearAmounts = (List<Integer>) context.getSessionData(pref + CK.S_SHEAR_AMOUNTS);
|
||||
final List<Integer> shearAmounts
|
||||
= (List<Integer>) context.getSessionData(pref + CK.S_SHEAR_AMOUNTS);
|
||||
if (shearAmounts != null) {
|
||||
for (final Integer i : shearAmounts) {
|
||||
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA).append(i);
|
||||
|
|
|
@ -228,7 +228,8 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
|
|||
@Override
|
||||
public @NotNull String getPromptText(final @NotNull ConversationContext context) {
|
||||
if (context.getPlugin() != null) {
|
||||
final QuestsEditorPostOpenStringPromptEvent event = new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
final QuestsEditorPostOpenStringPromptEvent event
|
||||
= new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
|
|
|
@ -80,9 +80,9 @@ public class DateTimePrompt extends QuestsEditorNumericPrompt {
|
|||
final Double zonedHour = (double) (cal.getTimeZone().getRawOffset() / 60 / 60 / 1000);
|
||||
final String[] sep = String.valueOf(zonedHour).replace("-", "").split("\\.");
|
||||
final DecimalFormat zoneFormat = new DecimalFormat("00");
|
||||
dateData += ChatColor.LIGHT_PURPLE + "UTC" + (zonedHour < 0 ? "-":"+") + zoneFormat.format(Integer.valueOf(sep[0]))
|
||||
+ ":" + zoneFormat.format(Integer.valueOf(sep[1])) + ChatColor.GREEN + " ("
|
||||
+ cal.getTimeZone().getDisplayName(loc) + ")";
|
||||
dateData += ChatColor.LIGHT_PURPLE + "UTC" + (zonedHour < 0 ? "-":"+")
|
||||
+ zoneFormat.format(Integer.valueOf(sep[0])) + ":" + zoneFormat.format(Integer.valueOf(sep[1]))
|
||||
+ ChatColor.GREEN + " (" + cal.getTimeZone().getDisplayName(loc) + ")";
|
||||
return dateData;
|
||||
}
|
||||
|
||||
|
@ -201,7 +201,9 @@ public class DateTimePrompt extends QuestsEditorNumericPrompt {
|
|||
text.append(getDataText(context));
|
||||
}
|
||||
for (int i = 0; i <= size - 1; i++) {
|
||||
text.append("\n").append(getNumberColor(context, i)).append(ChatColor.BOLD).append(i).append(ChatColor.RESET).append(" - ").append(getSelectionText(context, i)).append(" ").append(getAdditionalText(context, i));
|
||||
text.append("\n").append(getNumberColor(context, i)).append(ChatColor.BOLD).append(i)
|
||||
.append(ChatColor.RESET).append(" - ").append(getSelectionText(context, i)).append(" ")
|
||||
.append(getAdditionalText(context, i));
|
||||
}
|
||||
return text.toString();
|
||||
}
|
||||
|
|
|
@ -413,9 +413,9 @@ public class PlannerPrompt extends QuestsEditorNumericPrompt {
|
|||
final Double zonehour = (double) (cal.getTimeZone().getRawOffset() / 60 / 60 / 1000);
|
||||
final String[] sep = String.valueOf(zonehour).replace("-", "").split("\\.");
|
||||
final DecimalFormat zoneFormat = new DecimalFormat("00");
|
||||
output += ChatColor.LIGHT_PURPLE + " UTC" + (zonehour < 0 ? "-":"+") + zoneFormat.format(Integer.valueOf(sep[0]))
|
||||
+ ":" + zoneFormat.format(Integer.valueOf(sep[1])) + ChatColor.GREEN + " ("
|
||||
+ cal.getTimeZone().getDisplayName(loc) + ")";
|
||||
output += ChatColor.LIGHT_PURPLE + " UTC" + (zonehour < 0 ? "-":"+")
|
||||
+ zoneFormat.format(Integer.valueOf(sep[0])) + ":" + zoneFormat.format(Integer.valueOf(sep[1]))
|
||||
+ ChatColor.GREEN + " (" + cal.getTimeZone().getDisplayName(loc) + ")";
|
||||
return output;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -642,7 +642,8 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
final StringBuilder text = new StringBuilder();
|
||||
final List<Boolean> reqItemsRemove = (List<Boolean>) context.getSessionData(CK.REQ_ITEMS_REMOVE);
|
||||
final List<Boolean> reqItemsRemove
|
||||
= (List<Boolean>) context.getSessionData(CK.REQ_ITEMS_REMOVE);
|
||||
if (reqItemsRemove != null) {
|
||||
for (final Boolean b : reqItemsRemove) {
|
||||
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA)
|
||||
|
@ -913,7 +914,8 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
= new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
final List<String> names = plugin.getLoadedQuests().stream().map(IQuest::getName).collect(Collectors.toList());
|
||||
final List<String> names = plugin.getLoadedQuests().stream().map(IQuest::getName)
|
||||
.collect(Collectors.toList());
|
||||
return sendClickableMenu(getTitle(context), names, getQueryText(context), context);
|
||||
}
|
||||
|
||||
|
@ -1269,13 +1271,16 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
@Override
|
||||
public @NotNull String getBasicPromptText(final @NotNull ConversationContext context) {
|
||||
if (context.getPlugin() != null) {
|
||||
final QuestsEditorPostOpenNumericPromptEvent event = new QuestsEditorPostOpenNumericPromptEvent(context, this);
|
||||
final QuestsEditorPostOpenNumericPromptEvent event
|
||||
= new QuestsEditorPostOpenNumericPromptEvent(context, this);
|
||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
final StringBuilder text = new StringBuilder(ChatColor.AQUA + "- " + getTitle(context) + " -\n");
|
||||
for (int i = 1; i <= size; i++) {
|
||||
text.append(getNumberColor(context, i)).append(ChatColor.BOLD).append(i).append(ChatColor.RESET).append(" - ").append(getSelectionText(context, i)).append(" ").append(getAdditionalText(context, i)).append("\n");
|
||||
text.append(getNumberColor(context, i)).append(ChatColor.BOLD).append(i).append(ChatColor.RESET)
|
||||
.append(" - ").append(getSelectionText(context, i)).append(" ")
|
||||
.append(getAdditionalText(context, i)).append("\n");
|
||||
}
|
||||
return text.toString();
|
||||
}
|
||||
|
@ -1605,7 +1610,8 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||
if (co.getModuleName().equals(moduleName)) {
|
||||
final TextComponent click = new TextComponent(ChatColor.DARK_PURPLE + " - " + co.getName()
|
||||
+ "\n");
|
||||
click.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/quests choice " + co.getName()));
|
||||
click.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/quests choice "
|
||||
+ co.getName()));
|
||||
line.addExtra(click);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1838,7 +1838,8 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||
if (co.getModuleName().equals(moduleName)) {
|
||||
final TextComponent click = new TextComponent(ChatColor.DARK_PURPLE + " - " + co.getName()
|
||||
+ "\n");
|
||||
click.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/quests choice " + co.getName()));
|
||||
click.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/quests choice "
|
||||
+ co.getName()));
|
||||
line.addExtra(click);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -461,7 +461,9 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
|||
final StringBuilder text = new StringBuilder(ChatColor.LIGHT_PURPLE + "- " + ChatColor.AQUA
|
||||
+ getTitle(context).replaceFirst(" \\| ", ChatColor.LIGHT_PURPLE + " | ") + " -");
|
||||
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)).append(" ").append(getAdditionalText(context, i));
|
||||
text.append("\n").append(getNumberColor(context, i)).append(ChatColor.BOLD).append(i)
|
||||
.append(ChatColor.RESET).append(" - ").append(getSelectionText(context, i)).append(" ")
|
||||
.append(getAdditionalText(context, i));
|
||||
}
|
||||
return text.toString();
|
||||
}
|
||||
|
@ -2151,11 +2153,13 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
|||
final int i = Integer.parseInt(input);
|
||||
stageDelay = i * 1000L;
|
||||
} catch (final NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber").replace("<input>", input));
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber")
|
||||
.replace("<input>", input));
|
||||
return new DelayPrompt(context);
|
||||
}
|
||||
if (stageDelay < 1000) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidMinimum").replace("<number>", "1"));
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidMinimum")
|
||||
.replace("<number>", "1"));
|
||||
return new DelayPrompt(context);
|
||||
} else {
|
||||
context.setSessionData(stagePrefix + CK.S_DELAY, stageDelay);
|
||||
|
@ -2535,7 +2539,8 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
|||
if (co.getModuleName().equals(moduleName)) {
|
||||
final TextComponent click = new TextComponent(ChatColor.DARK_PURPLE + " - " + co.getName()
|
||||
+ "\n");
|
||||
click.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/quests choice " + co.getName()));
|
||||
click.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/quests choice "
|
||||
+ co.getName()));
|
||||
line.addExtra(click);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue