mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-22 02:25:42 +01:00
Refactor to core module, part 4
This commit is contained in:
parent
33e4a5661f
commit
4cfde2b126
@ -12,6 +12,7 @@
|
||||
|
||||
package me.blackvein.quests;
|
||||
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.Collection;
|
||||
@ -22,9 +23,9 @@ import java.util.LinkedList;
|
||||
*/
|
||||
public class QuestData {
|
||||
|
||||
private final Quester quester;
|
||||
private final IQuester quester;
|
||||
|
||||
public QuestData(final Quester quester) {
|
||||
public QuestData(final IQuester quester) {
|
||||
this.quester = quester;
|
||||
}
|
||||
|
||||
|
@ -1,228 +0,0 @@
|
||||
package me.blackvein.quests;
|
||||
|
||||
import me.blackvein.quests.enums.ObjectiveType;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentSkipListSet;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
|
||||
public interface Quester extends Comparable<Quester> {
|
||||
UUID getUUID();
|
||||
|
||||
void setUUID(final UUID id);
|
||||
|
||||
String getQuestIdToTake();
|
||||
|
||||
void setQuestIdToTake(final String questIdToTake);
|
||||
|
||||
String getLastKnownName();
|
||||
|
||||
void setLastKnownName(final String lastKnownName);
|
||||
|
||||
int getQuestPoints();
|
||||
|
||||
void setQuestPoints(final int questPoints);
|
||||
|
||||
/**
|
||||
* Get compass target quest. Returns null if not set
|
||||
*
|
||||
* @return Quest or null
|
||||
*/
|
||||
Quest getCompassTarget();
|
||||
|
||||
/**
|
||||
* Set compass target quest. Does not update in-game
|
||||
*
|
||||
* @param quest The target quest
|
||||
*/
|
||||
void setCompassTarget(final Quest quest);
|
||||
|
||||
ConcurrentHashMap<Integer, Quest> getTimers();
|
||||
|
||||
void setTimers(final ConcurrentHashMap<Integer, Quest> timers);
|
||||
|
||||
void removeTimer(final Integer timerId);
|
||||
|
||||
ConcurrentHashMap<Quest, Integer> getCurrentQuests();
|
||||
|
||||
void setCurrentQuests(final ConcurrentHashMap<Quest, Integer> currentQuests);
|
||||
|
||||
ConcurrentSkipListSet<Quest> getCompletedQuests();
|
||||
|
||||
void setCompletedQuests(final ConcurrentSkipListSet<Quest> completedQuests);
|
||||
|
||||
ConcurrentHashMap<Quest, Long> getCompletedTimes();
|
||||
|
||||
void setCompletedTimes(final ConcurrentHashMap<Quest, Long> completedTimes);
|
||||
|
||||
ConcurrentHashMap<Quest, Integer> getAmountsCompleted();
|
||||
|
||||
void setAmountsCompleted(final ConcurrentHashMap<Quest, Integer> amountsCompleted);
|
||||
|
||||
ConcurrentHashMap<Quest, QuestData> getQuestData();
|
||||
|
||||
void setQuestData(final ConcurrentHashMap<Quest, QuestData> questData);
|
||||
|
||||
Player getPlayer();
|
||||
|
||||
OfflinePlayer getOfflinePlayer();
|
||||
|
||||
void sendMessage(final String message);
|
||||
|
||||
Stage getCurrentStage(final Quest quest);
|
||||
|
||||
QuestData getQuestData(final Quest quest);
|
||||
|
||||
boolean hasJournal();
|
||||
|
||||
ItemStack getJournal();
|
||||
|
||||
int getJournalIndex();
|
||||
|
||||
void updateJournal();
|
||||
|
||||
void takeQuest(final Quest quest, final boolean ignoreRequirements);
|
||||
|
||||
void quitQuest(final Quest quest, final String message);
|
||||
|
||||
void quitQuest(final Quest quest, final String[] messages);
|
||||
|
||||
LinkedList<String> getCurrentRequirements(final Quest quest, final boolean ignoreOverrides);
|
||||
|
||||
LinkedList<String> getCurrentObjectives(final Quest quest, final boolean ignoreOverrides);
|
||||
|
||||
LinkedList<String> getObjectives(final Quest quest, final boolean ignoreOverrides);
|
||||
|
||||
boolean containsObjective(final Quest quest, final String name);
|
||||
|
||||
boolean hasCustomObjective(final Quest quest, final String name);
|
||||
|
||||
void breakBlock(final Quest quest, final ItemStack itemStack);
|
||||
|
||||
void damageBlock(final Quest quest, final ItemStack itemStack);
|
||||
|
||||
void placeBlock(final Quest quest, final ItemStack itemStack);
|
||||
|
||||
void useBlock(final Quest quest, final ItemStack itemStack);
|
||||
|
||||
void cutBlock(final Quest quest, final ItemStack itemStack);
|
||||
|
||||
void craftItem(final Quest quest, final ItemStack itemStack);
|
||||
|
||||
void smeltItem(final Quest quest, final ItemStack itemStack);
|
||||
|
||||
void enchantBook(final Quest quest, final ItemStack itemStack,
|
||||
final Map<Enchantment, Integer> enchantsToAdd);
|
||||
|
||||
void enchantItem(final Quest quest, final ItemStack itemStack);
|
||||
|
||||
void brewItem(final Quest quest, final ItemStack itemStack);
|
||||
|
||||
void consumeItem(final Quest quest, final ItemStack itemStack);
|
||||
|
||||
void deliverToNPC(final Quest quest, final NPC npc, final ItemStack itemStack);
|
||||
|
||||
void interactWithNPC(final Quest quest, final NPC npc);
|
||||
|
||||
void killNPC(final Quest quest, final NPC npc);
|
||||
|
||||
void milkCow(final Quest quest);
|
||||
|
||||
void catchFish(final Quest quest);
|
||||
|
||||
void killMob(final Quest quest, final Location killedLocation, final EntityType entityType);
|
||||
|
||||
void killPlayer(final Quest quest, final Player player);
|
||||
|
||||
void reachLocation(final Quest quest, final Location location);
|
||||
|
||||
void tameMob(final Quest quest, final EntityType entityType);
|
||||
|
||||
void shearSheep(final Quest quest, final DyeColor color);
|
||||
|
||||
void sayPassword(final Quest quest, final AsyncPlayerChatEvent evt);
|
||||
|
||||
void finishObjective(final Quest quest, final Objective objective, final EntityType mob,
|
||||
final String extra, final NPC npc, final Location location, final DyeColor color,
|
||||
final String pass, final CustomObjective co);
|
||||
|
||||
boolean testComplete(final Quest quest);
|
||||
|
||||
void addEmptiesFor(final Quest quest, final int stage);
|
||||
|
||||
boolean saveData();
|
||||
|
||||
long getCompletionDifference(final Quest quest);
|
||||
|
||||
long getRemainingCooldown(final Quest quest);
|
||||
|
||||
FileConfiguration getBaseData();
|
||||
|
||||
boolean hasData();
|
||||
|
||||
boolean hasBaseData();
|
||||
|
||||
void startStageTimer(final Quest quest);
|
||||
|
||||
void stopStageTimer(final Quest quest);
|
||||
|
||||
long getStageTime(final Quest quest);
|
||||
|
||||
void checkQuest(final Quest quest);
|
||||
|
||||
void showGUIDisplay(final NPC npc, final LinkedList<Quest> quests);
|
||||
|
||||
void hardQuit(final Quest quest);
|
||||
|
||||
void hardRemove(final Quest quest);
|
||||
|
||||
void hardClear();
|
||||
|
||||
void hardStagePut(final Quest key, final Integer val);
|
||||
|
||||
void hardDataPut(final Quest key, final QuestData val);
|
||||
|
||||
boolean canUseCompass();
|
||||
|
||||
void resetCompass();
|
||||
|
||||
void findCompassTarget();
|
||||
|
||||
void findNextCompassTarget(final boolean notify);
|
||||
|
||||
boolean hasItem(final ItemStack is);
|
||||
|
||||
Set<String> dispatchMultiplayerEverything(final Quest quest, final ObjectiveType type,
|
||||
final BiFunction<Quester, Quest, Void> fun);
|
||||
|
||||
Set<String> dispatchMultiplayerObjectives(final Quest quest, final Stage currentStage,
|
||||
final Function<Quester, Void> fun);
|
||||
|
||||
List<Quester> getMultiplayerQuesters(final Quest quest);
|
||||
|
||||
boolean offerQuest(final Quest quest, final boolean giveReason);
|
||||
|
||||
boolean canAcceptOffer(final Quest quest, final boolean giveReason);
|
||||
|
||||
boolean meetsCondition(final Quest quest, final boolean giveReason);
|
||||
|
||||
boolean isSelectingBlock();
|
||||
|
||||
boolean isInRegion(final String regionID);
|
||||
}
|
@ -1,9 +1,15 @@
|
||||
package me.blackvein.quests;
|
||||
|
||||
import me.blackvein.quests.actions.Action;
|
||||
import me.blackvein.quests.actions.IAction;
|
||||
import me.blackvein.quests.actions.ActionFactory;
|
||||
import me.blackvein.quests.conditions.Condition;
|
||||
import me.blackvein.quests.conditions.ICondition;
|
||||
import me.blackvein.quests.conditions.ConditionFactory;
|
||||
import me.blackvein.quests.config.ISettings;
|
||||
import me.blackvein.quests.dependencies.IDependencies;
|
||||
import me.blackvein.quests.module.ICustomObjective;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.quests.QuestFactory;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.conversations.ConversationFactory;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
@ -19,29 +25,29 @@ public interface QuestsAPI extends Plugin {
|
||||
|
||||
String getDetectedServerSoftwareVersion();
|
||||
|
||||
Dependencies getDependencies();
|
||||
IDependencies getDependencies();
|
||||
|
||||
Settings getSettings();
|
||||
ISettings getSettings();
|
||||
|
||||
List<CustomObjective> getCustomObjectives();
|
||||
List<ICustomObjective> getCustomObjectives();
|
||||
|
||||
List<CustomReward> getCustomRewards();
|
||||
|
||||
List<CustomRequirement> getCustomRequirements();
|
||||
|
||||
Collection<Quest> getLoadedQuests();
|
||||
Collection<IQuest> getLoadedQuests();
|
||||
|
||||
Collection<Action> getLoadedActions();
|
||||
Collection<IAction> getLoadedActions();
|
||||
|
||||
Collection<Condition> getLoadedConditions();
|
||||
Collection<ICondition> getLoadedConditions();
|
||||
|
||||
Quester getQuester(final UUID id);
|
||||
IQuester getQuester(final UUID id);
|
||||
|
||||
Collection<Quester> getOnlineQuesters();
|
||||
Collection<IQuester> getOnlineQuesters();
|
||||
|
||||
Collection<Quester> getOfflineQuesters();
|
||||
Collection<IQuester> getOfflineQuesters();
|
||||
|
||||
void setOfflineQuesters(final Collection<Quester> questers);
|
||||
void setOfflineQuesters(final Collection<IQuester> questers);
|
||||
|
||||
LinkedList<Integer> getQuestNpcIds();
|
||||
|
||||
|
@ -38,7 +38,7 @@ public interface ActionFactory {
|
||||
|
||||
Prompt returnToMenu(final ConversationContext context);
|
||||
|
||||
void loadData(final Action event, final ConversationContext context);
|
||||
void loadData(final IAction event, final ConversationContext context);
|
||||
|
||||
void clearData(final ConversationContext context);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
package me.blackvein.quests.actions;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.entity.QuestMob;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Location;
|
||||
@ -12,7 +12,7 @@ import org.bukkit.potion.PotionEffect;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
|
||||
public interface Action extends Comparable<Action> {
|
||||
public interface IAction extends Comparable<IAction> {
|
||||
String getName();
|
||||
|
||||
void setName(final String name);
|
||||
@ -105,5 +105,5 @@ public interface Action extends Comparable<Action> {
|
||||
|
||||
void setDenizenScript(final String scriptName);
|
||||
|
||||
void fire(final Quester quester, final Quest quest);
|
||||
void fire(final IQuester quester, final IQuest quest);
|
||||
}
|
@ -15,7 +15,7 @@ public interface ConditionFactory {
|
||||
|
||||
Prompt returnToMenu(final ConversationContext context);
|
||||
|
||||
void loadData(final Condition condition, final ConversationContext context);
|
||||
void loadData(final ICondition condition, final ConversationContext context);
|
||||
|
||||
void clearData(final ConversationContext context);
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
package me.blackvein.quests.conditions;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
public interface Condition extends Comparable<Condition> {
|
||||
public interface ICondition extends Comparable<ICondition> {
|
||||
String getName();
|
||||
|
||||
void setName(final String name);
|
||||
@ -51,5 +51,5 @@ public interface Condition extends Comparable<Condition> {
|
||||
|
||||
void setPlaceholdersCheckValue(final LinkedList<String> placeholdersCheckValue);
|
||||
|
||||
boolean check(final Quester quester, final Quest quest);
|
||||
boolean check(final IQuester quester, final IQuest quest);
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package me.blackvein.quests;
|
||||
package me.blackvein.quests.config;
|
||||
|
||||
public interface Settings {
|
||||
public interface ISettings {
|
||||
int getAcceptTimeout();
|
||||
void setAcceptTimeout(final int acceptTimeout);
|
||||
boolean canAllowCommands();
|
@ -12,7 +12,7 @@
|
||||
|
||||
package me.blackvein.quests.convo.quests;
|
||||
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
import me.blackvein.quests.quests.QuestFactory;
|
||||
import me.blackvein.quests.QuestsAPI;
|
||||
import me.blackvein.quests.convo.QuestsNumericPrompt;
|
||||
import org.bukkit.ChatColor;
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
package me.blackvein.quests.convo.quests;
|
||||
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
import me.blackvein.quests.quests.QuestFactory;
|
||||
import me.blackvein.quests.QuestsAPI;
|
||||
import me.blackvein.quests.convo.QuestsStringPrompt;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package me.blackvein.quests;
|
||||
package me.blackvein.quests.dependencies;
|
||||
|
||||
import com.alessiodp.parties.api.interfaces.PartiesAPI;
|
||||
import com.codisimus.plugins.phatloots.PhatLoots;
|
||||
@ -6,6 +6,7 @@ import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.herocraftonline.heroes.Heroes;
|
||||
import com.herocraftonline.heroes.characters.Hero;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.reflect.denizen.DenizenAPI;
|
||||
import me.blackvein.quests.reflect.worldguard.WorldGuardAPI;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
@ -19,7 +20,7 @@ import ro.nicuch.citizensbooks.CitizensBooksAPI;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface Dependencies {
|
||||
public interface IDependencies {
|
||||
Economy getVaultEconomy();
|
||||
|
||||
Permission getVaultPermission();
|
||||
@ -52,7 +53,7 @@ public interface Dependencies {
|
||||
|
||||
boolean isPluginAvailable(final String pluginName);
|
||||
|
||||
boolean runDenizenScript(final String scriptName, final Quester quester);
|
||||
boolean runDenizenScript(final String scriptName, final IQuester quester);
|
||||
|
||||
Location getNPCLocation(final int id);
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
package me.blackvein.quests.events.editor.quests;
|
||||
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
import me.blackvein.quests.quests.QuestFactory;
|
||||
import me.blackvein.quests.QuestsAPI;
|
||||
import me.blackvein.quests.events.QuestsEvent;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
|
@ -14,7 +14,7 @@ package me.blackvein.quests.events.quest;
|
||||
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.events.QuestsEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@ -23,13 +23,13 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public abstract class QuestEvent extends QuestsEvent {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private final Quest quest;
|
||||
private final IQuest quest;
|
||||
|
||||
public QuestEvent(final Quest quest) {
|
||||
public QuestEvent(final IQuest quest) {
|
||||
this.quest = quest;
|
||||
}
|
||||
|
||||
public QuestEvent(final Quest quest, final boolean async) {
|
||||
public QuestEvent(final IQuest quest, final boolean async) {
|
||||
super(async);
|
||||
this.quest = quest;
|
||||
}
|
||||
@ -39,7 +39,7 @@ public abstract class QuestEvent extends QuestsEvent {
|
||||
*
|
||||
* @return Quest which is involved in this event
|
||||
*/
|
||||
public final Quest getQuest() {
|
||||
public final IQuest getQuest() {
|
||||
return quest;
|
||||
}
|
||||
|
||||
|
@ -15,8 +15,8 @@ package me.blackvein.quests.events.quest;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@ -24,10 +24,10 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class QuestQuitEvent extends QuestEvent implements Cancellable {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private final Quester quester;
|
||||
private final IQuester quester;
|
||||
private boolean cancel = false;
|
||||
|
||||
public QuestQuitEvent(final Quest quest, final Quester who) {
|
||||
public QuestQuitEvent(final IQuest quest, final IQuester who) {
|
||||
super(quest);
|
||||
this.quester = who;
|
||||
}
|
||||
@ -37,7 +37,7 @@ public class QuestQuitEvent extends QuestEvent implements Cancellable {
|
||||
*
|
||||
* @return Quester who is involved in this event
|
||||
*/
|
||||
public Quester getQuester() {
|
||||
public IQuester getQuester() {
|
||||
return quester;
|
||||
}
|
||||
|
||||
|
@ -15,8 +15,8 @@ package me.blackvein.quests.events.quest;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@ -24,10 +24,10 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class QuestTakeEvent extends QuestEvent implements Cancellable {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private final Quester quester;
|
||||
private final IQuester quester;
|
||||
private boolean cancel = false;
|
||||
|
||||
public QuestTakeEvent(final Quest quest, final Quester who) {
|
||||
public QuestTakeEvent(final IQuest quest, final IQuester who) {
|
||||
super(quest);
|
||||
this.quester = who;
|
||||
}
|
||||
@ -37,7 +37,7 @@ public class QuestTakeEvent extends QuestEvent implements Cancellable {
|
||||
*
|
||||
* @return Quester who is involved in this event
|
||||
*/
|
||||
public Quester getQuester() {
|
||||
public IQuester getQuester() {
|
||||
return quester;
|
||||
}
|
||||
|
||||
|
@ -16,8 +16,8 @@ import org.bukkit.Location;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@ -25,11 +25,11 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class QuestUpdateCompassEvent extends QuestEvent implements Cancellable {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private final Quester quester;
|
||||
private final IQuester quester;
|
||||
private final Location target;
|
||||
private boolean cancel = false;
|
||||
|
||||
public QuestUpdateCompassEvent(final Quest quest, final Quester who, final Location target) {
|
||||
public QuestUpdateCompassEvent(final IQuest quest, final IQuester who, final Location target) {
|
||||
super(quest);
|
||||
this.quester = who;
|
||||
this.target = target;
|
||||
@ -40,7 +40,7 @@ public class QuestUpdateCompassEvent extends QuestEvent implements Cancellable {
|
||||
*
|
||||
* @return Quester who is involved in this event
|
||||
*/
|
||||
public Quester getQuester() {
|
||||
public IQuester getQuester() {
|
||||
return quester;
|
||||
}
|
||||
|
||||
|
@ -10,14 +10,15 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests;
|
||||
package me.blackvein.quests.module;
|
||||
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
|
||||
public interface CustomObjective {
|
||||
public interface ICustomObjective {
|
||||
|
||||
String getModuleName();
|
||||
|
||||
@ -82,7 +83,7 @@ public interface CustomObjective {
|
||||
* @param quest Current me.blackvein.quests.Quest which includes this objective
|
||||
* @return data
|
||||
*/
|
||||
Map<String, Object> getDataForPlayer(final Player player, final CustomObjective customObj, final Quest quest);
|
||||
Map<String, Object> getDataForPlayer(final Player player, final ICustomObjective customObj, final IQuest quest);
|
||||
|
||||
void incrementObjective(final Player player, final CustomObjective obj, final int count, final Quest quest);
|
||||
void incrementObjective(final Player player, final ICustomObjective obj, final int count, final IQuest quest);
|
||||
}
|
233
api/src/main/java/me/blackvein/quests/player/IQuester.java
Normal file
233
api/src/main/java/me/blackvein/quests/player/IQuester.java
Normal file
@ -0,0 +1,233 @@
|
||||
package me.blackvein.quests.player;
|
||||
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.quests.Objective;
|
||||
import me.blackvein.quests.QuestData;
|
||||
import me.blackvein.quests.quests.Stage;
|
||||
import me.blackvein.quests.enums.ObjectiveType;
|
||||
import me.blackvein.quests.module.ICustomObjective;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentSkipListSet;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
|
||||
public interface IQuester extends Comparable<IQuester> {
|
||||
UUID getUUID();
|
||||
|
||||
void setUUID(final UUID id);
|
||||
|
||||
String getQuestIdToTake();
|
||||
|
||||
void setQuestIdToTake(final String questIdToTake);
|
||||
|
||||
String getLastKnownName();
|
||||
|
||||
void setLastKnownName(final String lastKnownName);
|
||||
|
||||
int getQuestPoints();
|
||||
|
||||
void setQuestPoints(final int questPoints);
|
||||
|
||||
/**
|
||||
* Get compass target quest. Returns null if not set
|
||||
*
|
||||
* @return Quest or null
|
||||
*/
|
||||
IQuest getCompassTarget();
|
||||
|
||||
/**
|
||||
* Set compass target quest. Does not update in-game
|
||||
*
|
||||
* @param quest The target quest
|
||||
*/
|
||||
void setCompassTarget(final IQuest quest);
|
||||
|
||||
ConcurrentHashMap<Integer, IQuest> getTimers();
|
||||
|
||||
void setTimers(final ConcurrentHashMap<Integer, IQuest> timers);
|
||||
|
||||
void removeTimer(final Integer timerId);
|
||||
|
||||
ConcurrentHashMap<IQuest, Integer> getCurrentQuests();
|
||||
|
||||
void setCurrentQuests(final ConcurrentHashMap<IQuest, Integer> currentQuests);
|
||||
|
||||
ConcurrentSkipListSet<IQuest> getCompletedQuests();
|
||||
|
||||
void setCompletedQuests(final ConcurrentSkipListSet<IQuest> completedQuests);
|
||||
|
||||
ConcurrentHashMap<IQuest, Long> getCompletedTimes();
|
||||
|
||||
void setCompletedTimes(final ConcurrentHashMap<IQuest, Long> completedTimes);
|
||||
|
||||
ConcurrentHashMap<IQuest, Integer> getAmountsCompleted();
|
||||
|
||||
void setAmountsCompleted(final ConcurrentHashMap<IQuest, Integer> amountsCompleted);
|
||||
|
||||
ConcurrentHashMap<IQuest, QuestData> getQuestData();
|
||||
|
||||
void setQuestData(final ConcurrentHashMap<IQuest, QuestData> questData);
|
||||
|
||||
Player getPlayer();
|
||||
|
||||
OfflinePlayer getOfflinePlayer();
|
||||
|
||||
void sendMessage(final String message);
|
||||
|
||||
Stage getCurrentStage(final IQuest quest);
|
||||
|
||||
QuestData getQuestData(final IQuest quest);
|
||||
|
||||
boolean hasJournal();
|
||||
|
||||
ItemStack getJournal();
|
||||
|
||||
int getJournalIndex();
|
||||
|
||||
void updateJournal();
|
||||
|
||||
void takeQuest(final IQuest quest, final boolean ignoreRequirements);
|
||||
|
||||
void quitQuest(final IQuest quest, final String message);
|
||||
|
||||
void quitQuest(final IQuest quest, final String[] messages);
|
||||
|
||||
LinkedList<String> getCurrentRequirements(final IQuest quest, final boolean ignoreOverrides);
|
||||
|
||||
LinkedList<String> getCurrentObjectives(final IQuest quest, final boolean ignoreOverrides);
|
||||
|
||||
LinkedList<String> getObjectives(final IQuest quest, final boolean ignoreOverrides);
|
||||
|
||||
boolean containsObjective(final IQuest quest, final String name);
|
||||
|
||||
boolean hasCustomObjective(final IQuest quest, final String name);
|
||||
|
||||
void breakBlock(final IQuest quest, final ItemStack itemStack);
|
||||
|
||||
void damageBlock(final IQuest quest, final ItemStack itemStack);
|
||||
|
||||
void placeBlock(final IQuest quest, final ItemStack itemStack);
|
||||
|
||||
void useBlock(final IQuest quest, final ItemStack itemStack);
|
||||
|
||||
void cutBlock(final IQuest quest, final ItemStack itemStack);
|
||||
|
||||
void craftItem(final IQuest quest, final ItemStack itemStack);
|
||||
|
||||
void smeltItem(final IQuest quest, final ItemStack itemStack);
|
||||
|
||||
void enchantBook(final IQuest quest, final ItemStack itemStack,
|
||||
final Map<Enchantment, Integer> enchantsToAdd);
|
||||
|
||||
void enchantItem(final IQuest quest, final ItemStack itemStack);
|
||||
|
||||
void brewItem(final IQuest quest, final ItemStack itemStack);
|
||||
|
||||
void consumeItem(final IQuest quest, final ItemStack itemStack);
|
||||
|
||||
void deliverToNPC(final IQuest quest, final NPC npc, final ItemStack itemStack);
|
||||
|
||||
void interactWithNPC(final IQuest quest, final NPC npc);
|
||||
|
||||
void killNPC(final IQuest quest, final NPC npc);
|
||||
|
||||
void milkCow(final IQuest quest);
|
||||
|
||||
void catchFish(final IQuest quest);
|
||||
|
||||
void killMob(final IQuest quest, final Location killedLocation, final EntityType entityType);
|
||||
|
||||
void killPlayer(final IQuest quest, final Player player);
|
||||
|
||||
void reachLocation(final IQuest quest, final Location location);
|
||||
|
||||
void tameMob(final IQuest quest, final EntityType entityType);
|
||||
|
||||
void shearSheep(final IQuest quest, final DyeColor color);
|
||||
|
||||
void sayPassword(final IQuest quest, final AsyncPlayerChatEvent evt);
|
||||
|
||||
void finishObjective(final IQuest quest, final Objective objective, final EntityType mob,
|
||||
final String extra, final NPC npc, final Location location, final DyeColor color,
|
||||
final String pass, final ICustomObjective co);
|
||||
|
||||
boolean testComplete(final IQuest quest);
|
||||
|
||||
void addEmptiesFor(final IQuest quest, final int stage);
|
||||
|
||||
boolean saveData();
|
||||
|
||||
long getCompletionDifference(final IQuest quest);
|
||||
|
||||
long getRemainingCooldown(final IQuest quest);
|
||||
|
||||
FileConfiguration getBaseData();
|
||||
|
||||
boolean hasData();
|
||||
|
||||
boolean hasBaseData();
|
||||
|
||||
void startStageTimer(final IQuest quest);
|
||||
|
||||
void stopStageTimer(final IQuest quest);
|
||||
|
||||
long getStageTime(final IQuest quest);
|
||||
|
||||
void checkQuest(final IQuest quest);
|
||||
|
||||
void showGUIDisplay(final NPC npc, final LinkedList<IQuest> quests);
|
||||
|
||||
void hardQuit(final IQuest quest);
|
||||
|
||||
void hardRemove(final IQuest quest);
|
||||
|
||||
void hardClear();
|
||||
|
||||
void hardStagePut(final IQuest key, final Integer val);
|
||||
|
||||
void hardDataPut(final IQuest key, final QuestData val);
|
||||
|
||||
boolean canUseCompass();
|
||||
|
||||
void resetCompass();
|
||||
|
||||
void findCompassTarget();
|
||||
|
||||
void findNextCompassTarget(final boolean notify);
|
||||
|
||||
boolean hasItem(final ItemStack is);
|
||||
|
||||
Set<String> dispatchMultiplayerEverything(final IQuest quest, final ObjectiveType type,
|
||||
final BiFunction<IQuester, IQuest, Void> fun);
|
||||
|
||||
Set<String> dispatchMultiplayerObjectives(final IQuest quest, final Stage currentStage,
|
||||
final Function<IQuester, Void> fun);
|
||||
|
||||
List<IQuester> getMultiplayerQuesters(final IQuest quest);
|
||||
|
||||
boolean offerQuest(final IQuest quest, final boolean giveReason);
|
||||
|
||||
boolean canAcceptOffer(final IQuest quest, final boolean giveReason);
|
||||
|
||||
boolean meetsCondition(final IQuest quest, final boolean giveReason);
|
||||
|
||||
boolean isSelectingBlock();
|
||||
|
||||
boolean isInRegion(final String regionID);
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package me.blackvein.quests;
|
||||
package me.blackvein.quests.quests;
|
||||
|
||||
import me.blackvein.quests.actions.Action;
|
||||
import me.blackvein.quests.actions.IAction;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
@ -9,7 +10,7 @@ import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
public interface Quest extends Comparable<Quest> {
|
||||
public interface IQuest extends Comparable<IQuest> {
|
||||
Plugin getPlugin();
|
||||
|
||||
void setPlugin(Plugin plugin);
|
||||
@ -50,9 +51,9 @@ public interface Quest extends Comparable<Quest> {
|
||||
|
||||
void setBlockStart(final Location blockStart);
|
||||
|
||||
Action getInitialAction();
|
||||
IAction getInitialAction();
|
||||
|
||||
void setInitialAction(final Action initialAction);
|
||||
void setInitialAction(final IAction initialAction);
|
||||
|
||||
Requirements getRequirements();
|
||||
|
||||
@ -62,25 +63,25 @@ public interface Quest extends Comparable<Quest> {
|
||||
|
||||
Options getOptions();
|
||||
|
||||
void nextStage(final Quester quester, final boolean allowSharedProgress);
|
||||
void nextStage(final IQuester quester, final boolean allowSharedProgress);
|
||||
|
||||
void setStage(final Quester quester, final int stage);
|
||||
void setStage(final IQuester quester, final int stage);
|
||||
|
||||
boolean updateCompass(final Quester quester, final Stage stage);
|
||||
boolean updateCompass(final IQuester quester, final Stage stage);
|
||||
|
||||
boolean testRequirements(final Quester quester);
|
||||
boolean testRequirements(final IQuester quester);
|
||||
|
||||
boolean testRequirements(final OfflinePlayer player);
|
||||
|
||||
void completeQuest(final Quester quester);
|
||||
void completeQuest(final IQuester quester);
|
||||
|
||||
void completeQuest(final Quester quester, final boolean allowMultiplayer);
|
||||
void completeQuest(final IQuester quester, final boolean allowMultiplayer);
|
||||
|
||||
void failQuest(final Quester quester);
|
||||
void failQuest(final IQuester quester);
|
||||
|
||||
void failQuest(final Quester quester, final boolean ignoreFailAction);
|
||||
void failQuest(final IQuester quester, final boolean ignoreFailAction);
|
||||
|
||||
boolean isInRegion(final Quester quester);
|
||||
boolean isInRegion(final IQuester quester);
|
||||
|
||||
boolean isInRegionStart(final Quester quester);
|
||||
boolean isInRegionStart(final IQuester quester);
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package me.blackvein.quests;
|
||||
package me.blackvein.quests.quests;
|
||||
|
||||
import me.blackvein.quests.enums.ObjectiveType;
|
||||
import org.bukkit.inventory.ItemStack;
|
@ -1,4 +1,4 @@
|
||||
package me.blackvein.quests;
|
||||
package me.blackvein.quests.quests;
|
||||
|
||||
public interface Options {
|
||||
boolean canAllowCommands();
|
@ -1,4 +1,4 @@
|
||||
package me.blackvein.quests;
|
||||
package me.blackvein.quests.quests;
|
||||
|
||||
public interface Planner {
|
||||
String getStart();
|
@ -1,4 +1,4 @@
|
||||
package me.blackvein.quests;
|
||||
package me.blackvein.quests.quests;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
@ -36,7 +36,7 @@ public interface QuestFactory {
|
||||
|
||||
Prompt returnToMenu(final ConversationContext context);
|
||||
|
||||
void loadQuest(final ConversationContext context, final Quest q);
|
||||
void loadQuest(final ConversationContext context, final IQuest q);
|
||||
|
||||
void deleteQuest(final ConversationContext context);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package me.blackvein.quests;
|
||||
package me.blackvein.quests.quests;
|
||||
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
@ -22,13 +23,13 @@ public interface Requirements {
|
||||
|
||||
void setRemoveItems(final List<Boolean> removeItems);
|
||||
|
||||
List<Quest> getNeededQuests();
|
||||
List<IQuest> getNeededQuests();
|
||||
|
||||
void setNeededQuests(final List<Quest> neededQuests);
|
||||
void setNeededQuests(final List<IQuest> neededQuests);
|
||||
|
||||
List<Quest> getBlockQuests();
|
||||
List<IQuest> getBlockQuests();
|
||||
|
||||
void setBlockQuests(final List<Quest> blockQuests);
|
||||
void setBlockQuests(final List<IQuest> blockQuests);
|
||||
|
||||
List<String> getPermissions();
|
||||
|
@ -1,4 +1,4 @@
|
||||
package me.blackvein.quests;
|
||||
package me.blackvein.quests.quests;
|
||||
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
@ -1,8 +1,9 @@
|
||||
package me.blackvein.quests;
|
||||
package me.blackvein.quests.quests;
|
||||
|
||||
import me.blackvein.quests.actions.Action;
|
||||
import me.blackvein.quests.conditions.Condition;
|
||||
import me.blackvein.quests.actions.IAction;
|
||||
import me.blackvein.quests.conditions.ICondition;
|
||||
import me.blackvein.quests.enums.ObjectiveType;
|
||||
import me.blackvein.quests.module.ICustomObjective;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
@ -215,41 +216,41 @@ public interface Stage {
|
||||
|
||||
void setScript(final String script);
|
||||
|
||||
Action getStartAction();
|
||||
IAction getStartAction();
|
||||
|
||||
void setStartAction(final Action startAction);
|
||||
void setStartAction(final IAction startAction);
|
||||
|
||||
Action getFinishAction();
|
||||
IAction getFinishAction();
|
||||
|
||||
void setFinishAction(final Action finishAction);
|
||||
void setFinishAction(final IAction finishAction);
|
||||
|
||||
Action getFailAction();
|
||||
IAction getFailAction();
|
||||
|
||||
void setFailAction(final Action failAction);
|
||||
void setFailAction(final IAction failAction);
|
||||
|
||||
Action getDeathAction();
|
||||
IAction getDeathAction();
|
||||
|
||||
void setDeathAction(final Action deathAction);
|
||||
void setDeathAction(final IAction deathAction);
|
||||
|
||||
Map<String, Action> getChatActions();
|
||||
Map<String, IAction> getChatActions();
|
||||
|
||||
void addChatAction(Map.Entry<String, Action> chatAction);
|
||||
void addChatAction(Map.Entry<String, IAction> chatAction);
|
||||
|
||||
void setChatActions(final Map<String, Action> chatActions);
|
||||
void setChatActions(final Map<String, IAction> chatActions);
|
||||
|
||||
Map<String, Action> getCommandActions();
|
||||
Map<String, IAction> getCommandActions();
|
||||
|
||||
void addCommandAction(Map.Entry<String, Action> commandAction);
|
||||
void addCommandAction(Map.Entry<String, IAction> commandAction);
|
||||
|
||||
void setCommandActions(final Map<String, Action> commandActions);
|
||||
void setCommandActions(final Map<String, IAction> commandActions);
|
||||
|
||||
Action getDisconnectAction();
|
||||
IAction getDisconnectAction();
|
||||
|
||||
void setDisconnectAction(final Action disconnectAction);
|
||||
void setDisconnectAction(final IAction disconnectAction);
|
||||
|
||||
Condition getCondition();
|
||||
ICondition getCondition();
|
||||
|
||||
void setCondition(final Condition condition);
|
||||
void setCondition(final ICondition condition);
|
||||
|
||||
long getDelay();
|
||||
|
||||
@ -273,9 +274,9 @@ public interface Stage {
|
||||
|
||||
void setObjectiveOverrides(final LinkedList<String> objectiveOverrides);
|
||||
|
||||
LinkedList<CustomObjective> getCustomObjectives();
|
||||
LinkedList<ICustomObjective> getCustomObjectives();
|
||||
|
||||
boolean addCustomObjectives(final CustomObjective customObjective);
|
||||
boolean addCustomObjectives(final ICustomObjective customObjective);
|
||||
|
||||
void clearCustomObjectives();
|
||||
|
@ -10,18 +10,15 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.module;
|
||||
package me.blackvein.quests;
|
||||
|
||||
import me.blackvein.quests.CustomObjective;
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.Stage;
|
||||
import me.blackvein.quests.enums.ObjectiveType;
|
||||
import me.blackvein.quests.events.quester.QuesterPostUpdateObjectiveEvent;
|
||||
import me.blackvein.quests.events.quester.QuesterPreUpdateObjectiveEvent;
|
||||
import me.blackvein.quests.module.ICustomObjective;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.quests.BukkitObjective;
|
||||
import me.blackvein.quests.quests.BukkitQuest;
|
||||
import me.blackvein.quests.quests.Stage;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
@ -34,7 +31,7 @@ import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public abstract class BukkitCustomObjective implements CustomObjective, Listener {
|
||||
public abstract class CustomObjective implements ICustomObjective, Listener {
|
||||
|
||||
private final Quests plugin = Quests.getPlugin(Quests.class);
|
||||
private String name = null;
|
||||
@ -162,17 +159,16 @@ public abstract class BukkitCustomObjective implements CustomObjective, Listener
|
||||
this.showCount = showCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getDataForPlayer(final Player player, final CustomObjective customObj,
|
||||
final Quest quest) {
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(player.getUniqueId());
|
||||
if (quester != null) {
|
||||
final Stage currentStage = quester.getCurrentStage((BukkitQuest) quest);
|
||||
final Stage currentStage = quester.getCurrentStage(quest);
|
||||
if (currentStage == null) {
|
||||
return null;
|
||||
}
|
||||
CustomObjective found = null;
|
||||
for (final CustomObjective co : currentStage.getCustomObjectives()) {
|
||||
ICustomObjective found = null;
|
||||
for (final ICustomObjective co : currentStage.getCustomObjectives()) {
|
||||
if (co.getName().equals(customObj.getName())) {
|
||||
found = co;
|
||||
break;
|
||||
@ -195,15 +191,13 @@ public abstract class BukkitCustomObjective implements CustomObjective, Listener
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void incrementObjective(final Player player, final CustomObjective obj, final int count, final Quest quest) {
|
||||
final Quest bQuest = (BukkitQuest) quest;
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
if (quester != null) {
|
||||
if (quester.hasCustomObjective(bQuest, obj.getName())) {
|
||||
if (quester.hasCustomObjective(quest, obj.getName())) {
|
||||
int index = -1;
|
||||
final LinkedList<Integer> customObjCounts = quester.getQuestData(bQuest).customObjectiveCounts;
|
||||
for (final CustomObjective co : quester.getCurrentStage(bQuest).getCustomObjectives()) {
|
||||
final LinkedList<Integer> customObjCounts = quester.getQuestData(quest).customObjectiveCounts;
|
||||
for (final ICustomObjective co : quester.getCurrentStage(quest).getCustomObjectives()) {
|
||||
index++;
|
||||
if (co.getName().equals(this.getName())) {
|
||||
if (index >= customObjCounts.size()) {
|
||||
@ -212,14 +206,14 @@ public abstract class BukkitCustomObjective implements CustomObjective, Listener
|
||||
continue;
|
||||
}
|
||||
final int old = customObjCounts.get(index);
|
||||
plugin.getQuester(player.getUniqueId()).getQuestData(bQuest).customObjectiveCounts
|
||||
plugin.getQuester(player.getUniqueId()).getQuestData(quest).customObjectiveCounts
|
||||
.set(index, old + count);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (index > -1) {
|
||||
final int progress = customObjCounts.get(index);
|
||||
final int goal = quester.getCurrentStage(bQuest).getCustomObjectiveCounts().get(index);
|
||||
final int goal = quester.getCurrentStage(quest).getCustomObjectiveCounts().get(index);
|
||||
|
||||
final ObjectiveType type = ObjectiveType.CUSTOM;
|
||||
final QuesterPreUpdateObjectiveEvent preEvent
|
||||
@ -227,15 +221,15 @@ public abstract class BukkitCustomObjective implements CustomObjective, Listener
|
||||
plugin.getServer().getPluginManager().callEvent(preEvent);
|
||||
|
||||
if (progress >= goal) {
|
||||
quester.finishObjective(bQuest, new BukkitObjective(type, new ItemStack(Material.AIR, 1),
|
||||
quester.finishObjective(quest, new BukkitObjective(type, new ItemStack(Material.AIR, 1),
|
||||
new ItemStack(Material.AIR, goal)), null, null, null, null, null, null, obj);
|
||||
|
||||
// Multiplayer
|
||||
final int finalIndex = index;
|
||||
quester.dispatchMultiplayerObjectives(bQuest, quester.getCurrentStage(bQuest), (final Quester q) -> {
|
||||
final int old = q.getQuestData(bQuest).customObjectiveCounts.get(finalIndex);
|
||||
q.getQuestData(bQuest).customObjectiveCounts.set(finalIndex, old + count);
|
||||
q.finishObjective(bQuest, new BukkitObjective(type, new ItemStack(Material.AIR, 1),
|
||||
quester.dispatchMultiplayerObjectives(quest, quester.getCurrentStage(quest), (final IQuester q) -> {
|
||||
final int old = q.getQuestData(quest).customObjectiveCounts.get(finalIndex);
|
||||
q.getQuestData(quest).customObjectiveCounts.set(finalIndex, old + count);
|
||||
q.finishObjective(quest, new BukkitObjective(type, new ItemStack(Material.AIR, 1),
|
||||
new ItemStack(Material.AIR, goal)), null, null, null, null, null, null, obj);
|
||||
return null;
|
||||
});
|
@ -10,7 +10,7 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.dependencies;
|
||||
package me.blackvein.quests;
|
||||
|
||||
import com.alessiodp.parties.api.Parties;
|
||||
import com.alessiodp.parties.api.interfaces.PartiesAPI;
|
||||
@ -21,13 +21,11 @@ import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.herocraftonline.heroes.Heroes;
|
||||
import com.herocraftonline.heroes.characters.Hero;
|
||||
import me.blackvein.quests.Dependencies;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.dependencies.IDependencies;
|
||||
import me.blackvein.quests.listeners.NpcListener;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.reflect.denizen.DenizenAPI;
|
||||
import me.blackvein.quests.reflect.worldguard.WorldGuardAPI;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import me.pikamug.unite.api.objects.PartyProvider;
|
||||
import net.citizensnpcs.api.CitizensPlugin;
|
||||
@ -46,7 +44,7 @@ import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public class BukkitDependencies implements Dependencies {
|
||||
public class Dependencies implements IDependencies {
|
||||
|
||||
private final Quests plugin;
|
||||
private static Economy economy = null;
|
||||
@ -63,7 +61,7 @@ public class BukkitDependencies implements Dependencies {
|
||||
private static CitizensBooksAPI citizensBooks = null;
|
||||
private static PartiesAPI parties = null;
|
||||
|
||||
public BukkitDependencies(final Quests plugin) {
|
||||
public Dependencies(final Quests plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@ -73,7 +71,6 @@ public class BukkitDependencies implements Dependencies {
|
||||
plugin.getLogger().warning("Economy provider not found.");
|
||||
}
|
||||
}
|
||||
placeholder.isEnabled();
|
||||
return economy;
|
||||
}
|
||||
|
||||
@ -271,30 +268,7 @@ public class BukkitDependencies implements Dependencies {
|
||||
return (partyProvider != null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Do not use. Will be removed in a future version.
|
||||
**/
|
||||
public String getCurrency(final boolean plural) {
|
||||
// TODO remove "money" from strings.yml
|
||||
if (getVaultEconomy() == null) {
|
||||
return Lang.get("money");
|
||||
}
|
||||
if (plural) {
|
||||
if (getVaultEconomy().currencyNamePlural().trim().isEmpty()) {
|
||||
return Lang.get("money");
|
||||
} else {
|
||||
return getVaultEconomy().currencyNamePlural();
|
||||
}
|
||||
} else {
|
||||
if (getVaultEconomy().currencyNameSingular().trim().isEmpty()) {
|
||||
return Lang.get("money");
|
||||
} else {
|
||||
return getVaultEconomy().currencyNameSingular();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean runDenizenScript(final String scriptName, final Quester quester) {
|
||||
public boolean runDenizenScript(final String scriptName, final IQuester quester) {
|
||||
return plugin.getDenizenTrigger().runDenizenScript(scriptName, quester);
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.quests;
|
||||
package me.blackvein.quests;
|
||||
|
||||
import com.alessiodp.parties.api.interfaces.Party;
|
||||
import com.alessiodp.parties.api.interfaces.PartyPlayer;
|
||||
@ -20,20 +20,10 @@ import com.codisimus.plugins.phatloots.loot.LootBundle;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.herocraftonline.heroes.characters.Hero;
|
||||
import me.blackvein.quests.CustomRequirement;
|
||||
import me.blackvein.quests.CustomReward;
|
||||
import me.blackvein.quests.Dependencies;
|
||||
import me.blackvein.quests.Options;
|
||||
import me.blackvein.quests.Planner;
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.Requirements;
|
||||
import me.blackvein.quests.Rewards;
|
||||
import me.blackvein.quests.Stage;
|
||||
import me.blackvein.quests.actions.IAction;
|
||||
import me.blackvein.quests.actions.Action;
|
||||
import me.blackvein.quests.actions.BukkitAction;
|
||||
import me.blackvein.quests.conditions.Condition;
|
||||
import me.blackvein.quests.conditions.ICondition;
|
||||
import me.blackvein.quests.dependencies.IDependencies;
|
||||
import me.blackvein.quests.events.quest.QuestUpdateCompassEvent;
|
||||
import me.blackvein.quests.events.quester.QuesterPostChangeStageEvent;
|
||||
import me.blackvein.quests.events.quester.QuesterPostCompleteQuestEvent;
|
||||
@ -41,6 +31,17 @@ import me.blackvein.quests.events.quester.QuesterPostFailQuestEvent;
|
||||
import me.blackvein.quests.events.quester.QuesterPreChangeStageEvent;
|
||||
import me.blackvein.quests.events.quester.QuesterPreCompleteQuestEvent;
|
||||
import me.blackvein.quests.events.quester.QuesterPreFailQuestEvent;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.quests.BukkitOptions;
|
||||
import me.blackvein.quests.quests.BukkitPlanner;
|
||||
import me.blackvein.quests.quests.BukkitRequirements;
|
||||
import me.blackvein.quests.quests.BukkitRewards;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.quests.Options;
|
||||
import me.blackvein.quests.quests.Planner;
|
||||
import me.blackvein.quests.quests.Requirements;
|
||||
import me.blackvein.quests.quests.Rewards;
|
||||
import me.blackvein.quests.quests.Stage;
|
||||
import me.blackvein.quests.util.ConfigUtil;
|
||||
import me.blackvein.quests.util.InventoryUtil;
|
||||
import me.blackvein.quests.util.ItemUtil;
|
||||
@ -73,7 +74,7 @@ import java.util.Map.Entry;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class BukkitQuest implements Quest {
|
||||
public class Quest implements IQuest {
|
||||
|
||||
protected Quests plugin;
|
||||
protected String id;
|
||||
@ -85,18 +86,18 @@ public class BukkitQuest implements Quest {
|
||||
protected UUID npcStart;
|
||||
protected Location blockStart;
|
||||
protected String regionStart = null;
|
||||
protected BukkitAction initialAction;
|
||||
protected Action initialAction;
|
||||
private final BukkitRequirements requirements = new BukkitRequirements();
|
||||
private final BukkitPlanner planner = new BukkitPlanner();
|
||||
private final BukkitRewards rewards = new BukkitRewards();
|
||||
private final BukkitOptions options = new BukkitOptions();
|
||||
|
||||
public BukkitQuest(final Quests plugin) {
|
||||
public Quest(final Quests plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(final Quest quest) {
|
||||
public int compareTo(final IQuest quest) {
|
||||
return id.compareTo(quest.getId());
|
||||
}
|
||||
|
||||
@ -210,33 +211,33 @@ public class BukkitQuest implements Quest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Action getInitialAction() {
|
||||
public IAction getInitialAction() {
|
||||
return initialAction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInitialAction(final Action initialAction) {
|
||||
this.initialAction = (BukkitAction) initialAction;
|
||||
public void setInitialAction(final IAction initialAction) {
|
||||
this.initialAction = (Action) initialAction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Requirements getRequirements() {
|
||||
return (Requirements) requirements;
|
||||
return requirements;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Planner getPlanner() {
|
||||
return (Planner) planner;
|
||||
return planner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rewards getRewards() {
|
||||
return (Rewards) rewards;
|
||||
return rewards;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Options getOptions() {
|
||||
return (Options) options;
|
||||
return options;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -245,7 +246,7 @@ public class BukkitQuest implements Quest {
|
||||
* @param quester Player to force
|
||||
* @param allowSharedProgress Whether to distribute progress to fellow questers
|
||||
*/
|
||||
public void nextStage(final Quester quester, final boolean allowSharedProgress) {
|
||||
public void nextStage(final IQuester quester, final boolean allowSharedProgress) {
|
||||
final Stage currentStage = quester.getCurrentStage(this);
|
||||
if (currentStage == null) {
|
||||
plugin.getLogger().severe("Current stage was null for quester " + quester.getPlayer().getUniqueId());
|
||||
@ -281,8 +282,8 @@ public class BukkitQuest implements Quest {
|
||||
|
||||
// Multiplayer
|
||||
if (allowSharedProgress && options.getShareProgressLevel() == 3) {
|
||||
final List<Quester> mq = quester.getMultiplayerQuesters(this);
|
||||
for (final Quester qq : mq) {
|
||||
final List<IQuester> mq = quester.getMultiplayerQuesters(this);
|
||||
for (final IQuester qq : mq) {
|
||||
if (currentStage.equals(qq.getCurrentStage(this))) {
|
||||
nextStage(qq, true);
|
||||
}
|
||||
@ -301,7 +302,7 @@ public class BukkitQuest implements Quest {
|
||||
* @param stage Stage number to specify
|
||||
* @throws IndexOutOfBoundsException if stage does not exist
|
||||
*/
|
||||
public void setStage(final Quester quester, final int stage) throws IndexOutOfBoundsException {
|
||||
public void setStage(final IQuester quester, final int stage) throws IndexOutOfBoundsException {
|
||||
final OfflinePlayer player = quester.getOfflinePlayer();
|
||||
if (orderedStages.size() - 1 < stage) {
|
||||
final String msg = "Tried to set invalid stage number of " + stage + " for quest " + getName() + " on "
|
||||
@ -311,7 +312,8 @@ public class BukkitQuest implements Quest {
|
||||
final Stage currentStage = quester.getCurrentStage(this);
|
||||
final Stage nextStage = getStage(stage);
|
||||
if (player.isOnline()) {
|
||||
final QuesterPreChangeStageEvent preEvent = new QuesterPreChangeStageEvent(quester, this, currentStage, nextStage);
|
||||
final QuesterPreChangeStageEvent preEvent
|
||||
= new QuesterPreChangeStageEvent((Quester) quester, this, currentStage, nextStage);
|
||||
plugin.getServer().getPluginManager().callEvent(preEvent);
|
||||
if (preEvent.isCancelled()) {
|
||||
return;
|
||||
@ -336,7 +338,7 @@ public class BukkitQuest implements Quest {
|
||||
if (stageStartMessage != null) {
|
||||
p.sendMessage(ConfigUtil.parseStringWithPossibleLineBreaks(stageStartMessage, this, p));
|
||||
}
|
||||
final Condition c = nextStage.getCondition();
|
||||
final ICondition c = nextStage.getCondition();
|
||||
if (c != null && nextStage.getObjectiveOverrides().isEmpty()) {
|
||||
p.sendMessage(ChatColor.LIGHT_PURPLE + Lang.get("stageEditorConditions"));
|
||||
if (!c.getEntitiesWhileRiding().isEmpty()) {
|
||||
@ -405,7 +407,8 @@ public class BukkitQuest implements Quest {
|
||||
}
|
||||
quester.updateJournal();
|
||||
if (player.isOnline()) {
|
||||
final QuesterPostChangeStageEvent postEvent = new QuesterPostChangeStageEvent(quester, this, currentStage, nextStage);
|
||||
final QuesterPostChangeStageEvent postEvent
|
||||
= new QuesterPostChangeStageEvent((Quester) quester, this, currentStage, nextStage);
|
||||
plugin.getServer().getPluginManager().callEvent(postEvent);
|
||||
}
|
||||
}
|
||||
@ -419,7 +422,7 @@ public class BukkitQuest implements Quest {
|
||||
* @param stage The stage to process for targets
|
||||
* @return true if an attempt was made successfully
|
||||
*/
|
||||
public boolean updateCompass(final Quester quester, final Stage stage) {
|
||||
public boolean updateCompass(final IQuester quester, final Stage stage) {
|
||||
if (quester == null) {
|
||||
return false;
|
||||
}
|
||||
@ -432,7 +435,7 @@ public class BukkitQuest implements Quest {
|
||||
if (!quester.getPlayer().hasPermission("quests.compass")) {
|
||||
return false;
|
||||
}
|
||||
final Quest quest = this;
|
||||
final IQuest quest = this;
|
||||
Bukkit.getScheduler().runTask(plugin, () -> {
|
||||
Location targetLocation = null;
|
||||
if (stage.getCitizensToInteract() != null && stage.getCitizensToInteract().size() > 0) {
|
||||
@ -557,7 +560,7 @@ public class BukkitQuest implements Quest {
|
||||
* @param quester The quester to check
|
||||
* @return true if all Requirements have been met
|
||||
*/
|
||||
public boolean testRequirements(final Quester quester) {
|
||||
public boolean testRequirements(final IQuester quester) {
|
||||
return testRequirements(quester.getOfflinePlayer());
|
||||
}
|
||||
|
||||
@ -570,7 +573,7 @@ public class BukkitQuest implements Quest {
|
||||
* @return true if all Requirements have been met
|
||||
*/
|
||||
public boolean testRequirements(final OfflinePlayer player) {
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(player.getUniqueId());
|
||||
if (requirements.getMoney() != 0 && plugin.getDependencies().getVaultEconomy() != null) {
|
||||
if (plugin.getDependencies().getVaultEconomy().getBalance(player) < requirements.getMoney()) {
|
||||
return false;
|
||||
@ -582,7 +585,7 @@ public class BukkitQuest implements Quest {
|
||||
if (!quester.getCompletedQuests().containsAll(requirements.getNeededQuests())) {
|
||||
return false;
|
||||
}
|
||||
for (final BukkitQuest q : requirements.getBlockQuests()) {
|
||||
for (final IQuest q : requirements.getBlockQuests()) {
|
||||
if (quester.getCompletedQuests().contains(q) || quester.getCurrentQuests().containsKey(q)) {
|
||||
return false;
|
||||
}
|
||||
@ -647,7 +650,7 @@ public class BukkitQuest implements Quest {
|
||||
*
|
||||
* @param quester The quester finishing this quest
|
||||
*/
|
||||
public void completeQuest(final Quester quester) {
|
||||
public void completeQuest(final IQuester quester) {
|
||||
completeQuest(quester, true);
|
||||
}
|
||||
|
||||
@ -658,13 +661,13 @@ public class BukkitQuest implements Quest {
|
||||
* @param allowMultiplayer Allow multiplayer sharing
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public void completeQuest(final Quester quester, final boolean allowMultiplayer) {
|
||||
public void completeQuest(final IQuester quester, final boolean allowMultiplayer) {
|
||||
final OfflinePlayer player = quester.getOfflinePlayer();
|
||||
boolean cancelled = false;
|
||||
if (player.isOnline()) {
|
||||
if (Bukkit.isPrimaryThread()) {
|
||||
final QuesterPreCompleteQuestEvent preEvent
|
||||
= new QuesterPreCompleteQuestEvent(quester, this, false);
|
||||
= new QuesterPreCompleteQuestEvent((Quester) quester, this, false);
|
||||
plugin.getServer().getPluginManager().callEvent(preEvent);
|
||||
if (preEvent.isCancelled()) {
|
||||
return;
|
||||
@ -672,7 +675,7 @@ public class BukkitQuest implements Quest {
|
||||
} else {
|
||||
final CompletableFuture<Boolean> future = CompletableFuture.supplyAsync(() -> {
|
||||
final QuesterPreCompleteQuestEvent preEvent
|
||||
= new QuesterPreCompleteQuestEvent(quester, BukkitQuest.this, true);
|
||||
= new QuesterPreCompleteQuestEvent((Quester) quester, Quest.this, true);
|
||||
plugin.getServer().getPluginManager().callEvent(preEvent);
|
||||
return preEvent.isCancelled();
|
||||
});
|
||||
@ -689,7 +692,7 @@ public class BukkitQuest implements Quest {
|
||||
}
|
||||
quester.hardQuit(this);
|
||||
quester.getCompletedQuests().add(this);
|
||||
for (final Map.Entry<Integer, Quest> entry : quester.getTimers().entrySet()) {
|
||||
for (final Map.Entry<Integer, IQuest> entry : quester.getTimers().entrySet()) {
|
||||
if (entry.getValue().getName().equals(getName())) {
|
||||
plugin.getServer().getScheduler().cancelTask(entry.getKey());
|
||||
quester.getTimers().remove(entry.getKey());
|
||||
@ -711,7 +714,7 @@ public class BukkitQuest implements Quest {
|
||||
}
|
||||
|
||||
// Issue rewards
|
||||
final Dependencies depends = plugin.getDependencies();
|
||||
final IDependencies depends = plugin.getDependencies();
|
||||
boolean issuedReward = false;
|
||||
if (rewards.getMoney() > 0 && depends.getVaultEconomy() != null) {
|
||||
depends.getVaultEconomy().depositPlayer(player, rewards.getMoney());
|
||||
@ -1098,14 +1101,14 @@ public class BukkitQuest implements Quest {
|
||||
quester.updateJournal();
|
||||
quester.findCompassTarget();
|
||||
if (player.isOnline()) {
|
||||
final QuesterPostCompleteQuestEvent postEvent = new QuesterPostCompleteQuestEvent(quester, this);
|
||||
final QuesterPostCompleteQuestEvent postEvent = new QuesterPostCompleteQuestEvent((Quester) quester, this);
|
||||
plugin.getServer().getPluginManager().callEvent(postEvent);
|
||||
}
|
||||
|
||||
// Multiplayer
|
||||
if (allowMultiplayer && options.getShareProgressLevel() == 4) {
|
||||
final List<Quester> mq = quester.getMultiplayerQuesters(this);
|
||||
for (final Quester qq : mq) {
|
||||
final List<IQuester> mq = quester.getMultiplayerQuesters(this);
|
||||
for (final IQuester qq : mq) {
|
||||
if (qq.getQuestData(this) != null) {
|
||||
completeQuest(qq, false);
|
||||
}
|
||||
@ -1118,7 +1121,7 @@ public class BukkitQuest implements Quest {
|
||||
*
|
||||
* @param quester The quester to be ejected
|
||||
*/
|
||||
public void failQuest(final Quester quester) {
|
||||
public void failQuest(final IQuester quester) {
|
||||
failQuest(quester, false);
|
||||
}
|
||||
|
||||
@ -1126,10 +1129,10 @@ public class BukkitQuest implements Quest {
|
||||
* Force player to quit quest and inform them of their failure
|
||||
*
|
||||
* @param quester The quester to be ejected
|
||||
* @param ignoreFailAction Whether to ignore quest fail Action
|
||||
* @param ignoreFailAction Whether to ignore quest fail IAction
|
||||
*/
|
||||
public void failQuest(final Quester quester, final boolean ignoreFailAction) {
|
||||
final QuesterPreFailQuestEvent preEvent = new QuesterPreFailQuestEvent(quester, this);
|
||||
public void failQuest(final IQuester quester, final boolean ignoreFailAction) {
|
||||
final QuesterPreFailQuestEvent preEvent = new QuesterPreFailQuestEvent((Quester) quester, this);
|
||||
plugin.getServer().getPluginManager().callEvent(preEvent);
|
||||
if (preEvent.isCancelled()) {
|
||||
return;
|
||||
@ -1149,19 +1152,19 @@ public class BukkitQuest implements Quest {
|
||||
if (player.isOnline()) {
|
||||
player.updateInventory();
|
||||
}
|
||||
final QuesterPostFailQuestEvent postEvent = new QuesterPostFailQuestEvent(quester, this);
|
||||
final QuesterPostFailQuestEvent postEvent = new QuesterPostFailQuestEvent((Quester) quester, this);
|
||||
plugin.getServer().getPluginManager().callEvent(postEvent);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if quester is in WorldGuard region start
|
||||
*
|
||||
* @deprecated Use {@link #isInRegionStart(Quester)}
|
||||
* @deprecated Use {@link #isInRegionStart(IQuester)}
|
||||
* @param quester The quester to check
|
||||
* @return true if quester is in region
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean isInRegion(final Quester quester) {
|
||||
public boolean isInRegion(final IQuester quester) {
|
||||
return isInRegionStart(quester);
|
||||
}
|
||||
|
||||
@ -1184,7 +1187,7 @@ public class BukkitQuest implements Quest {
|
||||
* @param quester The quester to check
|
||||
* @return true if quester is in region
|
||||
*/
|
||||
public boolean isInRegionStart(final Quester quester) {
|
||||
public boolean isInRegionStart(final IQuester quester) {
|
||||
return isInRegionStart(quester.getPlayer());
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -15,19 +15,19 @@ package me.blackvein.quests;
|
||||
import com.codisimus.plugins.phatloots.PhatLootsAPI;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.herocraftonline.heroes.characters.classes.HeroClass;
|
||||
import me.blackvein.quests.actions.Action;
|
||||
import me.blackvein.quests.actions.IAction;
|
||||
import me.blackvein.quests.actions.ActionFactory;
|
||||
import me.blackvein.quests.actions.BukkitAction;
|
||||
import me.blackvein.quests.actions.Action;
|
||||
import me.blackvein.quests.actions.BukkitActionFactory;
|
||||
import me.blackvein.quests.conditions.BukkitCondition;
|
||||
import me.blackvein.quests.conditions.BukkitConditionFactory;
|
||||
import me.blackvein.quests.conditions.Condition;
|
||||
import me.blackvein.quests.conditions.BukkitConditionFactory;
|
||||
import me.blackvein.quests.conditions.ICondition;
|
||||
import me.blackvein.quests.conditions.ConditionFactory;
|
||||
import me.blackvein.quests.config.BukkitSettings;
|
||||
import me.blackvein.quests.config.ISettings;
|
||||
import me.blackvein.quests.convo.misc.MiscStringPrompt;
|
||||
import me.blackvein.quests.convo.misc.NpcOfferQuestPrompt;
|
||||
import me.blackvein.quests.dependencies.BukkitDependencies;
|
||||
import me.blackvein.quests.dependencies.DenizenTrigger;
|
||||
import me.blackvein.quests.dependencies.IDependencies;
|
||||
import me.blackvein.quests.entity.BukkitQuestMob;
|
||||
import me.blackvein.quests.entity.QuestMob;
|
||||
import me.blackvein.quests.events.misc.MiscPostQuestAcceptEvent;
|
||||
@ -44,11 +44,17 @@ import me.blackvein.quests.listeners.NpcListener;
|
||||
import me.blackvein.quests.listeners.PartiesListener;
|
||||
import me.blackvein.quests.listeners.PlayerListener;
|
||||
import me.blackvein.quests.listeners.UniteListener;
|
||||
import me.blackvein.quests.module.BukkitCustomObjective;
|
||||
import me.blackvein.quests.player.BukkitQuester;
|
||||
import me.blackvein.quests.quests.BukkitQuest;
|
||||
import me.blackvein.quests.module.ICustomObjective;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.quests.BukkitQuestFactory;
|
||||
import me.blackvein.quests.quests.BukkitStage;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.quests.Options;
|
||||
import me.blackvein.quests.quests.Planner;
|
||||
import me.blackvein.quests.quests.QuestFactory;
|
||||
import me.blackvein.quests.quests.Requirements;
|
||||
import me.blackvein.quests.quests.Rewards;
|
||||
import me.blackvein.quests.quests.Stage;
|
||||
import me.blackvein.quests.statistics.Metrics;
|
||||
import me.blackvein.quests.storage.Storage;
|
||||
import me.blackvein.quests.storage.StorageFactory;
|
||||
@ -134,15 +140,15 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
|
||||
private boolean loading = true;
|
||||
private String bukkitVersion = "0";
|
||||
private Dependencies depends;
|
||||
private Settings settings;
|
||||
private final List<CustomObjective> customObjectives = new LinkedList<>();
|
||||
private IDependencies depends;
|
||||
private ISettings settings;
|
||||
private final List<ICustomObjective> customObjectives = new LinkedList<>();
|
||||
private final List<CustomRequirement> customRequirements = new LinkedList<>();
|
||||
private final List<CustomReward> customRewards = new LinkedList<>();
|
||||
private Collection<Quester> questers = new ConcurrentSkipListSet<>();
|
||||
private final Collection<Quest> quests = new ConcurrentSkipListSet<>();
|
||||
private Collection<Action> actions = new ConcurrentSkipListSet<>();
|
||||
private Collection<Condition> conditions = new ConcurrentSkipListSet<>();
|
||||
private Collection<IQuester> questers = new ConcurrentSkipListSet<>();
|
||||
private final Collection<IQuest> quests = new ConcurrentSkipListSet<>();
|
||||
private Collection<IAction> actions = new ConcurrentSkipListSet<>();
|
||||
private Collection<ICondition> conditions = new ConcurrentSkipListSet<>();
|
||||
private LinkedList<Integer> questNpcIds = new LinkedList<>();
|
||||
private CommandExecutor cmdExecutor;
|
||||
private ConversationFactory conversationFactory;
|
||||
@ -169,7 +175,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
|
||||
// 1 - Initialize variables
|
||||
bukkitVersion = Bukkit.getServer().getBukkitVersion().split("-")[0];
|
||||
settings = new BukkitSettings(this);
|
||||
settings = new Settings(this);
|
||||
try {
|
||||
Class.forName("me.blackvein.quests.libs.localelib.LocaleManager");
|
||||
localeManager = new LocaleManager();
|
||||
@ -188,7 +194,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
questFactory = new BukkitQuestFactory(this);
|
||||
actionFactory = new BukkitActionFactory(this);
|
||||
conditionFactory = new BukkitConditionFactory(this);
|
||||
depends = new BukkitDependencies(this);
|
||||
depends = new Dependencies(this);
|
||||
trigger = new DenizenTrigger(this);
|
||||
final Metrics metrics = new Metrics(this);
|
||||
metrics.addCustomChart(new Metrics.SimplePie("language", Lang::getISO));
|
||||
@ -272,7 +278,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
public void onDisable() {
|
||||
getLogger().info("Saving Quester data...");
|
||||
for (final Player p : getServer().getOnlinePlayers()) {
|
||||
final Quester quester = getQuester(p.getUniqueId());
|
||||
final IQuester quester = getQuester(p.getUniqueId());
|
||||
quester.saveData();
|
||||
}
|
||||
Bukkit.getScheduler().cancelTasks(this);
|
||||
@ -291,20 +297,20 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
}
|
||||
|
||||
public Dependencies getDependencies() {
|
||||
return depends;
|
||||
return (Dependencies) depends;
|
||||
}
|
||||
|
||||
public Settings getSettings() {
|
||||
return settings;
|
||||
return (Settings) settings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CustomObjective> getCustomObjectives() {
|
||||
public List<ICustomObjective> getCustomObjectives() {
|
||||
return customObjectives;
|
||||
}
|
||||
|
||||
public Optional<CustomObjective> getCustomObjective(final String className) {
|
||||
for (final CustomObjective co : customObjectives) {
|
||||
public Optional<ICustomObjective> getCustomObjective(final String className) {
|
||||
for (final ICustomObjective co : customObjectives) {
|
||||
if (co.getClass().getName().equals(className)) {
|
||||
return Optional.of(co);
|
||||
}
|
||||
@ -340,66 +346,111 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get every Quest loaded in memory
|
||||
*
|
||||
* @deprecated Use {@link #getLoadedQuests()}
|
||||
* @return a list of all Quests
|
||||
*/
|
||||
@Deprecated
|
||||
public LinkedList<Quest> getQuests() {
|
||||
final LinkedList<Quest> list = new LinkedList<>();
|
||||
for (IQuest q : quests) {
|
||||
list.add((Quest) q);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get every Quest loaded in memory
|
||||
*
|
||||
* @return a collection of all Quests
|
||||
*/
|
||||
public Collection<Quest> getLoadedQuests() {
|
||||
public Collection<IQuest> getLoadedQuests() {
|
||||
return quests;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get every Action loaded in memory
|
||||
*
|
||||
* @deprecated Use {@link #getLoadedActions()}
|
||||
* @return a list of all Actions
|
||||
*/
|
||||
@Deprecated
|
||||
public LinkedList<Action> getActions() {
|
||||
final LinkedList<Action> list = new LinkedList<>();
|
||||
for (IAction a : actions) {
|
||||
list.add((Action) a);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get every IAction loaded in memory
|
||||
*
|
||||
* @return a collection of all Actions
|
||||
*/
|
||||
public Collection<Action> getLoadedActions() {
|
||||
public Collection<IAction> getLoadedActions() {
|
||||
return actions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set every Action loaded in memory
|
||||
* Set every IAction loaded in memory
|
||||
*
|
||||
* @deprecated Use {@link #setLoadedActions(Collection)}
|
||||
*/
|
||||
@Deprecated
|
||||
public void setActions(final LinkedList<Action> actions) {
|
||||
public void setActions(final LinkedList<IAction> actions) {
|
||||
this.actions = actions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set every Action loaded in memory
|
||||
* Set every IAction loaded in memory
|
||||
*
|
||||
*/
|
||||
public void setLoadedActions(final Collection<Action> actions) {
|
||||
public void setLoadedActions(final Collection<IAction> actions) {
|
||||
this.actions = actions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get every Condition loaded in memory
|
||||
*
|
||||
* @deprecated Use {@link #getLoadedConditions()}
|
||||
* @return a list of all Actions
|
||||
*/
|
||||
@Deprecated
|
||||
public LinkedList<Condition> getConditions() {
|
||||
final LinkedList<Condition> list = new LinkedList<>();
|
||||
for (ICondition c : conditions) {
|
||||
list.add((Condition) c);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get every ICondition loaded in memory
|
||||
*
|
||||
* @return a collection of all Conditions
|
||||
*/
|
||||
public Collection<Condition> getLoadedConditions() {
|
||||
public Collection<ICondition> getLoadedConditions() {
|
||||
return conditions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set every Condition loaded in memory
|
||||
* Set every ICondition loaded in memory
|
||||
*
|
||||
* @deprecated Use {@link #setLoadedConditions(Collection)}
|
||||
*/
|
||||
@Deprecated
|
||||
public void setConditions(final LinkedList<Condition> conditions) {
|
||||
public void setConditions(final LinkedList<ICondition> conditions) {
|
||||
this.conditions = conditions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set every Condition loaded in memory
|
||||
* Set every ICondition loaded in memory
|
||||
*
|
||||
*/
|
||||
public void setLoadedConditions(final Collection<Condition> conditions) {
|
||||
public void setLoadedConditions(final Collection<ICondition> conditions) {
|
||||
this.conditions = conditions;
|
||||
}
|
||||
|
||||
@ -413,19 +464,19 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
if (id == null) {
|
||||
return null;
|
||||
}
|
||||
final ConcurrentSkipListSet<Quester> set = (ConcurrentSkipListSet<Quester>) questers;
|
||||
for (final Quester q: set) {
|
||||
final ConcurrentSkipListSet<IQuester> set = (ConcurrentSkipListSet<IQuester>) questers;
|
||||
for (final IQuester q: set) {
|
||||
if (q != null && q.getUUID().equals(id)) {
|
||||
return q;
|
||||
return (Quester) q;
|
||||
}
|
||||
}
|
||||
final Quester quester = new BukkitQuester(this, id);
|
||||
final Quester quester = new Quester(this, id);
|
||||
if (depends.getCitizens() != null) {
|
||||
if (depends.getCitizens().getNPCRegistry().getByUniqueId(id) != null) {
|
||||
return quester;
|
||||
}
|
||||
}
|
||||
final Quester q = new BukkitQuester(this, id);
|
||||
final Quester q = new Quester(this, id);
|
||||
questers.add(q);
|
||||
return q;
|
||||
}
|
||||
@ -435,9 +486,9 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
*
|
||||
* @return a collection of all online Questers
|
||||
*/
|
||||
public Collection<Quester> getOnlineQuesters() {
|
||||
final Collection<Quester> questers = new ConcurrentSkipListSet<>();
|
||||
for (final Quester q : getOfflineQuesters()) {
|
||||
public Collection<IQuester> getOnlineQuesters() {
|
||||
final Collection<IQuester> questers = new ConcurrentSkipListSet<>();
|
||||
for (final IQuester q : getOfflineQuesters()) {
|
||||
if (q.getOfflinePlayer().isOnline()) {
|
||||
// Workaround for issues with the compass on fast join
|
||||
q.findCompassTarget();
|
||||
@ -452,7 +503,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
*
|
||||
* @return a collection of all Questers
|
||||
*/
|
||||
public Collection<Quester> getOfflineQuesters() {
|
||||
public Collection<IQuester> getOfflineQuesters() {
|
||||
return questers;
|
||||
}
|
||||
|
||||
@ -461,7 +512,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
*
|
||||
* @param questers a collection of Questers
|
||||
*/
|
||||
public void setOfflineQuesters(final Collection<Quester> questers) {
|
||||
public void setOfflineQuesters(final Collection<IQuester> questers) {
|
||||
this.questers = new ConcurrentSkipListSet<>(questers);
|
||||
}
|
||||
|
||||
@ -628,10 +679,10 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
final Player player = (Player) context.getForWhom();
|
||||
if (input.equalsIgnoreCase("1") || input.equalsIgnoreCase("y")
|
||||
|| input.equalsIgnoreCase(Lang.get(player, "yesWord"))) {
|
||||
Quester quester = getQuester(player.getUniqueId());
|
||||
IQuester quester = getQuester(player.getUniqueId());
|
||||
if (quester == null) {
|
||||
// Must be new player
|
||||
quester = new BukkitQuester(Quests.this, player.getUniqueId());
|
||||
quester = new Quester(Quests.this, player.getUniqueId());
|
||||
if (quester.saveData()) {
|
||||
getLogger().info("Created new data for player " + player.getName());
|
||||
} else {
|
||||
@ -755,10 +806,10 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
loadQuests();
|
||||
loadActions();
|
||||
loadConditions();
|
||||
getLogger().log(Level.INFO, "Loaded " + quests.size() + " Quest(s), " + actions.size() + " Action(s), "
|
||||
+ conditions.size() + " Condition(s) and " + Lang.size() + " Phrase(s)");
|
||||
getLogger().log(Level.INFO, "Loaded " + quests.size() + " Quest(s), " + actions.size() + " IAction(s), "
|
||||
+ conditions.size() + " ICondition(s) and " + Lang.size() + " Phrase(s)");
|
||||
for (final Player p : getServer().getOnlinePlayers()) {
|
||||
final Quester quester = new BukkitQuester(Quests.this, p.getUniqueId());
|
||||
final IQuester quester = new Quester(Quests.this, p.getUniqueId());
|
||||
if (!quester.hasData()) {
|
||||
quester.saveData();
|
||||
}
|
||||
@ -815,12 +866,12 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
int count = 0;
|
||||
for (final String questKey : questsSection.getKeys(false)) {
|
||||
try {
|
||||
for (final Quest lq : getLoadedQuests()) {
|
||||
for (final IQuest lq : getLoadedQuests()) {
|
||||
if (lq.getId().equals(questKey)) {
|
||||
throw new QuestFormatException("id already exists", questKey);
|
||||
}
|
||||
}
|
||||
final Quest quest = loadQuest(config, questKey);
|
||||
final IQuest quest = loadQuest(config, questKey);
|
||||
if (config.contains("quests." + questKey + ".requirements")) {
|
||||
loadQuestRequirements(config, questsSection, quest, questKey);
|
||||
}
|
||||
@ -945,13 +996,13 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
final String author = reward.getAuthor() == null ? "[Unknown]" : reward.getAuthor();
|
||||
count++;
|
||||
getLogger().info("Loaded \"" + name + "\" by " + author);
|
||||
} else if (CustomObjective.class.isAssignableFrom(c)) {
|
||||
final Class<? extends BukkitCustomObjective> objectiveClass = c.asSubclass(BukkitCustomObjective.class);
|
||||
final Constructor<? extends BukkitCustomObjective> constructor = objectiveClass.getConstructor();
|
||||
final BukkitCustomObjective objective = constructor.newInstance();
|
||||
final Optional<CustomObjective> oo = getCustomObjective(objective.getClass().getName());
|
||||
if (oo.isPresent() && oo.get() instanceof BukkitCustomObjective) {
|
||||
HandlerList.unregisterAll((BukkitCustomObjective)oo.get());
|
||||
} else if (ICustomObjective.class.isAssignableFrom(c)) {
|
||||
final Class<? extends CustomObjective> objectiveClass = c.asSubclass(CustomObjective.class);
|
||||
final Constructor<? extends CustomObjective> constructor = objectiveClass.getConstructor();
|
||||
final CustomObjective objective = constructor.newInstance();
|
||||
final Optional<ICustomObjective> oo = getCustomObjective(objective.getClass().getName());
|
||||
if (oo.isPresent() && oo.get() instanceof CustomObjective) {
|
||||
HandlerList.unregisterAll((CustomObjective)oo.get());
|
||||
customObjectives.remove(oo.get());
|
||||
}
|
||||
customObjectives.add(objective);
|
||||
@ -990,7 +1041,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
* @param ignoreOverrides Whether to ignore objective-overrides
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public void showObjectives(final Quest quest, final Quester quester, final boolean ignoreOverrides) {
|
||||
public void showObjectives(final IQuest quest, final IQuester quester, final boolean ignoreOverrides) {
|
||||
if (quest == null) {
|
||||
getLogger().severe("Quest was null when getting objectives for " + quester.getLastKnownName());
|
||||
return;
|
||||
@ -1497,7 +1548,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
passIndex++;
|
||||
}
|
||||
int customIndex = 0;
|
||||
for (final CustomObjective co : stage.getCustomObjectives()) {
|
||||
for (final ICustomObjective co : stage.getCustomObjectives()) {
|
||||
int cleared = 0;
|
||||
if (data.customObjectiveCounts.size() > customIndex) {
|
||||
cleared = data.customObjectiveCounts.get(customIndex);
|
||||
@ -1535,14 +1586,14 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
* @param quester Quester to show the list
|
||||
* @param page Page to display, with 7 quests per page
|
||||
*/
|
||||
public void listQuests(final Quester quester, final int page) {
|
||||
public void listQuests(final IQuester quester, final int page) {
|
||||
// Although we could copy the quests list to a new object, we instead opt to
|
||||
// duplicate code to improve efficiency if ignore-locked-quests is set to 'false'
|
||||
final int rows = 7;
|
||||
final Player player = quester.getPlayer();
|
||||
if (getSettings().canIgnoreLockedQuests()) {
|
||||
final LinkedList<Quest> available = new LinkedList<>();
|
||||
for (final Quest q : quests) {
|
||||
final LinkedList<IQuest> available = new LinkedList<>();
|
||||
for (final IQuest q : quests) {
|
||||
if (!quester.getCompletedQuests().contains(q)) {
|
||||
if (q.testRequirements(player)) {
|
||||
available.add(q);
|
||||
@ -1558,14 +1609,14 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
} else {
|
||||
Lang.send(player, ChatColor.GOLD + Lang.get(player, "questListTitle"));
|
||||
int fromOrder = (page - 1) * rows;
|
||||
final List<Quest> subQuests;
|
||||
final List<IQuest> subQuests;
|
||||
if (available.size() >= (fromOrder + rows)) {
|
||||
subQuests = available.subList((fromOrder), (fromOrder + rows));
|
||||
} else {
|
||||
subQuests = available.subList((fromOrder), available.size());
|
||||
}
|
||||
fromOrder++;
|
||||
for (final Quest q : subQuests) {
|
||||
for (final IQuest q : subQuests) {
|
||||
if (quester.canAcceptOffer(q, false)) {
|
||||
quester.sendMessage(ChatColor.YELLOW + Integer.toString(fromOrder) + ". " + q.getName());
|
||||
} else {
|
||||
@ -1585,14 +1636,14 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
} else {
|
||||
Lang.send(player, ChatColor.GOLD + Lang.get(player, "questListTitle"));
|
||||
int fromOrder = (page - 1) * rows;
|
||||
final List<Quest> subQuests;
|
||||
final List<IQuest> subQuests;
|
||||
if (quests.size() >= (fromOrder + rows)) {
|
||||
subQuests = new LinkedList<>(getLoadedQuests()).subList((fromOrder), (fromOrder + rows));
|
||||
} else {
|
||||
subQuests = new LinkedList<>(getLoadedQuests()).subList((fromOrder), quests.size());
|
||||
}
|
||||
fromOrder++;
|
||||
for (final Quest q : subQuests) {
|
||||
for (final IQuest q : subQuests) {
|
||||
if (quester.canAcceptOffer(q, false)) {
|
||||
Lang.send(player, ChatColor.YELLOW + Integer.toString(fromOrder) + ". " + q.getName());
|
||||
} else {
|
||||
@ -1633,10 +1684,10 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
loadConditions();
|
||||
final CompletableFuture<Void> loadFuture = saveFuture.thenRunAsync(() -> {
|
||||
try {
|
||||
for (final Quester quester : questers) {
|
||||
final CompletableFuture<Quester> cf = getStorage().loadQuester(quester.getUUID());
|
||||
final Quester loaded = cf.get();
|
||||
for (final Quest q : loaded.getCurrentQuests().keySet()) {
|
||||
for (final IQuester quester : questers) {
|
||||
final CompletableFuture<IQuester> cf = getStorage().loadQuester(quester.getUUID());
|
||||
final IQuester loaded = cf.get();
|
||||
for (final IQuest q : loaded.getCurrentQuests().keySet()) {
|
||||
loaded.checkQuest(q);
|
||||
}
|
||||
}
|
||||
@ -1702,7 +1753,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
}
|
||||
for (final String questKey : questsSection.getKeys(false)) {
|
||||
try {
|
||||
final Quest quest = loadQuest(config, questKey);
|
||||
final IQuest quest = loadQuest(config, questKey);
|
||||
if (config.contains("quests." + questKey + ".requirements")) {
|
||||
loadQuestRequirements(config, questsSection, quest, questKey);
|
||||
}
|
||||
@ -1735,9 +1786,9 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private Quest loadQuest(final FileConfiguration config, final String questKey) throws QuestFormatException,
|
||||
private IQuest loadQuest(final FileConfiguration config, final String questKey) throws QuestFormatException,
|
||||
ActionFormatException {
|
||||
final Quest quest = new BukkitQuest(this);
|
||||
final IQuest quest = new Quest(this);
|
||||
quest.setId(questKey);
|
||||
if (config.contains("quests." + questKey + ".name")) {
|
||||
quest.setName(ConfigUtil.parseString(config.getString("quests." + questKey + ".name"), quest));
|
||||
@ -1826,14 +1877,14 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
}
|
||||
}
|
||||
if (config.contains("quests." + questKey + ".action")) {
|
||||
final Action action = loadAction(config.getString("quests." + questKey + ".action"));
|
||||
final IAction action = loadAction(config.getString("quests." + questKey + ".action"));
|
||||
if (action != null) {
|
||||
quest.setInitialAction(action);
|
||||
} else {
|
||||
throw new QuestFormatException("action failed to load", questKey);
|
||||
}
|
||||
} else if (config.contains("quests." + questKey + ".event")) {
|
||||
final Action action = loadAction(config.getString("quests." + questKey + ".event"));
|
||||
final IAction action = loadAction(config.getString("quests." + questKey + ".event"));
|
||||
if (action != null) {
|
||||
quest.setInitialAction(action);
|
||||
} else {
|
||||
@ -1844,7 +1895,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "deprecation"})
|
||||
private void loadQuestRewards(final FileConfiguration config, final Quest quest, final String questKey)
|
||||
private void loadQuestRewards(final FileConfiguration config, final IQuest quest, final String questKey)
|
||||
throws QuestFormatException {
|
||||
final Rewards rewards = quest.getRewards();
|
||||
if (config.contains("quests." + questKey + ".rewards.items")) {
|
||||
@ -2031,7 +2082,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
|
||||
@SuppressWarnings({ "unchecked", "deprecation" })
|
||||
private void loadQuestRequirements(final FileConfiguration config, final ConfigurationSection questsSection,
|
||||
final Quest quest, final String questKey) throws QuestFormatException {
|
||||
final IQuest quest, final String questKey) throws QuestFormatException {
|
||||
final Requirements requires = quest.getRequirements();
|
||||
if (config.contains("quests." + questKey + ".requirements.fail-requirement-message")) {
|
||||
final Object o = config.get("quests." + questKey + ".requirements.fail-requirement-message");
|
||||
@ -2107,7 +2158,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
final List<String> nodes = config.getStringList("quests." + questKey + ".requirements.quest-blocks");
|
||||
boolean failed = false;
|
||||
String failedQuest = "NULL";
|
||||
final List<Quest> temp = new LinkedList<>();
|
||||
final List<IQuest> temp = new LinkedList<>();
|
||||
for (final String node : nodes) {
|
||||
boolean done = false;
|
||||
for (final String id : questsSection.getKeys(false)) {
|
||||
@ -2146,7 +2197,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
final List<String> nodes = config.getStringList("quests." + questKey + ".requirements.quests");
|
||||
boolean failed = false;
|
||||
String failedQuest = "NULL";
|
||||
final List<Quest> temp = new LinkedList<>();
|
||||
final List<IQuest> temp = new LinkedList<>();
|
||||
for (final String node : nodes) {
|
||||
boolean done = false;
|
||||
for (final String id : questsSection.getKeys(false)) {
|
||||
@ -2248,7 +2299,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
}
|
||||
}
|
||||
|
||||
private void loadQuestPlanner(final FileConfiguration config, final Quest quest, final String questKey)
|
||||
private void loadQuestPlanner(final FileConfiguration config, final IQuest quest, final String questKey)
|
||||
throws QuestFormatException {
|
||||
final Planner pln = quest.getPlanner();
|
||||
if (config.contains("quests." + questKey + ".planner.start")) {
|
||||
@ -2276,7 +2327,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
}
|
||||
}
|
||||
|
||||
private void loadQuestOptions(final FileConfiguration config, final Quest quest, final String questKey)
|
||||
private void loadQuestOptions(final FileConfiguration config, final IQuest quest, final String questKey)
|
||||
throws QuestFormatException {
|
||||
final Options opts = quest.getOptions();
|
||||
if (config.contains("quests." + questKey + ".options.allow-commands")) {
|
||||
@ -2312,7 +2363,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "unused", "deprecation" })
|
||||
private void loadQuestStages(final Quest quest, final FileConfiguration config, final String questKey)
|
||||
private void loadQuestStages(final IQuest quest, final FileConfiguration config, final String questKey)
|
||||
throws StageFormatException, ActionFormatException, ConditionFormatException {
|
||||
final ConfigurationSection questStages = config.getConfigurationSection("quests." + questKey
|
||||
+ ".stages.ordered");
|
||||
@ -3249,7 +3300,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
}
|
||||
}
|
||||
if (config.contains("quests." + questKey + ".stages.ordered." + stageNum + ".start-event")) {
|
||||
final BukkitAction action = loadAction(config.getString("quests." + questKey + ".stages.ordered." + stageNum
|
||||
final Action action = loadAction(config.getString("quests." + questKey + ".stages.ordered." + stageNum
|
||||
+ ".start-event"));
|
||||
if (action != null) {
|
||||
oStage.setStartAction(action);
|
||||
@ -3258,7 +3309,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
}
|
||||
}
|
||||
if (config.contains("quests." + questKey + ".stages.ordered." + stageNum + ".finish-event")) {
|
||||
final BukkitAction action = loadAction(config.getString("quests." + questKey + ".stages.ordered." + stageNum
|
||||
final Action action = loadAction(config.getString("quests." + questKey + ".stages.ordered." + stageNum
|
||||
+ ".finish-event"));
|
||||
if (action != null) {
|
||||
oStage.setFinishAction(action);
|
||||
@ -3267,7 +3318,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
}
|
||||
}
|
||||
if (config.contains("quests." + questKey + ".stages.ordered." + stageNum + ".fail-event")) {
|
||||
final BukkitAction action = loadAction(config.getString("quests." + questKey + ".stages.ordered." + stageNum
|
||||
final Action action = loadAction(config.getString("quests." + questKey + ".stages.ordered." + stageNum
|
||||
+ ".fail-event"));
|
||||
if (action != null) {
|
||||
oStage.setFailAction(action);
|
||||
@ -3276,7 +3327,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
}
|
||||
}
|
||||
if (config.contains("quests." + questKey + ".stages.ordered." + stageNum + ".death-event")) {
|
||||
final BukkitAction action = loadAction(config.getString("quests." + questKey + ".stages.ordered." + stageNum
|
||||
final Action action = loadAction(config.getString("quests." + questKey + ".stages.ordered." + stageNum
|
||||
+ ".death-event"));
|
||||
if (action != null) {
|
||||
oStage.setDeathAction(action);
|
||||
@ -3285,7 +3336,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
}
|
||||
}
|
||||
if (config.contains("quests." + questKey + ".stages.ordered." + stageNum + ".disconnect-event")) {
|
||||
final BukkitAction action = loadAction(config.getString("quests." + questKey + ".stages.ordered." + stageNum
|
||||
final Action action = loadAction(config.getString("quests." + questKey + ".stages.ordered." + stageNum
|
||||
+ ".disconnect-event"));
|
||||
if (action != null) {
|
||||
oStage.setDisconnectAction(action);
|
||||
@ -3304,7 +3355,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
final List<String> chatEventTriggers = config.getStringList("quests." + questKey
|
||||
+ ".stages.ordered." + stageNum + ".chat-event-triggers");
|
||||
for (int i = 0; i < chatEvents.size(); i++) {
|
||||
final BukkitAction action = loadAction(chatEvents.get(i));
|
||||
final Action action = loadAction(chatEvents.get(i));
|
||||
if (action != null) {
|
||||
if (i < chatEventTriggers.size()) {
|
||||
oStage.addChatAction(new AbstractMap.SimpleEntry<>(chatEventTriggers.get(i),
|
||||
@ -3340,7 +3391,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
final List<String> commandEventTriggers = config.getStringList("quests." + questKey
|
||||
+ ".stages.ordered." + stageNum + ".command-event-triggers");
|
||||
for (int i = 0; i < commandEvents.size(); i++) {
|
||||
final BukkitAction action = loadAction(commandEvents.get(i));
|
||||
final Action action = loadAction(commandEvents.get(i));
|
||||
if (action != null) {
|
||||
if (i < commandEventTriggers.size()) {
|
||||
oStage.addCommandAction(new AbstractMap.SimpleEntry<>(commandEventTriggers
|
||||
@ -3366,7 +3417,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
}
|
||||
}
|
||||
if (config.contains("quests." + questKey + ".stages.ordered." + stageNum + ".condition")) {
|
||||
final BukkitCondition condition = loadCondition(config.getString("quests." + questKey + ".stages.ordered."
|
||||
final Condition condition = loadCondition(config.getString("quests." + questKey + ".stages.ordered."
|
||||
+ stageNum + ".condition"));
|
||||
if (condition != null) {
|
||||
oStage.setCondition(condition);
|
||||
@ -3399,7 +3450,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "deprecation" })
|
||||
protected BukkitAction loadAction(final String name) throws ActionFormatException {
|
||||
protected Action loadAction(final String name) throws ActionFormatException {
|
||||
if (name == null) {
|
||||
return null;
|
||||
}
|
||||
@ -3420,7 +3471,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
if (data.contains(legacyName)) {
|
||||
actionKey = legacyName + ".";
|
||||
}
|
||||
final BukkitAction action = new BukkitAction(this);
|
||||
final Action action = new Action(this);
|
||||
action.setName(name);
|
||||
if (data.contains(actionKey + "message")) {
|
||||
action.setMessage(ConfigUtil.parseString(data.getString(actionKey + "message")));
|
||||
@ -3731,7 +3782,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
return action;
|
||||
}
|
||||
|
||||
protected BukkitCondition loadCondition(final String name) throws ConditionFormatException {
|
||||
protected Condition loadCondition(final String name) throws ConditionFormatException {
|
||||
if (name == null) {
|
||||
return null;
|
||||
}
|
||||
@ -3745,7 +3796,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
e.printStackTrace();
|
||||
}
|
||||
final String conditionKey = "conditions." + name + ".";
|
||||
final BukkitCondition condition = new BukkitCondition(this);
|
||||
final Condition condition = new Condition(this);
|
||||
condition.setName(name);
|
||||
if (data.contains(conditionKey + "fail-quest")) {
|
||||
if (data.isBoolean(conditionKey + "fail-quest")) {
|
||||
@ -3886,7 +3937,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
return condition;
|
||||
}
|
||||
|
||||
private void loadCustomSections(final Quest quest, final FileConfiguration config, final String questKey)
|
||||
private void loadCustomSections(final IQuest quest, final FileConfiguration config, final String questKey)
|
||||
throws StageFormatException, QuestFormatException {
|
||||
final ConfigurationSection questStages = config.getConfigurationSection("quests." + questKey + ".stages.ordered");
|
||||
if (questStages != null) {
|
||||
@ -3912,8 +3963,8 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
for (final String path : sec.getKeys(false)) {
|
||||
final String name = sec.getString(path + ".name");
|
||||
final int count = sec.getInt(path + ".count");
|
||||
Optional<CustomObjective> found = Optional.empty();
|
||||
for (final CustomObjective cr : customObjectives) {
|
||||
Optional<ICustomObjective> found = Optional.empty();
|
||||
for (final ICustomObjective cr : customObjectives) {
|
||||
if (cr.getName().equalsIgnoreCase(name)) {
|
||||
found = Optional.of(cr);
|
||||
break;
|
||||
@ -4074,7 +4125,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
}
|
||||
if (sec != null) {
|
||||
for (final String s : sec.getKeys(false)) {
|
||||
BukkitAction action = null;
|
||||
Action action = null;
|
||||
try {
|
||||
action = loadAction(s);
|
||||
} catch (final ActionFormatException e) {
|
||||
@ -4083,7 +4134,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
if (action != null) {
|
||||
actions.add(action);
|
||||
} else {
|
||||
getLogger().log(Level.SEVERE, "Failed to load Action \"" + s + "\". Skipping.");
|
||||
getLogger().log(Level.SEVERE, "Failed to load IAction \"" + s + "\". Skipping.");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -4112,7 +4163,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
final ConfigurationSection sec = config.getConfigurationSection("conditions");
|
||||
if (sec != null) {
|
||||
for (final String s : sec.getKeys(false)) {
|
||||
BukkitCondition condition = null;
|
||||
Condition condition = null;
|
||||
try {
|
||||
condition = loadCondition(s);
|
||||
} catch (final ConditionFormatException e) {
|
||||
@ -4121,7 +4172,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
if (condition != null) {
|
||||
conditions.add(condition);
|
||||
} else {
|
||||
getLogger().log(Level.SEVERE, "Failed to load Condition \"" + s + "\". Skipping.");
|
||||
getLogger().log(Level.SEVERE, "Failed to load ICondition \"" + s + "\". Skipping.");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -4219,11 +4270,11 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
* @return Exact match or null if not found
|
||||
* @since 3.8.6
|
||||
*/
|
||||
public Quest getQuestById(final String id) {
|
||||
public IQuest getQuestById(final String id) {
|
||||
if (id == null) {
|
||||
return null;
|
||||
}
|
||||
for (final Quest q : quests) {
|
||||
for (final IQuest q : quests) {
|
||||
if (q.getId().equals(id)) {
|
||||
return q;
|
||||
}
|
||||
@ -4237,21 +4288,21 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
* @param name Name of the quest
|
||||
* @return Closest match or null if not found
|
||||
*/
|
||||
public Quest getQuest(final String name) {
|
||||
public IQuest getQuest(final String name) {
|
||||
if (name == null) {
|
||||
return null;
|
||||
}
|
||||
for (final Quest q : quests) {
|
||||
for (final IQuest q : quests) {
|
||||
if (q.getName().equalsIgnoreCase(ChatColor.translateAlternateColorCodes('&', name))) {
|
||||
return q;
|
||||
}
|
||||
}
|
||||
for (final Quest q : quests) {
|
||||
for (final IQuest q : quests) {
|
||||
if (q.getName().toLowerCase().startsWith(ChatColor.translateAlternateColorCodes('&', name).toLowerCase())) {
|
||||
return q;
|
||||
}
|
||||
}
|
||||
for (final Quest q : quests) {
|
||||
for (final IQuest q : quests) {
|
||||
if (q.getName().toLowerCase().contains(ChatColor.translateAlternateColorCodes('&', name).toLowerCase())) {
|
||||
return q;
|
||||
}
|
||||
@ -4260,26 +4311,26 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an Action by name
|
||||
* Get an IAction by name
|
||||
*
|
||||
* @param name Name of the action
|
||||
* @return Closest match or null if not found
|
||||
*/
|
||||
public Action getAction(final String name) {
|
||||
public IAction getAction(final String name) {
|
||||
if (name == null) {
|
||||
return null;
|
||||
}
|
||||
for (final Action a : actions) {
|
||||
for (final IAction a : actions) {
|
||||
if (a.getName().equalsIgnoreCase(ChatColor.translateAlternateColorCodes('&', name))) {
|
||||
return a;
|
||||
}
|
||||
}
|
||||
for (final Action a : actions) {
|
||||
for (final IAction a : actions) {
|
||||
if (a.getName().toLowerCase().startsWith(ChatColor.translateAlternateColorCodes('&', name).toLowerCase())) {
|
||||
return a;
|
||||
}
|
||||
}
|
||||
for (final Action a : actions) {
|
||||
for (final IAction a : actions) {
|
||||
if (a.getName().toLowerCase().contains(ChatColor.translateAlternateColorCodes('&', name).toLowerCase())) {
|
||||
return a;
|
||||
}
|
||||
@ -4288,26 +4339,26 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a Condition by name
|
||||
* Get a ICondition by name
|
||||
*
|
||||
* @param name Name of the condition
|
||||
* @return Closest match or null if not found
|
||||
*/
|
||||
public Condition getCondition(final String name) {
|
||||
public ICondition getCondition(final String name) {
|
||||
if (name == null) {
|
||||
return null;
|
||||
}
|
||||
for (final Condition c : conditions) {
|
||||
for (final ICondition c : conditions) {
|
||||
if (c.getName().equalsIgnoreCase(ChatColor.translateAlternateColorCodes('&', name))) {
|
||||
return c;
|
||||
}
|
||||
}
|
||||
for (final Condition c : conditions) {
|
||||
for (final ICondition c : conditions) {
|
||||
if (c.getName().toLowerCase().startsWith(ChatColor.translateAlternateColorCodes('&', name).toLowerCase())) {
|
||||
return c;
|
||||
}
|
||||
}
|
||||
for (final Condition c : conditions) {
|
||||
for (final ICondition c : conditions) {
|
||||
if (c.getName().toLowerCase().contains(ChatColor.translateAlternateColorCodes('&', name).toLowerCase())) {
|
||||
return c;
|
||||
}
|
||||
@ -4322,8 +4373,8 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
* @param quester The player to check
|
||||
* @return true if at least one available quest has not yet been completed
|
||||
*/
|
||||
public boolean hasQuest(final NPC npc, final Quester quester) {
|
||||
for (final Quest q : quests) {
|
||||
public boolean hasQuest(final NPC npc, final IQuester quester) {
|
||||
for (final IQuest q : quests) {
|
||||
if (q.getNpcStart() != null && !quester.getCompletedQuests().contains(q)) {
|
||||
if (q.getNpcStart().getId() == npc.getId()) {
|
||||
final boolean ignoreLockedQuests = settings.canIgnoreLockedQuests();
|
||||
@ -4344,8 +4395,8 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
* @param quester The player to check
|
||||
* @return true if at least one available quest has been completed
|
||||
*/
|
||||
public boolean hasCompletedQuest(final NPC npc, final Quester quester) {
|
||||
for (final Quest q : quests) {
|
||||
public boolean hasCompletedQuest(final NPC npc, final IQuester quester) {
|
||||
for (final IQuest q : quests) {
|
||||
if (q.getNpcStart() != null && quester.getCompletedQuests().contains(q)) {
|
||||
if (q.getNpcStart().getId() == npc.getId()) {
|
||||
final boolean ignoreLockedQuests = settings.canIgnoreLockedQuests();
|
||||
@ -4365,8 +4416,8 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
* @param quester The player to check
|
||||
* @return true if at least one available, redoable quest has been completed
|
||||
*/
|
||||
public boolean hasCompletedRedoableQuest(final NPC npc, final Quester quester) {
|
||||
for (final Quest q : quests) {
|
||||
public boolean hasCompletedRedoableQuest(final NPC npc, final IQuester quester) {
|
||||
for (final IQuest q : quests) {
|
||||
if (q.getNpcStart() != null && quester.getCompletedQuests().contains(q)
|
||||
&& q.getPlanner().getCooldown() > -1) {
|
||||
if (q.getNpcStart().getId() == npc.getId()) {
|
||||
|
@ -10,10 +10,9 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.config;
|
||||
package me.blackvein.quests;
|
||||
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.Settings;
|
||||
import me.blackvein.quests.config.ISettings;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
|
||||
@ -21,7 +20,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class BukkitSettings implements Settings {
|
||||
public class Settings implements ISettings {
|
||||
|
||||
private final Quests plugin;
|
||||
private int acceptTimeout = 20;
|
||||
@ -48,7 +47,7 @@ public class BukkitSettings implements Settings {
|
||||
private boolean translateSubCommands = false;
|
||||
private boolean updateCheck = true;
|
||||
|
||||
public BukkitSettings(final Quests plugin) {
|
||||
public Settings(final Quests plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
@ -11,8 +11,8 @@
|
||||
*/
|
||||
package me.blackvein.quests.actions;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.entity.QuestMob;
|
||||
import me.blackvein.quests.tasks.ActionTimer;
|
||||
@ -31,7 +31,7 @@ import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
|
||||
public class BukkitAction implements Action {
|
||||
public class Action implements IAction {
|
||||
|
||||
private final Quests plugin;
|
||||
private String name = "";
|
||||
@ -79,12 +79,12 @@ public class BukkitAction implements Action {
|
||||
protected String book = "";
|
||||
protected String denizenScript;
|
||||
|
||||
public BukkitAction(final Quests plugin) {
|
||||
public Action(final Quests plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(final Action action) {
|
||||
public int compareTo(final IAction action) {
|
||||
return name.compareTo(action.getName());
|
||||
}
|
||||
|
||||
@ -318,7 +318,7 @@ public class BukkitAction implements Action {
|
||||
this.denizenScript = scriptName;
|
||||
}
|
||||
|
||||
public void fire(final Quester quester, final Quest quest) {
|
||||
public void fire(final IQuester quester, final IQuest quest) {
|
||||
final Player player = quester.getPlayer();
|
||||
if (message != null) {
|
||||
player.sendMessage(ConfigUtil.parseStringWithPossibleLineBreaks(message, quest, player));
|
||||
@ -394,7 +394,7 @@ public class BukkitAction implements Action {
|
||||
}
|
||||
if (teleport != null) {
|
||||
if (player.isDead()) {
|
||||
plugin.getLogger().warning("Tried to fire Action " + name + " but player " + player.getUniqueId()
|
||||
plugin.getLogger().warning("Tried to fire IAction " + name + " but player " + player.getUniqueId()
|
||||
+ " was dead (known Bukkit limitation).");
|
||||
} else {
|
||||
player.teleport(teleport);
|
||||
@ -452,7 +452,7 @@ public class BukkitAction implements Action {
|
||||
.runTaskLater(plugin, timer * 20L).getTaskId(), quest);
|
||||
}
|
||||
if (cancelTimer) {
|
||||
for (final Map.Entry<Integer, Quest> entry : quester.getTimers().entrySet()) {
|
||||
for (final Map.Entry<Integer, IQuest> entry : quester.getTimers().entrySet()) {
|
||||
if (entry.getValue().getName().equals(quest.getName())) {
|
||||
plugin.getServer().getScheduler().cancelTask(entry.getKey());
|
||||
quester.getTimers().remove(entry.getKey());
|
@ -12,8 +12,8 @@
|
||||
|
||||
package me.blackvein.quests.actions;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.convo.actions.main.ActionMainPrompt;
|
||||
import me.blackvein.quests.convo.actions.menu.ActionMenuPrompt;
|
||||
@ -152,7 +152,7 @@ public class BukkitActionFactory implements ActionFactory, ConversationAbandoned
|
||||
return new ActionMainPrompt(context);
|
||||
}
|
||||
|
||||
public void loadData(final Action event, final ConversationContext context) {
|
||||
public void loadData(final IAction event, final ConversationContext context) {
|
||||
if (event.getMessage() != null) {
|
||||
context.setSessionData(CK.E_MESSAGE, event.getMessage());
|
||||
}
|
||||
@ -313,8 +313,8 @@ public class BukkitActionFactory implements ActionFactory, ConversationAbandoned
|
||||
"Player " + ((Player)context.getForWhom()).getUniqueId() : "CONSOLE";
|
||||
plugin.getLogger().info(identifier + " deleted action " + action);
|
||||
}
|
||||
for (final Quester q : plugin.getOfflineQuesters()) {
|
||||
for (final Quest quest : q.getCurrentQuests().keySet()) {
|
||||
for (final IQuester q : plugin.getOfflineQuesters()) {
|
||||
for (final IQuest quest : q.getCurrentQuests().keySet()) {
|
||||
q.checkQuest(quest);
|
||||
}
|
||||
}
|
||||
@ -340,7 +340,7 @@ public class BukkitActionFactory implements ActionFactory, ConversationAbandoned
|
||||
if (context.getSessionData(CK.E_OLD_EVENT) != null
|
||||
&& !((String) Objects.requireNonNull(context.getSessionData(CK.E_OLD_EVENT))).isEmpty()) {
|
||||
data.set(key + "." + context.getSessionData(CK.E_OLD_EVENT), null);
|
||||
final Collection<Action> temp = plugin.getLoadedActions();
|
||||
final Collection<IAction> temp = plugin.getLoadedActions();
|
||||
temp.remove(plugin.getAction((String) context.getSessionData(CK.E_OLD_EVENT)));
|
||||
plugin.setLoadedActions(temp);
|
||||
}
|
||||
@ -470,8 +470,8 @@ public class BukkitActionFactory implements ActionFactory, ConversationAbandoned
|
||||
"Player " + ((Player)context.getForWhom()).getUniqueId() : "CONSOLE";
|
||||
plugin.getLogger().info(identifier + " saved action " + context.getSessionData(CK.E_NAME));
|
||||
}
|
||||
for (final Quester q : plugin.getOfflineQuesters()) {
|
||||
for (final Quest quest : q.getCurrentQuests().keySet()) {
|
||||
for (final IQuester q : plugin.getOfflineQuesters()) {
|
||||
for (final IQuest quest : q.getCurrentQuests().keySet()) {
|
||||
q.checkQuest(quest);
|
||||
}
|
||||
}
|
||||
|
@ -12,8 +12,8 @@
|
||||
|
||||
package me.blackvein.quests.conditions;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.convo.conditions.main.ConditionMainPrompt;
|
||||
import me.blackvein.quests.convo.conditions.menu.ConditionMenuPrompt;
|
||||
@ -85,7 +85,7 @@ public class BukkitConditionFactory implements ConditionFactory, ConversationAba
|
||||
return new ConditionMainPrompt(context);
|
||||
}
|
||||
|
||||
public void loadData(final Condition condition, final ConversationContext context) {
|
||||
public void loadData(final ICondition condition, final ConversationContext context) {
|
||||
if (condition.isFailQuest()) {
|
||||
context.setSessionData(CK.C_FAIL_QUEST, Lang.get("yesWord"));
|
||||
} else {
|
||||
@ -179,8 +179,8 @@ public class BukkitConditionFactory implements ConditionFactory, ConversationAba
|
||||
"Player " + ((Player)context.getForWhom()).getUniqueId() : "CONSOLE";
|
||||
plugin.getLogger().info(identifier + " deleted condition " + condition);
|
||||
}
|
||||
for (final Quester q : plugin.getOfflineQuesters()) {
|
||||
for (final Quest quest : q.getCurrentQuests().keySet()) {
|
||||
for (final IQuester q : plugin.getOfflineQuesters()) {
|
||||
for (final IQuest quest : q.getCurrentQuests().keySet()) {
|
||||
q.checkQuest(quest);
|
||||
}
|
||||
}
|
||||
@ -201,7 +201,7 @@ public class BukkitConditionFactory implements ConditionFactory, ConversationAba
|
||||
if (context.getSessionData(CK.C_OLD_CONDITION) != null
|
||||
&& !((String) Objects.requireNonNull(context.getSessionData(CK.C_OLD_CONDITION))).isEmpty()) {
|
||||
data.set("conditions." + context.getSessionData(CK.C_OLD_CONDITION), null);
|
||||
final Collection<Condition> temp = plugin.getLoadedConditions();
|
||||
final Collection<ICondition> temp = plugin.getLoadedConditions();
|
||||
temp.remove(plugin.getCondition((String) context.getSessionData(CK.C_OLD_CONDITION)));
|
||||
plugin.setLoadedConditions(temp);
|
||||
}
|
||||
@ -267,8 +267,8 @@ public class BukkitConditionFactory implements ConditionFactory, ConversationAba
|
||||
"Player " + ((Player)context.getForWhom()).getUniqueId() : "CONSOLE";
|
||||
plugin.getLogger().info(identifier + " saved condition " + context.getSessionData(CK.C_NAME));
|
||||
}
|
||||
for (final Quester q : plugin.getOfflineQuesters()) {
|
||||
for (final Quest quest : q.getCurrentQuests().keySet()) {
|
||||
for (final IQuester q : plugin.getOfflineQuesters()) {
|
||||
for (final IQuest quest : q.getCurrentQuests().keySet()) {
|
||||
q.checkQuest(quest);
|
||||
}
|
||||
}
|
||||
|
@ -12,8 +12,8 @@
|
||||
|
||||
package me.blackvein.quests.conditions;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.util.ItemUtil;
|
||||
import me.blackvein.quests.util.MiscUtil;
|
||||
@ -24,7 +24,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Objects;
|
||||
|
||||
public class BukkitCondition implements Condition {
|
||||
public class Condition implements ICondition {
|
||||
|
||||
private final Quests plugin;
|
||||
private String name = "";
|
||||
@ -39,12 +39,12 @@ public class BukkitCondition implements Condition {
|
||||
private LinkedList<String> placeholdersCheckIdentifier = new LinkedList<>();
|
||||
private LinkedList<String> placeholdersCheckValue = new LinkedList<>();
|
||||
|
||||
public BukkitCondition(final Quests plugin) {
|
||||
public Condition(final Quests plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(final Condition condition) {
|
||||
public int compareTo(final ICondition condition) {
|
||||
return name.compareTo(condition.getName());
|
||||
}
|
||||
|
||||
@ -160,14 +160,14 @@ public class BukkitCondition implements Condition {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public boolean check(final Quester quester, final Quest quest) {
|
||||
public boolean check(final IQuester quester, final IQuest quest) {
|
||||
final Player player = quester.getPlayer();
|
||||
if (!entitiesWhileRiding.isEmpty()) {
|
||||
for (final String e : entitiesWhileRiding) {
|
||||
if (player.getVehicle() != null && player.getVehicle().getType().equals(MiscUtil.getProperMobType(e))) {
|
||||
return true;
|
||||
} else if (plugin.getSettings().getConsoleLogging() > 2) {
|
||||
plugin.getLogger().info("DEBUG: Condition entity mismatch for " + player.getName() + ": " + e);
|
||||
plugin.getLogger().info("DEBUG: ICondition entity mismatch for " + player.getName() + ": " + e);
|
||||
}
|
||||
}
|
||||
} else if (!npcsWhileRiding.isEmpty()) {
|
||||
@ -177,7 +177,7 @@ public class BukkitCondition implements Condition {
|
||||
.equals(plugin.getDependencies().getCitizens().getNPCRegistry().getById(n).getEntity())) {
|
||||
return true;
|
||||
} else if (plugin.getSettings().getConsoleLogging() > 2) {
|
||||
plugin.getLogger().info("DEBUG: Condition NPC mismatch for " + player.getName() + ": ID " + n);
|
||||
plugin.getLogger().info("DEBUG: ICondition NPC mismatch for " + player.getName() + ": ID " + n);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -187,7 +187,7 @@ public class BukkitCondition implements Condition {
|
||||
if (plugin.getDependencies().getVaultPermission().has(player, p)) {
|
||||
return plugin.getDependencies().getVaultPermission().has(player, p);
|
||||
} else if (plugin.getSettings().getConsoleLogging() > 2) {
|
||||
plugin.getLogger().info("DEBUG: Condition permission mismatch for " + player.getName() + ": " + p);
|
||||
plugin.getLogger().info("DEBUG: ICondition permission mismatch for " + player.getName() + ": " + p);
|
||||
}
|
||||
} else {
|
||||
plugin.getLogger().warning("Vault must be installed for condition permission checks: " + p);
|
||||
@ -198,7 +198,7 @@ public class BukkitCondition implements Condition {
|
||||
if (ItemUtil.compareItems(player.getItemInHand(), is, true, true) == 0) {
|
||||
return true;
|
||||
} else if (plugin.getSettings().getConsoleLogging() > 2) {
|
||||
plugin.getLogger().info("DEBUG: Condition item mismatch for " + player.getName() + ": code "
|
||||
plugin.getLogger().info("DEBUG: ICondition item mismatch for " + player.getName() + ": code "
|
||||
+ ItemUtil.compareItems(player.getItemInHand(), is, true, true));
|
||||
}
|
||||
}
|
||||
@ -207,7 +207,7 @@ public class BukkitCondition implements Condition {
|
||||
if (player.getWorld().getName().equalsIgnoreCase(w)) {
|
||||
return true;
|
||||
} else if (plugin.getSettings().getConsoleLogging() > 2) {
|
||||
plugin.getLogger().info("DEBUG: Condition world mismatch for " + player.getName() + ": " + w);
|
||||
plugin.getLogger().info("DEBUG: ICondition world mismatch for " + player.getName() + ": " + w);
|
||||
}
|
||||
}
|
||||
} else if (!biomesWhileStayingWithin.isEmpty()) {
|
||||
@ -219,7 +219,7 @@ public class BukkitCondition implements Condition {
|
||||
.name().equalsIgnoreCase(Objects.requireNonNull(MiscUtil.getProperBiome(b)).name())) {
|
||||
return true;
|
||||
} else if (plugin.getSettings().getConsoleLogging() > 2) {
|
||||
plugin.getLogger().info("DEBUG: Condition biome mismatch for " + player.getName() + ": "
|
||||
plugin.getLogger().info("DEBUG: ICondition biome mismatch for " + player.getName() + ": "
|
||||
+ MiscUtil.getProperBiome(b));
|
||||
}
|
||||
}
|
||||
@ -228,7 +228,7 @@ public class BukkitCondition implements Condition {
|
||||
if (quester.isInRegion(r)) {
|
||||
return true;
|
||||
} else if (plugin.getSettings().getConsoleLogging() > 2) {
|
||||
plugin.getLogger().info("DEBUG: Condition region mismatch for " + player.getName() + ": " + r);
|
||||
plugin.getLogger().info("DEBUG: ICondition region mismatch for " + player.getName() + ": " + r);
|
||||
}
|
||||
}
|
||||
} else if (!placeholdersCheckIdentifier.isEmpty()) {
|
||||
@ -239,7 +239,7 @@ public class BukkitCondition implements Condition {
|
||||
placeholdersCheckValue.get(index).equals(PlaceholderAPI.setPlaceholders(player, i))) {
|
||||
return true;
|
||||
} else if (plugin.getSettings().getConsoleLogging() > 2) {
|
||||
plugin.getLogger().info("DEBUG: Condition placeholder mismatch for " + player.getName() + ": " + i);
|
||||
plugin.getLogger().info("DEBUG: ICondition placeholder mismatch for " + player.getName() + ": " + i);
|
||||
}
|
||||
} else {
|
||||
plugin.getLogger().warning("PAPI must be installed for placeholder checks: " + i);
|
@ -12,10 +12,10 @@
|
||||
|
||||
package me.blackvein.quests.convo.actions.main;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.actions.IAction;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.Stage;
|
||||
import me.blackvein.quests.actions.Action;
|
||||
import me.blackvein.quests.quests.Stage;
|
||||
import me.blackvein.quests.convo.QuestsNumericPrompt;
|
||||
import me.blackvein.quests.convo.actions.ActionsEditorNumericPrompt;
|
||||
import me.blackvein.quests.convo.actions.ActionsEditorStringPrompt;
|
||||
@ -272,7 +272,7 @@ public class ActionMainPrompt extends ActionsEditorNumericPrompt {
|
||||
return null;
|
||||
}
|
||||
if (!input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
for (final Action a : plugin.getLoadedActions()) {
|
||||
for (final IAction a : plugin.getLoadedActions()) {
|
||||
if (a.getName().equalsIgnoreCase(input)) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorExists"));
|
||||
return new ActionNamePrompt(context);
|
||||
@ -565,11 +565,11 @@ public class ActionMainPrompt extends ActionsEditorNumericPrompt {
|
||||
= new ActionsEditorPostOpenNumericPromptEvent(context, this);
|
||||
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++) {
|
||||
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(ChatColor.RESET)
|
||||
.append(" - ").append(getSelectionText(context, i)).append(ChatColor.GRAY).append(" ")
|
||||
.append(getAdditionalText(context, i)).append("\n");
|
||||
.append(getAdditionalText(context, i));
|
||||
}
|
||||
return text.toString();
|
||||
}
|
||||
@ -1015,7 +1015,7 @@ public class ActionMainPrompt extends ActionsEditorNumericPrompt {
|
||||
super(context);
|
||||
if (modifiedName != null) {
|
||||
modName = modifiedName;
|
||||
for (final Quest q : plugin.getLoadedQuests()) {
|
||||
for (final IQuest q : plugin.getLoadedQuests()) {
|
||||
for (final Stage s : q.getStages()) {
|
||||
if (s.getFinishAction() != null && s.getFinishAction().getName() != null) {
|
||||
if (s.getFinishAction().getName().equalsIgnoreCase(modifiedName)) {
|
||||
|
@ -12,10 +12,10 @@
|
||||
|
||||
package me.blackvein.quests.convo.actions.menu;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.actions.IAction;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.Stage;
|
||||
import me.blackvein.quests.actions.Action;
|
||||
import me.blackvein.quests.quests.Stage;
|
||||
import me.blackvein.quests.convo.QuestsNumericPrompt;
|
||||
import me.blackvein.quests.convo.actions.ActionsEditorNumericPrompt;
|
||||
import me.blackvein.quests.convo.actions.ActionsEditorStringPrompt;
|
||||
@ -186,7 +186,7 @@ public class ActionMenuPrompt extends ActionsEditorNumericPrompt {
|
||||
}
|
||||
input = input.trim();
|
||||
if (!input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
for (final Action a : plugin.getLoadedActions()) {
|
||||
for (final IAction a : plugin.getLoadedActions()) {
|
||||
if (a.getName().equalsIgnoreCase(input)) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorExists"));
|
||||
return new ActionSelectCreatePrompt(context);
|
||||
@ -236,7 +236,7 @@ public class ActionMenuPrompt extends ActionsEditorNumericPrompt {
|
||||
final ActionsEditorPostOpenStringPromptEvent event
|
||||
= new ActionsEditorPostOpenStringPromptEvent(context, this);
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
final List<String> names = plugin.getLoadedActions().stream().map(Action::getName).collect(Collectors.toList());
|
||||
final List<String> names = plugin.getLoadedActions().stream().map(IAction::getName).collect(Collectors.toList());
|
||||
return sendClickableMenu(getTitle(context), names, getQueryText(context), context);
|
||||
}
|
||||
|
||||
@ -246,7 +246,7 @@ public class ActionMenuPrompt extends ActionsEditorNumericPrompt {
|
||||
return null;
|
||||
}
|
||||
if (!input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
final Action a = plugin.getAction(input);
|
||||
final IAction a = plugin.getAction(input);
|
||||
if (a != null) {
|
||||
context.setSessionData(CK.E_OLD_EVENT, a.getName());
|
||||
context.setSessionData(CK.E_NAME, a.getName());
|
||||
@ -282,7 +282,7 @@ public class ActionMenuPrompt extends ActionsEditorNumericPrompt {
|
||||
final ActionsEditorPostOpenStringPromptEvent event
|
||||
= new ActionsEditorPostOpenStringPromptEvent(context, this);
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
final List<String> names = plugin.getLoadedActions().stream().map(Action::getName).collect(Collectors.toList());
|
||||
final List<String> names = plugin.getLoadedActions().stream().map(IAction::getName).collect(Collectors.toList());
|
||||
return sendClickableMenu(getTitle(context), names, getQueryText(context), context);
|
||||
}
|
||||
|
||||
@ -293,9 +293,9 @@ public class ActionMenuPrompt extends ActionsEditorNumericPrompt {
|
||||
}
|
||||
if (!input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
final LinkedList<String> used = new LinkedList<String>();
|
||||
final Action a = plugin.getAction(input);
|
||||
final IAction a = plugin.getAction(input);
|
||||
if (a != null) {
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
for (final Stage stage : quest.getStages()) {
|
||||
if (stage.getFinishAction() != null
|
||||
&& stage.getFinishAction().getName().equalsIgnoreCase(a.getName())) {
|
||||
|
@ -12,10 +12,10 @@
|
||||
|
||||
package me.blackvein.quests.convo.conditions.main;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.conditions.ICondition;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.Stage;
|
||||
import me.blackvein.quests.conditions.Condition;
|
||||
import me.blackvein.quests.quests.Stage;
|
||||
import me.blackvein.quests.convo.QuestsNumericPrompt;
|
||||
import me.blackvein.quests.convo.conditions.ConditionsEditorNumericPrompt;
|
||||
import me.blackvein.quests.convo.conditions.ConditionsEditorStringPrompt;
|
||||
@ -204,7 +204,7 @@ public class ConditionMainPrompt extends ConditionsEditorNumericPrompt {
|
||||
return null;
|
||||
}
|
||||
if (!input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
for (final Condition c : plugin.getLoadedConditions()) {
|
||||
for (final ICondition c : plugin.getLoadedConditions()) {
|
||||
if (c.getName().equalsIgnoreCase(input)) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("conditionEditorExists"));
|
||||
return new ConditionNamePrompt(context);
|
||||
@ -482,7 +482,7 @@ public class ConditionMainPrompt extends ConditionsEditorNumericPrompt {
|
||||
super(context);
|
||||
if (modifiedName != null) {
|
||||
modName = modifiedName;
|
||||
for (final Quest q : plugin.getLoadedQuests()) {
|
||||
for (final IQuest q : plugin.getLoadedQuests()) {
|
||||
for (final Stage s : q.getStages()) {
|
||||
if (s.getCondition() != null && s.getCondition().getName() != null) {
|
||||
if (s.getCondition().getName().equalsIgnoreCase(modifiedName)) {
|
||||
|
@ -12,10 +12,10 @@
|
||||
|
||||
package me.blackvein.quests.convo.conditions.menu;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.conditions.ICondition;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.Stage;
|
||||
import me.blackvein.quests.conditions.Condition;
|
||||
import me.blackvein.quests.quests.Stage;
|
||||
import me.blackvein.quests.convo.QuestsNumericPrompt;
|
||||
import me.blackvein.quests.convo.conditions.ConditionsEditorNumericPrompt;
|
||||
import me.blackvein.quests.convo.conditions.ConditionsEditorStringPrompt;
|
||||
@ -185,7 +185,7 @@ public class ConditionMenuPrompt extends ConditionsEditorNumericPrompt {
|
||||
}
|
||||
input = input.trim();
|
||||
if (!input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
for (final Condition c : plugin.getLoadedConditions()) {
|
||||
for (final ICondition c : plugin.getLoadedConditions()) {
|
||||
if (c.getName().equalsIgnoreCase(input)) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("conditionEditorExists"));
|
||||
return new ConditionSelectCreatePrompt(context);
|
||||
@ -235,7 +235,7 @@ 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(Condition::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);
|
||||
}
|
||||
|
||||
@ -245,7 +245,7 @@ public class ConditionMenuPrompt extends ConditionsEditorNumericPrompt {
|
||||
return null;
|
||||
}
|
||||
if (!input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
final Condition c = plugin.getCondition(input);
|
||||
final ICondition c = plugin.getCondition(input);
|
||||
if (c != null) {
|
||||
context.setSessionData(CK.C_OLD_CONDITION, c.getName());
|
||||
context.setSessionData(CK.C_NAME, c.getName());
|
||||
@ -281,7 +281,7 @@ 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(Condition::getName)
|
||||
final List<String> names = plugin.getLoadedConditions().stream().map(ICondition::getName)
|
||||
.collect(Collectors.toList());
|
||||
return sendClickableMenu(getTitle(context), names, getQueryText(context), context);
|
||||
}
|
||||
@ -293,9 +293,9 @@ public class ConditionMenuPrompt extends ConditionsEditorNumericPrompt {
|
||||
}
|
||||
if (!input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
final LinkedList<String> used = new LinkedList<>();
|
||||
final Condition c = plugin.getCondition(input);
|
||||
final ICondition c = plugin.getCondition(input);
|
||||
if (c != null) {
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
for (final Stage stage : quest.getStages()) {
|
||||
if (stage.getCondition() != null
|
||||
&& stage.getCondition().getName().equalsIgnoreCase(c.getName())) {
|
||||
|
@ -12,11 +12,11 @@
|
||||
|
||||
package me.blackvein.quests.convo.misc;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.events.misc.MiscPostNpcOfferQuestEvent;
|
||||
import me.blackvein.quests.quests.BukkitQuest;
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import net.md_5.bungee.api.chat.ClickEvent;
|
||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||
@ -65,12 +65,12 @@ public class NpcOfferQuestPrompt extends MiscStringPrompt {
|
||||
@SuppressWarnings("unchecked")
|
||||
public ChatColor getNumberColor(final ConversationContext context, final int number) {
|
||||
final Quests plugin = (Quests)context.getPlugin();
|
||||
final LinkedList<Quest> quests = (LinkedList<Quest>) context.getSessionData("npcQuests");
|
||||
final LinkedList<IQuest> quests = (LinkedList<IQuest>) context.getSessionData("npcQuests");
|
||||
if (plugin != null) {
|
||||
final Quester quester = plugin.getQuester(((Player) context.getForWhom()).getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(((Player) context.getForWhom()).getUniqueId());
|
||||
if (quests != null && number > 0) {
|
||||
if (number < (quests.size() + 1)) {
|
||||
final Quest quest = quests.get(number - 1);
|
||||
final IQuest quest = quests.get(number - 1);
|
||||
if (quester.getCompletedQuests().contains(quest)) {
|
||||
return ChatColor.GREEN;
|
||||
} else {
|
||||
@ -88,12 +88,12 @@ public class NpcOfferQuestPrompt extends MiscStringPrompt {
|
||||
@SuppressWarnings("unchecked")
|
||||
public String getSelectionText(final ConversationContext context, final int number) {
|
||||
final Quests plugin = (Quests)context.getPlugin();
|
||||
final LinkedList<Quest> quests = (LinkedList<Quest>) context.getSessionData("npcQuests");
|
||||
final LinkedList<IQuest> quests = (LinkedList<IQuest>) context.getSessionData("npcQuests");
|
||||
if (plugin != null) {
|
||||
final Quester quester = plugin.getQuester(((Player) context.getForWhom()).getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(((Player) context.getForWhom()).getUniqueId());
|
||||
if (quests != null && number > 0) {
|
||||
if (number < (quests.size() + 1)) {
|
||||
final Quest quest = quests.get(number - 1);
|
||||
final IQuest quest = quests.get(number - 1);
|
||||
if (quester.getCompletedQuests().contains(quest)) {
|
||||
return ChatColor.GREEN + "" + ChatColor.ITALIC + quest.getName();
|
||||
} else {
|
||||
@ -110,12 +110,12 @@ public class NpcOfferQuestPrompt extends MiscStringPrompt {
|
||||
@SuppressWarnings("unchecked")
|
||||
public String getAdditionalText(final ConversationContext context, final int number) {
|
||||
final Quests plugin = (Quests)context.getPlugin();
|
||||
final LinkedList<Quest> quests = (LinkedList<Quest>) context.getSessionData("npcQuests");
|
||||
final LinkedList<IQuest> quests = (LinkedList<IQuest>) context.getSessionData("npcQuests");
|
||||
if (plugin != null) {
|
||||
final Quester quester = plugin.getQuester(((Player) context.getForWhom()).getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(((Player) context.getForWhom()).getUniqueId());
|
||||
if (quests != null && number > 0) {
|
||||
if (number < (quests.size() + 1)) {
|
||||
final Quest quest = quests.get(number - 1);
|
||||
final IQuest quest = quests.get(number - 1);
|
||||
if (quester.getCompletedQuests().contains(quest)) {
|
||||
return ChatColor.GREEN + "" + Lang.get("redoCompleted");
|
||||
}
|
||||
@ -134,12 +134,12 @@ public class NpcOfferQuestPrompt extends MiscStringPrompt {
|
||||
public @Nonnull String getPromptText(final ConversationContext context) {
|
||||
this.cc = context;
|
||||
final Quests plugin = (Quests)context.getPlugin();
|
||||
final LinkedList<BukkitQuest> quests = (LinkedList<BukkitQuest>) context.getSessionData("npcQuests");
|
||||
final LinkedList<Quest> quests = (LinkedList<Quest>) context.getSessionData("npcQuests");
|
||||
final String npc = (String) context.getSessionData("npc");
|
||||
if (plugin == null || quests == null || npc == null) {
|
||||
return ChatColor.YELLOW + Lang.get("unknownError");
|
||||
}
|
||||
quests.sort(Comparator.comparing(BukkitQuest::getName));
|
||||
quests.sort(Comparator.comparing(Quest::getName));
|
||||
|
||||
final MiscPostNpcOfferQuestEvent event = new MiscPostNpcOfferQuestEvent(context, this);
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
@ -180,11 +180,11 @@ public class NpcOfferQuestPrompt extends MiscStringPrompt {
|
||||
@Override
|
||||
public Prompt acceptInput(final ConversationContext context, final String input) {
|
||||
final Quests plugin = (Quests)context.getPlugin();
|
||||
final LinkedList<Quest> quests = (LinkedList<Quest>) context.getSessionData("npcQuests");
|
||||
final LinkedList<IQuest> quests = (LinkedList<IQuest>) context.getSessionData("npcQuests");
|
||||
if (plugin == null || quests == null) {
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
}
|
||||
final Quester quester = plugin.getQuester(((Player) context.getForWhom()).getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(((Player) context.getForWhom()).getUniqueId());
|
||||
int numInput = -1;
|
||||
try {
|
||||
numInput = Integer.parseInt(input);
|
||||
@ -195,15 +195,15 @@ public class NpcOfferQuestPrompt extends MiscStringPrompt {
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("cancelled"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
} else {
|
||||
Quest q = null;
|
||||
for (final Quest quest : quests) {
|
||||
IQuest q = null;
|
||||
for (final IQuest quest : quests) {
|
||||
if (quest.getName().equalsIgnoreCase(input)) {
|
||||
q = quest;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (q == null) {
|
||||
for (final Quest quest : quests) {
|
||||
for (final IQuest quest : quests) {
|
||||
if (numInput == (quests.indexOf(quest) + 1)) {
|
||||
q = quest;
|
||||
break;
|
||||
@ -211,7 +211,7 @@ public class NpcOfferQuestPrompt extends MiscStringPrompt {
|
||||
}
|
||||
}
|
||||
if (q == null) {
|
||||
for (final Quest quest : quests) {
|
||||
for (final IQuest quest : quests) {
|
||||
if (quest.getName().toLowerCase().contains(input.toLowerCase())) {
|
||||
q = quest;
|
||||
break;
|
||||
@ -239,8 +239,8 @@ public class NpcOfferQuestPrompt extends MiscStringPrompt {
|
||||
}
|
||||
}
|
||||
|
||||
private String extracted(final Quests plugin, final Quester quester) {
|
||||
final Quest quest = plugin.getQuestById(quester.getQuestIdToTake());
|
||||
private String extracted(final Quests plugin, final IQuester quester) {
|
||||
final IQuest quest = plugin.getQuestById(quester.getQuestIdToTake());
|
||||
return MessageFormat.format("{0}- {1}{2}{3} -\n\n{4}{5}\n", ChatColor.GOLD, ChatColor.DARK_PURPLE,
|
||||
quest.getName(), ChatColor.GOLD, ChatColor.RESET, quest.getDescription());
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
package me.blackvein.quests.convo.quests.main;
|
||||
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.convo.QuestsNumericPrompt;
|
||||
import me.blackvein.quests.convo.generic.ItemStackPrompt;
|
||||
@ -341,7 +341,7 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
||||
return null;
|
||||
}
|
||||
if (!input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
for (final Quest q : plugin.getLoadedQuests()) {
|
||||
for (final IQuest q : plugin.getLoadedQuests()) {
|
||||
if (q.getName().equalsIgnoreCase(input)) {
|
||||
String s = null;
|
||||
if (context.getSessionData(CK.ED_QUEST_EDIT) != null) {
|
||||
@ -732,7 +732,7 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
||||
if (context.getSessionData("tempStack") != null) {
|
||||
final ItemStack stack = (ItemStack) context.getSessionData("tempStack");
|
||||
boolean failed = false;
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (quest.getGUIDisplay() != null) {
|
||||
if (ItemUtil.compareItems(stack, quest.getGUIDisplay(), false) == 0) {
|
||||
String error = Lang.get("questGUIError");
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
package me.blackvein.quests.convo.quests.menu;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.convo.QuestsNumericPrompt;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||
@ -169,7 +169,7 @@ public class QuestMenuPrompt extends QuestsEditorNumericPrompt {
|
||||
}
|
||||
input = input.trim();
|
||||
if (!input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
for (final Quest q : plugin.getLoadedQuests()) {
|
||||
for (final IQuest q : plugin.getLoadedQuests()) {
|
||||
if (q.getName().equalsIgnoreCase(input)) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorNameExists"));
|
||||
return new QuestSelectCreatePrompt(context);
|
||||
@ -221,7 +221,7 @@ 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(Quest::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);
|
||||
}
|
||||
|
||||
@ -231,7 +231,7 @@ public class QuestMenuPrompt extends QuestsEditorNumericPrompt {
|
||||
return null;
|
||||
}
|
||||
if (!input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
final Quest q = plugin.getQuest(input);
|
||||
final IQuest q = plugin.getQuest(input);
|
||||
if (q != null) {
|
||||
plugin.getQuestFactory().loadQuest(context, q);
|
||||
return new QuestMainPrompt(context);
|
||||
@ -264,7 +264,7 @@ 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(Quest::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);
|
||||
}
|
||||
|
||||
@ -275,9 +275,9 @@ public class QuestMenuPrompt extends QuestsEditorNumericPrompt {
|
||||
}
|
||||
if (!input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
final LinkedList<String> used = new LinkedList<>();
|
||||
final Quest found = plugin.getQuest(input);
|
||||
final IQuest found = plugin.getQuest(input);
|
||||
if (found != null) {
|
||||
for (final Quest q : plugin.getLoadedQuests()) {
|
||||
for (final IQuest q : plugin.getLoadedQuests()) {
|
||||
if (q.getRequirements().getNeededQuests().contains(q)
|
||||
|| q.getRequirements().getBlockQuests().contains(q)) {
|
||||
used.add(q.getName());
|
||||
|
@ -15,7 +15,7 @@ package me.blackvein.quests.convo.quests.requirements;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.herocraftonline.heroes.characters.classes.HeroClass;
|
||||
import me.blackvein.quests.CustomRequirement;
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.convo.generic.ItemStackPrompt;
|
||||
import me.blackvein.quests.convo.generic.OverridePrompt;
|
||||
@ -854,7 +854,7 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
||||
StringBuilder text = new StringBuilder(ChatColor.LIGHT_PURPLE + getTitle(context) + "\n"
|
||||
+ ChatColor.DARK_PURPLE);
|
||||
boolean none = true;
|
||||
for (final Quest q : plugin.getLoadedQuests()) {
|
||||
for (final IQuest q : plugin.getLoadedQuests()) {
|
||||
text.append(q.getName()).append(", ");
|
||||
none = false;
|
||||
}
|
||||
|
@ -12,10 +12,10 @@
|
||||
|
||||
package me.blackvein.quests.convo.quests.stages;
|
||||
|
||||
import me.blackvein.quests.CustomObjective;
|
||||
import me.blackvein.quests.actions.IAction;
|
||||
import me.blackvein.quests.conditions.ICondition;
|
||||
import me.blackvein.quests.module.ICustomObjective;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.actions.Action;
|
||||
import me.blackvein.quests.conditions.Condition;
|
||||
import me.blackvein.quests.convo.QuestsNumericPrompt;
|
||||
import me.blackvein.quests.convo.generic.OverridePrompt;
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||
@ -1438,7 +1438,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
if (plugin.getLoadedActions().isEmpty()) {
|
||||
text.append(ChatColor.RED).append("- ").append(Lang.get("none")).append("\n");
|
||||
} else {
|
||||
for (final Action a : plugin.getLoadedActions()) {
|
||||
for (final IAction a : plugin.getLoadedActions()) {
|
||||
text.append(ChatColor.GREEN).append("- ").append(a.getName()).append("\n");
|
||||
}
|
||||
}
|
||||
@ -1450,8 +1450,8 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
final Player player = (Player) context.getForWhom();
|
||||
if (input != null && !input.equalsIgnoreCase(Lang.get("cmdCancel"))
|
||||
&& !input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
Action found = null;
|
||||
for (final Action a : plugin.getLoadedActions()) {
|
||||
IAction found = null;
|
||||
for (final IAction a : plugin.getLoadedActions()) {
|
||||
if (a.getName().equalsIgnoreCase(input)) {
|
||||
found = a;
|
||||
break;
|
||||
@ -1505,7 +1505,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
if (plugin.getLoadedActions().isEmpty()) {
|
||||
text.append(ChatColor.RED).append("- ").append(Lang.get("none"));
|
||||
} else {
|
||||
for (final Action a : plugin.getLoadedActions()) {
|
||||
for (final IAction a : plugin.getLoadedActions()) {
|
||||
text.append(ChatColor.GREEN).append("- ").append(a.getName()).append("\n");
|
||||
}
|
||||
}
|
||||
@ -1517,8 +1517,8 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
final Player player = (Player) context.getForWhom();
|
||||
if (input != null && !input.equalsIgnoreCase(Lang.get("cmdCancel"))
|
||||
&& !input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
Action found = null;
|
||||
for (final Action a : plugin.getLoadedActions()) {
|
||||
IAction found = null;
|
||||
for (final IAction a : plugin.getLoadedActions()) {
|
||||
if (a.getName().equalsIgnoreCase(input)) {
|
||||
found = a;
|
||||
break;
|
||||
@ -1572,7 +1572,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
if (plugin.getLoadedActions().isEmpty()) {
|
||||
text.append(ChatColor.RED).append("- ").append(Lang.get("none"));
|
||||
} else {
|
||||
for (final Action a : plugin.getLoadedActions()) {
|
||||
for (final IAction a : plugin.getLoadedActions()) {
|
||||
text.append(ChatColor.GREEN).append("- ").append(a.getName()).append("\n");
|
||||
}
|
||||
}
|
||||
@ -1584,8 +1584,8 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
final Player player = (Player) context.getForWhom();
|
||||
if (input != null && !input.equalsIgnoreCase(Lang.get("cmdCancel"))
|
||||
&& !input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
Action found = null;
|
||||
for (final Action a : plugin.getLoadedActions()) {
|
||||
IAction found = null;
|
||||
for (final IAction a : plugin.getLoadedActions()) {
|
||||
if (a.getName().equalsIgnoreCase(input)) {
|
||||
found = a;
|
||||
break;
|
||||
@ -1639,7 +1639,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
if (plugin.getLoadedActions().isEmpty()) {
|
||||
text.append(ChatColor.RED).append("- ").append(Lang.get("none")).append("\n");
|
||||
} else {
|
||||
for (final Action a : plugin.getLoadedActions()) {
|
||||
for (final IAction a : plugin.getLoadedActions()) {
|
||||
text.append(ChatColor.GREEN).append("- ").append(a.getName()).append("\n");
|
||||
}
|
||||
}
|
||||
@ -1651,8 +1651,8 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
final Player player = (Player) context.getForWhom();
|
||||
if (input != null && !input.equalsIgnoreCase(Lang.get("cmdCancel"))
|
||||
&& !input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
Action found = null;
|
||||
for (final Action a : plugin.getLoadedActions()) {
|
||||
IAction found = null;
|
||||
for (final IAction a : plugin.getLoadedActions()) {
|
||||
if (a.getName().equalsIgnoreCase(input)) {
|
||||
found = a;
|
||||
break;
|
||||
@ -1706,7 +1706,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
if (plugin.getLoadedActions().isEmpty()) {
|
||||
text.append(ChatColor.RED).append("- ").append(Lang.get("none"));
|
||||
} else {
|
||||
for (final Action a : plugin.getLoadedActions()) {
|
||||
for (final IAction a : plugin.getLoadedActions()) {
|
||||
text.append(ChatColor.GREEN).append("- ").append(a.getName()).append("\n");
|
||||
}
|
||||
}
|
||||
@ -1718,8 +1718,8 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
final Player player = (Player) context.getForWhom();
|
||||
if (input != null && !input.equalsIgnoreCase(Lang.get("cmdCancel"))
|
||||
&& !input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
Action found = null;
|
||||
for (final Action a : plugin.getLoadedActions()) {
|
||||
IAction found = null;
|
||||
for (final IAction a : plugin.getLoadedActions()) {
|
||||
if (a.getName().equalsIgnoreCase(input)) {
|
||||
found = a;
|
||||
break;
|
||||
@ -1773,7 +1773,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
if (plugin.getLoadedActions().isEmpty()) {
|
||||
text.append(ChatColor.RED).append("- ").append(Lang.get("none"));
|
||||
} else {
|
||||
for (final Action a : plugin.getLoadedActions()) {
|
||||
for (final IAction a : plugin.getLoadedActions()) {
|
||||
text.append(ChatColor.GREEN).append("- ").append(a.getName()).append("\n");
|
||||
}
|
||||
}
|
||||
@ -1785,8 +1785,8 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
final Player player = (Player) context.getForWhom();
|
||||
if (input != null && !input.equalsIgnoreCase(Lang.get("cmdCancel"))
|
||||
&& !input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
Action found = null;
|
||||
for (final Action a : plugin.getLoadedActions()) {
|
||||
IAction found = null;
|
||||
for (final IAction a : plugin.getLoadedActions()) {
|
||||
if (a.getName().equalsIgnoreCase(input)) {
|
||||
found = a;
|
||||
break;
|
||||
@ -1915,7 +1915,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
if (plugin.getLoadedActions().isEmpty()) {
|
||||
text.append(ChatColor.RED).append("- ").append(Lang.get("none"));
|
||||
} else {
|
||||
for (final Action a : plugin.getLoadedActions()) {
|
||||
for (final IAction a : plugin.getLoadedActions()) {
|
||||
text.append(ChatColor.GREEN).append("- ").append(a.getName()).append("\n");
|
||||
}
|
||||
}
|
||||
@ -1927,8 +1927,8 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
final Player player = (Player) context.getForWhom();
|
||||
if (input != null && !input.equalsIgnoreCase(Lang.get("cmdCancel"))
|
||||
&& !input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
Action found = null;
|
||||
for (final Action a : plugin.getLoadedActions()) {
|
||||
IAction found = null;
|
||||
for (final IAction a : plugin.getLoadedActions()) {
|
||||
if (a.getName().equalsIgnoreCase(input)) {
|
||||
found = a;
|
||||
break;
|
||||
@ -2058,7 +2058,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
if (plugin.getLoadedConditions().isEmpty()) {
|
||||
text.append(ChatColor.RED).append("- ").append(Lang.get("none")).append("\n");
|
||||
} else {
|
||||
for (final Condition c : plugin.getLoadedConditions()) {
|
||||
for (final ICondition c : plugin.getLoadedConditions()) {
|
||||
text.append(ChatColor.GREEN).append("- ").append(c.getName()).append("\n");
|
||||
}
|
||||
}
|
||||
@ -2070,8 +2070,8 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
final Player player = (Player) context.getForWhom();
|
||||
if (input != null && !input.equalsIgnoreCase(Lang.get("cmdCancel"))
|
||||
&& !input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
Condition found = null;
|
||||
for (final Condition c : plugin.getLoadedConditions()) {
|
||||
ICondition found = null;
|
||||
for (final ICondition c : plugin.getLoadedConditions()) {
|
||||
if (c.getName().equalsIgnoreCase(input)) {
|
||||
found = c;
|
||||
break;
|
||||
@ -2395,7 +2395,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
text.append(ChatColor.DARK_PURPLE).append("(").append(Lang.get("stageEditorNoModules"))
|
||||
.append(") ");
|
||||
} else {
|
||||
for (final String name : plugin.getCustomObjectives().stream().map(CustomObjective::getModuleName)
|
||||
for (final String name : plugin.getCustomObjectives().stream().map(ICustomObjective::getModuleName)
|
||||
.collect(Collectors.toCollection(TreeSet::new))) {
|
||||
text.append(ChatColor.DARK_PURPLE).append(" - ").append(name).append("\n");
|
||||
}
|
||||
@ -2412,7 +2412,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
line.addExtra(link);
|
||||
line.addExtra(ChatColor.DARK_AQUA + "(" + Lang.get("stageEditorNoModules") + ") ");
|
||||
} else {
|
||||
for (final String name : plugin.getCustomObjectives().stream().map(CustomObjective::getModuleName)
|
||||
for (final String name : plugin.getCustomObjectives().stream().map(ICustomObjective::getModuleName)
|
||||
.collect(Collectors.toCollection(TreeSet::new))) {
|
||||
final TextComponent click = new TextComponent(ChatColor.DARK_PURPLE + " - " + name + "\n");
|
||||
click.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, name));
|
||||
@ -2431,7 +2431,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
&& !input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
String found = null;
|
||||
// Check if we have a module with the specified name
|
||||
for (final CustomObjective co : plugin.getCustomObjectives()) {
|
||||
for (final ICustomObjective co : plugin.getCustomObjectives()) {
|
||||
if (co.getModuleName().equalsIgnoreCase(input)) {
|
||||
found = co.getModuleName();
|
||||
break;
|
||||
@ -2439,7 +2439,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
}
|
||||
if (found == null) {
|
||||
// No? Check again, but with locale sensitivity
|
||||
for (final CustomObjective co : plugin.getCustomObjectives()) {
|
||||
for (final ICustomObjective co : plugin.getCustomObjectives()) {
|
||||
if (co.getModuleName().toLowerCase().contains(input.toLowerCase())) {
|
||||
found = co.getModuleName();
|
||||
break;
|
||||
@ -2503,7 +2503,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
text.append(ChatColor.DARK_PURPLE).append("(").append(Lang.get("stageEditorNoModules"))
|
||||
.append(") ");
|
||||
} else {
|
||||
for (final CustomObjective co : plugin.getCustomObjectives()) {
|
||||
for (final ICustomObjective co : plugin.getCustomObjectives()) {
|
||||
if (co.getModuleName().equals(moduleName)) {
|
||||
text.append(ChatColor.DARK_PURPLE).append(" - ").append(co.getName()).append("\n");
|
||||
}
|
||||
@ -2521,7 +2521,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
line.addExtra(link);
|
||||
line.addExtra(ChatColor.DARK_AQUA + "(" + Lang.get("stageEditorNoModules") + ") ");
|
||||
} else {
|
||||
for (final CustomObjective co : plugin.getCustomObjectives()) {
|
||||
for (final ICustomObjective co : plugin.getCustomObjectives()) {
|
||||
if (co.getModuleName().equals(moduleName)) {
|
||||
final TextComponent click = new TextComponent(ChatColor.DARK_PURPLE + " - " + co.getName()
|
||||
+ "\n");
|
||||
@ -2541,8 +2541,8 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
public Prompt acceptInput(final @NotNull ConversationContext context, final String input) {
|
||||
if (input != null && !input.equalsIgnoreCase(Lang.get("cmdCancel"))
|
||||
&& !input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
CustomObjective found = null;
|
||||
for (final CustomObjective co : plugin.getCustomObjectives()) {
|
||||
ICustomObjective found = null;
|
||||
for (final ICustomObjective co : plugin.getCustomObjectives()) {
|
||||
if (co.getModuleName().equals(moduleName)) {
|
||||
if (co.getName().toLowerCase().contains(input.toLowerCase())) {
|
||||
found = co;
|
||||
@ -2619,8 +2619,8 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
if (list != null && plugin != null) {
|
||||
final String objName = list.getLast();
|
||||
text.append(objName).append(" -\n");
|
||||
CustomObjective found = null;
|
||||
for (final CustomObjective co : plugin.getCustomObjectives()) {
|
||||
ICustomObjective found = null;
|
||||
for (final ICustomObjective co : plugin.getCustomObjectives()) {
|
||||
if (co.getName().equals(objName)) {
|
||||
found = co;
|
||||
break;
|
||||
@ -2645,8 +2645,8 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
if (counts != null && list != null && plugin != null) {
|
||||
counts.set(counts.size() - 1, num);
|
||||
final String objName = list.getLast();
|
||||
CustomObjective found = null;
|
||||
for (final CustomObjective co : plugin.getCustomObjectives()) {
|
||||
ICustomObjective found = null;
|
||||
for (final ICustomObjective co : plugin.getCustomObjectives()) {
|
||||
if (co.getName().equals(objName)) {
|
||||
found = co;
|
||||
break;
|
||||
@ -2682,8 +2682,8 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
+ CK.S_CUSTOM_OBJECTIVES_DATA);
|
||||
if (list != null && plugin != null) {
|
||||
final String objName = list.getLast();
|
||||
CustomObjective found = null;
|
||||
for (final CustomObjective co : plugin.getCustomObjectives()) {
|
||||
ICustomObjective found = null;
|
||||
for (final ICustomObjective co : plugin.getCustomObjectives()) {
|
||||
if (co.getName().equals(objName)) {
|
||||
found = co;
|
||||
break;
|
||||
@ -2726,8 +2726,8 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
+ CK.S_CUSTOM_OBJECTIVES);
|
||||
if (list != null && plugin != null) {
|
||||
final String objName = list.getLast();
|
||||
CustomObjective found = null;
|
||||
for (final CustomObjective co : plugin.getCustomObjectives()) {
|
||||
ICustomObjective found = null;
|
||||
for (final ICustomObjective co : plugin.getCustomObjectives()) {
|
||||
if (co.getName().equals(objName)) {
|
||||
found = co;
|
||||
break;
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
package me.blackvein.quests.dependencies;
|
||||
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.Quests;
|
||||
|
||||
public class DenizenTrigger {
|
||||
@ -21,7 +21,7 @@ public class DenizenTrigger {
|
||||
public DenizenTrigger(final Quests plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
public boolean runDenizenScript(final String scriptName, final Quester quester) {
|
||||
public boolean runDenizenScript(final String scriptName, final IQuester quester) {
|
||||
if (scriptName == null) {
|
||||
return false;
|
||||
}
|
||||
|
@ -12,10 +12,9 @@
|
||||
|
||||
package me.blackvein.quests.events.command;
|
||||
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.events.QuestsEvent;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
@ -12,11 +12,10 @@
|
||||
|
||||
package me.blackvein.quests.events.command;
|
||||
|
||||
import me.blackvein.quests.Quester;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.Quester;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
@ -12,10 +12,9 @@
|
||||
|
||||
package me.blackvein.quests.events.command;
|
||||
|
||||
import me.blackvein.quests.Quester;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.Quester;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
@ -12,10 +12,9 @@
|
||||
|
||||
package me.blackvein.quests.events.command;
|
||||
|
||||
import me.blackvein.quests.Quester;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.Quester;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
@ -12,10 +12,9 @@
|
||||
|
||||
package me.blackvein.quests.events.quester;
|
||||
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.events.QuestsEvent;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
@ -12,11 +12,10 @@
|
||||
|
||||
package me.blackvein.quests.events.quester;
|
||||
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.Stage;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.quests.Stage;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@ -24,11 +23,11 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class QuesterPostChangeStageEvent extends QuesterEvent {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private final Quest quest;
|
||||
private final IQuest quest;
|
||||
private final Stage current;
|
||||
private final Stage next;
|
||||
|
||||
public QuesterPostChangeStageEvent(final Quester quester, final Quest quest, final Stage current, final Stage next) {
|
||||
public QuesterPostChangeStageEvent(final Quester quester, final IQuest quest, final Stage current, final Stage next) {
|
||||
super(quester);
|
||||
this.quest = quest;
|
||||
this.current = current;
|
||||
@ -40,7 +39,7 @@ public class QuesterPostChangeStageEvent extends QuesterEvent {
|
||||
*
|
||||
* @return Quest which is involved in this event
|
||||
*/
|
||||
public Quest getQuest() {
|
||||
public IQuest getQuest() {
|
||||
return quest;
|
||||
}
|
||||
|
@ -12,10 +12,9 @@
|
||||
|
||||
package me.blackvein.quests.events.quester;
|
||||
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@ -23,9 +22,9 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class QuesterPostCompleteQuestEvent extends QuesterEvent {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private final Quest quest;
|
||||
private final IQuest quest;
|
||||
|
||||
public QuesterPostCompleteQuestEvent(final Quester quester, final Quest quest) {
|
||||
public QuesterPostCompleteQuestEvent(final Quester quester, final IQuest quest) {
|
||||
super(quester);
|
||||
this.quest = quest;
|
||||
}
|
||||
@ -35,7 +34,7 @@ public class QuesterPostCompleteQuestEvent extends QuesterEvent {
|
||||
*
|
||||
* @return Quest which is involved in this event
|
||||
*/
|
||||
public Quest getQuest() {
|
||||
public IQuest getQuest() {
|
||||
return quest;
|
||||
}
|
||||
|
@ -12,10 +12,9 @@
|
||||
|
||||
package me.blackvein.quests.events.quester;
|
||||
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@ -23,9 +22,9 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class QuesterPostFailQuestEvent extends QuesterEvent {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private final Quest quest;
|
||||
private final IQuest quest;
|
||||
|
||||
public QuesterPostFailQuestEvent(final Quester quester, final Quest quest) {
|
||||
public QuesterPostFailQuestEvent(final Quester quester, final IQuest quest) {
|
||||
super(quester);
|
||||
this.quest = quest;
|
||||
}
|
||||
@ -35,7 +34,7 @@ public class QuesterPostFailQuestEvent extends QuesterEvent {
|
||||
*
|
||||
* @return Quest which is involved in this event
|
||||
*/
|
||||
public Quest getQuest() {
|
||||
public IQuest getQuest() {
|
||||
return quest;
|
||||
}
|
||||
|
@ -12,10 +12,9 @@
|
||||
|
||||
package me.blackvein.quests.events.quester;
|
||||
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@ -23,9 +22,9 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class QuesterPostStartQuestEvent extends QuesterEvent {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private final Quest quest;
|
||||
private final IQuest quest;
|
||||
|
||||
public QuesterPostStartQuestEvent(final Quester quester, final Quest quest) {
|
||||
public QuesterPostStartQuestEvent(final Quester quester, final IQuest quest) {
|
||||
super(quester);
|
||||
this.quest = quest;
|
||||
}
|
||||
@ -35,7 +34,7 @@ public class QuesterPostStartQuestEvent extends QuesterEvent {
|
||||
*
|
||||
* @return Quest which is involved in this event
|
||||
*/
|
||||
public Quest getQuest() {
|
||||
public IQuest getQuest() {
|
||||
return quest;
|
||||
}
|
||||
|
@ -12,12 +12,11 @@
|
||||
|
||||
package me.blackvein.quests.events.quester;
|
||||
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.quests.Objective;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.Objective;
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@ -25,11 +24,11 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class QuesterPostUpdateObjectiveEvent extends QuesterEvent implements Cancellable {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private final Quest quest;
|
||||
private final IQuest quest;
|
||||
private final Objective objective;
|
||||
private boolean cancel = false;
|
||||
|
||||
public QuesterPostUpdateObjectiveEvent(final Quester quester, final Quest quest, final Objective objective) {
|
||||
public QuesterPostUpdateObjectiveEvent(final Quester quester, final IQuest quest, final Objective objective) {
|
||||
super(quester);
|
||||
this.quest = quest;
|
||||
this.objective = objective;
|
||||
@ -40,7 +39,7 @@ public class QuesterPostUpdateObjectiveEvent extends QuesterEvent implements Can
|
||||
*
|
||||
* @return Quest which is involved in this event
|
||||
*/
|
||||
public Quest getQuest() {
|
||||
public IQuest getQuest() {
|
||||
return quest;
|
||||
}
|
||||
|
@ -12,12 +12,11 @@
|
||||
|
||||
package me.blackvein.quests.events.quester;
|
||||
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.quests.Stage;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.Stage;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@ -25,12 +24,12 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class QuesterPreChangeStageEvent extends QuesterEvent implements Cancellable {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private final Quest quest;
|
||||
private final IQuest quest;
|
||||
private final Stage current;
|
||||
private final Stage next;
|
||||
private boolean cancel = false;;
|
||||
|
||||
public QuesterPreChangeStageEvent(final Quester quester, final Quest quest, final Stage current, final Stage next) {
|
||||
public QuesterPreChangeStageEvent(final Quester quester, final IQuest quest, final Stage current, final Stage next) {
|
||||
super(quester);
|
||||
this.quest = quest;
|
||||
this.current = current;
|
||||
@ -42,7 +41,7 @@ public class QuesterPreChangeStageEvent extends QuesterEvent implements Cancella
|
||||
*
|
||||
* @return Quest which is involved in this event
|
||||
*/
|
||||
public Quest getQuest() {
|
||||
public IQuest getQuest() {
|
||||
return quest;
|
||||
}
|
||||
|
@ -12,11 +12,10 @@
|
||||
|
||||
package me.blackvein.quests.events.quester;
|
||||
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@ -24,15 +23,15 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class QuesterPreCompleteQuestEvent extends QuesterEvent implements Cancellable {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private final Quest quest;
|
||||
private final IQuest quest;
|
||||
private boolean cancel = false;
|
||||
|
||||
public QuesterPreCompleteQuestEvent(final Quester quester, final Quest quest) {
|
||||
public QuesterPreCompleteQuestEvent(final Quester quester, final IQuest quest) {
|
||||
super(quester);
|
||||
this.quest = quest;
|
||||
}
|
||||
|
||||
public QuesterPreCompleteQuestEvent(final Quester quester, final Quest quest, final boolean async) {
|
||||
public QuesterPreCompleteQuestEvent(final Quester quester, final IQuest quest, final boolean async) {
|
||||
super(quester, async);
|
||||
this.quest = quest;
|
||||
}
|
||||
@ -42,7 +41,7 @@ public class QuesterPreCompleteQuestEvent extends QuesterEvent implements Cancel
|
||||
*
|
||||
* @return Quest which is involved in this event
|
||||
*/
|
||||
public Quest getQuest() {
|
||||
public IQuest getQuest() {
|
||||
return quest;
|
||||
}
|
||||
|
@ -12,11 +12,10 @@
|
||||
|
||||
package me.blackvein.quests.events.quester;
|
||||
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@ -24,10 +23,10 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class QuesterPreFailQuestEvent extends QuesterEvent implements Cancellable {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private final Quest quest;
|
||||
private final IQuest quest;
|
||||
private boolean cancel = false;
|
||||
|
||||
public QuesterPreFailQuestEvent(final Quester quester, final Quest quest) {
|
||||
public QuesterPreFailQuestEvent(final Quester quester, final IQuest quest) {
|
||||
super(quester);
|
||||
this.quest = quest;
|
||||
}
|
||||
@ -37,7 +36,7 @@ public class QuesterPreFailQuestEvent extends QuesterEvent implements Cancellabl
|
||||
*
|
||||
* @return Quest which is involved in this event
|
||||
*/
|
||||
public Quest getQuest() {
|
||||
public IQuest getQuest() {
|
||||
return quest;
|
||||
}
|
||||
|
@ -12,11 +12,10 @@
|
||||
|
||||
package me.blackvein.quests.events.quester;
|
||||
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@ -24,10 +23,10 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class QuesterPreStartQuestEvent extends QuesterEvent implements Cancellable {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private final Quest quest;
|
||||
private final IQuest quest;
|
||||
private boolean cancel = false;
|
||||
|
||||
public QuesterPreStartQuestEvent(final Quester quester, final Quest quest) {
|
||||
public QuesterPreStartQuestEvent(final Quester quester, final IQuest quest) {
|
||||
super(quester);
|
||||
this.quest = quest;
|
||||
}
|
||||
@ -37,7 +36,7 @@ public class QuesterPreStartQuestEvent extends QuesterEvent implements Cancellab
|
||||
*
|
||||
* @return Quest which is involved in this event
|
||||
*/
|
||||
public Quest getQuest() {
|
||||
public IQuest getQuest() {
|
||||
return quest;
|
||||
}
|
||||
|
@ -12,12 +12,11 @@
|
||||
|
||||
package me.blackvein.quests.events.quester;
|
||||
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.quests.Objective;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.Objective;
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@ -25,11 +24,11 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class QuesterPreUpdateObjectiveEvent extends QuesterEvent implements Cancellable {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private final Quest quest;
|
||||
private final IQuest quest;
|
||||
private final Objective objective;
|
||||
private boolean cancel = false;
|
||||
|
||||
public QuesterPreUpdateObjectiveEvent(final Quester quester, final Quest quest, final Objective objective) {
|
||||
public QuesterPreUpdateObjectiveEvent(final Quester quester, final IQuest quest, final Objective objective) {
|
||||
super(quester);
|
||||
this.quest = quest;
|
||||
this.objective = objective;
|
||||
@ -40,7 +39,7 @@ public class QuesterPreUpdateObjectiveEvent extends QuesterEvent implements Canc
|
||||
*
|
||||
* @return Quest which is involved in this event
|
||||
*/
|
||||
public Quest getQuest() {
|
||||
public IQuest getQuest() {
|
||||
return quest;
|
||||
}
|
||||
|
@ -12,17 +12,17 @@
|
||||
|
||||
package me.blackvein.quests.exceptions;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
|
||||
public class StageFormatException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = -8217391053042612896L;
|
||||
private final String message;
|
||||
private final Quest quest;
|
||||
private final IQuest quest;
|
||||
private final int stage;
|
||||
|
||||
|
||||
public StageFormatException(final String message, final Quest quest, final int stage) {
|
||||
public StageFormatException(final String message, final IQuest quest, final int stage) {
|
||||
super(message + ", see quest " + quest.getName() + " stage " + stage);
|
||||
this.message = message + ", see quest " + quest.getName() + " stage " + stage;
|
||||
this.quest = quest;
|
||||
@ -44,7 +44,7 @@ public class StageFormatException extends Exception {
|
||||
*
|
||||
* @return The quest that an invalid stage id was set within.
|
||||
*/
|
||||
public Quest getQuest() {
|
||||
public IQuest getQuest() {
|
||||
return quest;
|
||||
}
|
||||
|
||||
|
@ -12,8 +12,8 @@
|
||||
|
||||
package me.blackvein.quests.item;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
@ -27,10 +27,10 @@ import java.util.stream.Collectors;
|
||||
|
||||
public class QuestJournal {
|
||||
|
||||
final Quester owner;
|
||||
final IQuester owner;
|
||||
ItemStack journal = new ItemStack(Material.WRITTEN_BOOK);
|
||||
|
||||
public QuestJournal(final Quester owner) {
|
||||
public QuestJournal(final IQuester owner) {
|
||||
this.owner = owner;
|
||||
final BookMeta book = (BookMeta) journal.getItemMeta();
|
||||
if (book != null) {
|
||||
@ -45,10 +45,10 @@ public class QuestJournal {
|
||||
int currentLength = 0;
|
||||
int currentLines = 0;
|
||||
StringBuilder page = new StringBuilder();
|
||||
final List<Quest> sortedList = owner.getCurrentQuests().keySet().stream()
|
||||
.sorted(Comparator.comparing(Quest::getName))
|
||||
final List<IQuest> sortedList = owner.getCurrentQuests().keySet().stream()
|
||||
.sorted(Comparator.comparing(IQuest::getName))
|
||||
.collect(Collectors.toList());
|
||||
for (final Quest quest : sortedList) {
|
||||
for (final IQuest quest : sortedList) {
|
||||
if ((currentLength + quest.getName().length() > 240) || (currentLines
|
||||
+ ((quest.getName().length() % 19) == 0 ? (quest.getName().length() / 19)
|
||||
: ((quest.getName().length() / 19) + 1))) > 13) {
|
||||
@ -90,7 +90,7 @@ public class QuestJournal {
|
||||
}
|
||||
}
|
||||
|
||||
public Quester getOwner() {
|
||||
public IQuester getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
|
@ -12,10 +12,11 @@
|
||||
|
||||
package me.blackvein.quests.listeners;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.Stage;
|
||||
import me.blackvein.quests.quests.Stage;
|
||||
import me.blackvein.quests.enums.ObjectiveType;
|
||||
import me.blackvein.quests.events.quester.QuesterPostUpdateObjectiveEvent;
|
||||
import me.blackvein.quests.events.quester.QuesterPreUpdateObjectiveEvent;
|
||||
@ -62,7 +63,7 @@ public class BlockListener implements Listener {
|
||||
final Set<String> dispatchedBreakQuestIDs = new HashSet<>();
|
||||
final Set<String> dispatchedPlaceQuestIDs = new HashSet<>();
|
||||
final Set<String> dispatchedCutQuestIDs = new HashSet<>();
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (!evt.isCancelled()) {
|
||||
if (!quester.meetsCondition(quest, true)) {
|
||||
continue;
|
||||
@ -84,7 +85,7 @@ public class BlockListener implements Listener {
|
||||
|
||||
// Multiplayer
|
||||
dispatchedBreakQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, breakType,
|
||||
(final Quester q, final Quest cq) -> {
|
||||
(final IQuester q, final IQuest cq) -> {
|
||||
if (!dispatchedBreakQuestIDs.contains(cq.getId())) {
|
||||
q.breakBlock(cq, blockItemStack);
|
||||
}
|
||||
@ -120,7 +121,7 @@ public class BlockListener implements Listener {
|
||||
}
|
||||
}
|
||||
dispatchedPlaceQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, placeType,
|
||||
(final Quester q, final Quest cq) -> {
|
||||
(final IQuester q, final IQuest cq) -> {
|
||||
if (!dispatchedPlaceQuestIDs.contains(cq.getId())) {
|
||||
for (final ItemStack is : q.getQuestData(cq).blocksPlaced) {
|
||||
if (evt.getBlock().getType().equals(is.getType()) && is.getAmount() > 0) {
|
||||
@ -132,7 +133,7 @@ public class BlockListener implements Listener {
|
||||
}
|
||||
|
||||
final QuesterPreUpdateObjectiveEvent preEvent
|
||||
= new QuesterPreUpdateObjectiveEvent(q, cq,
|
||||
= new QuesterPreUpdateObjectiveEvent((Quester) q, cq,
|
||||
new BukkitObjective(placeType, is.getAmount(), toPlace.getAmount()));
|
||||
plugin.getServer().getPluginManager().callEvent(preEvent);
|
||||
|
||||
@ -142,7 +143,7 @@ public class BlockListener implements Listener {
|
||||
q.getQuestData(cq).blocksPlaced.set(index, is);
|
||||
|
||||
final QuesterPostUpdateObjectiveEvent postEvent
|
||||
= new QuesterPostUpdateObjectiveEvent(q, cq,
|
||||
= new QuesterPostUpdateObjectiveEvent((Quester) q, cq,
|
||||
new BukkitObjective(placeType, newAmount, toPlace.getAmount()));
|
||||
plugin.getServer().getPluginManager().callEvent(postEvent);
|
||||
}
|
||||
@ -156,7 +157,7 @@ public class BlockListener implements Listener {
|
||||
}
|
||||
}
|
||||
dispatchedCutQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, cutType,
|
||||
(final Quester q, final Quest cq) -> {
|
||||
(final IQuester q, final IQuest cq) -> {
|
||||
if (!dispatchedCutQuestIDs.contains(cq.getId())) {
|
||||
if (player.getItemInHand().getType().equals(Material.SHEARS)) {
|
||||
q.cutBlock(cq, blockItemStack);
|
||||
@ -177,10 +178,10 @@ public class BlockListener implements Listener {
|
||||
if (plugin.canUseQuests(player.getUniqueId())) {
|
||||
final ItemStack blockItemStack = new ItemStack(evt.getBlock().getType(), 1, evt.getBlock().getState()
|
||||
.getData().toItemStack().getDurability());
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(player.getUniqueId());
|
||||
final ObjectiveType type = ObjectiveType.DAMAGE_BLOCK;
|
||||
final Set<String> dispatchedQuestIDs = new HashSet<>();
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (!quester.meetsCondition(quest, true)) {
|
||||
continue;
|
||||
}
|
||||
@ -191,7 +192,7 @@ public class BlockListener implements Listener {
|
||||
}
|
||||
|
||||
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, type,
|
||||
(final Quester q, final Quest cq) -> {
|
||||
(final IQuester q, final IQuest cq) -> {
|
||||
if (!dispatchedQuestIDs.contains(cq.getId())) {
|
||||
q.placeBlock(cq, blockItemStack);
|
||||
}
|
||||
@ -208,10 +209,10 @@ public class BlockListener implements Listener {
|
||||
if (plugin.canUseQuests(player.getUniqueId())) {
|
||||
final ItemStack blockItemStack = new ItemStack(evt.getBlock().getType(), 1, evt.getBlock().getState()
|
||||
.getData().toItemStack().getDurability());
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(player.getUniqueId());
|
||||
final ObjectiveType type = ObjectiveType.PLACE_BLOCK;
|
||||
final Set<String> dispatchedQuestIDs = new HashSet<>();
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (!evt.isCancelled()) {
|
||||
if (!quester.meetsCondition(quest, true)) {
|
||||
continue;
|
||||
@ -223,7 +224,7 @@ public class BlockListener implements Listener {
|
||||
}
|
||||
|
||||
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, type,
|
||||
(final Quester q, final Quest cq) -> {
|
||||
(final IQuester q, final IQuest cq) -> {
|
||||
if (!dispatchedQuestIDs.contains(cq.getId())) {
|
||||
q.placeBlock(cq, blockItemStack);
|
||||
}
|
||||
@ -246,7 +247,7 @@ public class BlockListener implements Listener {
|
||||
if (e == null || e.equals(EquipmentSlot.HAND)) { //If the event is fired by HAND (main hand)
|
||||
final Player player = evt.getPlayer();
|
||||
if (plugin.canUseQuests(evt.getPlayer().getUniqueId())) {
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(player.getUniqueId());
|
||||
if (quester.isSelectingBlock()) {
|
||||
return;
|
||||
}
|
||||
@ -256,7 +257,7 @@ public class BlockListener implements Listener {
|
||||
.getClickedBlock().getState().getData().toItemStack().getDurability());
|
||||
final ObjectiveType type = ObjectiveType.USE_BLOCK;
|
||||
final Set<String> dispatchedQuestIDs = new HashSet<>();
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (!quester.meetsCondition(quest, true)) {
|
||||
continue;
|
||||
}
|
||||
@ -267,7 +268,7 @@ public class BlockListener implements Listener {
|
||||
}
|
||||
|
||||
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, type,
|
||||
(final Quester q, final Quest cq) -> {
|
||||
(final IQuester q, final IQuest cq) -> {
|
||||
if (!dispatchedQuestIDs.contains(cq.getId())) {
|
||||
q.useBlock(cq, blockItemStack);
|
||||
}
|
||||
|
@ -12,18 +12,18 @@
|
||||
|
||||
package me.blackvein.quests.listeners;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.Requirements;
|
||||
import me.blackvein.quests.Stage;
|
||||
import me.blackvein.quests.quests.Requirements;
|
||||
import me.blackvein.quests.quests.Stage;
|
||||
import me.blackvein.quests.events.command.QuestsCommandPreQuestsEditorEvent;
|
||||
import me.blackvein.quests.events.command.QuestsCommandPreQuestsJournalEvent;
|
||||
import me.blackvein.quests.events.command.QuestsCommandPreQuestsListEvent;
|
||||
import me.blackvein.quests.events.quest.QuestQuitEvent;
|
||||
import me.blackvein.quests.interfaces.ReloadCallback;
|
||||
import me.blackvein.quests.item.QuestJournal;
|
||||
import me.blackvein.quests.player.BukkitQuester;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.storage.Storage;
|
||||
import me.blackvein.quests.util.ItemUtil;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
@ -197,9 +197,9 @@ public class CmdExecutor implements CommandExecutor {
|
||||
if (cs.hasPermission("quests.quest")) {
|
||||
if (args.length == 0) {
|
||||
final Player player = (Player) cs;
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(player.getUniqueId());
|
||||
if (!quester.getCurrentQuests().isEmpty()) {
|
||||
for (final Quest q : quester.getCurrentQuests().keySet()) {
|
||||
for (final IQuest q : quester.getCurrentQuests().keySet()) {
|
||||
final Stage stage = quester.getCurrentStage(q);
|
||||
q.updateCompass(quester, stage);
|
||||
if (plugin.getQuester(player.getUniqueId()).getQuestData(q).getDelayStartTime() == 0) {
|
||||
@ -345,10 +345,10 @@ public class CmdExecutor implements CommandExecutor {
|
||||
index++;
|
||||
}
|
||||
}
|
||||
final Quest q = plugin.getQuest(name.toString());
|
||||
final IQuest q = plugin.getQuest(name.toString());
|
||||
if (q != null) {
|
||||
final Player player = (Player) cs;
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(player.getUniqueId());
|
||||
cs.sendMessage(ChatColor.GOLD + "- " + q.getName() + " -");
|
||||
cs.sendMessage(" ");
|
||||
if (q.getNpcStart() != null) {
|
||||
@ -437,7 +437,7 @@ public class CmdExecutor implements CommandExecutor {
|
||||
}
|
||||
}
|
||||
if (!reqs.getNeededQuests().isEmpty()) {
|
||||
for (final Quest quest : reqs.getNeededQuests()) {
|
||||
for (final IQuest quest : reqs.getNeededQuests()) {
|
||||
if (quester.getCompletedQuests().contains(quest)) {
|
||||
cs.sendMessage(ChatColor.GRAY + "- " + ChatColor.GREEN + Lang.get("complete") + " "
|
||||
+ ChatColor.ITALIC + quest.getName());
|
||||
@ -448,7 +448,7 @@ public class CmdExecutor implements CommandExecutor {
|
||||
}
|
||||
}
|
||||
if (!reqs.getBlockQuests().isEmpty()) {
|
||||
for (final Quest quest : reqs.getBlockQuests()) {
|
||||
for (final IQuest quest : reqs.getBlockQuests()) {
|
||||
if (quester.getCompletedQuests().contains(quest)) {
|
||||
String msg = Lang.get("haveCompleted");
|
||||
msg = msg.replace("<quest>", ChatColor.ITALIC + "" + ChatColor.DARK_PURPLE
|
||||
@ -614,7 +614,7 @@ public class CmdExecutor implements CommandExecutor {
|
||||
} else {
|
||||
target = Bukkit.getOfflinePlayer(((Player)cs).getUniqueId());
|
||||
}
|
||||
final Quester quester = plugin.getQuester(target.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(target.getUniqueId());
|
||||
cs.sendMessage(ChatColor.GOLD + "- " + target.getName() + " -");
|
||||
cs.sendMessage(ChatColor.YELLOW + Lang.get("questPoints") + " - " + ChatColor.DARK_PURPLE
|
||||
+ quester.getQuestPoints());
|
||||
@ -622,8 +622,8 @@ public class CmdExecutor implements CommandExecutor {
|
||||
cs.sendMessage(ChatColor.YELLOW + Lang.get("currentQuest") + " " + ChatColor.DARK_PURPLE+ Lang.get("none"));
|
||||
} else {
|
||||
cs.sendMessage(ChatColor.YELLOW + Lang.get("currentQuest"));
|
||||
for (final Entry<Quest, Integer> set : quester.getCurrentQuests().entrySet()) {
|
||||
final Quest q = set.getKey();
|
||||
for (final Entry<IQuest, Integer> set : quester.getCurrentQuests().entrySet()) {
|
||||
final IQuest q = set.getKey();
|
||||
final String msg = ChatColor.LIGHT_PURPLE + " - " + ChatColor.DARK_PURPLE + q.getName()
|
||||
+ ChatColor.LIGHT_PURPLE + " (" + Lang.get("stageEditorStage") + " " + (set.getValue() + 1) + ")";
|
||||
cs.sendMessage(msg);
|
||||
@ -636,7 +636,7 @@ public class CmdExecutor implements CommandExecutor {
|
||||
} else {
|
||||
final StringBuilder completed = new StringBuilder(" ");
|
||||
int index = 1;
|
||||
for (final Quest q : quester.getCompletedQuests()) {
|
||||
for (final IQuest q : quester.getCompletedQuests()) {
|
||||
completed.append(ChatColor.DARK_PURPLE).append(q.getName());
|
||||
if (quester.getAmountsCompleted().containsKey(q) && quester.getAmountsCompleted().get(q) > 1) {
|
||||
completed.append(ChatColor.LIGHT_PURPLE).append(" (x").append(quester.getAmountsCompleted()
|
||||
@ -697,9 +697,9 @@ public class CmdExecutor implements CommandExecutor {
|
||||
Lang.send(player, ChatColor.RED + Lang.get(player, "COMMAND_QUIT_HELP"));
|
||||
return;
|
||||
}
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(player.getUniqueId());
|
||||
if (!quester.getCurrentQuests().isEmpty()) {
|
||||
final Quest quest = plugin.getQuest(concatArgArray(args, 1, args.length - 1, ' '));
|
||||
final IQuest quest = plugin.getQuest(concatArgArray(args, 1, args.length - 1, ' '));
|
||||
if (quest != null) {
|
||||
if (quest.getOptions().canAllowQuitting()) {
|
||||
final QuestQuitEvent event = new QuestQuitEvent(quest, quester);
|
||||
@ -730,10 +730,10 @@ public class CmdExecutor implements CommandExecutor {
|
||||
if (args.length == 1) {
|
||||
Lang.send(player, ChatColor.YELLOW + Lang.get(player, "COMMAND_TAKE_USAGE"));
|
||||
} else {
|
||||
final Quest questToFind = plugin.getQuest(concatArgArray(args, 1, args.length - 1, ' '));
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
final IQuest questToFind = plugin.getQuest(concatArgArray(args, 1, args.length - 1, ' '));
|
||||
final IQuester quester = plugin.getQuester(player.getUniqueId());
|
||||
if (questToFind != null) {
|
||||
for (final Quest q : quester.getCurrentQuests().keySet()) {
|
||||
for (final IQuest q : quester.getCurrentQuests().keySet()) {
|
||||
if (q.getId().equals(questToFind.getId())) {
|
||||
Lang.send(player, ChatColor.RED + Lang.get(player, "questAlreadyOn"));
|
||||
return;
|
||||
@ -757,7 +757,7 @@ public class CmdExecutor implements CommandExecutor {
|
||||
if (!(cs instanceof Player)) {
|
||||
int num = 1;
|
||||
cs.sendMessage(ChatColor.GOLD + Lang.get("questListTitle"));
|
||||
for (final Quest q : plugin.getLoadedQuests()) {
|
||||
for (final IQuest q : plugin.getLoadedQuests()) {
|
||||
cs.sendMessage(ChatColor.YELLOW + "" + num + ". " + q.getName());
|
||||
num++;
|
||||
}
|
||||
@ -781,7 +781,8 @@ public class CmdExecutor implements CommandExecutor {
|
||||
cs.sendMessage(ChatColor.YELLOW + Lang.get("pageSelectionPosNum"));
|
||||
} else {
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
final QuestsCommandPreQuestsListEvent preEvent = new QuestsCommandPreQuestsListEvent(quester, page);
|
||||
final QuestsCommandPreQuestsListEvent preEvent
|
||||
= new QuestsCommandPreQuestsListEvent(quester, page);
|
||||
plugin.getServer().getPluginManager().callEvent(preEvent);
|
||||
if (preEvent.isCancelled()) {
|
||||
return;
|
||||
@ -936,7 +937,7 @@ public class CmdExecutor implements CommandExecutor {
|
||||
cs.sendMessage(ChatColor.YELLOW + Lang.get("inputNum"));
|
||||
return;
|
||||
}
|
||||
final Quester quester = plugin.getQuester(target.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(target.getUniqueId());
|
||||
quester.setQuestPoints(quester.getQuestPoints() + Math.abs(points));
|
||||
String msg1 = Lang.get("giveQuestPoints").replace("<points>", Lang.get("questPoints"));
|
||||
msg1 = msg1.replace("<player>", ChatColor.GREEN + target.getName() + ChatColor.GOLD);
|
||||
@ -973,7 +974,7 @@ public class CmdExecutor implements CommandExecutor {
|
||||
cs.sendMessage(ChatColor.YELLOW + Lang.get("inputNum"));
|
||||
return;
|
||||
}
|
||||
final Quester quester = plugin.getQuester(target.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(target.getUniqueId());
|
||||
quester.setQuestPoints(quester.getQuestPoints() - Math.abs(points));
|
||||
String msg1 = Lang.get("takeQuestPoints").replace("<points>", Lang.get("questPoints"));
|
||||
msg1 = msg1.replace("<player>", ChatColor.GREEN + target.getName() + ChatColor.GOLD);
|
||||
@ -1010,7 +1011,7 @@ public class CmdExecutor implements CommandExecutor {
|
||||
cs.sendMessage(ChatColor.YELLOW + Lang.get("inputNum"));
|
||||
return;
|
||||
}
|
||||
final Quester quester = plugin.getQuester(target.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(target.getUniqueId());
|
||||
quester.setQuestPoints(points);
|
||||
String msg1 = Lang.get("setQuestPoints").replace("<points>", Lang.get("questPoints"));
|
||||
msg1 = msg1.replace("<player>", ChatColor.GREEN + target.getName() + ChatColor.GOLD);
|
||||
@ -1040,7 +1041,7 @@ public class CmdExecutor implements CommandExecutor {
|
||||
return;
|
||||
}
|
||||
}
|
||||
final Quest questToGive;
|
||||
final IQuest questToGive;
|
||||
StringBuilder name = new StringBuilder();
|
||||
if (args.length == 3) {
|
||||
name = new StringBuilder(args[2].toLowerCase());
|
||||
@ -1058,8 +1059,8 @@ public class CmdExecutor implements CommandExecutor {
|
||||
if (questToGive == null) {
|
||||
cs.sendMessage(ChatColor.YELLOW + Lang.get("questNotFound"));
|
||||
} else {
|
||||
final Quester quester = plugin.getQuester(target.getUniqueId());
|
||||
for (final Quest q : quester.getCurrentQuests().keySet()) {
|
||||
final IQuester quester = plugin.getQuester(target.getUniqueId());
|
||||
for (final IQuest q : quester.getCurrentQuests().keySet()) {
|
||||
if (q.getName().equalsIgnoreCase(questToGive.getName())) {
|
||||
String msg = Lang.get("questsPlayerHasQuestAlready");
|
||||
msg = msg.replace("<player>", ChatColor.ITALIC + "" + ChatColor.GREEN + target.getName()
|
||||
@ -1104,7 +1105,7 @@ public class CmdExecutor implements CommandExecutor {
|
||||
}
|
||||
cs.sendMessage(ChatColor.YELLOW + Lang.get("settingAllQuestPoints")
|
||||
.replace("<points>", Lang.get("questPoints")));
|
||||
for (final Quester q : plugin.getOfflineQuesters()) {
|
||||
for (final IQuester q : plugin.getOfflineQuesters()) {
|
||||
q.setQuestPoints(amount);
|
||||
}
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
@ -1159,13 +1160,13 @@ public class CmdExecutor implements CommandExecutor {
|
||||
return;
|
||||
}
|
||||
}
|
||||
final Quester quester = plugin.getQuester(target.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(target.getUniqueId());
|
||||
if (quester.getCurrentQuests().isEmpty() && target.getName() != null) {
|
||||
String msg = Lang.get("noCurrentQuest");
|
||||
msg = msg.replace("<player>", target.getName());
|
||||
cs.sendMessage(ChatColor.YELLOW + msg);
|
||||
} else {
|
||||
final Quest quest = plugin.getQuest(concatArgArray(args, 2, args.length - 1, ' '));
|
||||
final IQuest quest = plugin.getQuest(concatArgArray(args, 2, args.length - 1, ' '));
|
||||
if (quest == null) {
|
||||
cs.sendMessage(ChatColor.RED + Lang.get("questNotFound"));
|
||||
return;
|
||||
@ -1211,13 +1212,13 @@ public class CmdExecutor implements CommandExecutor {
|
||||
cs.sendMessage(ChatColor.YELLOW + Lang.get("COMMAND_QUESTADMIN_SETSTAGE_USAGE"));
|
||||
return;
|
||||
}
|
||||
final Quester quester = plugin.getQuester(target.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(target.getUniqueId());
|
||||
if (quester.getCurrentQuests().isEmpty() && target.getName() != null) {
|
||||
String msg = Lang.get("noCurrentQuest");
|
||||
msg = msg.replace("<player>", target.getName());
|
||||
cs.sendMessage(ChatColor.YELLOW + msg);
|
||||
} else {
|
||||
final Quest quest = plugin.getQuest(concatArgArray(args, 2, args.length - 2, ' '));
|
||||
final IQuest quest = plugin.getQuest(concatArgArray(args, 2, args.length - 2, ' '));
|
||||
if (quest == null) {
|
||||
cs.sendMessage(ChatColor.RED + Lang.get("questNotFound"));
|
||||
return;
|
||||
@ -1247,13 +1248,13 @@ public class CmdExecutor implements CommandExecutor {
|
||||
return;
|
||||
}
|
||||
}
|
||||
final Quester quester = plugin.getQuester(target.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(target.getUniqueId());
|
||||
if (quester.getCurrentQuests().isEmpty() && target.getName() != null) {
|
||||
String msg = Lang.get("noCurrentQuest");
|
||||
msg = msg.replace("<player>", target.getName());
|
||||
cs.sendMessage(ChatColor.YELLOW + msg);
|
||||
} else {
|
||||
final Quest quest = plugin.getQuest(concatArgArray(args, 2, args.length - 1, ' '));
|
||||
final IQuest quest = plugin.getQuest(concatArgArray(args, 2, args.length - 1, ' '));
|
||||
if (quest == null) {
|
||||
cs.sendMessage(ChatColor.RED + Lang.get("questNotFound"));
|
||||
return;
|
||||
@ -1288,13 +1289,13 @@ public class CmdExecutor implements CommandExecutor {
|
||||
return;
|
||||
}
|
||||
}
|
||||
final Quester quester = plugin.getQuester(target.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(target.getUniqueId());
|
||||
if (quester.getCurrentQuests().isEmpty() && target.getName() != null) {
|
||||
String msg = Lang.get("noCurrentQuest");
|
||||
msg = msg.replace("<player>", target.getName());
|
||||
cs.sendMessage(ChatColor.YELLOW + msg);
|
||||
} else {
|
||||
final Quest quest = plugin.getQuest(concatArgArray(args, 2, args.length - 1, ' '));
|
||||
final IQuest quest = plugin.getQuest(concatArgArray(args, 2, args.length - 1, ' '));
|
||||
if (quest == null) {
|
||||
cs.sendMessage(ChatColor.RED + Lang.get("questNotFound"));
|
||||
return;
|
||||
@ -1325,10 +1326,10 @@ public class CmdExecutor implements CommandExecutor {
|
||||
}
|
||||
}
|
||||
final UUID id = target.getUniqueId();
|
||||
final ConcurrentSkipListSet<Quester> temp = (ConcurrentSkipListSet<Quester>) plugin.getOfflineQuesters();
|
||||
final ConcurrentSkipListSet<IQuester> temp = (ConcurrentSkipListSet<IQuester>) plugin.getOfflineQuesters();
|
||||
temp.removeIf(quester -> quester.getUUID().equals(id));
|
||||
plugin.setOfflineQuesters(temp);
|
||||
Quester quester = plugin.getQuester(id);
|
||||
IQuester quester = plugin.getQuester(id);
|
||||
try {
|
||||
quester.hardClear();
|
||||
quester.saveData();
|
||||
@ -1346,9 +1347,9 @@ public class CmdExecutor implements CommandExecutor {
|
||||
} catch (final Exception e) {
|
||||
plugin.getLogger().info("Data file does not exist for " + id);
|
||||
}
|
||||
quester = new BukkitQuester(plugin, id);
|
||||
quester = new Quester(plugin, id);
|
||||
quester.saveData();
|
||||
final ConcurrentSkipListSet<Quester> temp2 = (ConcurrentSkipListSet<Quester>) plugin.getOfflineQuesters();
|
||||
final ConcurrentSkipListSet<IQuester> temp2 = (ConcurrentSkipListSet<IQuester>) plugin.getOfflineQuesters();
|
||||
temp2.add(quester);
|
||||
plugin.setOfflineQuesters(temp2);
|
||||
} else {
|
||||
@ -1375,12 +1376,12 @@ public class CmdExecutor implements CommandExecutor {
|
||||
return;
|
||||
}
|
||||
}
|
||||
final Quest toRemove = plugin.getQuest(concatArgArray(args, 2, args.length - 1, ' '));
|
||||
final IQuest toRemove = plugin.getQuest(concatArgArray(args, 2, args.length - 1, ' '));
|
||||
if (toRemove == null) {
|
||||
cs.sendMessage(ChatColor.RED + Lang.get("questNotFound"));
|
||||
return;
|
||||
}
|
||||
final Quester quester = plugin.getQuester(target.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(target.getUniqueId());
|
||||
String msg = Lang.get("questRemoved");
|
||||
if (target.getName() != null) {
|
||||
msg = msg.replace("<player>", ChatColor.GREEN + target.getName() + ChatColor.GOLD);
|
||||
|
@ -12,8 +12,8 @@
|
||||
|
||||
package me.blackvein.quests.listeners;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.enums.ObjectiveType;
|
||||
import org.bukkit.Material;
|
||||
@ -49,10 +49,10 @@ public class ItemListener implements Listener {
|
||||
final Player player = (Player) evt.getWhoClicked();
|
||||
if (plugin.canUseQuests(player.getUniqueId())) {
|
||||
final ItemStack craftedItem = getCraftedItem(evt);
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(player.getUniqueId());
|
||||
final ObjectiveType type = ObjectiveType.CRAFT_ITEM;
|
||||
final Set<String> dispatchedQuestIDs = new HashSet<>();
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (!quester.meetsCondition(quest, true)) {
|
||||
continue;
|
||||
}
|
||||
@ -62,7 +62,7 @@ public class ItemListener implements Listener {
|
||||
quester.craftItem(quest, craftedItem);
|
||||
}
|
||||
|
||||
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, type, (final Quester q, final Quest cq) -> {
|
||||
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, type, (final IQuester q, final IQuest cq) -> {
|
||||
if (!dispatchedQuestIDs.contains(cq.getId())) {
|
||||
q.craftItem(cq, craftedItem);
|
||||
}
|
||||
@ -100,10 +100,10 @@ public class ItemListener implements Listener {
|
||||
|| evt.getInventory().getType().name().equals("BLAST_FURNACE")
|
||||
|| evt.getInventory().getType().name().equals("SMOKER")) {
|
||||
if (evt.getSlotType() == SlotType.RESULT) {
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(player.getUniqueId());
|
||||
final ObjectiveType type = ObjectiveType.SMELT_ITEM;
|
||||
final Set<String> dispatchedQuestIDs = new HashSet<>();
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (!quester.meetsCondition(quest, true)) {
|
||||
continue;
|
||||
}
|
||||
@ -113,7 +113,7 @@ public class ItemListener implements Listener {
|
||||
quester.smeltItem(quest, evt.getCurrentItem());
|
||||
}
|
||||
|
||||
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, type, (final Quester q, final Quest cq) -> {
|
||||
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, type, (final IQuester q, final IQuest cq) -> {
|
||||
if (!dispatchedQuestIDs.contains(cq.getId())) {
|
||||
q.smeltItem(cq, evt.getCurrentItem());
|
||||
}
|
||||
@ -123,10 +123,10 @@ public class ItemListener implements Listener {
|
||||
}
|
||||
} else if (evt.getInventory().getType() == InventoryType.BREWING) {
|
||||
if (evt.getSlotType() == SlotType.CRAFTING) {
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(player.getUniqueId());
|
||||
final ObjectiveType type = ObjectiveType.BREW_ITEM;
|
||||
final Set<String> dispatchedQuestIDs = new HashSet<>();
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (!quester.meetsCondition(quest, true)) {
|
||||
continue;
|
||||
}
|
||||
@ -136,7 +136,7 @@ public class ItemListener implements Listener {
|
||||
quester.brewItem(quest, evt.getCurrentItem());
|
||||
}
|
||||
|
||||
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, type, (final Quester q, final Quest cq) -> {
|
||||
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, type, (final IQuester q, final IQuest cq) -> {
|
||||
if (!dispatchedQuestIDs.contains(cq.getId())) {
|
||||
q.brewItem(cq, evt.getCurrentItem());
|
||||
}
|
||||
@ -154,10 +154,10 @@ public class ItemListener implements Listener {
|
||||
final ItemStack enchantedItem = evt.getItem().clone();
|
||||
enchantedItem.setAmount(1);
|
||||
enchantedItem.addUnsafeEnchantments(evt.getEnchantsToAdd());
|
||||
final Quester quester = plugin.getQuester(evt.getEnchanter().getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(evt.getEnchanter().getUniqueId());
|
||||
final ObjectiveType type = ObjectiveType.ENCHANT_ITEM;
|
||||
final Set<String> dispatchedQuestIDs = new HashSet<>();
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (!quester.meetsCondition(quest, true)) {
|
||||
continue;
|
||||
}
|
||||
@ -171,7 +171,7 @@ public class ItemListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, type, (final Quester q, final Quest cq) -> {
|
||||
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, type, (final IQuester q, final IQuest cq) -> {
|
||||
if (!dispatchedQuestIDs.contains(cq.getId())) {
|
||||
if (enchantedItem.getType().equals(Material.BOOK)) {
|
||||
q.enchantBook(cq, enchantedItem, evt.getEnchantsToAdd());
|
||||
@ -191,10 +191,10 @@ public class ItemListener implements Listener {
|
||||
if (plugin.canUseQuests(evt.getPlayer().getUniqueId())) {
|
||||
final ItemStack consumedItem = evt.getItem().clone();
|
||||
consumedItem.setAmount(1);
|
||||
final Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
|
||||
final ObjectiveType type = ObjectiveType.CONSUME_ITEM;
|
||||
final Set<String> dispatchedQuestIDs = new HashSet<>();
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (!quester.meetsCondition(quest, true)) {
|
||||
continue;
|
||||
}
|
||||
@ -204,7 +204,7 @@ public class ItemListener implements Listener {
|
||||
quester.consumeItem(quest, consumedItem);
|
||||
}
|
||||
|
||||
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, type, (final Quester q, final Quest cq) -> {
|
||||
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, type, (final IQuester q, final IQuest cq) -> {
|
||||
if (!dispatchedQuestIDs.contains(cq.getId())) {
|
||||
q.consumeItem(cq, consumedItem);
|
||||
}
|
||||
|
@ -12,8 +12,8 @@
|
||||
|
||||
package me.blackvein.quests.listeners;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.enums.ObjectiveType;
|
||||
import me.blackvein.quests.util.ItemUtil;
|
||||
@ -64,8 +64,8 @@ public class NpcListener implements Listener {
|
||||
}
|
||||
if (!evt.getClicker().isConversing()) {
|
||||
final Player player = evt.getClicker();
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
for (final Quest quest : quester.getCurrentQuests().keySet()) {
|
||||
final IQuester quester = plugin.getQuester(player.getUniqueId());
|
||||
for (final IQuest quest : quester.getCurrentQuests().keySet()) {
|
||||
if (quester.getCurrentStage(quest).containsObjective(ObjectiveType.DELIVER_ITEM)) {
|
||||
final ItemStack hand = player.getItemInHand();
|
||||
int currentIndex = -1;
|
||||
@ -183,7 +183,7 @@ public class NpcListener implements Listener {
|
||||
}
|
||||
if (plugin.getQuestNpcIds().contains(evt.getNPC().getId())) {
|
||||
boolean hasObjective = false;
|
||||
for (final Quest quest : quester.getCurrentQuests().keySet()) {
|
||||
for (final IQuest quest : quester.getCurrentQuests().keySet()) {
|
||||
if (quester.getCurrentStage(quest).containsObjective(ObjectiveType.TALK_TO_NPC)) {
|
||||
final int npcIndex
|
||||
= quester.getCurrentStage(quest).getCitizensToInteract().indexOf(evt.getNPC().getId());
|
||||
@ -196,8 +196,8 @@ public class NpcListener implements Listener {
|
||||
}
|
||||
if (!hasObjective) {
|
||||
boolean hasAtLeastOneGUI = false;
|
||||
final LinkedList<Quest> npcQuests = new LinkedList<>();
|
||||
for (final Quest q : plugin.getLoadedQuests()) {
|
||||
final LinkedList<IQuest> npcQuests = new LinkedList<>();
|
||||
for (final IQuest q : plugin.getLoadedQuests()) {
|
||||
if (quester.getCurrentQuests().containsKey(q))
|
||||
continue;
|
||||
if (q.getNpcStart() != null && q.getNpcStart().getId() == evt.getNPC().getId()) {
|
||||
@ -219,7 +219,7 @@ public class NpcListener implements Listener {
|
||||
}
|
||||
}
|
||||
if (npcQuests.size() == 1) {
|
||||
final Quest q = npcQuests.get(0);
|
||||
final IQuest q = npcQuests.get(0);
|
||||
if (quester.canAcceptOffer(q, true)) {
|
||||
quester.setQuestIdToTake(q.getId());
|
||||
if (!plugin.getSettings().canAskConfirmation()) {
|
||||
@ -289,8 +289,8 @@ public class NpcListener implements Listener {
|
||||
player = (Player) damager;
|
||||
}
|
||||
if (player != null) {
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
for (final Quest quest : quester.getCurrentQuests().keySet()) {
|
||||
final IQuester quester = plugin.getQuester(player.getUniqueId());
|
||||
for (final IQuest quest : quester.getCurrentQuests().keySet()) {
|
||||
if (!quester.meetsCondition(quest, true)) {
|
||||
continue;
|
||||
}
|
||||
@ -301,7 +301,7 @@ public class NpcListener implements Listener {
|
||||
}
|
||||
|
||||
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, type,
|
||||
(final Quester q, final Quest cq) -> {
|
||||
(final IQuester q, final IQuest cq) -> {
|
||||
if (!dispatchedQuestIDs.contains(cq.getId())) {
|
||||
q.killNPC(cq, evt.getNPC());
|
||||
}
|
||||
@ -312,8 +312,8 @@ public class NpcListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
private String extracted(final Quester quester) {
|
||||
final Quest quest = plugin.getQuestById(quester.getQuestIdToTake());
|
||||
private String extracted(final IQuester quester) {
|
||||
final IQuest quest = plugin.getQuestById(quester.getQuestIdToTake());
|
||||
return MessageFormat.format("{0}- {1}{2}{3} -\n\n{4}{5}\n", ChatColor.GOLD, ChatColor.DARK_PURPLE,
|
||||
quest.getName(), ChatColor.GOLD, ChatColor.RESET, quest.getDescription());
|
||||
}
|
||||
|
@ -12,12 +12,12 @@
|
||||
|
||||
package me.blackvein.quests.listeners;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.Stage;
|
||||
import me.blackvein.quests.quests.Stage;
|
||||
import me.blackvein.quests.enums.ObjectiveType;
|
||||
import me.blackvein.quests.player.BukkitQuester;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.util.ItemUtil;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import me.blackvein.quests.util.MiscUtil;
|
||||
@ -120,12 +120,12 @@ public class PlayerListener implements Listener {
|
||||
return;
|
||||
}
|
||||
}
|
||||
final Quester quester = plugin.getQuester(evt.getWhoClicked().getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(evt.getWhoClicked().getUniqueId());
|
||||
final Player player = (Player) evt.getWhoClicked();
|
||||
if (evt.getView().getTitle().contains(Lang.get(player, "quests"))) {
|
||||
final ItemStack clicked = evt.getCurrentItem();
|
||||
if (ItemUtil.isItem(clicked)) {
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (quest.getGUIDisplay() != null) {
|
||||
if (ItemUtil.compareItems(clicked, quest.getGUIDisplay(), false) == 0) {
|
||||
if (quester.canAcceptOffer(quest, true)) {
|
||||
@ -214,12 +214,12 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
}
|
||||
if (plugin.canUseQuests(evt.getPlayer().getUniqueId())) {
|
||||
final Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
|
||||
final Player player = evt.getPlayer();
|
||||
if (evt.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
|
||||
boolean hasObjective = false;
|
||||
if (!evt.isCancelled()) {
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (quester.getCurrentQuests().containsKey(quest)
|
||||
&& quester.getCurrentStage(quest).containsObjective(ObjectiveType.USE_BLOCK)) {
|
||||
hasObjective = true;
|
||||
@ -364,7 +364,7 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
evt.setCancelled(true);
|
||||
} else if (!player.isConversing()) {
|
||||
for (final Quest q : plugin.getLoadedQuests()) {
|
||||
for (final IQuest q : plugin.getLoadedQuests()) {
|
||||
if (q.getBlockStart() != null && evt.getClickedBlock() != null) {
|
||||
if (q.getBlockStart().equals(evt.getClickedBlock().getLocation())) {
|
||||
if (quester.getCurrentQuests().size() >= plugin.getSettings().getMaxQuests()
|
||||
@ -398,7 +398,7 @@ public class PlayerListener implements Listener {
|
||||
if (!plugin.getSettings().canAskConfirmation()) {
|
||||
quester.takeQuest(q, false);
|
||||
} else {
|
||||
final Quest quest = plugin.getQuestById(quester.getQuestIdToTake());
|
||||
final IQuest quest = plugin.getQuestById(quester.getQuestIdToTake());
|
||||
final String s = ChatColor.GOLD + "- " + ChatColor.DARK_PURPLE
|
||||
+ quest.getName() + ChatColor.GOLD + " -\n" + "\n"
|
||||
+ ChatColor.RESET + quest.getDescription() + "\n";
|
||||
@ -450,10 +450,10 @@ public class PlayerListener implements Listener {
|
||||
if (evt.getItemStack() != null && evt.getItemStack().getType() == Material.MILK_BUCKET) {
|
||||
final Player player = evt.getPlayer();
|
||||
if (plugin.canUseQuests(player.getUniqueId())) {
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(player.getUniqueId());
|
||||
final ObjectiveType type = ObjectiveType.MILK_COW;
|
||||
final Set<String> dispatchedQuestIDs = new HashSet<>();
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (!quester.meetsCondition(quest, true)) {
|
||||
continue;
|
||||
}
|
||||
@ -464,7 +464,7 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
|
||||
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, type,
|
||||
(final Quester q, final Quest cq) -> {
|
||||
(final IQuester q, final IQuest cq) -> {
|
||||
if (!dispatchedQuestIDs.contains(cq.getId())) {
|
||||
q.milkCow(cq);
|
||||
}
|
||||
@ -478,8 +478,8 @@ public class PlayerListener implements Listener {
|
||||
@EventHandler
|
||||
public void onPlayerChat(final AsyncPlayerChatEvent evt) {
|
||||
if (plugin.canUseQuests(evt.getPlayer().getUniqueId())) {
|
||||
final Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
final IQuester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (!quester.meetsCondition(quest, true)) {
|
||||
continue;
|
||||
}
|
||||
@ -516,7 +516,7 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
|
||||
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, type,
|
||||
(final Quester q, final Quest cq) -> {
|
||||
(final IQuester q, final IQuest cq) -> {
|
||||
if (!dispatchedQuestIDs.contains(cq.getId())) {
|
||||
q.sayPassword(cq, evt);
|
||||
}
|
||||
@ -530,9 +530,9 @@ public class PlayerListener implements Listener {
|
||||
@EventHandler
|
||||
public void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent evt) {
|
||||
if (plugin.canUseQuests(evt.getPlayer().getUniqueId())) {
|
||||
final Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
|
||||
if (!quester.getCurrentQuests().isEmpty()) {
|
||||
for (final Quest quest : quester.getCurrentQuests().keySet()) {
|
||||
for (final IQuest quest : quester.getCurrentQuests().keySet()) {
|
||||
if (!quest.getOptions().canAllowCommands()) {
|
||||
if (!evt.getMessage().startsWith("/quest")) {
|
||||
final Player player = evt.getPlayer();
|
||||
@ -570,10 +570,10 @@ public class PlayerListener implements Listener {
|
||||
final Player player = evt.getPlayer();
|
||||
if (plugin.canUseQuests(player.getUniqueId())) {
|
||||
final Sheep sheep = (Sheep) evt.getEntity();
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(player.getUniqueId());
|
||||
final ObjectiveType type = ObjectiveType.SHEAR_SHEEP;
|
||||
final Set<String> dispatchedQuestIDs = new HashSet<>();
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (!quester.meetsCondition(quest, true)) {
|
||||
continue;
|
||||
}
|
||||
@ -584,7 +584,7 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
|
||||
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, type,
|
||||
(final Quester q, final Quest cq) -> {
|
||||
(final IQuester q, final IQuest cq) -> {
|
||||
if (!dispatchedQuestIDs.contains(cq.getId())) {
|
||||
q.shearSheep(cq, sheep.getColor());
|
||||
}
|
||||
@ -600,10 +600,10 @@ public class PlayerListener implements Listener {
|
||||
if (evt.getOwner() instanceof Player) {
|
||||
final Player player = (Player) evt.getOwner();
|
||||
if (plugin.canUseQuests(player.getUniqueId())) {
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(player.getUniqueId());
|
||||
final ObjectiveType type = ObjectiveType.TAME_MOB;
|
||||
final Set<String> dispatchedQuestIDs = new HashSet<>();
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (!quester.meetsCondition(quest, true)) {
|
||||
continue;
|
||||
}
|
||||
@ -614,7 +614,7 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
|
||||
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, type,
|
||||
(final Quester q, final Quest cq) -> {
|
||||
(final IQuester q, final IQuest cq) -> {
|
||||
if (!dispatchedQuestIDs.contains(cq.getId())) {
|
||||
q.tameMob(cq, evt.getEntityType());
|
||||
}
|
||||
@ -645,7 +645,7 @@ public class PlayerListener implements Listener {
|
||||
} else if (damager instanceof Wolf) {
|
||||
final Wolf wolf = (Wolf) damager;
|
||||
if (wolf.isTamed() && wolf.getOwner() != null) {
|
||||
final Quester quester = plugin.getQuester(wolf.getOwner().getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(wolf.getOwner().getUniqueId());
|
||||
if (quester != null) {
|
||||
preKillPlayer(quester.getPlayer(), evt.getEntity());
|
||||
}
|
||||
@ -671,10 +671,10 @@ public class PlayerListener implements Listener {
|
||||
if (plugin.getDependencies().getCitizens() != null && CitizensAPI.getNPCRegistry().isNPC(target)) {
|
||||
return;
|
||||
}
|
||||
final Quester quester = plugin.getQuester(damager.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(damager.getUniqueId());
|
||||
final ObjectiveType type = ObjectiveType.KILL_MOB;
|
||||
final Set<String> dispatchedQuestIDs = new HashSet<>();
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (!quester.meetsCondition(quest, true)) {
|
||||
continue;
|
||||
}
|
||||
@ -687,7 +687,7 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
|
||||
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, type,
|
||||
(final Quester q, final Quest cq) -> {
|
||||
(final IQuester q, final IQuest cq) -> {
|
||||
if (!dispatchedQuestIDs.contains(cq.getId())) {
|
||||
q.killMob(cq, target.getLocation(), target.getType());
|
||||
}
|
||||
@ -722,7 +722,7 @@ public class PlayerListener implements Listener {
|
||||
} else if (damager instanceof Wolf) {
|
||||
final Wolf wolf = (Wolf) damager;
|
||||
if (wolf.isTamed() && wolf.getOwner() != null) {
|
||||
final Quester quester = plugin.getQuester(wolf.getOwner().getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(wolf.getOwner().getUniqueId());
|
||||
preKillPlayer(quester.getPlayer(), evt.getEntity());
|
||||
}
|
||||
} else {
|
||||
@ -732,8 +732,8 @@ public class PlayerListener implements Listener {
|
||||
|
||||
final Player target = evt.getEntity();
|
||||
if (plugin.canUseQuests(target.getUniqueId())) {
|
||||
final Quester quester = plugin.getQuester(target.getUniqueId());
|
||||
for (final Quest quest : quester.getCurrentQuests().keySet()) {
|
||||
final IQuester quester = plugin.getQuester(target.getUniqueId());
|
||||
for (final IQuest quest : quester.getCurrentQuests().keySet()) {
|
||||
final Stage stage = quester.getCurrentStage(quest);
|
||||
if (stage != null && stage.getDeathAction() != null) {
|
||||
quester.getCurrentStage(quest).getDeathAction().fire(quester, quest);
|
||||
@ -775,10 +775,10 @@ public class PlayerListener implements Listener {
|
||||
return;
|
||||
}
|
||||
}
|
||||
final Quester quester = plugin.getQuester(damager.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(damager.getUniqueId());
|
||||
final ObjectiveType type = ObjectiveType.KILL_PLAYER;
|
||||
final Set<String> dispatchedQuestIDs = new HashSet<>();
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (!quester.meetsCondition(quest, true)) {
|
||||
continue;
|
||||
}
|
||||
@ -791,7 +791,7 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
|
||||
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, type,
|
||||
(final Quester q, final Quest cq) -> {
|
||||
(final IQuester q, final IQuest cq) -> {
|
||||
if (!dispatchedQuestIDs.contains(cq.getId())) {
|
||||
q.killPlayer(cq, (Player)target);
|
||||
}
|
||||
@ -805,10 +805,10 @@ public class PlayerListener implements Listener {
|
||||
public void onPlayerFish(final PlayerFishEvent evt) {
|
||||
final Player player = evt.getPlayer();
|
||||
if (plugin.canUseQuests(player.getUniqueId())) {
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(player.getUniqueId());
|
||||
final ObjectiveType type = ObjectiveType.CATCH_FISH;
|
||||
final Set<String> dispatchedQuestIDs = new HashSet<>();
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (!quester.meetsCondition(quest, true)) {
|
||||
continue;
|
||||
}
|
||||
@ -820,7 +820,7 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
|
||||
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, type,
|
||||
(final Quester q, final Quest cq) -> {
|
||||
(final IQuester q, final IQuest cq) -> {
|
||||
if (!dispatchedQuestIDs.contains(cq.getId())) {
|
||||
q.catchFish(cq);
|
||||
}
|
||||
@ -835,9 +835,9 @@ public class PlayerListener implements Listener {
|
||||
public void onPlayerChangeWorld(final PlayerChangedWorldEvent event) {
|
||||
final Player player = event.getPlayer();
|
||||
if (plugin.canUseQuests(player.getUniqueId())) {
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(player.getUniqueId());
|
||||
quester.findCompassTarget();
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
quester.meetsCondition(quest, true);
|
||||
}
|
||||
}
|
||||
@ -847,7 +847,7 @@ public class PlayerListener implements Listener {
|
||||
public void onPlayerRespawn(final PlayerRespawnEvent event) {
|
||||
final Player player = event.getPlayer();
|
||||
if (plugin.canUseQuests(player.getUniqueId())) {
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(player.getUniqueId());
|
||||
Bukkit.getScheduler().runTaskLater(plugin, quester::findCompassTarget, 10);
|
||||
}
|
||||
}
|
||||
@ -866,29 +866,29 @@ public class PlayerListener implements Listener {
|
||||
});
|
||||
}
|
||||
if (plugin.canUseQuests(player.getUniqueId())) {
|
||||
final Quester noobCheck = new BukkitQuester(plugin, player.getUniqueId());
|
||||
final IQuester noobCheck = new Quester(plugin, player.getUniqueId());
|
||||
if (plugin.getSettings().canGenFilesOnJoin() && !noobCheck.hasData()) {
|
||||
noobCheck.saveData();
|
||||
}
|
||||
|
||||
plugin.getServer().getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
final CompletableFuture<Quester> cf = plugin.getStorage().loadQuester(player.getUniqueId());
|
||||
final CompletableFuture<IQuester> cf = plugin.getStorage().loadQuester(player.getUniqueId());
|
||||
try {
|
||||
final Quester quester = cf.get();
|
||||
final IQuester quester = cf.get();
|
||||
if (quester == null) {
|
||||
return;
|
||||
}
|
||||
for (final Quest q : quester.getCompletedQuests()) {
|
||||
for (final IQuest q : quester.getCompletedQuests()) {
|
||||
if (q != null) {
|
||||
if (!quester.getCompletedTimes().containsKey(q) && q.getPlanner().getCooldown() > -1) {
|
||||
quester.getCompletedTimes().put(q, System.currentTimeMillis());
|
||||
}
|
||||
}
|
||||
}
|
||||
for (final Quest quest : quester.getCurrentQuests().keySet()) {
|
||||
for (final IQuest quest : quester.getCurrentQuests().keySet()) {
|
||||
quester.checkQuest(quest);
|
||||
}
|
||||
for (final Quest quest : quester.getCurrentQuests().keySet()) {
|
||||
for (final IQuest quest : quester.getCurrentQuests().keySet()) {
|
||||
if (quester.getCurrentStage(quest).getDelay() > -1) {
|
||||
quester.startStageTimer(quest);
|
||||
}
|
||||
@ -911,8 +911,8 @@ public class PlayerListener implements Listener {
|
||||
@EventHandler
|
||||
public void onPlayerQuit(final PlayerQuitEvent evt) {
|
||||
if (plugin.canUseQuests(evt.getPlayer().getUniqueId())) {
|
||||
final Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
|
||||
for (final Quest quest : quester.getCurrentQuests().keySet()) {
|
||||
final IQuester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
|
||||
for (final IQuest quest : quester.getCurrentQuests().keySet()) {
|
||||
final Stage currentStage = quester.getCurrentStage(quest);
|
||||
if (currentStage == null) {
|
||||
plugin.getLogger().severe("currentStage was null for " + quester.getUUID().toString()
|
||||
@ -946,7 +946,7 @@ public class PlayerListener implements Listener {
|
||||
temp.remove(evt.getPlayer().getUniqueId());
|
||||
plugin.getQuestFactory().setSelectingNpcs(temp);
|
||||
}
|
||||
final ConcurrentSkipListSet<Quester> temp = (ConcurrentSkipListSet<Quester>) plugin.getOfflineQuesters();
|
||||
final ConcurrentSkipListSet<IQuester> temp = (ConcurrentSkipListSet<IQuester>) plugin.getOfflineQuesters();
|
||||
temp.removeIf(q -> q.getUUID().equals(quester.getUUID()));
|
||||
plugin.setOfflineQuesters(temp);
|
||||
}
|
||||
@ -979,12 +979,12 @@ public class PlayerListener implements Listener {
|
||||
*/
|
||||
public void playerMove(final UUID uuid, final Location location) {
|
||||
plugin.getServer().getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
final Quester quester = plugin.getQuester(uuid);
|
||||
final IQuester quester = plugin.getQuester(uuid);
|
||||
if (quester != null) {
|
||||
if (plugin.canUseQuests(uuid)) {
|
||||
final ObjectiveType type = ObjectiveType.REACH_LOCATION;
|
||||
final Set<String> dispatchedQuestIDs = new HashSet<>();
|
||||
for (final Quest quest : plugin.getLoadedQuests()) {
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (!quester.meetsCondition(quest, true)) {
|
||||
continue;
|
||||
}
|
||||
@ -998,7 +998,7 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
|
||||
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, type,
|
||||
(final Quester q, final Quest cq) -> {
|
||||
(final IQuester q, final IQuest cq) -> {
|
||||
if (!dispatchedQuestIDs.contains(cq.getId())) {
|
||||
plugin.getServer().getScheduler().runTask(plugin, () -> q
|
||||
.reachLocation(cq, location));
|
||||
|
@ -12,7 +12,6 @@
|
||||
|
||||
package me.blackvein.quests.quests;
|
||||
|
||||
import me.blackvein.quests.Objective;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import me.blackvein.quests.enums.ObjectiveType;
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
package me.blackvein.quests.quests;
|
||||
|
||||
public class BukkitOptions {
|
||||
public class BukkitOptions implements Options {
|
||||
private boolean allowCommands = true;
|
||||
private boolean allowQuitting = true;
|
||||
private boolean ignoreSilkTouch = true;
|
||||
|
@ -15,7 +15,7 @@ package me.blackvein.quests.quests;
|
||||
import java.util.Calendar;
|
||||
import java.util.TimeZone;
|
||||
|
||||
public class BukkitPlanner {
|
||||
public class BukkitPlanner implements Planner {
|
||||
public String start = null;
|
||||
public String end = null;
|
||||
public long repeat = -1;
|
||||
|
@ -12,15 +12,8 @@
|
||||
|
||||
package me.blackvein.quests.quests;
|
||||
|
||||
import me.blackvein.quests.CustomObjective;
|
||||
import me.blackvein.quests.Options;
|
||||
import me.blackvein.quests.Planner;
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
import me.blackvein.quests.module.ICustomObjective;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.Requirements;
|
||||
import me.blackvein.quests.Rewards;
|
||||
import me.blackvein.quests.Stage;
|
||||
import me.blackvein.quests.convo.quests.main.QuestMainPrompt;
|
||||
import me.blackvein.quests.convo.quests.menu.QuestMenuPrompt;
|
||||
import me.blackvein.quests.convo.quests.stages.StageMenuPrompt;
|
||||
@ -150,7 +143,7 @@ public class BukkitQuestFactory implements QuestFactory, ConversationAbandonedLi
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void loadQuest(final ConversationContext context, final Quest q) {
|
||||
public void loadQuest(final ConversationContext context, final IQuest q) {
|
||||
context.setSessionData(CK.ED_QUEST_EDIT, q.getName());
|
||||
context.setSessionData(CK.Q_ID, q.getId());
|
||||
context.setSessionData(CK.Q_NAME, q.getName());
|
||||
@ -181,11 +174,11 @@ public class BukkitQuestFactory implements QuestFactory, ConversationAbandonedLi
|
||||
context.setSessionData(CK.REQ_ITEMS_REMOVE, requirements.getRemoveItems());
|
||||
}
|
||||
if (!requirements.getNeededQuests().isEmpty()) {
|
||||
final List<String> ids = requirements.getNeededQuests().stream().map(Quest::getId).collect(Collectors.toList());
|
||||
final List<String> ids = requirements.getNeededQuests().stream().map(IQuest::getId).collect(Collectors.toList());
|
||||
context.setSessionData(CK.REQ_QUEST, ids);
|
||||
}
|
||||
if (!requirements.getBlockQuests().isEmpty()) {
|
||||
final List<String> ids = requirements.getBlockQuests().stream().map(Quest::getId).collect(Collectors.toList());
|
||||
final List<String> ids = requirements.getBlockQuests().stream().map(IQuest::getId).collect(Collectors.toList());
|
||||
context.setSessionData(CK.REQ_QUEST_BLOCK, ids);
|
||||
}
|
||||
if (!requirements.getMcmmoSkills().isEmpty()) {
|
||||
@ -762,8 +755,8 @@ public class BukkitQuestFactory implements QuestFactory, ConversationAbandonedLi
|
||||
final ConfigurationSection sec2 = sec.createSection("custom" + (index + 1));
|
||||
sec2.set("name", customObj.get(index));
|
||||
sec2.set("count", customObjCounts.get(index));
|
||||
CustomObjective found = null;
|
||||
for (final CustomObjective co : plugin.getCustomObjectives()) {
|
||||
ICustomObjective found = null;
|
||||
for (final ICustomObjective co : plugin.getCustomObjectives()) {
|
||||
if (co.getName().equals(customObj.get(index))) {
|
||||
found = co;
|
||||
break;
|
||||
|
@ -19,13 +19,13 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class BukkitRequirements {
|
||||
public class BukkitRequirements implements Requirements {
|
||||
private int money = 0;
|
||||
private int questPoints = 0;
|
||||
private List<ItemStack> items = new LinkedList<>();
|
||||
private List<Boolean> removeItems = new LinkedList<>();
|
||||
private List<BukkitQuest> neededQuests = new LinkedList<>();
|
||||
private List<BukkitQuest> blockQuests = new LinkedList<>();
|
||||
private List<IQuest> neededQuests = new LinkedList<>();
|
||||
private List<IQuest> blockQuests = new LinkedList<>();
|
||||
private List<String> permissions = new LinkedList<>();
|
||||
private List<String> mcmmoSkills = new LinkedList<>();
|
||||
private List<Integer> mcmmoAmounts = new LinkedList<>();
|
||||
@ -58,16 +58,16 @@ public class BukkitRequirements {
|
||||
public void setRemoveItems(final List<Boolean> removeItems) {
|
||||
this.removeItems = removeItems;
|
||||
}
|
||||
public List<BukkitQuest> getNeededQuests() {
|
||||
public List<IQuest> getNeededQuests() {
|
||||
return neededQuests;
|
||||
}
|
||||
public void setNeededQuests(final List<BukkitQuest> neededQuests) {
|
||||
public void setNeededQuests(final List<IQuest> neededQuests) {
|
||||
this.neededQuests = neededQuests;
|
||||
}
|
||||
public List<BukkitQuest> getBlockQuests() {
|
||||
public List<IQuest> getBlockQuests() {
|
||||
return blockQuests;
|
||||
}
|
||||
public void setBlockQuests(final List<BukkitQuest> blockQuests) {
|
||||
public void setBlockQuests(final List<IQuest> blockQuests) {
|
||||
this.blockQuests = blockQuests;
|
||||
}
|
||||
public List<String> getPermissions() {
|
||||
@ -103,7 +103,7 @@ public class BukkitRequirements {
|
||||
public Map<String, Map<String, Object>> getCustomRequirements() {
|
||||
return customRequirements;
|
||||
}
|
||||
protected void setCustomRequirements(final Map<String, Map<String, Object>> customRequirements) {
|
||||
public void setCustomRequirements(final Map<String, Map<String, Object>> customRequirements) {
|
||||
this.customRequirements = customRequirements;
|
||||
}
|
||||
public List<String> getDetailsOverride() {
|
||||
|
@ -19,7 +19,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class BukkitRewards {
|
||||
public class BukkitRewards implements Rewards {
|
||||
private int money = 0;
|
||||
private int questPoints = 0;
|
||||
private int exp = 0;
|
||||
@ -124,7 +124,7 @@ public class BukkitRewards {
|
||||
public Map<String, Map<String, Object>> getCustomRewards() {
|
||||
return customRewards;
|
||||
}
|
||||
protected void setCustomRewards(final Map<String, Map<String, Object>> customRewards) {
|
||||
public void setCustomRewards(final Map<String, Map<String, Object>> customRewards) {
|
||||
this.customRewards = customRewards;
|
||||
}
|
||||
public List<String> getDetailsOverride() {
|
||||
|
@ -12,10 +12,9 @@
|
||||
|
||||
package me.blackvein.quests.quests;
|
||||
|
||||
import me.blackvein.quests.CustomObjective;
|
||||
import me.blackvein.quests.Stage;
|
||||
import me.blackvein.quests.actions.Action;
|
||||
import me.blackvein.quests.conditions.Condition;
|
||||
import me.blackvein.quests.actions.IAction;
|
||||
import me.blackvein.quests.conditions.ICondition;
|
||||
import me.blackvein.quests.module.ICustomObjective;
|
||||
import me.blackvein.quests.enums.ObjectiveType;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Location;
|
||||
@ -122,20 +121,20 @@ public class BukkitStage implements Stage {
|
||||
private LinkedList<String> passwordDisplays = new LinkedList<>();
|
||||
private LinkedList<String> passwordPhrases = new LinkedList<>();
|
||||
private String script;
|
||||
private Action startAction = null;
|
||||
private Action finishAction = null;
|
||||
private Action failAction = null;
|
||||
private Action deathAction = null;
|
||||
private Map<String, Action> chatActions = new HashMap<>();
|
||||
private Map<String, Action> commandActions = new HashMap<>();
|
||||
private Action disconnectAction = null;
|
||||
private Condition condition = null;
|
||||
private IAction startAction = null;
|
||||
private IAction finishAction = null;
|
||||
private IAction failAction = null;
|
||||
private IAction deathAction = null;
|
||||
private Map<String, IAction> chatActions = new HashMap<>();
|
||||
private Map<String, IAction> commandActions = new HashMap<>();
|
||||
private IAction disconnectAction = null;
|
||||
private ICondition condition = null;
|
||||
private long delay = -1;
|
||||
private String delayMessage = null;
|
||||
private String completeMessage = null;
|
||||
private String startMessage = null;
|
||||
private LinkedList<String> objectiveOverrides = new LinkedList<>();
|
||||
private LinkedList<CustomObjective> customObjectives = new LinkedList<>();
|
||||
private LinkedList<ICustomObjective> customObjectives = new LinkedList<>();
|
||||
private LinkedList<Integer> customObjectiveCounts = new LinkedList<>();
|
||||
private LinkedList<String> customObjectiveDisplays = new LinkedList<>();
|
||||
private LinkedList<Entry<String, Object>> customObjectiveData = new LinkedList<>();
|
||||
@ -575,77 +574,77 @@ public class BukkitStage implements Stage {
|
||||
this.script = script;
|
||||
}
|
||||
|
||||
public Action getStartAction() {
|
||||
public IAction getStartAction() {
|
||||
return startAction;
|
||||
}
|
||||
|
||||
public void setStartAction(final Action startAction) {
|
||||
public void setStartAction(final IAction startAction) {
|
||||
this.startAction = startAction;
|
||||
}
|
||||
|
||||
public Action getFinishAction() {
|
||||
public IAction getFinishAction() {
|
||||
return finishAction;
|
||||
}
|
||||
|
||||
public void setFinishAction(final Action finishAction) {
|
||||
public void setFinishAction(final IAction finishAction) {
|
||||
this.finishAction = finishAction;
|
||||
}
|
||||
|
||||
public Action getFailAction() {
|
||||
public IAction getFailAction() {
|
||||
return failAction;
|
||||
}
|
||||
|
||||
public void setFailAction(final Action failAction) {
|
||||
public void setFailAction(final IAction failAction) {
|
||||
this.failAction = failAction;
|
||||
}
|
||||
|
||||
public Action getDeathAction() {
|
||||
public IAction getDeathAction() {
|
||||
return deathAction;
|
||||
}
|
||||
|
||||
public void setDeathAction(final Action deathAction) {
|
||||
public void setDeathAction(final IAction deathAction) {
|
||||
this.deathAction = deathAction;
|
||||
}
|
||||
|
||||
public Map<String, Action> getChatActions() {
|
||||
public Map<String, IAction> getChatActions() {
|
||||
return chatActions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addChatAction(Entry<String, Action> chatAction) {
|
||||
public void addChatAction(Entry<String, IAction> chatAction) {
|
||||
chatActions.put(chatAction.getKey(), chatAction.getValue());
|
||||
}
|
||||
|
||||
public void setChatActions(final Map<String, Action> chatActions) {
|
||||
public void setChatActions(final Map<String, IAction> chatActions) {
|
||||
this.chatActions = chatActions;
|
||||
}
|
||||
|
||||
public Map<String, Action> getCommandActions() {
|
||||
public Map<String, IAction> getCommandActions() {
|
||||
return commandActions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCommandAction(Entry<String, Action> commandAction) {
|
||||
public void addCommandAction(Entry<String, IAction> commandAction) {
|
||||
commandActions.put(commandAction.getKey(), commandAction.getValue());
|
||||
}
|
||||
|
||||
public void setCommandActions(final Map<String, Action> commandActions) {
|
||||
public void setCommandActions(final Map<String, IAction> commandActions) {
|
||||
this.commandActions = commandActions;
|
||||
}
|
||||
|
||||
public Action getDisconnectAction() {
|
||||
public IAction getDisconnectAction() {
|
||||
return disconnectAction;
|
||||
}
|
||||
|
||||
public void setDisconnectAction(final Action disconnectAction) {
|
||||
public void setDisconnectAction(final IAction disconnectAction) {
|
||||
this.disconnectAction = disconnectAction;
|
||||
}
|
||||
|
||||
public Condition getCondition() {
|
||||
public ICondition getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public void setCondition(final Condition condition) {
|
||||
public void setCondition(final ICondition condition) {
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
@ -694,11 +693,11 @@ public class BukkitStage implements Stage {
|
||||
this.objectiveOverrides = objectiveOverrides;
|
||||
}
|
||||
|
||||
public LinkedList<CustomObjective> getCustomObjectives() {
|
||||
public LinkedList<ICustomObjective> getCustomObjectives() {
|
||||
return customObjectives;
|
||||
}
|
||||
|
||||
public boolean addCustomObjectives(final CustomObjective customObjective) {
|
||||
public boolean addCustomObjectives(final ICustomObjective customObjective) {
|
||||
return customObjectives.add(customObjective);
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
package me.blackvein.quests.storage;
|
||||
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.storage.implementation.StorageImplementation;
|
||||
|
||||
@ -85,11 +85,11 @@ public class Storage {
|
||||
}
|
||||
}
|
||||
|
||||
public CompletableFuture<Quester> loadQuester(final UUID uniqueId) {
|
||||
public CompletableFuture<IQuester> loadQuester(final UUID uniqueId) {
|
||||
return makeFuture(() -> implementation.loadQuester(uniqueId));
|
||||
}
|
||||
|
||||
public CompletableFuture<Void> saveQuester(final Quester quester) {
|
||||
public CompletableFuture<Void> saveQuester(final IQuester quester) {
|
||||
return makeFuture(() -> {
|
||||
try {
|
||||
implementation.saveQuester(quester);
|
||||
@ -102,7 +102,7 @@ public class Storage {
|
||||
public CompletableFuture<Void> saveOfflineQuesters() {
|
||||
return makeFuture(() -> {
|
||||
try {
|
||||
for (Quester quester : plugin.getOfflineQuesters()) {
|
||||
for (IQuester quester : plugin.getOfflineQuesters()) {
|
||||
implementation.saveQuester(quester);
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
package me.blackvein.quests.storage.implementation;
|
||||
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.Quests;
|
||||
|
||||
import java.util.Collection;
|
||||
@ -27,9 +27,9 @@ public interface StorageImplementation {
|
||||
|
||||
void close();
|
||||
|
||||
Quester loadQuester(UUID uniqueId) throws Exception;
|
||||
IQuester loadQuester(UUID uniqueId) throws Exception;
|
||||
|
||||
void saveQuester(Quester quester) throws Exception;
|
||||
void saveQuester(IQuester quester) throws Exception;
|
||||
|
||||
void deleteQuester(UUID uniqueId) throws Exception;
|
||||
|
||||
|
@ -12,11 +12,11 @@
|
||||
|
||||
package me.blackvein.quests.storage.implementation.file;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.Stage;
|
||||
import me.blackvein.quests.player.BukkitQuester;
|
||||
import me.blackvein.quests.quests.Stage;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.storage.implementation.StorageImplementation;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
@ -66,13 +66,13 @@ public class SeparatedYamlStorage implements StorageImplementation {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public Quester loadQuester(final UUID uniqueId) throws Exception {
|
||||
public IQuester loadQuester(final UUID uniqueId) throws Exception {
|
||||
final FileConfiguration data = new YamlConfiguration();
|
||||
Quester quester = plugin.getQuester(uniqueId);
|
||||
IQuester quester = plugin.getQuester(uniqueId);
|
||||
if (quester != null) {
|
||||
quester.hardClear();
|
||||
} else {
|
||||
quester = new BukkitQuester(plugin, uniqueId);
|
||||
quester = new Quester(plugin, uniqueId);
|
||||
}
|
||||
try {
|
||||
final File dataFile = getDataFile(quester);
|
||||
@ -88,7 +88,7 @@ public class SeparatedYamlStorage implements StorageImplementation {
|
||||
if (data.contains("completedRedoableQuests")) {
|
||||
final List<String> questIds = data.getStringList("completedRedoableQuests");
|
||||
final List<Long> questTimes = data.getLongList("completedQuestTimes");
|
||||
final ConcurrentHashMap<Quest, Long> completedTimes = quester.getCompletedTimes();
|
||||
final ConcurrentHashMap<IQuest, Long> completedTimes = quester.getCompletedTimes();
|
||||
for (int i = 0; i < questIds.size(); i++) {
|
||||
if (plugin.getQuestById(questIds.get(i)) != null) {
|
||||
completedTimes.put(plugin.getQuestById(questIds.get(i)), questTimes.get(i));
|
||||
@ -102,7 +102,7 @@ public class SeparatedYamlStorage implements StorageImplementation {
|
||||
if (data.contains("amountsCompletedQuests")) {
|
||||
final List<String> questIds = data.getStringList("amountsCompletedQuests");
|
||||
final List<Integer> questAmounts = data.getIntegerList("amountsCompleted");
|
||||
final ConcurrentHashMap<Quest, Integer> amountsCompleted = quester.getAmountsCompleted();
|
||||
final ConcurrentHashMap<IQuest, Integer> amountsCompleted = quester.getAmountsCompleted();
|
||||
for (int i = 0; i < questIds.size(); i++) {
|
||||
if (plugin.getQuestById(questIds.get(i)) != null) {
|
||||
amountsCompleted.put(plugin.getQuestById(questIds.get(i)), questAmounts.get(i));
|
||||
@ -115,10 +115,10 @@ public class SeparatedYamlStorage implements StorageImplementation {
|
||||
}
|
||||
quester.setLastKnownName(data.getString("lastKnownName"));
|
||||
quester.setQuestPoints(data.getInt("quest-points"));
|
||||
final ConcurrentSkipListSet<Quest> completedQuests = quester.getCompletedQuests();
|
||||
final ConcurrentSkipListSet<IQuest> completedQuests = quester.getCompletedQuests();
|
||||
if (data.isList("completed-Quests")) {
|
||||
for (final String s : data.getStringList("completed-Quests")) {
|
||||
for (final Quest q : plugin.getLoadedQuests()) {
|
||||
for (final IQuest q : plugin.getLoadedQuests()) {
|
||||
if (q.getId().equals(s)) {
|
||||
if (!quester.getCompletedQuests().contains(q)) {
|
||||
completedQuests.add(q);
|
||||
@ -139,7 +139,7 @@ public class SeparatedYamlStorage implements StorageImplementation {
|
||||
final List<String> questIds = data.getStringList("currentQuests");
|
||||
final List<Integer> questStages = data.getIntegerList("currentStages");
|
||||
final int maxSize = Math.min(questIds.size(), questStages.size());
|
||||
final ConcurrentHashMap<Quest, Integer> currentQuests = quester.getCurrentQuests();
|
||||
final ConcurrentHashMap<IQuest, Integer> currentQuests = quester.getCurrentQuests();
|
||||
for (int i = 0; i < maxSize; i++) {
|
||||
if (plugin.getQuestById(questIds.get(i)) != null) {
|
||||
currentQuests.put(plugin.getQuestById(questIds.get(i)), questStages.get(i));
|
||||
@ -155,7 +155,7 @@ public class SeparatedYamlStorage implements StorageImplementation {
|
||||
}
|
||||
for (final String key : dataSec.getKeys(false)) {
|
||||
final ConfigurationSection questSec = dataSec.getConfigurationSection(key);
|
||||
final Quest quest = plugin.getQuestById(key) != null ? plugin.getQuestById(key) : plugin.getQuest(key);
|
||||
final IQuest quest = plugin.getQuestById(key) != null ? plugin.getQuestById(key) : plugin.getQuest(key);
|
||||
if (quest == null || !quester.getCurrentQuests().containsKey(quest)) {
|
||||
continue;
|
||||
}
|
||||
@ -377,7 +377,7 @@ public class SeparatedYamlStorage implements StorageImplementation {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveQuester(final Quester quester) throws Exception {
|
||||
public void saveQuester(final IQuester quester) throws Exception {
|
||||
final FileConfiguration data = quester.getBaseData();
|
||||
try {
|
||||
data.save(new File(directoryPath + File.separator + quester.getUUID() + ".yml"));
|
||||
@ -394,11 +394,11 @@ public class SeparatedYamlStorage implements StorageImplementation {
|
||||
|
||||
@Override
|
||||
public String getQuesterLastKnownName(final UUID uniqueId) throws Exception {
|
||||
Quester quester = plugin.getQuester(uniqueId);
|
||||
IQuester quester = plugin.getQuester(uniqueId);
|
||||
if (quester != null) {
|
||||
quester.hardClear();
|
||||
} else {
|
||||
quester = new BukkitQuester(plugin, uniqueId);
|
||||
quester = new Quester(plugin, uniqueId);
|
||||
}
|
||||
return quester.getLastKnownName();
|
||||
}
|
||||
@ -435,7 +435,7 @@ public class SeparatedYamlStorage implements StorageImplementation {
|
||||
*
|
||||
* @return file if exists, otherwise null
|
||||
*/
|
||||
public File getDataFile(final Quester quester) {
|
||||
public File getDataFile(final IQuester quester) {
|
||||
File dataFile = new File(plugin.getDataFolder(), "data" + File.separator + quester.getUUID().toString() + ".yml");
|
||||
if (!dataFile.exists()) {
|
||||
final OfflinePlayer p = quester.getOfflinePlayer();
|
||||
|
@ -12,9 +12,9 @@
|
||||
|
||||
package me.blackvein.quests.storage.implementation.sql;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.QuestData;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.storage.implementation.StorageImplementation;
|
||||
import me.blackvein.quests.storage.implementation.sql.connection.ConnectionFactory;
|
||||
@ -221,8 +221,8 @@ public class SqlStorage implements StorageImplementation {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Quester loadQuester(final UUID uniqueId) throws Exception {
|
||||
final Quester quester = plugin.getQuester(uniqueId);
|
||||
public IQuester loadQuester(final UUID uniqueId) throws Exception {
|
||||
final IQuester quester = plugin.getQuester(uniqueId);
|
||||
if (quester == null) {
|
||||
return null;
|
||||
}
|
||||
@ -248,21 +248,21 @@ public class SqlStorage implements StorageImplementation {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveQuester(final Quester quester) throws Exception {
|
||||
public void saveQuester(final IQuester quester) throws Exception {
|
||||
final UUID uniqueId = quester.getUUID();
|
||||
final String lastKnownName = quester.getLastKnownName();
|
||||
final String oldLastKnownName = getQuesterLastKnownName(uniqueId);
|
||||
final Set<String> currentQuests = quester.getCurrentQuests().keySet().stream().map(Quest::getId).collect(Collectors.toSet());
|
||||
final Set<String> oldCurrentQuests = getQuesterCurrentQuests(uniqueId).keySet().stream().map(Quest::getId).collect(Collectors.toSet());
|
||||
final Set<String> currentQuests = quester.getCurrentQuests().keySet().stream().map(IQuest::getId).collect(Collectors.toSet());
|
||||
final Set<String> oldCurrentQuests = getQuesterCurrentQuests(uniqueId).keySet().stream().map(IQuest::getId).collect(Collectors.toSet());
|
||||
oldCurrentQuests.removeAll(currentQuests);
|
||||
final Set<String> completedQuests = quester.getCompletedQuests().stream().map(Quest::getId).collect(Collectors.toSet());
|
||||
final Set<String> oldCompletedQuests = getQuesterCompletedQuests(uniqueId).stream().map(Quest::getId).collect(Collectors.toSet());
|
||||
final Set<String> completedQuests = quester.getCompletedQuests().stream().map(IQuest::getId).collect(Collectors.toSet());
|
||||
final Set<String> oldCompletedQuests = getQuesterCompletedQuests(uniqueId).stream().map(IQuest::getId).collect(Collectors.toSet());
|
||||
oldCompletedQuests.removeAll(completedQuests);
|
||||
final Set<String> redoableQuests = quester.getCompletedTimes().keySet().stream().map(Quest::getId).collect(Collectors.toSet());
|
||||
final Set<String> oldRedoableQuests = getQuesterCompletedTimes(uniqueId).keySet().stream().map(Quest::getId).collect(Collectors.toSet());
|
||||
final Set<String> redoableQuests = quester.getCompletedTimes().keySet().stream().map(IQuest::getId).collect(Collectors.toSet());
|
||||
final Set<String> oldRedoableQuests = getQuesterCompletedTimes(uniqueId).keySet().stream().map(IQuest::getId).collect(Collectors.toSet());
|
||||
oldRedoableQuests.removeAll(redoableQuests);
|
||||
final Set<String> questData = quester.getQuestData().keySet().stream().map(Quest::getId).collect(Collectors.toSet());
|
||||
final Set<String> oldQuestData = getQuesterQuestData(uniqueId).keySet().stream().map(Quest::getId).collect(Collectors.toSet());
|
||||
final Set<String> questData = quester.getQuestData().keySet().stream().map(IQuest::getId).collect(Collectors.toSet());
|
||||
final Set<String> oldQuestData = getQuesterQuestData(uniqueId).keySet().stream().map(IQuest::getId).collect(Collectors.toSet());
|
||||
oldQuestData.removeAll(questData);
|
||||
|
||||
try (final Connection c = connectionFactory.getConnection()) {
|
||||
@ -290,7 +290,7 @@ public class SqlStorage implements StorageImplementation {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (final Entry<Quest, Integer> entry : quester.getCurrentQuests().entrySet()) {
|
||||
for (final Entry<IQuest, Integer> entry : quester.getCurrentQuests().entrySet()) {
|
||||
try (final PreparedStatement ps = c.prepareStatement(statementProcessor.apply(PLAYER_CURRENT_QUESTS_INSERT))) {
|
||||
ps.setString(1, uniqueId.toString());
|
||||
ps.setString(2, entry.getKey().getId());
|
||||
@ -309,7 +309,7 @@ public class SqlStorage implements StorageImplementation {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (final Quest quest : quester.getCompletedQuests()) {
|
||||
for (final IQuest quest : quester.getCompletedQuests()) {
|
||||
try (final PreparedStatement ps = c.prepareStatement(statementProcessor.apply(PLAYER_COMPLETED_QUESTS_INSERT))) {
|
||||
ps.setString(1, uniqueId.toString());
|
||||
ps.setString(2, quest.getId());
|
||||
@ -327,7 +327,7 @@ public class SqlStorage implements StorageImplementation {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (final Entry<Quest, Long> entry : quester.getCompletedTimes().entrySet()) {
|
||||
for (final Entry<IQuest, Long> entry : quester.getCompletedTimes().entrySet()) {
|
||||
final int amount = quester.getAmountsCompleted().get(entry.getKey());
|
||||
try (final PreparedStatement ps = c.prepareStatement(statementProcessor.apply(PLAYER_REDOABLE_QUESTS_INSERT))) {
|
||||
ps.setString(1, uniqueId.toString());
|
||||
@ -348,7 +348,7 @@ public class SqlStorage implements StorageImplementation {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (final Entry<Quest, QuestData> entry : quester.getQuestData().entrySet()) {
|
||||
for (final Entry<IQuest, QuestData> entry : quester.getQuestData().entrySet()) {
|
||||
try (final PreparedStatement ps = c.prepareStatement(statementProcessor.apply(PLAYER_QUEST_DATA_INSERT))) {
|
||||
ps.setString(1, uniqueId.toString());
|
||||
ps.setString(2, entry.getKey().getId());
|
||||
@ -424,14 +424,14 @@ public class SqlStorage implements StorageImplementation {
|
||||
return null;
|
||||
}
|
||||
|
||||
public ConcurrentHashMap<Quest, Integer> getQuesterCurrentQuests(final UUID uniqueId) throws Exception {
|
||||
final ConcurrentHashMap<Quest, Integer> currentQuests = new ConcurrentHashMap<>();
|
||||
public ConcurrentHashMap<IQuest, Integer> getQuesterCurrentQuests(final UUID uniqueId) throws Exception {
|
||||
final ConcurrentHashMap<IQuest, Integer> currentQuests = new ConcurrentHashMap<>();
|
||||
try (final Connection c = connectionFactory.getConnection()) {
|
||||
try (final PreparedStatement ps = c.prepareStatement(statementProcessor.apply(PLAYER_CURRENT_QUESTS_SELECT_BY_UUID))) {
|
||||
ps.setString(1, uniqueId.toString());
|
||||
try (final ResultSet rs = ps.executeQuery()) {
|
||||
while (rs.next()) {
|
||||
final Quest quest = plugin.getQuestById(rs.getString("questid"));
|
||||
final IQuest quest = plugin.getQuestById(rs.getString("questid"));
|
||||
if (quest != null) {
|
||||
currentQuests.put(quest, rs.getInt("stageNum"));
|
||||
}
|
||||
@ -442,15 +442,15 @@ public class SqlStorage implements StorageImplementation {
|
||||
return currentQuests;
|
||||
}
|
||||
|
||||
public ConcurrentHashMap<Quest, QuestData> getQuesterQuestData(final UUID uniqueId) throws Exception {
|
||||
final Quester quester = plugin.getQuester(uniqueId);
|
||||
final ConcurrentHashMap<Quest, QuestData> questData = new ConcurrentHashMap<>();
|
||||
public ConcurrentHashMap<IQuest, QuestData> getQuesterQuestData(final UUID uniqueId) throws Exception {
|
||||
final IQuester quester = plugin.getQuester(uniqueId);
|
||||
final ConcurrentHashMap<IQuest, QuestData> questData = new ConcurrentHashMap<>();
|
||||
try (final Connection c = connectionFactory.getConnection()) {
|
||||
try (final PreparedStatement ps = c.prepareStatement(statementProcessor.apply(PLAYER_QUEST_DATA_SELECT_BY_UUID))) {
|
||||
ps.setString(1, uniqueId.toString());
|
||||
try (final ResultSet rs = ps.executeQuery()) {
|
||||
while (rs.next()) {
|
||||
final Quest quest = plugin.getQuestById(rs.getString("quest_id"));
|
||||
final IQuest quest = plugin.getQuestById(rs.getString("quest_id"));
|
||||
final QuestData data = new QuestData(quester);
|
||||
if (quest != null && quester.getCurrentStage(quest) != null) {
|
||||
data.blocksBroken.addAll(deserializeItemStackProgress(rs.getString("blocks_broken"),
|
||||
@ -497,14 +497,14 @@ public class SqlStorage implements StorageImplementation {
|
||||
return questData;
|
||||
}
|
||||
|
||||
public ConcurrentSkipListSet<Quest> getQuesterCompletedQuests(final UUID uniqueId) throws Exception {
|
||||
final ConcurrentSkipListSet<Quest> completedQuests = new ConcurrentSkipListSet<>();
|
||||
public ConcurrentSkipListSet<IQuest> getQuesterCompletedQuests(final UUID uniqueId) throws Exception {
|
||||
final ConcurrentSkipListSet<IQuest> completedQuests = new ConcurrentSkipListSet<>();
|
||||
try (final Connection c = connectionFactory.getConnection()) {
|
||||
try (final PreparedStatement ps = c.prepareStatement(statementProcessor.apply(PLAYER_COMPLETED_QUESTS_SELECT_BY_UUID))) {
|
||||
ps.setString(1, uniqueId.toString());
|
||||
try (final ResultSet rs = ps.executeQuery()) {
|
||||
while (rs.next()) {
|
||||
final Quest quest = plugin.getQuestById(rs.getString("questid"));
|
||||
final IQuest quest = plugin.getQuestById(rs.getString("questid"));
|
||||
if (quest != null) {
|
||||
completedQuests.add(quest);
|
||||
}
|
||||
@ -515,14 +515,14 @@ public class SqlStorage implements StorageImplementation {
|
||||
return completedQuests;
|
||||
}
|
||||
|
||||
public ConcurrentHashMap<Quest, Long> getQuesterCompletedTimes(final UUID uniqueId) throws Exception {
|
||||
final ConcurrentHashMap<Quest, Long> completedTimes = new ConcurrentHashMap<>();
|
||||
public ConcurrentHashMap<IQuest, Long> getQuesterCompletedTimes(final UUID uniqueId) throws Exception {
|
||||
final ConcurrentHashMap<IQuest, Long> completedTimes = new ConcurrentHashMap<>();
|
||||
try (final Connection c = connectionFactory.getConnection()) {
|
||||
try (final PreparedStatement ps = c.prepareStatement(statementProcessor.apply(PLAYER_REDOABLE_QUESTS_SELECT_BY_UUID))) {
|
||||
ps.setString(1, uniqueId.toString());
|
||||
try (final ResultSet rs = ps.executeQuery()) {
|
||||
while (rs.next()) {
|
||||
final Quest quest = plugin.getQuestById(rs.getString("questid"));
|
||||
final IQuest quest = plugin.getQuestById(rs.getString("questid"));
|
||||
if (quest != null) {
|
||||
completedTimes.put(quest, rs.getLong("lasttime"));
|
||||
}
|
||||
@ -533,14 +533,14 @@ public class SqlStorage implements StorageImplementation {
|
||||
return completedTimes;
|
||||
}
|
||||
|
||||
public ConcurrentHashMap<Quest, Integer> getQuesterAmountsCompleted(final UUID uniqueId) throws Exception {
|
||||
final ConcurrentHashMap<Quest, Integer> amountsCompleted = new ConcurrentHashMap<>();
|
||||
public ConcurrentHashMap<IQuest, Integer> getQuesterAmountsCompleted(final UUID uniqueId) throws Exception {
|
||||
final ConcurrentHashMap<IQuest, Integer> amountsCompleted = new ConcurrentHashMap<>();
|
||||
try (final Connection c = connectionFactory.getConnection()) {
|
||||
try (final PreparedStatement ps = c.prepareStatement(statementProcessor.apply(PLAYER_REDOABLE_QUESTS_SELECT_BY_UUID))) {
|
||||
ps.setString(1, uniqueId.toString());
|
||||
try (final ResultSet rs = ps.executeQuery()) {
|
||||
while (rs.next()) {
|
||||
final Quest quest = plugin.getQuestById(rs.getString("questid"));
|
||||
final IQuest quest = plugin.getQuestById(rs.getString("questid"));
|
||||
if (quest != null) {
|
||||
amountsCompleted.put(quest, rs.getInt("amount"));
|
||||
}
|
||||
|
@ -12,20 +12,20 @@
|
||||
|
||||
package me.blackvein.quests.tasks;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
public class ActionTimer extends BukkitRunnable {
|
||||
|
||||
private final Quester quester;
|
||||
private final Quest quest;
|
||||
private final IQuester quester;
|
||||
private final IQuest quest;
|
||||
private final int time;
|
||||
private final boolean last;
|
||||
|
||||
public ActionTimer(final Quester quester, final Quest quest, final int time, final boolean last) {
|
||||
public ActionTimer(final IQuester quester, final IQuest quest, final int time, final boolean last) {
|
||||
this.quester = quester;
|
||||
this.quest = quest;
|
||||
this.time = time;
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
package me.blackvein.quests.tasks;
|
||||
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.particle.ParticleProvider;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
@ -33,7 +33,7 @@ public class NpcEffectThread implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
for (final Player player : plugin.getServer().getOnlinePlayers()) {
|
||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
final IQuester quester = plugin.getQuester(player.getUniqueId());
|
||||
final List<Entity> nearby = player.getNearbyEntities(32.0, 32.0, 32.0);
|
||||
if (!nearby.isEmpty()) {
|
||||
for (final Entity e : nearby) {
|
||||
|
@ -12,17 +12,17 @@
|
||||
|
||||
package me.blackvein.quests.tasks;
|
||||
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Quester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.Quests;
|
||||
|
||||
public class StageTimer implements Runnable {
|
||||
|
||||
private final Quester quester;
|
||||
private final IQuester quester;
|
||||
private final Quests plugin;
|
||||
private final Quest quest;
|
||||
private final IQuest quest;
|
||||
|
||||
public StageTimer(final Quests plugin, final Quester quester, final Quest quest) {
|
||||
public StageTimer(final Quests plugin, final IQuester quester, final IQuest quest) {
|
||||
this.quester = quester;
|
||||
this.quest = quest;
|
||||
this.plugin = plugin;
|
||||
|
@ -12,8 +12,8 @@
|
||||
|
||||
package me.blackvein.quests.util;
|
||||
|
||||
import me.blackvein.quests.dependencies.BukkitDependencies;
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.Dependencies;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.clip.placeholderapi.PlaceholderAPI;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -100,7 +100,7 @@ public class ConfigUtil {
|
||||
+ loc.getZ();
|
||||
}
|
||||
|
||||
public static String[] parseStringWithPossibleLineBreaks(final String s, final Quest quest, final Player player) {
|
||||
public static String[] parseStringWithPossibleLineBreaks(final String s, final IQuest quest, final Player player) {
|
||||
String parsed = parseString(s);
|
||||
if (parsed.contains("<npc>")) {
|
||||
if (quest.getNpcStart() != null) {
|
||||
@ -109,13 +109,13 @@ public class ConfigUtil {
|
||||
Bukkit.getLogger().warning(quest.getName() + " quest uses <npc> tag but doesn't have an NPC start set");
|
||||
}
|
||||
}
|
||||
if (BukkitDependencies.placeholder != null && player != null) {
|
||||
if (Dependencies.placeholder != null && player != null) {
|
||||
parsed = PlaceholderAPI.setPlaceholders(player, parsed);
|
||||
}
|
||||
return parsed.split("\n");
|
||||
}
|
||||
|
||||
public static String[] parseStringWithPossibleLineBreaks(final String s, final Quest quest) {
|
||||
public static String[] parseStringWithPossibleLineBreaks(final String s, final IQuest quest) {
|
||||
String parsed = parseString(s);
|
||||
if (parsed.contains("<npc>")) {
|
||||
if (quest.getNpcStart() != null) {
|
||||
@ -135,7 +135,7 @@ public class ConfigUtil {
|
||||
return parsed.split("\n");
|
||||
}
|
||||
|
||||
public static String parseString(final String s, final Quest quest) {
|
||||
public static String parseString(final String s, final IQuest quest) {
|
||||
String parsed = parseString(s);
|
||||
if (parsed.contains("<npc>")) {
|
||||
if (quest.getNpcStart() != null) {
|
||||
@ -147,9 +147,9 @@ public class ConfigUtil {
|
||||
return parsed;
|
||||
}
|
||||
|
||||
public static String parseString(final String s, final Quest quest, final Player player) {
|
||||
public static String parseString(final String s, final IQuest quest, final Player player) {
|
||||
String parsed = parseString(s, quest);
|
||||
if (BukkitDependencies.placeholder != null && player != null) {
|
||||
if (Dependencies.placeholder != null && player != null) {
|
||||
parsed = PlaceholderAPI.setPlaceholders(player, parsed);
|
||||
}
|
||||
return parsed;
|
||||
|
@ -141,20 +141,20 @@ stageEditorShearSheep: "Shear sheep"
|
||||
stageEditorKillPlayers: "Kill Players"
|
||||
stageEditorPlayers: "players"
|
||||
stageEditorEvents: "Actions"
|
||||
stageEditorEventCleared: "Action cleared."
|
||||
stageEditorEventCleared: "IAction cleared."
|
||||
stageEditorStageEvents: "Stage Actions"
|
||||
stageEditorStartEvent: "Start Action"
|
||||
stageEditorFinishEvent: "Finish Action"
|
||||
stageEditorFailEvent: "Fail Action"
|
||||
stageEditorChatEvents: "Chat Action"
|
||||
stageEditorStartEvent: "Start IAction"
|
||||
stageEditorFinishEvent: "Finish IAction"
|
||||
stageEditorFailEvent: "Fail IAction"
|
||||
stageEditorChatEvents: "Chat IAction"
|
||||
stageEditorChatTrigger: "Chat Trigger"
|
||||
stageEditorCommandEvents: "Command Action"
|
||||
stageEditorCommandEvents: "Command IAction"
|
||||
stageEditorCommandTrigger: "Command Trigger"
|
||||
stageEditorTriggeredBy: "Triggered by"
|
||||
stageEditorDeathEvent: "Death Action"
|
||||
stageEditorDisconnectEvent: "Disconnect Action"
|
||||
stageEditorDeathEvent: "Death IAction"
|
||||
stageEditorDisconnectEvent: "Disconnect IAction"
|
||||
stageEditorConditions: "Conditions"
|
||||
stageEditorConditionCleared: "Condition cleared."
|
||||
stageEditorConditionCleared: "ICondition cleared."
|
||||
stageEditorDelayMessage: "Delay Message"
|
||||
stageEditorDenizenScript: "Denizen Script"
|
||||
stageEditorStartMessage: "Start Message"
|
||||
@ -238,7 +238,7 @@ stageEditorInvalidMob: "ain't a valid mob name!"
|
||||
stageEditorInvalidItemName: "ain't a valid item name!"
|
||||
stageEditorInvalidDye: "ain't a valid dye color!"
|
||||
stageEditorInvalidEvent: "ain't a valid action name!"
|
||||
stageEditorDuplicateEvent: "Action be already in th' list!"
|
||||
stageEditorDuplicateEvent: "IAction be already in th' list!"
|
||||
stageEditorInvalidCondition: "ain't a valid condition name!"
|
||||
stageEditorInvalidScript: "Denizen script nah found!"
|
||||
stageEditorNoCitizens: "Citizens ain't installed!"
|
||||
@ -262,30 +262,30 @@ stageEditorEnchantments: "Enchantments"
|
||||
stageEditorNPCNote: 'Note: Ye may specify th'' name o'' th'' NPC wit'' <npc>'
|
||||
stageEditorOptional: "Optional"
|
||||
stageEditorColors: "Sheep Colors"
|
||||
eventEditorCreate: "Create new Action"
|
||||
eventEditorEdit: "Edit an Action"
|
||||
eventEditorDelete: "Delete an Action"
|
||||
eventEditorCreate: "Create new IAction"
|
||||
eventEditorEdit: "Edit an IAction"
|
||||
eventEditorDelete: "Delete an IAction"
|
||||
eventEditorNoneToEdit: "No Actions currently exist t' be edited!"
|
||||
eventEditorNoneToDelete: "No Actions currently exist t' be deleted!"
|
||||
eventEditorNotFound: "Action nah found!"
|
||||
eventEditorExists: "Action already exists!"
|
||||
eventEditorDeleted: "Action deleted, Quests 'n Actions reloaded."
|
||||
eventEditorSaved: "Action saved, Quests 'n Actions reloaded."
|
||||
eventEditorEnterEventName: "Enter an Action name, <cancel>"
|
||||
eventEditorModifiedNote: 'Note: Ye ''ave modified an Action that th'' followin'' Quests use:'
|
||||
eventEditorForcedToQuit: "If ye save th' Action, anyone who be actively doin' any o' these Quests will be forced t' abandon ship."
|
||||
eventEditorEventInUse: "Th' followin' Quests use th' Action"
|
||||
eventEditorNotFound: "IAction nah found!"
|
||||
eventEditorExists: "IAction already exists!"
|
||||
eventEditorDeleted: "IAction deleted, Quests 'n Actions reloaded."
|
||||
eventEditorSaved: "IAction saved, Quests 'n Actions reloaded."
|
||||
eventEditorEnterEventName: "Enter an IAction name, <cancel>"
|
||||
eventEditorModifiedNote: 'Note: Ye ''ave modified an IAction that th'' followin'' Quests use:'
|
||||
eventEditorForcedToQuit: "If ye save th' IAction, anyone who be actively doin' any o' these Quests will be forced t' abandon ship."
|
||||
eventEditorEventInUse: "Th' followin' Quests use th' IAction"
|
||||
eventEditorMustModifyQuests: "Ye must modify these Quests first!"
|
||||
eventEditorNotANumberList: "Input was nah a list o' numbers!"
|
||||
eventEditorGiveItemsTitle: "- Give Items -"
|
||||
eventEditorEffectsTitle: "- Effects -"
|
||||
eventEditorStormTitle: "- Action Storm -"
|
||||
eventEditorThunderTitle: "- Action Thunder -"
|
||||
eventEditorMobSpawnsTitle: "- Action Mob Spawns -"
|
||||
eventEditorStormTitle: "- IAction Storm -"
|
||||
eventEditorThunderTitle: "- IAction Thunder -"
|
||||
eventEditorMobSpawnsTitle: "- IAction Mob Spawns -"
|
||||
eventEditorMobsTitle: "- Mobs -"
|
||||
eventEditorAddMobTypesTitle: "- Add Mob -"
|
||||
eventEditorPotionEffectsTitle: "- Action Potion Effects -"
|
||||
eventEditorPotionTypesTitle: "- Action Potion Types -"
|
||||
eventEditorPotionEffectsTitle: "- IAction Potion Effects -"
|
||||
eventEditorPotionTypesTitle: "- IAction Potion Types -"
|
||||
eventEditorWorldsTitle: "- Worlds -"
|
||||
eventEditorSetName: "Set name"
|
||||
eventEditorPlayer: "Player"
|
||||
@ -310,15 +310,15 @@ eventEditorSetTimer: "Set time t' fail quest"
|
||||
eventEditorCancelTimer: "Cancel th' quest timer"
|
||||
eventEditorSetTeleport: "Set player teleport spot"
|
||||
eventEditorSetCommands: "Set commands t' execute"
|
||||
eventEditorItems: "Action Items"
|
||||
eventEditorItems: "IAction Items"
|
||||
eventEditorSetItems: "Give items"
|
||||
eventEditorItemsCleared: "Action items cleared."
|
||||
eventEditorItemsCleared: "IAction items cleared."
|
||||
eventEditorSetItemNames: "Set item names"
|
||||
eventEditorSetItemAmounts: "Set item amounts"
|
||||
eventEditorNoNames: "No names set"
|
||||
eventEditorMustSetNames: "Ye must set item names first!"
|
||||
eventEditorInvalidName: "ain't a valid item name!"
|
||||
eventEditorStorm: "Action Storm"
|
||||
eventEditorStorm: "IAction Storm"
|
||||
eventEditorSetWorld: "Set world"
|
||||
eventEditorSetDuration: "Set duration"
|
||||
eventEditorSetWorldFirst: "Ye must set a world first!"
|
||||
@ -327,18 +327,18 @@ eventEditorMustSetStormDuration: "Ye must set a storm duration!"
|
||||
eventEditorStormCleared: "Storm data cleared."
|
||||
eventEditorEnterStormWorld: "Enter a world name fer th' storm t' occur in, <cancel>"
|
||||
eventEditorEnterDuration: "Enter duration (in seconds)"
|
||||
eventEditorThunder: "Action Thunder"
|
||||
eventEditorThunder: "IAction Thunder"
|
||||
eventEditorMustSetThunderDuration: "Ye must set a thunder duration!"
|
||||
eventEditorThunderCleared: "Thunder data cleared."
|
||||
eventEditorEnterThunderWorld: "Enter a world name fer th' thunder t' occur in, <cancel>"
|
||||
eventEditorEffects: "Action Sound Effects"
|
||||
eventEditorEffects: "IAction Sound Effects"
|
||||
eventEditorAddEffect: "Add effect"
|
||||
eventEditorAddEffectLocation: "Add effect spot"
|
||||
eventEditorMustAddEffects: "Ye must add effects first!"
|
||||
eventEditorInvalidEffect: "ain't a valid effect name!"
|
||||
eventEditorEffectsCleared: "Action sound effects cleared."
|
||||
eventEditorEffectsCleared: "IAction sound effects cleared."
|
||||
eventEditorEffectLocationPrompt: "Right-jab on a block t' play an effect at, <add>, <cancel>"
|
||||
eventEditorMobSpawns: "Action Mob Spawns"
|
||||
eventEditorMobSpawns: "IAction Mob Spawns"
|
||||
eventEditorAddMobTypes: "Add mob"
|
||||
eventEditorMustSetMobTypesFirst: "Ye must set th' mob type first!"
|
||||
eventEditorSetMobAmounts: "Set mob amount"
|
||||
@ -360,7 +360,7 @@ eventEditorSetMobHelmet: "Set helmet"
|
||||
eventEditorSetMobHelmetDrop: "Set drop chance o' helmet"
|
||||
eventEditorSetMobSpawnAmount: "Set th' amount o' mobs t' spawn"
|
||||
eventEditorSetDropChance: "Set th' drop chance"
|
||||
eventEditorPotionEffects: "Action Potion Effects"
|
||||
eventEditorPotionEffects: "IAction Potion Effects"
|
||||
eventEditorSetPotionEffectTypes: "Set potion effect types"
|
||||
eventEditorMustSetPotionTypesFirst: "Ye must set potion effect types first!"
|
||||
eventEditorSetPotionDurations: "Set potion effect durations"
|
||||
@ -390,19 +390,19 @@ conditionEditorEdit: "Edit a condition"
|
||||
conditionEditorDelete: "Delete a condition"
|
||||
conditionEditorNoneToEdit: "No conditions currently exist t' be edited!"
|
||||
conditionEditorNoneToDelete: "No conditions currently exist t' be deleted!"
|
||||
conditionEditorNotFound: "Condition nah found!"
|
||||
conditionEditorExists: "Condition already exists!"
|
||||
conditionEditorNotFound: "ICondition nah found!"
|
||||
conditionEditorExists: "ICondition already exists!"
|
||||
conditionEditorInUse: "Th' followin' quests use th' condition"
|
||||
conditionEditorEnterName: "Enter Condition name, <cancel>"
|
||||
conditionEditorSaved: "Condition saved. Quest 'n condition data reloaded."
|
||||
conditionEditorDeleted: "Condition deleted. Quest 'n condition data reloaded."
|
||||
conditionEditorEnterName: "Enter ICondition name, <cancel>"
|
||||
conditionEditorSaved: "ICondition saved. Quest 'n condition data reloaded."
|
||||
conditionEditorDeleted: "ICondition deleted. Quest 'n condition data reloaded."
|
||||
conditionEditorModifiedNote: 'Note: Ye ''ave modified a condition that th'' followin'' quests use:'
|
||||
conditionEditorForcedToQuit: "If ye save th' condition, anyone who be actively doin' any o' these quests will be forced t' quit them."
|
||||
conditionEditorSetName: "Set name"
|
||||
conditionEditorEntity: "Entity"
|
||||
conditionEditorWorld: "World"
|
||||
conditionEditorCheckPlaceholder: "Check placeholder"
|
||||
conditionEditorConditionCleared: "Condition cleared."
|
||||
conditionEditorConditionCleared: "ICondition cleared."
|
||||
conditionEditorRideEntity: "Ride entity"
|
||||
conditionEditorRideNPC: "Ride NPC"
|
||||
conditionEditorEntitiesTitle: "- Entities -"
|
||||
@ -593,17 +593,17 @@ questDisplayHelp: "- Display this help"
|
||||
questNPCListTitle: "- Quests | <npc> -"
|
||||
questAdminHelpTitle: "- Questadmin -"
|
||||
questEditorTitle: "- Quest Editor -"
|
||||
eventEditorTitle: "- Action Editor - "
|
||||
conditionEditorTitle: "- Condition Editor -"
|
||||
eventEditorTitle: "- IAction Editor - "
|
||||
conditionEditorTitle: "- ICondition Editor -"
|
||||
questCreateTitle: "- Create Quest -"
|
||||
questEditTitle: "- Edit Quest -"
|
||||
questDeleteTitle: "- Delete Quest -"
|
||||
eventCreateTitle: "- Create Action -"
|
||||
eventEditTitle: "- Edit Action -"
|
||||
eventDeleteTitle: "- Delete Action -"
|
||||
conditionCreateTitle: "- Create Condition -"
|
||||
conditionEditTitle: "- Edit Condition -"
|
||||
conditionDeleteTitle: "- Delete Condition -"
|
||||
eventCreateTitle: "- Create IAction -"
|
||||
eventEditTitle: "- Edit IAction -"
|
||||
eventDeleteTitle: "- Delete IAction -"
|
||||
conditionCreateTitle: "- Create ICondition -"
|
||||
conditionEditTitle: "- Edit ICondition -"
|
||||
conditionDeleteTitle: "- Delete ICondition -"
|
||||
requirementsTitle: "- <quest> | Requirements -"
|
||||
rewardsTitle: "- <quest> | Rewards -"
|
||||
plannerTitle: "- <quest> | Planner -"
|
||||
@ -779,8 +779,8 @@ listsNotSameSize: "All required lists must 'ave th' same number o' entries!"
|
||||
listDuplicate: "List contains duplicates!"
|
||||
id: "ID"
|
||||
quest: "Quest"
|
||||
event: "Action"
|
||||
condition: "Condition"
|
||||
event: "IAction"
|
||||
condition: "ICondition"
|
||||
quests: "Quests"
|
||||
createdBy: "Pillaged by"
|
||||
continuedBy: "and ransacked by"
|
||||
@ -794,8 +794,8 @@ usage: "Usage"
|
||||
redoableEvery: "Redoable every <time>."
|
||||
requirements: "Requirements"
|
||||
requirementsItemFail: "Unable t' collect required item. Be it in yer off-hand?"
|
||||
conditionFailQuit: "Condition failed. Ye 'ave quit <quest>."
|
||||
conditionFailRetry: "Condition nah yet met fer this stage o' <quest>."
|
||||
conditionFailQuit: "ICondition failed. Ye 'ave quit <quest>."
|
||||
conditionFailRetry: "ICondition nah yet met fer this stage o' <quest>."
|
||||
optionSilkTouchFail: "Unable t' progress <quest> wit' th' Silk Touch enchantment."
|
||||
money: "Dubloons"
|
||||
with: "With"
|
||||
|
@ -141,20 +141,20 @@ stageEditorShearSheep: "Shear sheep"
|
||||
stageEditorKillPlayers: "Kill players"
|
||||
stageEditorPlayers: "players"
|
||||
stageEditorEvents: "Actions"
|
||||
stageEditorEventCleared: "Action cleared."
|
||||
stageEditorEventCleared: "IAction cleared."
|
||||
stageEditorStageEvents: "Stage Actions"
|
||||
stageEditorStartEvent: "Start Action"
|
||||
stageEditorFinishEvent: "Finish Action"
|
||||
stageEditorFailEvent: "Fail Action"
|
||||
stageEditorChatEvents: "Chat Action"
|
||||
stageEditorStartEvent: "Start IAction"
|
||||
stageEditorFinishEvent: "Finish IAction"
|
||||
stageEditorFailEvent: "Fail IAction"
|
||||
stageEditorChatEvents: "Chat IAction"
|
||||
stageEditorChatTrigger: "Chat Trigger"
|
||||
stageEditorCommandEvents: "Command Action"
|
||||
stageEditorCommandEvents: "Command IAction"
|
||||
stageEditorCommandTrigger: "Command Trigger"
|
||||
stageEditorTriggeredBy: "Triggered by"
|
||||
stageEditorDeathEvent: "Death Action"
|
||||
stageEditorDisconnectEvent: "Disconnect Action"
|
||||
stageEditorDeathEvent: "Death IAction"
|
||||
stageEditorDisconnectEvent: "Disconnect IAction"
|
||||
stageEditorConditions: "Conditions"
|
||||
stageEditorConditionCleared: "Condition cleared."
|
||||
stageEditorConditionCleared: "ICondition cleared."
|
||||
stageEditorDelayMessage: "Delay message"
|
||||
stageEditorDenizenScript: "Denizen script"
|
||||
stageEditorStartMessage: "Start message"
|
||||
@ -238,7 +238,7 @@ stageEditorInvalidMob: "is not a valid mob name!"
|
||||
stageEditorInvalidItemName: "is not a valid item name!"
|
||||
stageEditorInvalidDye: "is not a valid dye color!"
|
||||
stageEditorInvalidEvent: "is not a valid action name!"
|
||||
stageEditorDuplicateEvent: "Action is already in the list!"
|
||||
stageEditorDuplicateEvent: "IAction is already in the list!"
|
||||
stageEditorInvalidCondition: "is not a valid condition name!"
|
||||
stageEditorInvalidScript: "Denizen script not found!"
|
||||
stageEditorNoCitizens: "Citizens is not installed!"
|
||||
@ -267,11 +267,11 @@ eventEditorEdit: "Edit an action"
|
||||
eventEditorDelete: "Delete an action"
|
||||
eventEditorNoneToEdit: "No actions currently exist to be edited!"
|
||||
eventEditorNoneToDelete: "No actions currently exist to be deleted!"
|
||||
eventEditorNotFound: "Action not found!"
|
||||
eventEditorExists: "Action already exists!"
|
||||
eventEditorDeleted: "Action deleted. Quest and action data reloaded."
|
||||
eventEditorSaved: "Action saved. Quest and action data reloaded."
|
||||
eventEditorEnterEventName: "Enter Action name, <cancel>"
|
||||
eventEditorNotFound: "IAction not found!"
|
||||
eventEditorExists: "IAction already exists!"
|
||||
eventEditorDeleted: "IAction deleted. Quest and action data reloaded."
|
||||
eventEditorSaved: "IAction saved. Quest and action data reloaded."
|
||||
eventEditorEnterEventName: "Enter IAction name, <cancel>"
|
||||
eventEditorModifiedNote: 'Note: You have modified an action that the following quests use:'
|
||||
eventEditorForcedToQuit: "If you save the action, anyone who is actively doing any of these quests will be forced to quit them."
|
||||
eventEditorEventInUse: "The following quests use the action"
|
||||
@ -279,13 +279,13 @@ eventEditorMustModifyQuests: "You must modify these quests first!"
|
||||
eventEditorNotANumberList: "Input was not a list of numbers!"
|
||||
eventEditorGiveItemsTitle: "- Give Items -"
|
||||
eventEditorEffectsTitle: "- Sound Effects -"
|
||||
eventEditorStormTitle: "- Action Storm -"
|
||||
eventEditorThunderTitle: "- Action Thunder -"
|
||||
eventEditorMobSpawnsTitle: "- Action Mob Spawns -"
|
||||
eventEditorStormTitle: "- IAction Storm -"
|
||||
eventEditorThunderTitle: "- IAction Thunder -"
|
||||
eventEditorMobSpawnsTitle: "- IAction Mob Spawns -"
|
||||
eventEditorMobsTitle: "- Mobs -"
|
||||
eventEditorAddMobTypesTitle: "- Add Mob -"
|
||||
eventEditorPotionEffectsTitle: "- Action Potion Effects -"
|
||||
eventEditorPotionTypesTitle: "- Action Potion Types -"
|
||||
eventEditorPotionEffectsTitle: "- IAction Potion Effects -"
|
||||
eventEditorPotionTypesTitle: "- IAction Potion Types -"
|
||||
eventEditorWorldsTitle: "- Worlds -"
|
||||
eventEditorSetName: "Set name"
|
||||
eventEditorPlayer: "Player"
|
||||
@ -310,15 +310,15 @@ eventEditorSetTimer: "Set time to fail quest"
|
||||
eventEditorCancelTimer: "Cancel the quest timer"
|
||||
eventEditorSetTeleport: "Teleport to location"
|
||||
eventEditorSetCommands: "Execute commands"
|
||||
eventEditorItems: "Action Items"
|
||||
eventEditorItems: "IAction Items"
|
||||
eventEditorSetItems: "Give items"
|
||||
eventEditorItemsCleared: "Action items cleared."
|
||||
eventEditorItemsCleared: "IAction items cleared."
|
||||
eventEditorSetItemNames: "Set item names"
|
||||
eventEditorSetItemAmounts: "Set item amounts"
|
||||
eventEditorNoNames: "No names set"
|
||||
eventEditorMustSetNames: "You must set item names first!"
|
||||
eventEditorInvalidName: "is not a valid item name!"
|
||||
eventEditorStorm: "Action Storm"
|
||||
eventEditorStorm: "IAction Storm"
|
||||
eventEditorSetWorld: "Set world"
|
||||
eventEditorSetDuration: "Set duration"
|
||||
eventEditorSetWorldFirst: "You must set a world first!"
|
||||
@ -327,18 +327,18 @@ eventEditorMustSetStormDuration: "You must set a storm duration!"
|
||||
eventEditorStormCleared: "Storm data cleared."
|
||||
eventEditorEnterStormWorld: "Enter a world name for the storm to occur in, <cancel>"
|
||||
eventEditorEnterDuration: "Enter duration (in seconds)"
|
||||
eventEditorThunder: "Action Thunder"
|
||||
eventEditorThunder: "IAction Thunder"
|
||||
eventEditorMustSetThunderDuration: "You must set a thunder duration!"
|
||||
eventEditorThunderCleared: "Thunder data cleared."
|
||||
eventEditorEnterThunderWorld: "Enter a world name for the thunder to occur in, <cancel>"
|
||||
eventEditorEffects: "Action Sound Effects"
|
||||
eventEditorEffects: "IAction Sound Effects"
|
||||
eventEditorAddEffect: "Add sound effect"
|
||||
eventEditorAddEffectLocation: "Add sound effect location"
|
||||
eventEditorMustAddEffects: "You must add sound effects first!"
|
||||
eventEditorInvalidEffect: "is not a valid sound effect name!"
|
||||
eventEditorEffectsCleared: "Action sound effects cleared."
|
||||
eventEditorEffectsCleared: "IAction sound effects cleared."
|
||||
eventEditorEffectLocationPrompt: "Right-click on a block to play a sound effect at, <add>, <cancel>"
|
||||
eventEditorMobSpawns: "Action Mob Spawns"
|
||||
eventEditorMobSpawns: "IAction Mob Spawns"
|
||||
eventEditorAddMobTypes: "Add mob"
|
||||
eventEditorMustSetMobTypesFirst: "You must set the mob type first!"
|
||||
eventEditorSetMobAmounts: "Set mob amount"
|
||||
@ -360,7 +360,7 @@ eventEditorSetMobHelmet: "Set helmet"
|
||||
eventEditorSetMobHelmetDrop: "Set drop chance of helmet"
|
||||
eventEditorSetMobSpawnAmount: "Set the amount of mobs to spawn"
|
||||
eventEditorSetDropChance: "Set the drop chance"
|
||||
eventEditorPotionEffects: "Action Potion Effects"
|
||||
eventEditorPotionEffects: "IAction Potion Effects"
|
||||
eventEditorSetPotionEffectTypes: "Set potion effect types"
|
||||
eventEditorMustSetPotionTypesFirst: "You must set potion effect types first!"
|
||||
eventEditorSetPotionDurations: "Set potion effect durations"
|
||||
@ -390,19 +390,19 @@ conditionEditorEdit: "Edit a condition"
|
||||
conditionEditorDelete: "Delete a condition"
|
||||
conditionEditorNoneToEdit: "No conditions currently exist to be edited!"
|
||||
conditionEditorNoneToDelete: "No conditions currently exist to be deleted!"
|
||||
conditionEditorNotFound: "Condition not found!"
|
||||
conditionEditorExists: "Condition already exists!"
|
||||
conditionEditorNotFound: "ICondition not found!"
|
||||
conditionEditorExists: "ICondition already exists!"
|
||||
conditionEditorInUse: "The following quests use the condition"
|
||||
conditionEditorEnterName: "Enter Condition name, <cancel>"
|
||||
conditionEditorSaved: "Condition saved. Quest and condition data reloaded."
|
||||
conditionEditorDeleted: "Condition deleted. Quest and condition data reloaded."
|
||||
conditionEditorEnterName: "Enter ICondition name, <cancel>"
|
||||
conditionEditorSaved: "ICondition saved. Quest and condition data reloaded."
|
||||
conditionEditorDeleted: "ICondition deleted. Quest and condition data reloaded."
|
||||
conditionEditorModifiedNote: 'Note: You have modified a condition that the following quests use:'
|
||||
conditionEditorForcedToQuit: "If you save the condition, anyone who is actively doing any of these quests will be forced to quit them."
|
||||
conditionEditorSetName: "Set name"
|
||||
conditionEditorEntity: "Entity"
|
||||
conditionEditorWorld: "World"
|
||||
conditionEditorCheckPlaceholder: "Check placeholder"
|
||||
conditionEditorConditionCleared: "Condition cleared."
|
||||
conditionEditorConditionCleared: "ICondition cleared."
|
||||
conditionEditorRideEntity: "Ride entity"
|
||||
conditionEditorRideNPC: "Ride NPC"
|
||||
conditionEditorEntitiesTitle: "- Entities -"
|
||||
@ -593,17 +593,17 @@ questDisplayHelp: "- Display this help"
|
||||
questNPCListTitle: "- Quests | <npc> -"
|
||||
questAdminHelpTitle: "- Questadmin -"
|
||||
questEditorTitle: "- Quest Editor -"
|
||||
eventEditorTitle: "- Action Editor -"
|
||||
conditionEditorTitle: "- Condition Editor -"
|
||||
eventEditorTitle: "- IAction Editor -"
|
||||
conditionEditorTitle: "- ICondition Editor -"
|
||||
questCreateTitle: "- Create Quest -"
|
||||
questEditTitle: "- Edit Quest -"
|
||||
questDeleteTitle: "- Delete Quest -"
|
||||
eventCreateTitle: "- Create Action -"
|
||||
eventEditTitle: "- Edit Action -"
|
||||
eventDeleteTitle: "- Delete Action -"
|
||||
conditionCreateTitle: "- Create Condition -"
|
||||
conditionEditTitle: "- Edit Condition -"
|
||||
conditionDeleteTitle: "- Delete Condition -"
|
||||
eventCreateTitle: "- Create IAction -"
|
||||
eventEditTitle: "- Edit IAction -"
|
||||
eventDeleteTitle: "- Delete IAction -"
|
||||
conditionCreateTitle: "- Create ICondition -"
|
||||
conditionEditTitle: "- Edit ICondition -"
|
||||
conditionDeleteTitle: "- Delete ICondition -"
|
||||
requirementsTitle: "- <quest> | Requirements -"
|
||||
rewardsTitle: "- <quest> | Rewards -"
|
||||
plannerTitle: "- <quest> | Planner -"
|
||||
@ -779,8 +779,8 @@ listsNotSameSize: "All required lists must have the same number of entries!"
|
||||
listDuplicate: "List contains duplicates!"
|
||||
id: "ID"
|
||||
quest: "Quest"
|
||||
event: "Action"
|
||||
condition: "Condition"
|
||||
event: "IAction"
|
||||
condition: "ICondition"
|
||||
quests: "Quests"
|
||||
createdBy: "Created by"
|
||||
continuedBy: "and continued by"
|
||||
@ -794,8 +794,8 @@ usage: "Usage"
|
||||
redoableEvery: "Redoable every <time>."
|
||||
requirements: "Requirements"
|
||||
requirementsItemFail: "Unable to collect required item. Is it in your off-hand?"
|
||||
conditionFailQuit: "Condition failed. You have quit <quest>."
|
||||
conditionFailRetry: "Condition not yet met for this stage of <quest>."
|
||||
conditionFailQuit: "ICondition failed. You have quit <quest>."
|
||||
conditionFailRetry: "ICondition not yet met for this stage of <quest>."
|
||||
optionSilkTouchFail: "Unable to progress <quest> with the Silk Touch enchantment."
|
||||
money: "Money"
|
||||
with: "with"
|
||||
|
@ -141,11 +141,11 @@ stageEditorShearSheep: "Tondre des moutons"
|
||||
stageEditorKillPlayers: "Tuer des joueurs"
|
||||
stageEditorPlayers: "joueurs"
|
||||
stageEditorEvents: "Evénements"
|
||||
stageEditorEventCleared: "Action effacée."
|
||||
stageEditorEventCleared: "IAction effacée."
|
||||
stageEditorStageEvents: "Étape d'événements"
|
||||
stageEditorStartEvent: "Démarrage de l'événement"
|
||||
stageEditorFinishEvent: "Événement de fin"
|
||||
stageEditorFailEvent: "Action d'échec"
|
||||
stageEditorFailEvent: "IAction d'échec"
|
||||
stageEditorChatEvents: "Événements du chat"
|
||||
stageEditorChatTrigger: "Modifier un déclencheur"
|
||||
stageEditorCommandEvents: "Événements de Commande"
|
||||
@ -154,7 +154,7 @@ stageEditorTriggeredBy: "Déclenché par"
|
||||
stageEditorDeathEvent: "Événement de mort"
|
||||
stageEditorDisconnectEvent: "Événement de déconnexion"
|
||||
stageEditorConditions: "Conditions"
|
||||
stageEditorConditionCleared: "Condition effacée."
|
||||
stageEditorConditionCleared: "ICondition effacée."
|
||||
stageEditorDelayMessage: "Délai entre 2 messages"
|
||||
stageEditorDenizenScript: "Script Denizen"
|
||||
stageEditorStartMessage: "Message de début"
|
||||
@ -390,19 +390,19 @@ conditionEditorEdit: "Modifier une condition"
|
||||
conditionEditorDelete: "Supprimer une condition"
|
||||
conditionEditorNoneToEdit: "Aucune condition modifiable existe actuellement !"
|
||||
conditionEditorNoneToDelete: "Aucun condition qui peut être supprimée existe actuellement !"
|
||||
conditionEditorNotFound: "Condition non trouvée !"
|
||||
conditionEditorNotFound: "ICondition non trouvée !"
|
||||
conditionEditorExists: "La condition existe déjà !"
|
||||
conditionEditorInUse: "Les quêtes suivantes utilisent la condition"
|
||||
conditionEditorEnterName: "Entrez le nom de la condition, <cancel> pour le retour"
|
||||
conditionEditorSaved: "Condition sauvegardée. Données de quête et de condition rechargées."
|
||||
conditionEditorDeleted: "Condition supprimée. Données de quête et de condition rechargées."
|
||||
conditionEditorSaved: "ICondition sauvegardée. Données de quête et de condition rechargées."
|
||||
conditionEditorDeleted: "ICondition supprimée. Données de quête et de condition rechargées."
|
||||
conditionEditorModifiedNote: 'Remarque: vous avez modifié une condition utilisée par les quêtes suivantes :'
|
||||
conditionEditorForcedToQuit: "Si vous enregistrez la condition, toute personne effectuant activement l'une de ces quêtes sera obligée de l'abandonner."
|
||||
conditionEditorSetName: "Définir le nom"
|
||||
conditionEditorEntity: "Entité"
|
||||
conditionEditorWorld: "Monde"
|
||||
conditionEditorCheckPlaceholder: "Vérifier l'espace réservé"
|
||||
conditionEditorConditionCleared: "Condition effacée."
|
||||
conditionEditorConditionCleared: "ICondition effacée."
|
||||
conditionEditorRideEntity: "Entité de conduite"
|
||||
conditionEditorRideNPC: "Chevaucher un PNJ"
|
||||
conditionEditorEntitiesTitle: "- Entités -"
|
||||
@ -427,7 +427,7 @@ conditionEditorInvalidRegion: "n'est pas un nom de région valide!"
|
||||
conditionEditorPlaceholderTitle: "- PlaceholderAPI -"
|
||||
conditionEditorSetPlaceholderId: "Définir des identifiants d'espace réservé"
|
||||
conditionEditorSetPlaceholderVal: "Définir des valeurs d'espace réservé"
|
||||
conditionEditorPlaceholderCleared: "Condition d'espace réservé effacée."
|
||||
conditionEditorPlaceholderCleared: "ICondition d'espace réservé effacée."
|
||||
conditionEditorEnterPlaceholderId: "Entrez les identifiants d'espace réservé, <space>, <cancel>"
|
||||
conditionEditorEnterPlaceholderVal: "Entrez les valeurs d'espace réservé, <space>, <cancel>"
|
||||
reqSetMoney: "Définir la somme d'argent requise"
|
||||
@ -600,7 +600,7 @@ questEditTitle: "- Éditer une quête -"
|
||||
questDeleteTitle: "- Supprimer une quête -"
|
||||
eventCreateTitle: "- Créer une action -"
|
||||
eventEditTitle: "- Modifier l'action -"
|
||||
eventDeleteTitle: "- Action de suppression -"
|
||||
eventDeleteTitle: "- IAction de suppression -"
|
||||
conditionCreateTitle: "- Créer une condition -"
|
||||
conditionEditTitle: "- Modifier la condition -"
|
||||
conditionDeleteTitle: "- Supprimer la condition -"
|
||||
@ -780,7 +780,7 @@ listDuplicate: "La liste contient des doublons !"
|
||||
id: "ID"
|
||||
quest: "Quête"
|
||||
event: "Événement"
|
||||
condition: "Condition"
|
||||
condition: "ICondition"
|
||||
quests: "Quêtes"
|
||||
createdBy: "Créé par"
|
||||
continuedBy: "et continué par"
|
||||
@ -795,7 +795,7 @@ redoableEvery: "Recommençable tout les <time>."
|
||||
requirements: "Requis"
|
||||
requirementsItemFail: "Impossible de collecter l'élément requis. Est-ce dans votre main moins dominante?"
|
||||
conditionFailQuit: "La condition a échoué. Vous avez quitté <quest>."
|
||||
conditionFailRetry: "Condition non encore remplie pour cette étape de <quest>."
|
||||
conditionFailRetry: "ICondition non encore remplie pour cette étape de <quest>."
|
||||
optionSilkTouchFail: "Impossible de progresser <quest> avec l'enchantement Toucher de soie."
|
||||
money: "Argent"
|
||||
with: "avec"
|
||||
|
@ -599,7 +599,7 @@ questCreateTitle: "- Küldetés létrehozása -"
|
||||
questEditTitle: "- Küldetés szerkesztése -"
|
||||
questDeleteTitle: "- Küldetés törlése -"
|
||||
eventCreateTitle: "- Művelet létrehozása -"
|
||||
eventEditTitle: "- Action szerkesztése -"
|
||||
eventEditTitle: "- IAction szerkesztése -"
|
||||
eventDeleteTitle: "- Feltétel törlése -"
|
||||
conditionCreateTitle: "- Feltétel létrehozása -"
|
||||
conditionEditTitle: "- Feltétel szerkesztése -"
|
||||
|
@ -143,16 +143,16 @@ stageEditorPlayers: "players"
|
||||
stageEditorEvents: "Actions"
|
||||
stageEditorEventCleared: "작업이 삭제되었습니다."
|
||||
stageEditorStageEvents: "Stage Actions"
|
||||
stageEditorStartEvent: "Start Action"
|
||||
stageEditorFinishEvent: "Finish Action"
|
||||
stageEditorStartEvent: "Start IAction"
|
||||
stageEditorFinishEvent: "Finish IAction"
|
||||
stageEditorFailEvent: "실패 조치"
|
||||
stageEditorChatEvents: "Chat Actions"
|
||||
stageEditorChatTrigger: "Chat Trigger"
|
||||
stageEditorCommandEvents: "Command Actions"
|
||||
stageEditorCommandTrigger: "Command Trigger"
|
||||
stageEditorTriggeredBy: "Triggered by"
|
||||
stageEditorDeathEvent: "Death Action"
|
||||
stageEditorDisconnectEvent: "Disconnect Action"
|
||||
stageEditorDeathEvent: "Death IAction"
|
||||
stageEditorDisconnectEvent: "Disconnect IAction"
|
||||
stageEditorConditions: "정황"
|
||||
stageEditorConditionCleared: "조건이 삭제되었습니다."
|
||||
stageEditorDelayMessage: "Delay message"
|
||||
|
@ -140,20 +140,20 @@ stageEditorShearSheep: "Shear sheep"
|
||||
stageEditorKillPlayers: "Kill players"
|
||||
stageEditorPlayers: "players"
|
||||
stageEditorEvents: "Actions"
|
||||
stageEditorEventCleared: "Action cleared."
|
||||
stageEditorEventCleared: "IAction cleared."
|
||||
stageEditorStageEvents: "Stage Actions"
|
||||
stageEditorStartEvent: "Start Action"
|
||||
stageEditorFinishEvent: "Finish Action"
|
||||
stageEditorFailEvent: "Fail Action"
|
||||
stageEditorChatEvents: "Chat Action"
|
||||
stageEditorStartEvent: "Start IAction"
|
||||
stageEditorFinishEvent: "Finish IAction"
|
||||
stageEditorFailEvent: "Fail IAction"
|
||||
stageEditorChatEvents: "Chat IAction"
|
||||
stageEditorChatTrigger: "Chat Trigger"
|
||||
stageEditorCommandEvents: "Command Action"
|
||||
stageEditorCommandEvents: "Command IAction"
|
||||
stageEditorCommandTrigger: "Command Trigger"
|
||||
stageEditorTriggeredBy: "Triggered by"
|
||||
stageEditorDeathEvent: "Death Action"
|
||||
stageEditorDisconnectEvent: "Disconnect Action"
|
||||
stageEditorDeathEvent: "Death IAction"
|
||||
stageEditorDisconnectEvent: "Disconnect IAction"
|
||||
stageEditorConditions: "Conditions"
|
||||
stageEditorConditionCleared: "Condition cleared."
|
||||
stageEditorConditionCleared: "ICondition cleared."
|
||||
stageEditorDelayMessage: "Delay message"
|
||||
stageEditorDenizenScript: "Denizen script"
|
||||
stageEditorStartMessage: "Start message"
|
||||
@ -237,7 +237,7 @@ stageEditorInvalidMob: "is not a valid mob name!"
|
||||
stageEditorInvalidItemName: "is not a valid item name!"
|
||||
stageEditorInvalidDye: "is not a valid dye color!"
|
||||
stageEditorInvalidEvent: "is not a valid action name!"
|
||||
stageEditorDuplicateEvent: "Action is already in the list!"
|
||||
stageEditorDuplicateEvent: "IAction is already in the list!"
|
||||
stageEditorInvalidCondition: "is not a valid condition name!"
|
||||
stageEditorInvalidScript: "Denizen script not found!"
|
||||
stageEditorNoCitizens: "Citizens is not installed!"
|
||||
@ -266,10 +266,10 @@ eventEditorEdit: "Edit an action"
|
||||
eventEditorDelete: "Delete an action"
|
||||
eventEditorNoneToEdit: "No actions currently exist to be edited!"
|
||||
eventEditorNoneToDelete: "No actions currently exist to be deleted!"
|
||||
eventEditorNotFound: "Action not found!"
|
||||
eventEditorExists: "Action already exists!"
|
||||
eventEditorDeleted: "Action deleted. Quest and action data reloaded."
|
||||
eventEditorSaved: "Action saved. Quest and action data reloaded."
|
||||
eventEditorNotFound: "IAction not found!"
|
||||
eventEditorExists: "IAction already exists!"
|
||||
eventEditorDeleted: "IAction deleted. Quest and action data reloaded."
|
||||
eventEditorSaved: "IAction saved. Quest and action data reloaded."
|
||||
eventEditorEnterEventName: "Enter action name, <cancel>"
|
||||
eventEditorModifiedNote: 'Note: You have modified an action that the following quests use:'
|
||||
eventEditorForcedToQuit: "If you save the action, anyone who is actively doing any of these quests will be forced to quit them."
|
||||
@ -278,13 +278,13 @@ eventEditorMustModifyQuests: "You must modify these quests first!"
|
||||
eventEditorNotANumberList: "Input was not a list of numbers!"
|
||||
eventEditorGiveItemsTitle: "- Give Items -"
|
||||
eventEditorEffectsTitle: "- Sound Effects -"
|
||||
eventEditorStormTitle: "- Action Storm -"
|
||||
eventEditorThunderTitle: "- Action Thunder -"
|
||||
eventEditorMobSpawnsTitle: "- Action Mob Spawns -"
|
||||
eventEditorStormTitle: "- IAction Storm -"
|
||||
eventEditorThunderTitle: "- IAction Thunder -"
|
||||
eventEditorMobSpawnsTitle: "- IAction Mob Spawns -"
|
||||
eventEditorMobsTitle: "- Mobs -"
|
||||
eventEditorAddMobTypesTitle: "- Add Mob -"
|
||||
eventEditorPotionEffectsTitle: "- Action Potion Effects -"
|
||||
eventEditorPotionTypesTitle: "- Action Potion Types -"
|
||||
eventEditorPotionEffectsTitle: "- IAction Potion Effects -"
|
||||
eventEditorPotionTypesTitle: "- IAction Potion Types -"
|
||||
eventEditorWorldsTitle: "- Worlds -"
|
||||
eventEditorSetName: "Set name"
|
||||
eventEditorPlayer: "Player"
|
||||
@ -309,15 +309,15 @@ eventEditorSetTimer: "Set time to fail quest"
|
||||
eventEditorCancelTimer: "Cancel the quest timer"
|
||||
eventEditorSetTeleport: "Teleport to location"
|
||||
eventEditorSetCommands: "Execute commands"
|
||||
eventEditorItems: "Action Items"
|
||||
eventEditorItems: "IAction Items"
|
||||
eventEditorSetItems: "Give items"
|
||||
eventEditorItemsCleared: "Action items cleared."
|
||||
eventEditorItemsCleared: "IAction items cleared."
|
||||
eventEditorSetItemNames: "Set item names"
|
||||
eventEditorSetItemAmounts: "Set item amounts"
|
||||
eventEditorNoNames: "No names set"
|
||||
eventEditorMustSetNames: "You must set item names first!"
|
||||
eventEditorInvalidName: "is not a valid item name!"
|
||||
eventEditorStorm: "Action Storm"
|
||||
eventEditorStorm: "IAction Storm"
|
||||
eventEditorSetWorld: "Set world"
|
||||
eventEditorSetDuration: "Set duration"
|
||||
eventEditorSetWorldFirst: "You must set a world first!"
|
||||
@ -326,18 +326,18 @@ eventEditorMustSetStormDuration: "You must set a storm duration!"
|
||||
eventEditorStormCleared: "Storm data cleared."
|
||||
eventEditorEnterStormWorld: "Enter a world name for the storm to occur in, <cancel>"
|
||||
eventEditorEnterDuration: "Enter duration (in seconds)"
|
||||
eventEditorThunder: "Action Thunder"
|
||||
eventEditorThunder: "IAction Thunder"
|
||||
eventEditorMustSetThunderDuration: "You must set a thunder duration!"
|
||||
eventEditorThunderCleared: "Thunder data cleared."
|
||||
eventEditorEnterThunderWorld: "Enter a world name for the thunder to occur in, <cancel>"
|
||||
eventEditorEffects: "Action Sound Effects"
|
||||
eventEditorEffects: "IAction Sound Effects"
|
||||
eventEditorAddEffect: "Add sound effect"
|
||||
eventEditorAddEffectLocation: "Add sound effect location"
|
||||
eventEditorMustAddEffects: "You must add sound effects first!"
|
||||
eventEditorInvalidEffect: "is not a valid sound effect name!"
|
||||
eventEditorEffectsCleared: "Action sound effects cleared."
|
||||
eventEditorEffectsCleared: "IAction sound effects cleared."
|
||||
eventEditorEffectLocationPrompt: "Right-click on a block to play a sound effect at, <add>, <cancel>"
|
||||
eventEditorMobSpawns: "Action Mob Spawns"
|
||||
eventEditorMobSpawns: "IAction Mob Spawns"
|
||||
eventEditorAddMobTypes: "Add mob"
|
||||
eventEditorMustSetMobTypesFirst: "You must set the mob type first!"
|
||||
eventEditorSetMobAmounts: "Set mob amount"
|
||||
@ -359,7 +359,7 @@ eventEditorSetMobHelmet: "Set helmet"
|
||||
eventEditorSetMobHelmetDrop: "Set drop chance of helmet"
|
||||
eventEditorSetMobSpawnAmount: "Set the amount of mobs to spawn"
|
||||
eventEditorSetDropChance: "Set the drop chance"
|
||||
eventEditorPotionEffects: "Action Potion Effects"
|
||||
eventEditorPotionEffects: "IAction Potion Effects"
|
||||
eventEditorSetPotionEffectTypes: "Set potion effect types"
|
||||
eventEditorMustSetPotionTypesFirst: "You must set potion effect types first!"
|
||||
eventEditorSetPotionDurations: "Set potion effect durations"
|
||||
@ -389,19 +389,19 @@ conditionEditorEdit: "Edit a condition"
|
||||
conditionEditorDelete: "Delete a condition"
|
||||
conditionEditorNoneToEdit: "No conditions currently exist to be edited!"
|
||||
conditionEditorNoneToDelete: "No conditions currently exist to be deleted!"
|
||||
conditionEditorNotFound: "Condition not found!"
|
||||
conditionEditorExists: "Condition already exists!"
|
||||
conditionEditorNotFound: "ICondition not found!"
|
||||
conditionEditorExists: "ICondition already exists!"
|
||||
conditionEditorInUse: "The following quests use the condition"
|
||||
conditionEditorEnterName: "Enter condition name, <cancel>"
|
||||
conditionEditorSaved: "Condition saved. Quest and condition data reloaded."
|
||||
conditionEditorDeleted: "Condition deleted. Quest and condition data reloaded."
|
||||
conditionEditorSaved: "ICondition saved. Quest and condition data reloaded."
|
||||
conditionEditorDeleted: "ICondition deleted. Quest and condition data reloaded."
|
||||
conditionEditorModifiedNote: 'Note: You have modified a condition that the following quests use:'
|
||||
conditionEditorForcedToQuit: "If you save the condition, anyone who is actively doing any of these quests will be forced to quit them."
|
||||
conditionEditorSetName: "Set name"
|
||||
conditionEditorEntity: "Entity"
|
||||
conditionEditorWorld: "World"
|
||||
conditionEditorCheckPlaceholder: "Check placeholder"
|
||||
conditionEditorConditionCleared: "Condition cleared."
|
||||
conditionEditorConditionCleared: "ICondition cleared."
|
||||
conditionEditorRideEntity: "Ride entity"
|
||||
conditionEditorRideNPC: "Ride NPC"
|
||||
conditionEditorEntitiesTitle: "- Entities -"
|
||||
@ -592,17 +592,17 @@ questDisplayHelp: "- Display this help"
|
||||
questNPCListTitle: "- Quests | <npc> -"
|
||||
questAdminHelpTitle: "- Questadmin -"
|
||||
questEditorTitle: "- Quest Editor -"
|
||||
eventEditorTitle: "- Action Editor -"
|
||||
conditionEditorTitle: "- Condition Editor -"
|
||||
eventEditorTitle: "- IAction Editor -"
|
||||
conditionEditorTitle: "- ICondition Editor -"
|
||||
questCreateTitle: "- Create Quest -"
|
||||
questEditTitle: "- Edit Quest -"
|
||||
questDeleteTitle: "- Delete Quest -"
|
||||
eventCreateTitle: "- Create Action -"
|
||||
eventEditTitle: "- Edit Action -"
|
||||
eventDeleteTitle: "- Delete Action -"
|
||||
conditionCreateTitle: "- Create Condition -"
|
||||
conditionEditTitle: "- Edit Condition -"
|
||||
conditionDeleteTitle: "- Delete Condition -"
|
||||
eventCreateTitle: "- Create IAction -"
|
||||
eventEditTitle: "- Edit IAction -"
|
||||
eventDeleteTitle: "- Delete IAction -"
|
||||
conditionCreateTitle: "- Create ICondition -"
|
||||
conditionEditTitle: "- Edit ICondition -"
|
||||
conditionDeleteTitle: "- Delete ICondition -"
|
||||
requirementsTitle: "- <quest> | Requirements -"
|
||||
rewardsTitle: "- <quest> | Rewards -"
|
||||
plannerTitle: "- <quest> | Planner -"
|
||||
@ -778,8 +778,8 @@ listsNotSameSize: "All required lists must have the same number of entries!"
|
||||
listDuplicate: "List contains duplicates!"
|
||||
id: "ID"
|
||||
quest: "Quest"
|
||||
event: "Action"
|
||||
condition: "Condition"
|
||||
event: "IAction"
|
||||
condition: "ICondition"
|
||||
quests: "Quests"
|
||||
createdBy: "Created by"
|
||||
continuedBy: "and continued by"
|
||||
@ -793,8 +793,8 @@ usage: "Usage"
|
||||
redoableEvery: "Redoable every <time>."
|
||||
requirements: "Requirements"
|
||||
requirementsItemFail: "Unable to collect required item. Is it in your off-hand?"
|
||||
conditionFailQuit: "Condition failed. You have quit <quest>."
|
||||
conditionFailRetry: "Condition not yet met for this stage of <quest>."
|
||||
conditionFailQuit: "ICondition failed. You have quit <quest>."
|
||||
conditionFailRetry: "ICondition not yet met for this stage of <quest>."
|
||||
optionSilkTouchFail: "Unable to progress <quest> with the Silk Touch enchantment."
|
||||
with: "with"
|
||||
to: "to"
|
||||
|
@ -22,7 +22,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.blackvein.quests</groupId>
|
||||
<artifactId>quests-api</artifactId>
|
||||
<artifactId>quests-core</artifactId>
|
||||
<version>${revision}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
@ -22,7 +22,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.blackvein.quests</groupId>
|
||||
<artifactId>quests-api</artifactId>
|
||||
<artifactId>quests-core</artifactId>
|
||||
<version>${revision}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
@ -22,7 +22,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.blackvein.quests</groupId>
|
||||
<artifactId>quests-api</artifactId>
|
||||
<artifactId>quests-core</artifactId>
|
||||
<version>${revision}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
Loading…
Reference in New Issue
Block a user