mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-24 03:25:20 +01:00
Quests 5 (#2146)
* Begin refactoring, update license. Bump version * Update locale library * More refactoring * Still more refactoring * Even more refactoring * Cut missing quest requirement, fixes #2131 * Yet more refactoring * Refactoring intensifies * Wreaks of refactoring * Add debug warning for #2138 * Refactoring too stronk * Such refactoring wow * Do not assume click index, fixes #2143 * Bump version * Update headers
This commit is contained in:
parent
e0970db2a4
commit
720538d0f8
29
LICENSE.txt
29
LICENSE.txt
@ -1,9 +1,22 @@
|
||||
Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
MIT License
|
||||
|
||||
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
Copyright (c) PikaMug
|
||||
Copyright (c) contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
188
api/pom.xml
188
api/pom.xml
@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>me.blackvein.quests</groupId>
|
||||
<groupId>me.pikamug.quests</groupId>
|
||||
<artifactId>quests-parent</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
@ -15,50 +15,10 @@
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<!-- DungeonsXL, mcMMO Classic, PhatLoots, Unite, ZNPCsPlus -->
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<!-- Citizens, Denizen -->
|
||||
<id>citizens-repo</id>
|
||||
<url>https://repo.citizensnpcs.co/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<!-- WorldEdit, WorldGuard -->
|
||||
<id>enginehub-repo</id>
|
||||
<url>https://maven.enginehub.org/repo/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<!-- Parties -->
|
||||
<id>alessiodp-repo</id>
|
||||
<url>https://repo.alessiodp.com/releases/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<!-- PlaceholderAPI -->
|
||||
<id>papi-repo</id>
|
||||
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<!-- Heroes, Vault -->
|
||||
<id>hc-repo</id>
|
||||
<url>https://nexus.hc.to/content/repositories/pub_releases/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<!-- AstralBooks -->
|
||||
<id>repsy-release</id>
|
||||
<url>https://repo.repsy.io/mvn/niconeko/release</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<!-- PacketEvents for ZNPCsPlus -->
|
||||
<id>codemc-snapshots</id>
|
||||
<url>https://repo.codemc.io/repository/maven-snapshots/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
@ -69,88 +29,32 @@
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.citizensnpcs</groupId>
|
||||
<artifactId>citizensapi</artifactId>
|
||||
<version>2.0.30-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<groupId>org.jetbrains</groupId>
|
||||
<artifactId>annotations</artifactId>
|
||||
<version>24.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.denizenscript</groupId>
|
||||
<artifactId>denizen</artifactId>
|
||||
<version>1.2.5-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.28</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-java</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.milkbowl.vault</groupId>
|
||||
<artifactId>Vault</artifactId>
|
||||
<version>1.7.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.mcMMO-Dev</groupId>
|
||||
<artifactId>mcMMO-Classic</artifactId>
|
||||
<version>master-82f97cbe04-1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.herocraftonline.heroes</groupId>
|
||||
<artifactId>Heroes</artifactId>
|
||||
<version>1.9.26-RELEASE</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldedit</groupId>
|
||||
<artifactId>worldedit-bukkit</artifactId>
|
||||
<version>7.2.8</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldguard</groupId>
|
||||
<artifactId>worldguard-bukkit</artifactId>
|
||||
<version>7.0.5-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.clip</groupId>
|
||||
<artifactId>placeholderapi</artifactId>
|
||||
<version>2.11.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ro.niconeko</groupId>
|
||||
<artifactId>astralbooks-api</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.RednedEpic</groupId>
|
||||
<artifactId>PhatLoots</artifactId>
|
||||
<version>e55d0ba1f6</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alessiodp.parties</groupId>
|
||||
<artifactId>parties-api</artifactId>
|
||||
<version>3.2.9</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.retrooper.packetevents</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.Pyrbu</groupId>
|
||||
<artifactId>ZNPCsPlus</artifactId>
|
||||
<version>271b087586</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.PikaMug</groupId>
|
||||
<artifactId>Unite</artifactId>
|
||||
<version>1.1.7</version>
|
||||
<scope>provided</scope>
|
||||
<groupId>com.zaxxer</groupId>
|
||||
<artifactId>HikariCP</artifactId>
|
||||
<!-- Do not update until Java 11 is min -->
|
||||
<version>4.0.3</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<groupId>org.slf4j</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@ -174,6 +78,52 @@
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.2.4</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<minimizeJar>false</minimizeJar>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
|
||||
<configuration>
|
||||
<artifactSet>
|
||||
<includes>
|
||||
<include>me.*</include>
|
||||
<include>com.zaxxer:HikariCP</include>
|
||||
<include>mysql</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>*:*</artifact>
|
||||
<excludes>
|
||||
<exclude>META-INF/*.MF</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>com.zaxxer.hikari</pattern>
|
||||
<shadedPattern>me.pikamug.quests.libs.hikari</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>com.mysql</pattern>
|
||||
<shadedPattern>me.pikamug.quests.libs.mysql</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
@ -1,98 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests;
|
||||
|
||||
import me.blackvein.quests.actions.ActionFactory;
|
||||
import me.blackvein.quests.actions.IAction;
|
||||
import me.blackvein.quests.conditions.ConditionFactory;
|
||||
import me.blackvein.quests.conditions.ICondition;
|
||||
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 java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public interface QuestsAPI {
|
||||
|
||||
boolean isLoading();
|
||||
|
||||
String getDetectedServerSoftwareVersion();
|
||||
|
||||
File getPluginDataFolder();
|
||||
|
||||
Logger getPluginLogger();
|
||||
|
||||
InputStream getPluginResource(String filename);
|
||||
|
||||
IDependencies getDependencies();
|
||||
|
||||
ISettings getSettings();
|
||||
|
||||
List<ICustomObjective> getCustomObjectives();
|
||||
|
||||
List<CustomReward> getCustomRewards();
|
||||
|
||||
List<CustomRequirement> getCustomRequirements();
|
||||
|
||||
Collection<IQuest> getLoadedQuests();
|
||||
|
||||
Collection<IAction> getLoadedActions();
|
||||
|
||||
Collection<ICondition> getLoadedConditions();
|
||||
|
||||
IQuester getQuester(final UUID id);
|
||||
|
||||
Collection<IQuester> getOnlineQuesters();
|
||||
|
||||
Collection<IQuester> getOfflineQuesters();
|
||||
|
||||
void setOfflineQuesters(final Collection<IQuester> questers);
|
||||
|
||||
QuestFactory getQuestFactory();
|
||||
|
||||
ActionFactory getActionFactory();
|
||||
|
||||
ConditionFactory getConditionFactory();
|
||||
|
||||
/*ConvoListener getConvoListener();
|
||||
|
||||
BlockListener getBlockListener();
|
||||
|
||||
ItemListener getItemListener();
|
||||
|
||||
NpcListener getNpcListener();
|
||||
|
||||
PlayerListener getPlayerListener();
|
||||
|
||||
UniteListener getUniteListener();
|
||||
|
||||
NpcEffectThread getNpcEffectThread();
|
||||
|
||||
PlayerMoveThread getPlayerMoveThread();
|
||||
|
||||
PartiesListener getPartiesListener();
|
||||
|
||||
DenizenTrigger getDenizenTrigger();
|
||||
|
||||
LocaleManager getLocaleManager();
|
||||
|
||||
Storage getStorage();*/
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.actions;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.ConversationFactory;
|
||||
import org.bukkit.conversations.Prompt;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface ActionFactory {
|
||||
Map<UUID, Block> getSelectedExplosionLocations();
|
||||
|
||||
void setSelectedExplosionLocations(final Map<UUID, Block> selectedExplosionLocations);
|
||||
|
||||
Map<UUID, Block> getSelectedEffectLocations();
|
||||
|
||||
void setSelectedEffectLocations(final Map<UUID, Block> selectedEffectLocations);
|
||||
|
||||
Map<UUID, Block> getSelectedMobLocations();
|
||||
|
||||
void setSelectedMobLocations(final Map<UUID, Block> selectedMobLocations);
|
||||
|
||||
Map<UUID, Block> getSelectedLightningLocations();
|
||||
|
||||
void setSelectedLightningLocations(final Map<UUID, Block> selectedLightningLocations);
|
||||
|
||||
Map<UUID, Block> getSelectedTeleportLocations();
|
||||
|
||||
void setSelectedTeleportLocations(final Map<UUID, Block> selectedTeleportLocations);
|
||||
|
||||
ConversationFactory getConversationFactory();
|
||||
|
||||
List<String> getNamesOfActionsBeingEdited();
|
||||
|
||||
void setNamesOfActionsBeingEdited(final List<String> actionNames);
|
||||
|
||||
Prompt returnToMenu(final ConversationContext context);
|
||||
|
||||
void loadData(final IAction event, final ConversationContext context);
|
||||
|
||||
void clearData(final ConversationContext context);
|
||||
|
||||
void deleteAction(final ConversationContext context);
|
||||
|
||||
void saveAction(final ConversationContext context);
|
||||
}
|
@ -1,121 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.actions;
|
||||
|
||||
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;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IAction extends Comparable<IAction> {
|
||||
String getName();
|
||||
|
||||
void setName(final String name);
|
||||
|
||||
String getMessage();
|
||||
|
||||
void setMessage(final String message);
|
||||
|
||||
boolean isClearInv();
|
||||
|
||||
void setClearInv(final boolean clearInv);
|
||||
|
||||
boolean isFailQuest();
|
||||
|
||||
void setFailQuest(final boolean failQuest);
|
||||
|
||||
LinkedList<Location> getExplosions();
|
||||
|
||||
void setExplosions(final LinkedList<Location> explosions);
|
||||
|
||||
Map<Location, Effect> getEffects();
|
||||
|
||||
void setEffects(final Map<Location, Effect> effects);
|
||||
|
||||
LinkedList<ItemStack> getItems();
|
||||
|
||||
void setItems(final LinkedList<ItemStack> items);
|
||||
|
||||
World getStormWorld();
|
||||
|
||||
void setStormWorld(final World stormWorld);
|
||||
|
||||
int getStormDuration();
|
||||
|
||||
void setStormDuration(final int stormDuration);
|
||||
|
||||
World getThunderWorld();
|
||||
|
||||
void setThunderWorld(final World thunderWorld);
|
||||
|
||||
int getThunderDuration();
|
||||
|
||||
void setThunderDuration(final int thunderDuration);
|
||||
|
||||
int getTimer();
|
||||
|
||||
void setTimer(final int timer);
|
||||
|
||||
boolean isCancelTimer();
|
||||
|
||||
void setCancelTimer(final boolean cancelTimer);
|
||||
|
||||
LinkedList<QuestMob> getMobSpawns();
|
||||
|
||||
void setMobSpawns(final LinkedList<QuestMob> mobSpawns);
|
||||
|
||||
LinkedList<Location> getLightningStrikes();
|
||||
|
||||
void setLightningStrikes(final LinkedList<Location> lightningStrikes);
|
||||
|
||||
LinkedList<String> getCommands();
|
||||
|
||||
void setCommands(final LinkedList<String> commands);
|
||||
|
||||
LinkedList<PotionEffect> getPotionEffects();
|
||||
|
||||
void setPotionEffects(final LinkedList<PotionEffect> potionEffects);
|
||||
|
||||
int getHunger();
|
||||
|
||||
void setHunger(final int hunger);
|
||||
|
||||
int getSaturation();
|
||||
|
||||
void setSaturation(final int saturation);
|
||||
|
||||
float getHealth();
|
||||
|
||||
void setHealth(final float health);
|
||||
|
||||
Location getTeleport();
|
||||
|
||||
void setTeleport(final Location teleport);
|
||||
|
||||
String getBook();
|
||||
|
||||
void setBook(final String book);
|
||||
|
||||
String getDenizenScript();
|
||||
|
||||
void setDenizenScript(final String scriptName);
|
||||
|
||||
void fire(final IQuester quester, final IQuest quest);
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.conditions;
|
||||
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.ConversationFactory;
|
||||
import org.bukkit.conversations.Prompt;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ConditionFactory {
|
||||
ConversationFactory getConversationFactory();
|
||||
|
||||
List<String> getNamesOfConditionsBeingEdited();
|
||||
|
||||
void setNamesOfConditionsBeingEdited(final List<String> conditionNames);
|
||||
|
||||
Prompt returnToMenu(final ConversationContext context);
|
||||
|
||||
void loadData(final ICondition condition, final ConversationContext context);
|
||||
|
||||
void clearData(final ConversationContext context);
|
||||
|
||||
void deleteCondition(final ConversationContext context);
|
||||
|
||||
void saveCondition(final ConversationContext context);
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.convo.actions;
|
||||
|
||||
import me.blackvein.quests.QuestsAPI;
|
||||
import me.blackvein.quests.actions.ActionFactory;
|
||||
import me.blackvein.quests.convo.QuestsNumericPrompt;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
|
||||
public abstract class ActionsEditorNumericPrompt extends QuestsNumericPrompt {
|
||||
private final ConversationContext context;
|
||||
private ActionFactory factory;
|
||||
|
||||
public ActionsEditorNumericPrompt(final ConversationContext context) {
|
||||
this.context = context;
|
||||
if (context != null && context.getPlugin() != null) {
|
||||
this.factory = ((QuestsAPI)context.getPlugin()).getActionFactory();
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public ActionsEditorNumericPrompt(final ConversationContext context, final ActionFactory factory) {
|
||||
this.context = context;
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
|
||||
public ConversationContext getConversationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public ActionFactory getActionFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
public abstract int getSize();
|
||||
|
||||
public abstract String getTitle(ConversationContext context);
|
||||
|
||||
public abstract ChatColor getNumberColor(ConversationContext context, int number);
|
||||
|
||||
public abstract String getSelectionText(ConversationContext context, int number);
|
||||
|
||||
public abstract String getAdditionalText(ConversationContext context, int number);
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.convo.actions;
|
||||
|
||||
import me.blackvein.quests.QuestsAPI;
|
||||
import me.blackvein.quests.actions.ActionFactory;
|
||||
import me.blackvein.quests.convo.QuestsStringPrompt;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
|
||||
public abstract class ActionsEditorStringPrompt extends QuestsStringPrompt {
|
||||
private final ConversationContext context;
|
||||
private ActionFactory factory;
|
||||
|
||||
public ActionsEditorStringPrompt(final ConversationContext context) {
|
||||
this.context = context;
|
||||
if (context != null && context.getPlugin() != null) {
|
||||
this.factory = ((QuestsAPI)context.getPlugin()).getActionFactory();
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public ActionsEditorStringPrompt(final ConversationContext context, final ActionFactory factory) {
|
||||
this.context = context;
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
|
||||
public ConversationContext getConversationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public ActionFactory getActionFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
public abstract String getTitle(ConversationContext context);
|
||||
|
||||
public abstract String getQueryText(ConversationContext context);
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.convo.conditions;
|
||||
|
||||
import me.blackvein.quests.QuestsAPI;
|
||||
import me.blackvein.quests.conditions.ConditionFactory;
|
||||
import me.blackvein.quests.convo.QuestsNumericPrompt;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
|
||||
public abstract class ConditionsEditorNumericPrompt extends QuestsNumericPrompt {
|
||||
private final ConversationContext context;
|
||||
private ConditionFactory factory;
|
||||
|
||||
public ConditionsEditorNumericPrompt(final ConversationContext context) {
|
||||
this.context = context;
|
||||
if (context != null && context.getPlugin() != null) {
|
||||
this.factory = ((QuestsAPI)context.getPlugin()).getConditionFactory();
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public ConditionsEditorNumericPrompt(final ConversationContext context, final ConditionFactory factory) {
|
||||
this.context = context;
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
|
||||
public ConversationContext getConversationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public ConditionFactory getConditionFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
public abstract int getSize();
|
||||
|
||||
public abstract String getTitle(ConversationContext context);
|
||||
|
||||
public abstract ChatColor getNumberColor(ConversationContext context, int number);
|
||||
|
||||
public abstract String getSelectionText(ConversationContext context, int number);
|
||||
|
||||
public abstract String getAdditionalText(ConversationContext context, int number);
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.convo.conditions;
|
||||
|
||||
import me.blackvein.quests.QuestsAPI;
|
||||
import me.blackvein.quests.conditions.ConditionFactory;
|
||||
import me.blackvein.quests.convo.QuestsStringPrompt;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
|
||||
public abstract class ConditionsEditorStringPrompt extends QuestsStringPrompt {
|
||||
private final ConversationContext context;
|
||||
private ConditionFactory factory;
|
||||
|
||||
public ConditionsEditorStringPrompt(final ConversationContext context) {
|
||||
this.context = context;
|
||||
if (context != null && context.getPlugin() != null) {
|
||||
this.factory = ((QuestsAPI)context.getPlugin()).getConditionFactory();
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public ConditionsEditorStringPrompt(final ConversationContext context, final ConditionFactory factory) {
|
||||
this.context = context;
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
|
||||
public ConversationContext getConversationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public ConditionFactory getConditionFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
public abstract String getTitle(ConversationContext context);
|
||||
|
||||
public abstract String getQueryText(ConversationContext context);
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.convo.quests;
|
||||
|
||||
import me.blackvein.quests.quests.QuestFactory;
|
||||
import me.blackvein.quests.QuestsAPI;
|
||||
import me.blackvein.quests.convo.QuestsNumericPrompt;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
|
||||
public abstract class QuestsEditorNumericPrompt extends QuestsNumericPrompt {
|
||||
private final ConversationContext context;
|
||||
private QuestFactory factory;
|
||||
|
||||
public QuestsEditorNumericPrompt(final ConversationContext context) {
|
||||
this.context = context;
|
||||
if (context != null && context.getPlugin() != null) {
|
||||
factory = ((QuestsAPI)context.getPlugin()).getQuestFactory();
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public QuestsEditorNumericPrompt(final ConversationContext context, final QuestFactory factory) {
|
||||
this.context = context;
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
|
||||
public ConversationContext getConversationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public QuestFactory getQuestFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
public abstract int getSize();
|
||||
|
||||
public abstract String getTitle(ConversationContext context);
|
||||
|
||||
public abstract ChatColor getNumberColor(ConversationContext context, int number);
|
||||
|
||||
public abstract String getSelectionText(ConversationContext context, int number);
|
||||
|
||||
public abstract String getAdditionalText(ConversationContext context, int number);
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.convo.quests;
|
||||
|
||||
import me.blackvein.quests.quests.QuestFactory;
|
||||
import me.blackvein.quests.QuestsAPI;
|
||||
import me.blackvein.quests.convo.QuestsStringPrompt;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
|
||||
public abstract class QuestsEditorStringPrompt extends QuestsStringPrompt {
|
||||
private final ConversationContext context;
|
||||
private QuestFactory factory;
|
||||
|
||||
public QuestsEditorStringPrompt(final ConversationContext context) {
|
||||
this.context = context;
|
||||
if (context != null && context.getPlugin() != null) {
|
||||
factory = ((QuestsAPI)context.getPlugin()).getQuestFactory();
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public QuestsEditorStringPrompt(final ConversationContext context, final QuestFactory factory) {
|
||||
this.context = context;
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
|
||||
public ConversationContext getConversationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public QuestFactory getQuestFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
public abstract String getTitle(ConversationContext context);
|
||||
|
||||
public abstract String getQueryText(ConversationContext context);
|
||||
}
|
@ -1,87 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* 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;
|
||||
|
||||
import com.alessiodp.parties.api.interfaces.PartiesAPI;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.herocraftonline.heroes.Heroes;
|
||||
import com.herocraftonline.heroes.characters.Hero;
|
||||
import lol.pyr.znpcsplus.ZNPCsPlus;
|
||||
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;
|
||||
import me.pikamug.unite.api.objects.PartyProvider;
|
||||
import net.citizensnpcs.api.CitizensPlugin;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
import net.milkbowl.vault.permission.Permission;
|
||||
import org.bukkit.Location;
|
||||
import ro.niconeko.astralbooks.api.AstralBooksAPI;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface IDependencies {
|
||||
Economy getVaultEconomy();
|
||||
|
||||
Permission getVaultPermission();
|
||||
|
||||
PartyProvider getPartyProvider();
|
||||
|
||||
Set<PartyProvider> getPartyProviders();
|
||||
|
||||
WorldGuardAPI getWorldGuardApi();
|
||||
|
||||
mcMMO getMcmmoClassic();
|
||||
|
||||
Heroes getHeroes();
|
||||
|
||||
PlaceholderAPIPlugin getPlaceholderApi();
|
||||
|
||||
CitizensPlugin getCitizens();
|
||||
|
||||
void linkCitizens();
|
||||
|
||||
void unlinkCitizens();
|
||||
|
||||
DenizenAPI getDenizenApi();
|
||||
|
||||
AstralBooksAPI getAstralBooksApi();
|
||||
|
||||
ZNPCsPlus getZnpcsPlus();
|
||||
|
||||
void linkZnpcsPlus();
|
||||
|
||||
void unlinkZnpcsPlus();
|
||||
|
||||
PartiesAPI getPartiesApi();
|
||||
|
||||
boolean isPluginAvailable(final String pluginName);
|
||||
|
||||
boolean runDenizenScript(final String scriptName, final IQuester quester, final UUID uuid);
|
||||
|
||||
Location getNpcLocation(final UUID uuid);
|
||||
|
||||
String getNpcName(final UUID uuid);
|
||||
|
||||
int getMcmmoSkillLevel(final SkillType st, final String player);
|
||||
|
||||
Hero getHero(final UUID uuid);
|
||||
|
||||
boolean testPrimaryHeroesClass(final String primaryClass, final UUID uuid);
|
||||
|
||||
boolean testSecondaryHeroesClass(final String secondaryClass, final UUID uuid);
|
||||
|
||||
void init();
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.entity;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public interface QuestMob {
|
||||
String getName();
|
||||
|
||||
void setName(final String name);
|
||||
|
||||
EntityType getType();
|
||||
|
||||
void setType(final EntityType entityType);
|
||||
|
||||
Location getSpawnLocation();
|
||||
|
||||
void setSpawnLocation(final Location spawnLocation);
|
||||
|
||||
Integer getSpawnAmounts();
|
||||
|
||||
void setSpawnAmounts(final int spawnAmounts);
|
||||
|
||||
ItemStack[] getInventory();
|
||||
|
||||
void setInventory(final ItemStack[] inventory);
|
||||
|
||||
Float[] getDropChances();
|
||||
|
||||
void setDropChances(final Float[] dropChances);
|
||||
|
||||
void setHelmet(final ItemStack helmet, final float dropChance);
|
||||
|
||||
void setChest(final ItemStack chest, final float dropChance);
|
||||
|
||||
void setLeggings(final ItemStack leggings, final float dropChance);
|
||||
|
||||
void setBoots(final ItemStack boots, final float dropChance);
|
||||
|
||||
void setHeldItem(final ItemStack heldItem, final float dropChance);
|
||||
|
||||
void spawn();
|
||||
|
||||
String serialize();
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.events;
|
||||
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public abstract class QuestsEvent extends Event {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
|
||||
public QuestsEvent() {
|
||||
}
|
||||
|
||||
public QuestsEvent(final boolean async) {
|
||||
super(async);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
@ -1,54 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.events.quest;
|
||||
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.events.QuestsEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Represents a quest-related event
|
||||
*/
|
||||
public abstract class QuestEvent extends QuestsEvent {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private final IQuest quest;
|
||||
|
||||
public QuestEvent(final IQuest quest) {
|
||||
this.quest = quest;
|
||||
}
|
||||
|
||||
public QuestEvent(final IQuest quest, final boolean async) {
|
||||
super(async);
|
||||
this.quest = quest;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the quest involved in this event
|
||||
*
|
||||
* @return Quest which is involved in this event
|
||||
*/
|
||||
public final IQuest getQuest() {
|
||||
return quest;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.events.quest;
|
||||
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Called when a quest is quit by a quester
|
||||
*/
|
||||
public class QuestQuitEvent extends QuestEvent implements Cancellable {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private final IQuester quester;
|
||||
private boolean cancel = false;
|
||||
|
||||
public QuestQuitEvent(final IQuest quest, final IQuester who) {
|
||||
super(quest);
|
||||
this.quester = who;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the quester involved in this event
|
||||
*
|
||||
* @return Quester who is involved in this event
|
||||
*/
|
||||
public IQuester getQuester() {
|
||||
return quester;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(final boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.events.quest;
|
||||
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Called when a quest is taken by a quester
|
||||
*/
|
||||
public class QuestTakeEvent extends QuestEvent implements Cancellable {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private final IQuester quester;
|
||||
private boolean cancel = false;
|
||||
|
||||
public QuestTakeEvent(final IQuest quest, final IQuester who) {
|
||||
super(quest);
|
||||
this.quester = who;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the quester involved in this event
|
||||
*
|
||||
* @return Quester who is involved in this event
|
||||
*/
|
||||
public IQuester getQuester() {
|
||||
return quester;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(final boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
@ -1,268 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.player;
|
||||
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.quests.IStage;
|
||||
import me.blackvein.quests.quests.Objective;
|
||||
import me.blackvein.quests.QuestData;
|
||||
import me.blackvein.quests.enums.ObjectiveType;
|
||||
import me.blackvein.quests.module.ICustomObjective;
|
||||
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 getQuestIdToQuit();
|
||||
|
||||
void setQuestIdToQuit(final String questIdToQuit);
|
||||
|
||||
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
|
||||
* @deprecated Do not use
|
||||
*/
|
||||
IQuest getCompassTargetTemp();
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
/**
|
||||
* @deprecated Do not use
|
||||
*/
|
||||
ConcurrentHashMap<IQuest, Integer> getCurrentQuestsTemp();
|
||||
|
||||
void setCurrentQuests(final ConcurrentHashMap<IQuest, Integer> currentQuests);
|
||||
|
||||
/**
|
||||
* @deprecated Do not use
|
||||
*/
|
||||
ConcurrentSkipListSet<IQuest> getCompletedQuestsTemp();
|
||||
|
||||
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);
|
||||
|
||||
IStage getCurrentStage(final IQuest quest);
|
||||
|
||||
QuestData getQuestData(final IQuest quest);
|
||||
|
||||
boolean hasJournal();
|
||||
|
||||
ItemStack getJournal();
|
||||
|
||||
int getJournalIndex();
|
||||
|
||||
void updateJournal();
|
||||
|
||||
boolean offerQuest(final IQuest quest, final boolean giveReason);
|
||||
|
||||
boolean canAcceptOffer(final IQuest quest, final boolean giveReason);
|
||||
|
||||
boolean isOnTime(final IQuest quest, final boolean giveReason);
|
||||
|
||||
void takeQuest(final IQuest quest, final boolean ignoreRequirements);
|
||||
|
||||
boolean abandonQuest(final IQuest quest, final String message);
|
||||
|
||||
boolean abandonQuest(final IQuest quest, final String[] messages);
|
||||
|
||||
void quitQuest(final IQuest quest, final String message);
|
||||
|
||||
void quitQuest(final IQuest quest, final String[] messages);
|
||||
|
||||
void listQuests(final IQuester quester, final int page);
|
||||
|
||||
LinkedList<String> getCurrentRequirements(final IQuest quest, final boolean ignoreOverrides);
|
||||
|
||||
LinkedList<String> getCurrentObjectives(final IQuest quest, final boolean ignoreOverrides);
|
||||
|
||||
void showCurrentObjectives(final IQuest quest, final IQuester quester, final boolean ignoreOverrides);
|
||||
|
||||
LinkedList<String> getObjectives(final IQuest quest, final boolean ignoreOverrides);
|
||||
|
||||
boolean containsObjective(final IQuest quest, final String name);
|
||||
|
||||
boolean hasObjective(final IQuest quest, final ObjectiveType type);
|
||||
|
||||
boolean hasCustomObjective(final IQuest quest, final String name);
|
||||
|
||||
void showCurrentConditions(final IQuest quest, final IQuester quester);
|
||||
|
||||
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 UUID npc, final ItemStack itemStack);
|
||||
|
||||
void interactWithNPC(final IQuest quest, final UUID npc);
|
||||
|
||||
void killNPC(final IQuest quest, final UUID 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 UUID 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 UUID 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 IStage currentStage,
|
||||
final Function<IQuester, Void> fun);
|
||||
|
||||
List<IQuester> getMultiplayerQuesters(final IQuest quest);
|
||||
|
||||
boolean meetsCondition(final IQuest quest, final boolean giveReason);
|
||||
|
||||
boolean isSelectingBlock();
|
||||
|
||||
boolean isInRegion(final String regionID);
|
||||
}
|
@ -1,101 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* 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;
|
||||
|
||||
import me.blackvein.quests.actions.IAction;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface IQuest extends Comparable<IQuest> {
|
||||
Plugin getPlugin();
|
||||
|
||||
void setPlugin(Plugin plugin);
|
||||
|
||||
String getId();
|
||||
|
||||
void setId(String id);
|
||||
|
||||
String getName();
|
||||
|
||||
void setName(final String name);
|
||||
|
||||
String getDescription();
|
||||
|
||||
void setDescription(final String description);
|
||||
|
||||
String getFinished();
|
||||
|
||||
void setFinished(final String finished);
|
||||
|
||||
String getRegionStart();
|
||||
|
||||
void setRegionStart(final String regionStart);
|
||||
|
||||
ItemStack getGUIDisplay();
|
||||
|
||||
void setGUIDisplay(final ItemStack guiDisplay);
|
||||
|
||||
IStage getStage(final int index);
|
||||
|
||||
LinkedList<IStage> getStages();
|
||||
|
||||
UUID getNpcStart();
|
||||
|
||||
void setNpcStart(final UUID npcStart);
|
||||
|
||||
String getNpcStartName();
|
||||
|
||||
Location getBlockStart();
|
||||
|
||||
void setBlockStart(final Location blockStart);
|
||||
|
||||
IAction getInitialAction();
|
||||
|
||||
void setInitialAction(final IAction initialAction);
|
||||
|
||||
Requirements getRequirements();
|
||||
|
||||
Planner getPlanner();
|
||||
|
||||
Rewards getRewards();
|
||||
|
||||
Options getOptions();
|
||||
|
||||
void nextStage(final IQuester quester, final boolean allowSharedProgress);
|
||||
|
||||
void setStage(final IQuester quester, final int stage);
|
||||
|
||||
boolean updateCompass(final IQuester quester, final IStage stage);
|
||||
|
||||
boolean testRequirements(final IQuester quester);
|
||||
|
||||
boolean testRequirements(final OfflinePlayer player);
|
||||
|
||||
void completeQuest(final IQuester quester);
|
||||
|
||||
void completeQuest(final IQuester quester, final boolean allowMultiplayer);
|
||||
|
||||
void failQuest(final IQuester quester);
|
||||
|
||||
void failQuest(final IQuester quester, final boolean ignoreFailAction);
|
||||
|
||||
boolean isInRegion(final IQuester quester);
|
||||
|
||||
boolean isInRegionStart(final IQuester quester);
|
||||
}
|
@ -1,335 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* 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;
|
||||
|
||||
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;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface IStage {
|
||||
LinkedList<ItemStack> getBlocksToBreak();
|
||||
|
||||
boolean addBlockToBreak(ItemStack blockToBreak);
|
||||
|
||||
void setBlocksToBreak(final LinkedList<ItemStack> blocksToBreak);
|
||||
|
||||
LinkedList<ItemStack> getBlocksToDamage();
|
||||
|
||||
boolean addBlockToDamage(ItemStack blockToDamage);
|
||||
|
||||
void setBlocksToDamage(final LinkedList<ItemStack> blocksToDamage);
|
||||
|
||||
LinkedList<ItemStack> getBlocksToPlace();
|
||||
|
||||
boolean addBlockToPlace(ItemStack blockToPlace);
|
||||
|
||||
void setBlocksToPlace(final LinkedList<ItemStack> blocksToPlace);
|
||||
|
||||
LinkedList<ItemStack> getBlocksToUse();
|
||||
|
||||
boolean addBlockToUse(ItemStack blockToUse);
|
||||
|
||||
void setBlocksToUse(final LinkedList<ItemStack> blocksToUse);
|
||||
|
||||
LinkedList<ItemStack> getBlocksToCut();
|
||||
|
||||
boolean addBlockToCut(ItemStack blockToCut);
|
||||
|
||||
void setBlocksToCut(final LinkedList<ItemStack> blocksToCut);
|
||||
|
||||
LinkedList<ItemStack> getItemsToCraft();
|
||||
|
||||
boolean addItemToCraft(ItemStack itemToCraft);
|
||||
|
||||
void setItemsToCraft(final LinkedList<ItemStack> itemsToCraft);
|
||||
|
||||
LinkedList<ItemStack> getItemsToSmelt();
|
||||
|
||||
boolean addItemToSmelt(ItemStack itemToSmelt);
|
||||
|
||||
void setItemsToSmelt(final LinkedList<ItemStack> itemsToSmelt);
|
||||
|
||||
LinkedList<ItemStack> getItemsToEnchant();
|
||||
|
||||
boolean addItemToEnchant(ItemStack itemToEnchant);
|
||||
|
||||
void setItemsToEnchant(final LinkedList<ItemStack> itemsToEnchant);
|
||||
|
||||
LinkedList<ItemStack> getItemsToBrew();
|
||||
|
||||
boolean addItemsToBrew(ItemStack itemToBrew);
|
||||
|
||||
void setItemsToBrew(final LinkedList<ItemStack> itemsToBrew);
|
||||
|
||||
LinkedList<ItemStack> getItemsToConsume();
|
||||
|
||||
boolean addItemToConsume(ItemStack itemToConsume);
|
||||
|
||||
void setItemsToConsume(final LinkedList<ItemStack> itemsToConsume);
|
||||
|
||||
LinkedList<ItemStack> getItemsToDeliver();
|
||||
|
||||
boolean addItemToDeliver(ItemStack itemToDeliver);
|
||||
|
||||
void setItemsToDeliver(final LinkedList<ItemStack> itemsToDeliver);
|
||||
|
||||
LinkedList<UUID> getItemDeliveryTargets();
|
||||
|
||||
boolean addItemDeliveryTarget(UUID itemDeliveryTarget);
|
||||
|
||||
void setItemDeliveryTargets(final LinkedList<UUID> itemDeliveryTargets);
|
||||
|
||||
LinkedList<String> getDeliverMessages();
|
||||
|
||||
boolean addDeliverMessage(String deliverMessage);
|
||||
|
||||
void setDeliverMessages(final LinkedList<String> deliverMessages);
|
||||
|
||||
LinkedList<UUID> getNpcsToInteract();
|
||||
|
||||
boolean addNpcToInteract(UUID npcToInteract);
|
||||
|
||||
void setNpcsToInteract(final LinkedList<UUID> npcsToInteract);
|
||||
|
||||
LinkedList<UUID> getNpcsToKill();
|
||||
|
||||
boolean addNpcToKill(UUID citizenToKill);
|
||||
|
||||
void setNpcsToKill(final LinkedList<UUID> npcsToKill);
|
||||
|
||||
LinkedList<Integer> getNpcNumToKill();
|
||||
|
||||
boolean addNpcNumToKill(Integer npcNumToKill);
|
||||
|
||||
void setNpcNumToKill(final LinkedList<Integer> npcNumToKill);
|
||||
|
||||
LinkedList<EntityType> getMobsToKill();
|
||||
|
||||
boolean addMobToKill(EntityType mobToKill);
|
||||
|
||||
void setMobsToKill(final LinkedList<EntityType> mobsToKill);
|
||||
|
||||
LinkedList<Integer> getMobNumToKill();
|
||||
|
||||
boolean addMobNumToKill(Integer mobNumToKill);
|
||||
|
||||
void setMobNumToKill(final LinkedList<Integer> mobNumToKill);
|
||||
|
||||
LinkedList<Location> getLocationsToKillWithin();
|
||||
|
||||
boolean addLocationToKillWithin(Location locationToKillWithin);
|
||||
|
||||
void setLocationsToKillWithin(final LinkedList<Location> locationsToKillWithin);
|
||||
|
||||
LinkedList<Integer> getRadiiToKillWithin();
|
||||
|
||||
boolean addRadiusToKillWithin(Integer radiusToKillWithin);
|
||||
|
||||
void setRadiiToKillWithin(final LinkedList<Integer> radiiToKillWithin);
|
||||
|
||||
LinkedList<String> getKillNames();
|
||||
|
||||
boolean addKillName(String killName);
|
||||
|
||||
void setKillNames(final LinkedList<String> killNames);
|
||||
|
||||
LinkedList<Location> getLocationsToReach();
|
||||
|
||||
boolean addLocationToReach(Location locationToReach);
|
||||
|
||||
void setLocationsToReach(final LinkedList<Location> locationsToReach);
|
||||
|
||||
LinkedList<Integer> getRadiiToReachWithin();
|
||||
|
||||
boolean addRadiusToReachWithin(Integer radiusToReachWithin);
|
||||
|
||||
void setRadiiToReachWithin(final LinkedList<Integer> radiiToReachWithin);
|
||||
|
||||
LinkedList<World> getWorldsToReachWithin();
|
||||
|
||||
boolean addWorldToReachWithin(World worldToReachWithin);
|
||||
|
||||
void setWorldsToReachWithin(final LinkedList<World> worldsToReachWithin);
|
||||
|
||||
LinkedList<String> getLocationNames();
|
||||
|
||||
boolean addLocationName(String locationName);
|
||||
|
||||
void setLocationNames(final LinkedList<String> locationNames);
|
||||
|
||||
LinkedList<EntityType> getMobsToTame();
|
||||
|
||||
boolean addMobToTame(EntityType mobToTame);
|
||||
|
||||
void setMobsToTame(final LinkedList<EntityType> mobsToTame);
|
||||
|
||||
LinkedList<Integer> getMobNumToTame();
|
||||
|
||||
boolean addMobNumToTame(Integer mobNumToTame);
|
||||
|
||||
void setMobNumToTame(final LinkedList<Integer> mobNumToTame);
|
||||
|
||||
Integer getFishToCatch();
|
||||
|
||||
void setFishToCatch(final Integer fishToCatch);
|
||||
|
||||
Integer getCowsToMilk();
|
||||
|
||||
void setCowsToMilk(final Integer cowsToMilk);
|
||||
|
||||
Integer getPlayersToKill();
|
||||
|
||||
void setPlayersToKill(final Integer playersToKill);
|
||||
|
||||
LinkedList<DyeColor> getSheepToShear();
|
||||
|
||||
boolean addSheepToShear(DyeColor sheepToShear);
|
||||
|
||||
void setSheepToShear(final LinkedList<DyeColor> sheepToShear);
|
||||
|
||||
LinkedList<Integer> getSheepNumToShear();
|
||||
|
||||
boolean addSheepNumToShear(Integer sheepNumToShear);
|
||||
|
||||
void setSheepNumToShear(final LinkedList<Integer> sheepNumToShear);
|
||||
|
||||
LinkedList<String> getPasswordDisplays();
|
||||
|
||||
boolean addPasswordDisplay(String passwordDisplay);
|
||||
|
||||
void setPasswordDisplays(final LinkedList<String> passwordDisplays);
|
||||
|
||||
LinkedList<String> getPasswordPhrases();
|
||||
|
||||
boolean addPasswordPhrase(String passwordPhrase);
|
||||
|
||||
void setPasswordPhrases(final LinkedList<String> passwordPhrases);
|
||||
|
||||
String getScript();
|
||||
|
||||
void setScript(final String script);
|
||||
|
||||
IAction getStartAction();
|
||||
|
||||
void setStartAction(final IAction startAction);
|
||||
|
||||
IAction getFinishAction();
|
||||
|
||||
void setFinishAction(final IAction finishAction);
|
||||
|
||||
IAction getFailAction();
|
||||
|
||||
void setFailAction(final IAction failAction);
|
||||
|
||||
IAction getDeathAction();
|
||||
|
||||
void setDeathAction(final IAction deathAction);
|
||||
|
||||
Map<String, IAction> getChatActions();
|
||||
|
||||
void addChatAction(Map.Entry<String, IAction> chatAction);
|
||||
|
||||
void setChatActions(final Map<String, IAction> chatActions);
|
||||
|
||||
Map<String, IAction> getCommandActions();
|
||||
|
||||
void addCommandAction(Map.Entry<String, IAction> commandAction);
|
||||
|
||||
void setCommandActions(final Map<String, IAction> commandActions);
|
||||
|
||||
IAction getDisconnectAction();
|
||||
|
||||
void setDisconnectAction(final IAction disconnectAction);
|
||||
|
||||
ICondition getCondition();
|
||||
|
||||
void setCondition(final ICondition condition);
|
||||
|
||||
long getDelay();
|
||||
|
||||
void setDelay(final long delay);
|
||||
|
||||
String getDelayMessage();
|
||||
|
||||
void setDelayMessage(final String delayMessage);
|
||||
|
||||
String getCompleteMessage();
|
||||
|
||||
void setCompleteMessage(final String completeMessage);
|
||||
|
||||
String getStartMessage();
|
||||
|
||||
void setStartMessage(final String startMessage);
|
||||
|
||||
LinkedList<String> getObjectiveOverrides();
|
||||
|
||||
boolean addObjectiveOverride(String objectiveOverride);
|
||||
|
||||
void setObjectiveOverrides(final LinkedList<String> objectiveOverrides);
|
||||
|
||||
LinkedList<ICustomObjective> getCustomObjectives();
|
||||
|
||||
boolean addCustomObjectives(final ICustomObjective customObjective);
|
||||
|
||||
void clearCustomObjectives();
|
||||
|
||||
LinkedList<Integer> getCustomObjectiveCounts();
|
||||
|
||||
boolean addCustomObjectiveCounts(final Integer customObjectiveCount);
|
||||
|
||||
void clearCustomObjectiveCounts();
|
||||
|
||||
LinkedList<String> getCustomObjectiveDisplays();
|
||||
|
||||
void clearCustomObjectiveDisplays();
|
||||
|
||||
LinkedList<Map.Entry<String, Object>> getCustomObjectiveData();
|
||||
|
||||
boolean addCustomObjectiveData(final Map.Entry<String, Object> customObjectiveDatum);
|
||||
|
||||
void clearCustomObjectiveData();
|
||||
|
||||
/**
|
||||
* Check if stage has at least one objective<p>
|
||||
*
|
||||
* Excludes start/complete message, delay, and objective-override
|
||||
*
|
||||
* @return true if stage contains an objective
|
||||
*/
|
||||
boolean hasObjective();
|
||||
|
||||
/**
|
||||
* Check if stage has at least one objective of which the target can be located easily<p>
|
||||
*
|
||||
* @return true if stage contains a locatable objective
|
||||
*/
|
||||
boolean hasLocatableObjective();
|
||||
|
||||
/**
|
||||
* Check if stage has the specified type of objective<p>
|
||||
*
|
||||
* @param type The type of objective to check for
|
||||
* @return true if stage contains specified objective
|
||||
*/
|
||||
boolean containsObjective(final ObjectiveType type);
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* 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;
|
||||
|
||||
import me.blackvein.quests.enums.ObjectiveType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public interface Objective {
|
||||
ObjectiveType getType();
|
||||
|
||||
String getMessage();
|
||||
|
||||
int getProgress();
|
||||
|
||||
int getGoal();
|
||||
|
||||
@NotNull Object getProgressObject();
|
||||
|
||||
@NotNull Object getGoalObject();
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* 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;
|
||||
|
||||
public interface Planner {
|
||||
String getStart();
|
||||
|
||||
long getStartInMillis();
|
||||
|
||||
boolean hasStart();
|
||||
|
||||
void setStart(final String start);
|
||||
|
||||
String getEnd();
|
||||
|
||||
long getEndInMillis();
|
||||
|
||||
boolean hasEnd();
|
||||
|
||||
void setEnd(final String end);
|
||||
|
||||
long getRepeat();
|
||||
|
||||
boolean hasRepeat();
|
||||
|
||||
void setRepeat(final long repeat);
|
||||
|
||||
long getCooldown();
|
||||
|
||||
boolean hasCooldown();
|
||||
|
||||
void setCooldown(final long cooldown);
|
||||
|
||||
boolean getOverride();
|
||||
|
||||
void setOverride(final boolean override);
|
||||
}
|
@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* 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;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.ConversationFactory;
|
||||
import org.bukkit.conversations.Prompt;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface QuestFactory {
|
||||
Map<UUID, Block> getSelectedBlockStarts();
|
||||
|
||||
void setSelectedBlockStarts(final Map<UUID, Block> selectedBlockStarts);
|
||||
|
||||
Map<UUID, Block> getSelectedKillLocations();
|
||||
|
||||
void setSelectedKillLocations(final Map<UUID, Block> selectedKillLocations);
|
||||
|
||||
Map<UUID, Block> getSelectedReachLocations();
|
||||
|
||||
void setSelectedReachLocations(final Map<UUID, Block> selectedReachLocations);
|
||||
|
||||
Set<UUID> getSelectingNpcs();
|
||||
|
||||
void setSelectingNpcs(final Set<UUID> selectingNpcs);
|
||||
|
||||
List<String> getNamesOfQuestsBeingEdited();
|
||||
|
||||
void setNamesOfQuestsBeingEdited(final List<String> questNames);
|
||||
|
||||
ConversationFactory getConversationFactory();
|
||||
|
||||
Prompt returnToMenu(final ConversationContext context);
|
||||
|
||||
void loadQuest(final ConversationContext context, final IQuest q);
|
||||
|
||||
void deleteQuest(final ConversationContext context);
|
||||
|
||||
void saveQuest(final ConversationContext context, final ConfigurationSection section);
|
||||
|
||||
/*void saveRequirements(final ConversationContext context, final ConfigurationSection section);
|
||||
|
||||
void saveStages(final ConversationContext context, final ConfigurationSection section);
|
||||
|
||||
void saveRewards(final ConversationContext context, final ConfigurationSection section);
|
||||
|
||||
void savePlanner(final ConversationContext context, final ConfigurationSection section);
|
||||
|
||||
void saveOptions(final ConversationContext context, final ConfigurationSection section);*/
|
||||
}
|
100
api/src/main/java/me/pikamug/quests/Quests.java
Normal file
100
api/src/main/java/me/pikamug/quests/Quests.java
Normal file
@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests;
|
||||
|
||||
import me.pikamug.quests.actions.Action;
|
||||
import me.pikamug.quests.actions.ActionFactory;
|
||||
import me.pikamug.quests.conditions.Condition;
|
||||
import me.pikamug.quests.conditions.ConditionFactory;
|
||||
import me.pikamug.quests.config.ConfigSettings;
|
||||
import me.pikamug.quests.dependencies.Dependencies;
|
||||
import me.pikamug.quests.module.CustomObjective;
|
||||
import me.pikamug.quests.module.CustomRequirement;
|
||||
import me.pikamug.quests.module.CustomReward;
|
||||
import me.pikamug.quests.player.Quester;
|
||||
import me.pikamug.quests.quests.Quest;
|
||||
import me.pikamug.quests.quests.QuestFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public interface Quests {
|
||||
|
||||
boolean isLoading();
|
||||
|
||||
String getDetectedServerSoftwareVersion();
|
||||
|
||||
File getPluginDataFolder();
|
||||
|
||||
Logger getPluginLogger();
|
||||
|
||||
InputStream getPluginResource(String filename);
|
||||
|
||||
Dependencies getDependencies();
|
||||
|
||||
ConfigSettings getConfigSettings();
|
||||
|
||||
List<CustomObjective> getCustomObjectives();
|
||||
|
||||
List<CustomReward> getCustomRewards();
|
||||
|
||||
List<CustomRequirement> getCustomRequirements();
|
||||
|
||||
Collection<Quest> getLoadedQuests();
|
||||
|
||||
Collection<Action> getLoadedActions();
|
||||
|
||||
Collection<Condition> getLoadedConditions();
|
||||
|
||||
Quester getQuester(final UUID id);
|
||||
|
||||
Collection<Quester> getOnlineQuesters();
|
||||
|
||||
Collection<Quester> getOfflineQuesters();
|
||||
|
||||
void setOfflineQuesters(final Collection<Quester> questers);
|
||||
|
||||
QuestFactory getQuestFactory();
|
||||
|
||||
ActionFactory getActionFactory();
|
||||
|
||||
ConditionFactory getConditionFactory();
|
||||
|
||||
/*ConvoListener getConvoListener();
|
||||
|
||||
BlockListener getBlockListener();
|
||||
|
||||
ItemListener getItemListener();
|
||||
|
||||
NpcListener getNpcListener();
|
||||
|
||||
PlayerListener getPlayerListener();
|
||||
|
||||
UniteListener getUniteListener();
|
||||
|
||||
NpcEffectThread getNpcEffectThread();
|
||||
|
||||
PlayerMoveThread getPlayerMoveThread();
|
||||
|
||||
PartiesListener getPartiesListener();
|
||||
|
||||
DenizenTrigger getDenizenTrigger();
|
||||
|
||||
LocaleManager getLocaleManager();
|
||||
|
||||
QuesterStorage getStorage();*/
|
||||
|
||||
void saveResourceAs(String resourcePath, final String outputPath, final boolean replace);
|
||||
}
|
81
api/src/main/java/me/pikamug/quests/actions/Action.java
Normal file
81
api/src/main/java/me/pikamug/quests/actions/Action.java
Normal file
@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.actions;
|
||||
|
||||
import me.pikamug.quests.entity.QuestMob;
|
||||
import me.pikamug.quests.player.Quester;
|
||||
import me.pikamug.quests.quests.Quest;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
public interface Action extends Comparable<Action> {
|
||||
String getName();
|
||||
|
||||
void setName(final String name);
|
||||
|
||||
String getMessage();
|
||||
|
||||
void setMessage(final String message);
|
||||
|
||||
boolean isClearInv();
|
||||
|
||||
void setClearInv(final boolean clearInv);
|
||||
|
||||
boolean isFailQuest();
|
||||
|
||||
void setFailQuest(final boolean failQuest);
|
||||
|
||||
int getStormDuration();
|
||||
|
||||
void setStormDuration(final int stormDuration);
|
||||
|
||||
int getThunderDuration();
|
||||
|
||||
void setThunderDuration(final int thunderDuration);
|
||||
|
||||
int getTimer();
|
||||
|
||||
void setTimer(final int timer);
|
||||
|
||||
boolean isCancelTimer();
|
||||
|
||||
void setCancelTimer(final boolean cancelTimer);
|
||||
|
||||
LinkedList<QuestMob> getMobSpawns();
|
||||
|
||||
void setMobSpawns(final LinkedList<QuestMob> mobSpawns);
|
||||
|
||||
LinkedList<String> getCommands();
|
||||
|
||||
void setCommands(final LinkedList<String> commands);
|
||||
|
||||
int getHunger();
|
||||
|
||||
void setHunger(final int hunger);
|
||||
|
||||
int getSaturation();
|
||||
|
||||
void setSaturation(final int saturation);
|
||||
|
||||
float getHealth();
|
||||
|
||||
void setHealth(final float health);
|
||||
|
||||
String getBook();
|
||||
|
||||
void setBook(final String book);
|
||||
|
||||
String getDenizenScript();
|
||||
|
||||
void setDenizenScript(final String scriptName);
|
||||
|
||||
void fire(final Quester quester, final Quest quest);
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.actions;
|
||||
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.ConversationFactory;
|
||||
import org.bukkit.conversations.Prompt;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ActionFactory {
|
||||
|
||||
ConversationFactory getConversationFactory();
|
||||
|
||||
List<String> getNamesOfActionsBeingEdited();
|
||||
|
||||
void setNamesOfActionsBeingEdited(final List<String> actionNames);
|
||||
|
||||
Prompt returnToMenu(final ConversationContext context);
|
||||
|
||||
void loadData(final ConversationContext context, final Action action);
|
||||
|
||||
void clearData(final ConversationContext context);
|
||||
|
||||
void deleteAction(final ConversationContext context);
|
||||
|
||||
void saveAction(final ConversationContext context);
|
||||
}
|
@ -1,25 +1,22 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.conditions;
|
||||
package me.pikamug.quests.conditions;
|
||||
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import me.pikamug.quests.player.Quester;
|
||||
import me.pikamug.quests.quests.Quest;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface ICondition extends Comparable<ICondition> {
|
||||
public interface Condition extends Comparable<Condition> {
|
||||
String getName();
|
||||
|
||||
void setName(final String name);
|
||||
@ -40,14 +37,6 @@ public interface ICondition extends Comparable<ICondition> {
|
||||
|
||||
void setPermissions(final LinkedList<String> permissions);
|
||||
|
||||
LinkedList<ItemStack> getItemsWhileHoldingMainHand();
|
||||
|
||||
void setItemsWhileHoldingMainHand(final LinkedList<ItemStack> itemsWhileHoldingMainHand);
|
||||
|
||||
LinkedList<ItemStack> getItemsWhileWearing();
|
||||
|
||||
void setItemsWhileWearing(final LinkedList<ItemStack> itemsWhileWearing);
|
||||
|
||||
LinkedList<String> getWorldsWhileStayingWithin();
|
||||
|
||||
void setWorldsWhileStayingWithin(final LinkedList<String> worldsWhileStayingWithin);
|
||||
@ -76,5 +65,5 @@ public interface ICondition extends Comparable<ICondition> {
|
||||
|
||||
void setPlaceholdersCheckValue(final LinkedList<String> placeholdersCheckValue);
|
||||
|
||||
boolean check(final IQuester quester, final IQuest quest);
|
||||
boolean check(final Quester quester, final Quest quest);
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.conditions;
|
||||
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.ConversationFactory;
|
||||
import org.bukkit.conversations.Prompt;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ConditionFactory {
|
||||
ConversationFactory getConversationFactory();
|
||||
|
||||
List<String> getNamesOfConditionsBeingEdited();
|
||||
|
||||
void setNamesOfConditionsBeingEdited(final List<String> conditionNames);
|
||||
|
||||
Prompt returnToMenu(final ConversationContext context);
|
||||
|
||||
void loadData(final ConversationContext context, final Condition condition);
|
||||
|
||||
void clearData(final ConversationContext context);
|
||||
|
||||
void deleteCondition(final ConversationContext context);
|
||||
|
||||
void saveCondition(final ConversationContext context);
|
||||
}
|
@ -1,18 +1,16 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.config;
|
||||
package me.pikamug.quests.config;
|
||||
|
||||
public interface ISettings {
|
||||
public interface ConfigSettings {
|
||||
int getAcceptTimeout();
|
||||
void setAcceptTimeout(final int acceptTimeout);
|
||||
boolean canAllowCommands();
|
@ -1,19 +1,16 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.convo;
|
||||
package me.pikamug.quests.convo;
|
||||
|
||||
import me.blackvein.quests.QuestsAPI;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import me.pikamug.quests.Quests;
|
||||
import net.md_5.bungee.api.chat.ClickEvent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -64,9 +61,9 @@ public abstract class QuestsNumericPrompt extends NumericPrompt {
|
||||
*/
|
||||
public static String sendClickableSelection(final String input, final ConversationContext context) {
|
||||
if (context.getPlugin() == null) {
|
||||
return Lang.get("itemCreateCriticalError");
|
||||
return "ERROR";
|
||||
}
|
||||
if (!(context.getForWhom() instanceof Player) || !((QuestsAPI)context.getPlugin()).getSettings().canClickablePrompts()) {
|
||||
if (!(context.getForWhom() instanceof Player) || !((Quests)context.getPlugin()).getConfigSettings().canClickablePrompts()) {
|
||||
return input;
|
||||
}
|
||||
final String[] basicText = input.split("\n");
|
@ -1,19 +1,16 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.convo;
|
||||
package me.pikamug.quests.convo;
|
||||
|
||||
import me.blackvein.quests.QuestsAPI;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import me.pikamug.quests.Quests;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import net.md_5.bungee.api.chat.ClickEvent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
@ -57,9 +54,9 @@ public abstract class QuestsStringPrompt extends StringPrompt {
|
||||
protected String sendClickableMenu(final String header, final List<String> list, final String footer,
|
||||
final ConversationContext context) {
|
||||
if (context.getPlugin() == null) {
|
||||
return Lang.get("itemCreateCriticalError");
|
||||
return "ERROR";
|
||||
}
|
||||
if (!(context.getForWhom() instanceof Player) || !((QuestsAPI)context.getPlugin()).getSettings().canClickablePrompts()) {
|
||||
if (!(context.getForWhom() instanceof Player) || !((Quests)context.getPlugin()).getConfigSettings().canClickablePrompts()) {
|
||||
return ChatColor.GOLD + header + "\n" + ChatColor.AQUA + String.join(ChatColor.GRAY + ", " + ChatColor.AQUA, list) + "\n" + ChatColor.YELLOW + footer;
|
||||
}
|
||||
final TextComponent component = new TextComponent(header + "\n");
|
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.convo.actions;
|
||||
|
||||
import me.pikamug.quests.Quests;
|
||||
import me.pikamug.quests.actions.ActionFactory;
|
||||
import me.pikamug.quests.convo.QuestsNumericPrompt;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
|
||||
public abstract class ActionsEditorNumericPrompt extends QuestsNumericPrompt {
|
||||
private final ConversationContext context;
|
||||
private ActionFactory factory;
|
||||
|
||||
public ActionsEditorNumericPrompt(final ConversationContext context) {
|
||||
this.context = context;
|
||||
if (context != null && context.getPlugin() != null) {
|
||||
this.factory = ((Quests)context.getPlugin()).getActionFactory();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
|
||||
public ConversationContext getConversationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public ActionFactory getActionFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
public abstract int getSize();
|
||||
|
||||
public abstract String getTitle(ConversationContext context);
|
||||
|
||||
public abstract ChatColor getNumberColor(ConversationContext context, int number);
|
||||
|
||||
public abstract String getSelectionText(ConversationContext context, int number);
|
||||
|
||||
public abstract String getAdditionalText(ConversationContext context, int number);
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.convo.actions;
|
||||
|
||||
import me.pikamug.quests.Quests;
|
||||
import me.pikamug.quests.actions.ActionFactory;
|
||||
import me.pikamug.quests.convo.QuestsStringPrompt;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
|
||||
public abstract class ActionsEditorStringPrompt extends QuestsStringPrompt {
|
||||
private final ConversationContext context;
|
||||
private ActionFactory factory;
|
||||
|
||||
public ActionsEditorStringPrompt(final ConversationContext context) {
|
||||
this.context = context;
|
||||
if (context != null && context.getPlugin() != null) {
|
||||
this.factory = ((Quests)context.getPlugin()).getActionFactory();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
|
||||
public ConversationContext getConversationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public ActionFactory getActionFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
public abstract String getTitle(ConversationContext context);
|
||||
|
||||
public abstract String getQueryText(ConversationContext context);
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.convo.conditions;
|
||||
|
||||
import me.pikamug.quests.Quests;
|
||||
import me.pikamug.quests.conditions.ConditionFactory;
|
||||
import me.pikamug.quests.convo.QuestsNumericPrompt;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
|
||||
public abstract class ConditionsEditorNumericPrompt extends QuestsNumericPrompt {
|
||||
private final ConversationContext context;
|
||||
private ConditionFactory factory;
|
||||
|
||||
public ConditionsEditorNumericPrompt(final ConversationContext context) {
|
||||
this.context = context;
|
||||
if (context != null && context.getPlugin() != null) {
|
||||
this.factory = ((Quests)context.getPlugin()).getConditionFactory();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
|
||||
public ConversationContext getConversationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public ConditionFactory getConditionFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
public abstract int getSize();
|
||||
|
||||
public abstract String getTitle(ConversationContext context);
|
||||
|
||||
public abstract ChatColor getNumberColor(ConversationContext context, int number);
|
||||
|
||||
public abstract String getSelectionText(ConversationContext context, int number);
|
||||
|
||||
public abstract String getAdditionalText(ConversationContext context, int number);
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.convo.conditions;
|
||||
|
||||
import me.pikamug.quests.Quests;
|
||||
import me.pikamug.quests.conditions.ConditionFactory;
|
||||
import me.pikamug.quests.convo.QuestsStringPrompt;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
|
||||
public abstract class ConditionsEditorStringPrompt extends QuestsStringPrompt {
|
||||
private final ConversationContext context;
|
||||
private ConditionFactory factory;
|
||||
|
||||
public ConditionsEditorStringPrompt(final ConversationContext context) {
|
||||
this.context = context;
|
||||
if (context != null && context.getPlugin() != null) {
|
||||
this.factory = ((Quests)context.getPlugin()).getConditionFactory();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
|
||||
public ConversationContext getConversationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public ConditionFactory getConditionFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
public abstract String getTitle(ConversationContext context);
|
||||
|
||||
public abstract String getQueryText(ConversationContext context);
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.convo.quests;
|
||||
|
||||
import me.pikamug.quests.quests.QuestFactory;
|
||||
import me.pikamug.quests.Quests;
|
||||
import me.pikamug.quests.convo.QuestsNumericPrompt;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
|
||||
public abstract class QuestsEditorNumericPrompt extends QuestsNumericPrompt {
|
||||
private final ConversationContext context;
|
||||
private QuestFactory factory;
|
||||
|
||||
public QuestsEditorNumericPrompt(final ConversationContext context) {
|
||||
this.context = context;
|
||||
if (context != null && context.getPlugin() != null) {
|
||||
factory = ((Quests)context.getPlugin()).getQuestFactory();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
|
||||
public ConversationContext getConversationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public QuestFactory getQuestFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
public abstract int getSize();
|
||||
|
||||
public abstract String getTitle(ConversationContext context);
|
||||
|
||||
public abstract ChatColor getNumberColor(ConversationContext context, int number);
|
||||
|
||||
public abstract String getSelectionText(ConversationContext context, int number);
|
||||
|
||||
public abstract String getAdditionalText(ConversationContext context, int number);
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.convo.quests;
|
||||
|
||||
import me.pikamug.quests.quests.QuestFactory;
|
||||
import me.pikamug.quests.Quests;
|
||||
import me.pikamug.quests.convo.QuestsStringPrompt;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
|
||||
public abstract class QuestsEditorStringPrompt extends QuestsStringPrompt {
|
||||
private final ConversationContext context;
|
||||
private QuestFactory factory;
|
||||
|
||||
public QuestsEditorStringPrompt(final ConversationContext context) {
|
||||
this.context = context;
|
||||
if (context != null && context.getPlugin() != null) {
|
||||
factory = ((Quests)context.getPlugin()).getQuestFactory();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
|
||||
public ConversationContext getConversationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public QuestFactory getQuestFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
public abstract String getTitle(ConversationContext context);
|
||||
|
||||
public abstract String getQueryText(ConversationContext context);
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.dependencies;
|
||||
|
||||
public interface Dependencies {
|
||||
|
||||
boolean isPluginAvailable(final String pluginName);
|
||||
|
||||
void init();
|
||||
}
|
27
api/src/main/java/me/pikamug/quests/entity/QuestMob.java
Normal file
27
api/src/main/java/me/pikamug/quests/entity/QuestMob.java
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.entity;
|
||||
|
||||
public interface QuestMob {
|
||||
String getName();
|
||||
|
||||
void setName(final String name);
|
||||
|
||||
Integer getSpawnAmounts();
|
||||
|
||||
void setSpawnAmounts(final int spawnAmounts);
|
||||
|
||||
Float[] getDropChances();
|
||||
|
||||
void setDropChances(final Float[] dropChances);
|
||||
|
||||
void spawn();
|
||||
}
|
@ -1,16 +1,14 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.enums;
|
||||
package me.pikamug.quests.enums;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
58
api/src/main/java/me/pikamug/quests/enums/StorageType.java
Normal file
58
api/src/main/java/me/pikamug/quests/enums/StorageType.java
Normal file
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.enums;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public enum StorageType {
|
||||
|
||||
// Local text file
|
||||
YAML("YAML", "yaml", "yml"),
|
||||
|
||||
// Remote database
|
||||
MYSQL("MySQL", "mysql"),
|
||||
|
||||
// Local archive
|
||||
JAR("JAR", "jar"),
|
||||
|
||||
// Custom
|
||||
CUSTOM("Custom", "custom");
|
||||
|
||||
private final String name;
|
||||
|
||||
private final List<String> identifiers;
|
||||
|
||||
StorageType(final String name, final String... identifiers) {
|
||||
this.name = name;
|
||||
this.identifiers = Collections.unmodifiableList(Arrays.asList(identifiers));
|
||||
}
|
||||
|
||||
public static StorageType parse(final String name, final StorageType def) {
|
||||
for (final StorageType t : values()) {
|
||||
for (final String id : t.getIdentifiers()) {
|
||||
if (id.equalsIgnoreCase(name)) {
|
||||
return t;
|
||||
}
|
||||
}
|
||||
}
|
||||
return def;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public List<String> getIdentifiers() {
|
||||
return identifiers;
|
||||
}
|
||||
}
|
35
api/src/main/java/me/pikamug/quests/events/QuestsEvent.java
Normal file
35
api/src/main/java/me/pikamug/quests/events/QuestsEvent.java
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.events;
|
||||
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public abstract class QuestsEvent extends Event {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
|
||||
public QuestsEvent() {
|
||||
}
|
||||
|
||||
public QuestsEvent(final boolean async) {
|
||||
super(async);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
@ -1,20 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.events.editor.actions;
|
||||
package me.pikamug.quests.events.editor.actions;
|
||||
|
||||
import me.blackvein.quests.QuestsAPI;
|
||||
import me.blackvein.quests.actions.ActionFactory;
|
||||
import me.blackvein.quests.events.QuestsEvent;
|
||||
import me.pikamug.quests.Quests;
|
||||
import me.pikamug.quests.actions.ActionFactory;
|
||||
import me.pikamug.quests.events.QuestsEvent;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.Prompt;
|
||||
import org.bukkit.event.HandlerList;
|
||||
@ -33,14 +31,14 @@ public abstract class ActionsEditorEvent extends QuestsEvent {
|
||||
|
||||
public ActionsEditorEvent(final ConversationContext context, final Prompt prompt) {
|
||||
this.context = context;
|
||||
this.factory = ((QuestsAPI) Objects.requireNonNull(context.getPlugin())).getActionFactory();
|
||||
this.factory = ((Quests) Objects.requireNonNull(context.getPlugin())).getActionFactory();
|
||||
this.prompt = prompt;
|
||||
}
|
||||
|
||||
public ActionsEditorEvent(final ConversationContext context, final Prompt prompt, final boolean async) {
|
||||
super(async);
|
||||
this.context = context;
|
||||
this.factory = ((QuestsAPI) Objects.requireNonNull(context.getPlugin())).getActionFactory();
|
||||
this.factory = ((Quests) Objects.requireNonNull(context.getPlugin())).getActionFactory();
|
||||
this.prompt = prompt;
|
||||
}
|
||||
|
@ -1,21 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.events.editor.actions;
|
||||
package me.pikamug.quests.events.editor.actions;
|
||||
|
||||
import me.pikamug.quests.convo.actions.ActionsEditorNumericPrompt;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.convo.actions.ActionsEditorNumericPrompt;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class ActionsEditorPostOpenNumericPromptEvent extends ActionsEditorEvent {
|
@ -1,18 +1,16 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.events.editor.actions;
|
||||
package me.pikamug.quests.events.editor.actions;
|
||||
|
||||
import me.blackvein.quests.convo.actions.ActionsEditorStringPrompt;
|
||||
import me.pikamug.quests.convo.actions.ActionsEditorStringPrompt;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
@ -1,20 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.events.editor.conditions;
|
||||
package me.pikamug.quests.events.editor.conditions;
|
||||
|
||||
import me.blackvein.quests.QuestsAPI;
|
||||
import me.blackvein.quests.conditions.ConditionFactory;
|
||||
import me.blackvein.quests.events.QuestsEvent;
|
||||
import me.pikamug.quests.Quests;
|
||||
import me.pikamug.quests.conditions.ConditionFactory;
|
||||
import me.pikamug.quests.events.QuestsEvent;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.Prompt;
|
||||
import org.bukkit.event.HandlerList;
|
||||
@ -33,14 +31,14 @@ public abstract class ConditionsEditorEvent extends QuestsEvent {
|
||||
|
||||
public ConditionsEditorEvent(final ConversationContext context, final Prompt prompt) {
|
||||
this.context = context;
|
||||
this.factory = ((QuestsAPI) Objects.requireNonNull(context.getPlugin())).getConditionFactory();
|
||||
this.factory = ((Quests) Objects.requireNonNull(context.getPlugin())).getConditionFactory();
|
||||
this.prompt = prompt;
|
||||
}
|
||||
|
||||
public ConditionsEditorEvent(final ConversationContext context, final Prompt prompt, final boolean async) {
|
||||
super(async);
|
||||
this.context = context;
|
||||
this.factory = ((QuestsAPI) Objects.requireNonNull(context.getPlugin())).getConditionFactory();
|
||||
this.factory = ((Quests) Objects.requireNonNull(context.getPlugin())).getConditionFactory();
|
||||
this.prompt = prompt;
|
||||
}
|
||||
|
@ -1,21 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.events.editor.conditions;
|
||||
package me.pikamug.quests.events.editor.conditions;
|
||||
|
||||
import me.pikamug.quests.convo.conditions.ConditionsEditorNumericPrompt;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.convo.conditions.ConditionsEditorNumericPrompt;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class ConditionsEditorPostOpenNumericPromptEvent extends ConditionsEditorEvent {
|
@ -1,21 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.events.editor.conditions;
|
||||
package me.pikamug.quests.events.editor.conditions;
|
||||
|
||||
import me.pikamug.quests.convo.conditions.ConditionsEditorStringPrompt;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.convo.conditions.ConditionsEditorStringPrompt;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class ConditionsEditorPostOpenStringPromptEvent extends ConditionsEditorEvent {
|
@ -1,20 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.events.editor.quests;
|
||||
package me.pikamug.quests.events.editor.quests;
|
||||
|
||||
import me.blackvein.quests.quests.QuestFactory;
|
||||
import me.blackvein.quests.QuestsAPI;
|
||||
import me.blackvein.quests.events.QuestsEvent;
|
||||
import me.pikamug.quests.quests.QuestFactory;
|
||||
import me.pikamug.quests.Quests;
|
||||
import me.pikamug.quests.events.QuestsEvent;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.Prompt;
|
||||
import org.bukkit.event.HandlerList;
|
||||
@ -33,14 +31,14 @@ public abstract class QuestsEditorEvent extends QuestsEvent {
|
||||
|
||||
public QuestsEditorEvent(final ConversationContext context, final Prompt prompt) {
|
||||
this.context = context;
|
||||
this.factory = ((QuestsAPI) Objects.requireNonNull(context.getPlugin())).getQuestFactory();
|
||||
this.factory = ((Quests) Objects.requireNonNull(context.getPlugin())).getQuestFactory();
|
||||
this.prompt = prompt;
|
||||
}
|
||||
|
||||
public QuestsEditorEvent(final ConversationContext context, final Prompt prompt, final boolean async) {
|
||||
super(async);
|
||||
this.context = context;
|
||||
this.factory = ((QuestsAPI) Objects.requireNonNull(context.getPlugin())).getQuestFactory();
|
||||
this.factory = ((Quests) Objects.requireNonNull(context.getPlugin())).getQuestFactory();
|
||||
this.prompt = prompt;
|
||||
}
|
||||
|
@ -1,18 +1,16 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.events.editor.quests;
|
||||
package me.pikamug.quests.events.editor.quests;
|
||||
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||
import me.pikamug.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
@ -1,18 +1,16 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.events.editor.quests;
|
||||
package me.pikamug.quests.events.editor.quests;
|
||||
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorStringPrompt;
|
||||
import me.pikamug.quests.convo.quests.QuestsEditorStringPrompt;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
@ -1,18 +1,16 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.events.misc;
|
||||
package me.pikamug.quests.events.misc;
|
||||
|
||||
import me.blackvein.quests.events.QuestsEvent;
|
||||
import me.pikamug.quests.events.QuestsEvent;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.Prompt;
|
||||
import org.bukkit.event.HandlerList;
|
@ -1,16 +1,14 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.events.misc;
|
||||
package me.pikamug.quests.events.misc;
|
||||
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.Prompt;
|
@ -1,16 +1,14 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.events.misc;
|
||||
package me.pikamug.quests.events.misc;
|
||||
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.Prompt;
|
@ -1,16 +1,14 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.events.misc;
|
||||
package me.pikamug.quests.events.misc;
|
||||
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.Prompt;
|
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.events.quest;
|
||||
|
||||
import me.pikamug.quests.events.QuestsEvent;
|
||||
import me.pikamug.quests.quests.Quest;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Represents a quest-related event
|
||||
*/
|
||||
public abstract class QuestEvent extends QuestsEvent {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private final Quest quest;
|
||||
|
||||
public QuestEvent(final Quest quest) {
|
||||
this.quest = quest;
|
||||
}
|
||||
|
||||
public QuestEvent(final Quest quest, final boolean async) {
|
||||
super(async);
|
||||
this.quest = quest;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the quest involved in this event
|
||||
*
|
||||
* @return Quest which is involved in this event
|
||||
*/
|
||||
public final Quest getQuest() {
|
||||
return quest;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.events.quest;
|
||||
|
||||
import me.pikamug.quests.player.Quester;
|
||||
import me.pikamug.quests.quests.Quest;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Called when a quest is quit by a quester
|
||||
*/
|
||||
public class QuestQuitEvent extends QuestEvent implements Cancellable {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private final Quester quester;
|
||||
private boolean cancel = false;
|
||||
|
||||
public QuestQuitEvent(final Quest quest, final Quester who) {
|
||||
super(quest);
|
||||
this.quester = who;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the quester involved in this event
|
||||
*
|
||||
* @return Quester who is involved in this event
|
||||
*/
|
||||
public Quester getQuester() {
|
||||
return quester;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(final boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.events.quest;
|
||||
|
||||
import me.pikamug.quests.player.Quester;
|
||||
import me.pikamug.quests.quests.Quest;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Called when a quest is taken by a quester
|
||||
*/
|
||||
public class QuestTakeEvent extends QuestEvent implements Cancellable {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private final Quester quester;
|
||||
private boolean cancel = false;
|
||||
|
||||
public QuestTakeEvent(final Quest quest, final Quester who) {
|
||||
super(quest);
|
||||
this.quester = who;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the quester involved in this event
|
||||
*
|
||||
* @return Quester who is involved in this event
|
||||
*/
|
||||
public Quester getQuester() {
|
||||
return quester;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(final boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
@ -1,23 +1,21 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.events.quest;
|
||||
package me.pikamug.quests.events.quest;
|
||||
|
||||
import me.pikamug.quests.player.Quester;
|
||||
import me.pikamug.quests.quests.Quest;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@ -25,11 +23,11 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class QuestUpdateCompassEvent extends QuestEvent implements Cancellable {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private final IQuester quester;
|
||||
private final Quester quester;
|
||||
private final Location target;
|
||||
private boolean cancel = false;
|
||||
|
||||
public QuestUpdateCompassEvent(final IQuest quest, final IQuester who, final Location target) {
|
||||
public QuestUpdateCompassEvent(final Quest quest, final Quester who, final Location target) {
|
||||
super(quest);
|
||||
this.quester = who;
|
||||
this.target = target;
|
||||
@ -40,7 +38,7 @@ public class QuestUpdateCompassEvent extends QuestEvent implements Cancellable {
|
||||
*
|
||||
* @return Quester who is involved in this event
|
||||
*/
|
||||
public IQuester getQuester() {
|
||||
public Quester getQuester() {
|
||||
return quester;
|
||||
}
|
||||
|
@ -1,16 +1,14 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.exceptions;
|
||||
package me.pikamug.quests.exceptions;
|
||||
|
||||
public class ActionFormatException extends Exception {
|
||||
|
@ -1,16 +1,14 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.exceptions;
|
||||
package me.pikamug.quests.exceptions;
|
||||
|
||||
public class ConditionFormatException extends Exception {
|
||||
|
@ -1,16 +1,14 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.exceptions;
|
||||
package me.pikamug.quests.exceptions;
|
||||
|
||||
public class QuestFormatException extends Exception {
|
||||
|
@ -1,28 +1,26 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.exceptions;
|
||||
package me.pikamug.quests.exceptions;
|
||||
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.pikamug.quests.quests.Quest;
|
||||
|
||||
public class StageFormatException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = -8217391053042612896L;
|
||||
private final String message;
|
||||
private final IQuest quest;
|
||||
private final Quest quest;
|
||||
private final int stage;
|
||||
|
||||
|
||||
public StageFormatException(final String message, final IQuest quest, final int stage) {
|
||||
public StageFormatException(final String message, final Quest 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 +42,7 @@ public class StageFormatException extends Exception {
|
||||
*
|
||||
* @return The quest that an invalid stage id was set within.
|
||||
*/
|
||||
public IQuest getQuest() {
|
||||
public Quest getQuest() {
|
||||
return quest;
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.interfaces;
|
||||
|
||||
public interface ReloadCallback<T> {
|
||||
void execute(T response);
|
||||
}
|
@ -1,27 +1,26 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.module;
|
||||
package me.pikamug.quests.module;
|
||||
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import org.bukkit.entity.Player;
|
||||
import me.pikamug.quests.quests.Quest;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface ICustomObjective {
|
||||
public interface CustomObjective {
|
||||
|
||||
String getModuleName();
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
Map.Entry<String, Short> getModuleItem();
|
||||
|
||||
String getName();
|
||||
@ -78,12 +77,20 @@ public interface ICustomObjective {
|
||||
/**
|
||||
* Get custom objective data for applicable player
|
||||
*
|
||||
* @param player Player attempting this objective
|
||||
* @param uuid UUID of player attempting this objective
|
||||
* @param customObj The objective being attempted
|
||||
* @param quest Current me.blackvein.quests.Quest which includes this objective
|
||||
* @return data
|
||||
* @param quest Current me.pikamug.quests.Quest which includes this objective
|
||||
* @return data Map of custom objective data
|
||||
*/
|
||||
Map<String, Object> getDataForPlayerTemp(final Player player, final ICustomObjective customObj, final IQuest quest);
|
||||
Map<String, Object> getDataForPlayer(final UUID uuid, final CustomObjective customObj, final Quest quest);
|
||||
|
||||
void incrementObjectiveTemp(final Player player, final ICustomObjective obj, final int count, final IQuest quest);
|
||||
/**
|
||||
* Increment objective count for applicable player
|
||||
*
|
||||
* @param uuid UUID of player attempting this objective
|
||||
* @param customObj The objective being attempted
|
||||
* @param quest Current me.pikamug.quests.Quest which includes this objective
|
||||
* @param count Amount to increase objective count by
|
||||
*/
|
||||
void incrementObjective(final UUID uuid, final CustomObjective customObj, final Quest quest, final int count);
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.module;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface CustomRequirement {
|
||||
|
||||
String getModuleName();
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
Map.Entry<String, Short> getModuleItem();
|
||||
|
||||
String getName();
|
||||
|
||||
void setName(final String name);
|
||||
|
||||
String getAuthor();
|
||||
|
||||
void setAuthor(final String author);
|
||||
|
||||
String getDisplay();
|
||||
|
||||
void setDisplay(final String display);
|
||||
|
||||
Map.Entry<String, Short> getItem();
|
||||
|
||||
void setItem(final String type, final short durability);
|
||||
|
||||
Map<String, Object> getData();
|
||||
|
||||
Map<String, String> getDescriptions();
|
||||
|
||||
/**
|
||||
* Add a new prompt<p>
|
||||
*
|
||||
* Note that the "defaultValue" Object will be cast to a String internally
|
||||
*
|
||||
* @param title Prompt name
|
||||
* @param description Description of expected input
|
||||
* @param defaultValue Value to be used if input is not received
|
||||
*/
|
||||
void addStringPrompt(final String title, final String description, final Object defaultValue);
|
||||
|
||||
/**
|
||||
* Test whether a player has met the requirement
|
||||
*
|
||||
* @param uuid UUID of player being tested
|
||||
* @param data Map of custom requirement data
|
||||
* @return true if met
|
||||
*/
|
||||
boolean testRequirement(UUID uuid, Map<String, Object> data);
|
||||
}
|
61
api/src/main/java/me/pikamug/quests/module/CustomReward.java
Normal file
61
api/src/main/java/me/pikamug/quests/module/CustomReward.java
Normal file
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.module;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface CustomReward {
|
||||
|
||||
String getModuleName();
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
Map.Entry<String, Short> getModuleItem();
|
||||
|
||||
String getName();
|
||||
|
||||
void setName(final String name);
|
||||
|
||||
String getAuthor();
|
||||
|
||||
void setAuthor(final String author);
|
||||
|
||||
String getDisplay();
|
||||
|
||||
void setDisplay(final String display);
|
||||
|
||||
Map.Entry<String, Short> getItem();
|
||||
|
||||
void setItem(final String type, final short durability);
|
||||
|
||||
Map<String, Object> getData();
|
||||
|
||||
Map<String, String> getDescriptions();
|
||||
|
||||
/**
|
||||
* Add a new prompt<p>
|
||||
*
|
||||
* Note that the "defaultValue" Object will be cast to a String internally
|
||||
*
|
||||
* @param title Prompt name
|
||||
* @param description Description of expected input
|
||||
* @param defaultValue Value to be used if input is not received
|
||||
*/
|
||||
void addStringPrompt(final String title, final String description, final Object defaultValue);
|
||||
|
||||
/**
|
||||
* Give loot reward to a player
|
||||
*
|
||||
* @param uuid UUID of player being tested
|
||||
* @param data Map of custom reward data
|
||||
*/
|
||||
void giveReward(UUID uuid, Map<String, Object> data);
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.player;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
public interface QuestProgress {
|
||||
LinkedList<?> getBlocksBroken();
|
||||
|
||||
LinkedList<?> getBlocksDamaged();
|
||||
|
||||
LinkedList<?> getBlocksPlaced();
|
||||
|
||||
LinkedList<?> getBlocksUsed();
|
||||
|
||||
LinkedList<?> getBlocksCut();
|
||||
|
||||
LinkedList<?> getItemsCrafted();
|
||||
|
||||
LinkedList<?> getItemsSmelted();
|
||||
|
||||
LinkedList<?> getItemsEnchanted();
|
||||
|
||||
LinkedList<?> getItemsBrewed();
|
||||
|
||||
LinkedList<?> getItemsConsumed();
|
||||
|
||||
LinkedList<?> getItemsDelivered();
|
||||
|
||||
LinkedList<Boolean> getNpcsInteracted();
|
||||
|
||||
void setNpcsInteracted(final LinkedList<Boolean> npcsInteracted);
|
||||
|
||||
LinkedList<Integer> getNpcsNumKilled();
|
||||
|
||||
void setNpcsNumKilled(final LinkedList<Integer> npcsNumKilled);
|
||||
|
||||
LinkedList<Integer> getMobNumKilled();
|
||||
|
||||
void setMobNumKilled(final LinkedList<Integer> mobNumKilled);
|
||||
|
||||
LinkedList<Integer> getMobsTamed();
|
||||
|
||||
void setMobsTamed(final LinkedList<Integer> mobsTamed);
|
||||
|
||||
int getFishCaught();
|
||||
|
||||
void setFishCaught(final int fishCaught);
|
||||
|
||||
int getCowsMilked();
|
||||
|
||||
void setCowsMilked(final int cowsMilked);
|
||||
|
||||
LinkedList<Integer> getSheepSheared();
|
||||
|
||||
void setSheepSheared(final LinkedList<Integer> sheepSheared);
|
||||
|
||||
int getPlayersKilled();
|
||||
|
||||
void setPlayersKilled(final int playersKilled);
|
||||
|
||||
LinkedList<Boolean> getLocationsReached();
|
||||
|
||||
void setLocationsReached(final LinkedList<Boolean> locationsReached);
|
||||
|
||||
LinkedList<Boolean> getPasswordsSaid();
|
||||
|
||||
void setPasswordsSaid(final LinkedList<Boolean> passwordsSaid);
|
||||
|
||||
LinkedList<Integer> getCustomObjectiveCounts();
|
||||
|
||||
void setCustomObjectiveCounts(final LinkedList<Integer> customObjectiveCounts);
|
||||
|
||||
long getDelayStartTime();
|
||||
|
||||
void setDelayStartTime(final long delayStartTime);
|
||||
|
||||
long getDelayTimeLeft();
|
||||
|
||||
void setDelayTimeLeft(final long delayTimeLeft);
|
||||
|
||||
boolean canDoJournalUpdate();
|
||||
|
||||
void setDoJournalUpdate(final boolean b);
|
||||
}
|
256
api/src/main/java/me/pikamug/quests/player/Quester.java
Normal file
256
api/src/main/java/me/pikamug/quests/player/Quester.java
Normal file
@ -0,0 +1,256 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.player;
|
||||
|
||||
import me.pikamug.quests.quests.Quest;
|
||||
import me.pikamug.quests.quests.components.Stage;
|
||||
import me.pikamug.quests.quests.components.Objective;
|
||||
import me.pikamug.quests.enums.ObjectiveType;
|
||||
import me.pikamug.quests.module.CustomObjective;
|
||||
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 getQuestIdToQuit();
|
||||
|
||||
void setQuestIdToQuit(final String questIdToQuit);
|
||||
|
||||
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);
|
||||
|
||||
Player getPlayer();
|
||||
|
||||
OfflinePlayer getOfflinePlayer();
|
||||
|
||||
void sendMessage(final String message);
|
||||
|
||||
Stage getCurrentStage(final Quest quest);
|
||||
|
||||
QuestProgress getQuestDataOrDefault(final Quest quest);
|
||||
|
||||
boolean hasJournal();
|
||||
|
||||
ItemStack getJournal();
|
||||
|
||||
int getJournalIndex();
|
||||
|
||||
void updateJournal();
|
||||
|
||||
boolean offerQuest(final Quest quest, final boolean giveReason);
|
||||
|
||||
boolean canAcceptOffer(final Quest quest, final boolean giveReason);
|
||||
|
||||
boolean isOnTime(final Quest quest, final boolean giveReason);
|
||||
|
||||
void takeQuest(final Quest quest, final boolean ignoreRequirements);
|
||||
|
||||
boolean abandonQuest(final Quest quest, final String message);
|
||||
|
||||
boolean abandonQuest(final Quest quest, final String[] messages);
|
||||
|
||||
void quitQuest(final Quest quest, final String message);
|
||||
|
||||
void quitQuest(final Quest quest, final String[] messages);
|
||||
|
||||
void listQuests(final Quester quester, final int page);
|
||||
|
||||
LinkedList<String> getCurrentRequirements(final Quest quest, final boolean ignoreOverrides);
|
||||
|
||||
LinkedList<String> getCurrentObjectives(final Quest quest, final boolean ignoreOverrides);
|
||||
|
||||
void showCurrentObjectives(final Quest quest, final Quester quester, final boolean ignoreOverrides);
|
||||
|
||||
boolean hasObjective(final Quest quest, final ObjectiveType type);
|
||||
|
||||
boolean hasCustomObjective(final Quest quest, final String name);
|
||||
|
||||
void showCurrentConditions(final Quest quest, final Quester quester);
|
||||
|
||||
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 UUID npc, final ItemStack itemStack);
|
||||
|
||||
void interactWithNPC(final Quest quest, final UUID npc);
|
||||
|
||||
void killNPC(final Quest quest, final UUID 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 UUID 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 UUID 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 QuestProgress 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 meetsCondition(final Quest quest, final boolean giveReason);
|
||||
|
||||
boolean isSelectingBlock();
|
||||
|
||||
boolean isInRegion(final String regionID);
|
||||
|
||||
boolean canAcceptQuest(final UUID npc);
|
||||
|
||||
boolean canAcceptCompletedQuest(final UUID npc);
|
||||
|
||||
boolean canAcceptCompletedRedoableQuest(final UUID npc);
|
||||
}
|
93
api/src/main/java/me/pikamug/quests/quests/Quest.java
Normal file
93
api/src/main/java/me/pikamug/quests/quests/Quest.java
Normal file
@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.quests;
|
||||
|
||||
import me.pikamug.quests.actions.Action;
|
||||
import me.pikamug.quests.player.Quester;
|
||||
import me.pikamug.quests.quests.components.Options;
|
||||
import me.pikamug.quests.quests.components.Planner;
|
||||
import me.pikamug.quests.quests.components.Requirements;
|
||||
import me.pikamug.quests.quests.components.Rewards;
|
||||
import me.pikamug.quests.quests.components.Stage;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface Quest extends Comparable<Quest> {
|
||||
|
||||
String getId();
|
||||
|
||||
void setId(String id);
|
||||
|
||||
String getName();
|
||||
|
||||
void setName(final String name);
|
||||
|
||||
String getDescription();
|
||||
|
||||
void setDescription(final String description);
|
||||
|
||||
String getFinished();
|
||||
|
||||
void setFinished(final String finished);
|
||||
|
||||
String getRegionStart();
|
||||
|
||||
void setRegionStart(final String regionStart);
|
||||
|
||||
Stage getStage(final int index);
|
||||
|
||||
LinkedList<Stage> getStages();
|
||||
|
||||
UUID getNpcStart();
|
||||
|
||||
void setNpcStart(final UUID npcStart);
|
||||
|
||||
String getNpcStartName();
|
||||
|
||||
Action getInitialAction();
|
||||
|
||||
void setInitialAction(final Action initialAction);
|
||||
|
||||
Requirements getRequirements();
|
||||
|
||||
void setRequirements(final Requirements requirements);
|
||||
|
||||
Planner getPlanner();
|
||||
|
||||
void setPlanner(final Planner planner);
|
||||
|
||||
Rewards getRewards();
|
||||
|
||||
void setRewards(final Rewards rewards);
|
||||
|
||||
Options getOptions();
|
||||
|
||||
void setOptions(final Options options);
|
||||
|
||||
void nextStage(final Quester quester, final boolean allowSharedProgress);
|
||||
|
||||
void setStage(final Quester quester, final int stage);
|
||||
|
||||
boolean updateCompass(final Quester quester, final Stage stage);
|
||||
|
||||
boolean testRequirements(final Quester quester);
|
||||
|
||||
void completeQuest(final Quester quester);
|
||||
|
||||
void completeQuest(final Quester quester, final boolean allowMultiplayer);
|
||||
|
||||
void failQuest(final Quester quester);
|
||||
|
||||
void failQuest(final Quester quester, final boolean ignoreFailAction);
|
||||
|
||||
boolean isInRegionStart(final Quester quester);
|
||||
}
|
51
api/src/main/java/me/pikamug/quests/quests/QuestFactory.java
Normal file
51
api/src/main/java/me/pikamug/quests/quests/QuestFactory.java
Normal file
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.quests;
|
||||
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.ConversationFactory;
|
||||
import org.bukkit.conversations.Prompt;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface QuestFactory {
|
||||
|
||||
Set<UUID> getSelectingNpcs();
|
||||
|
||||
void setSelectingNpcs(final Set<UUID> selectingNpcs);
|
||||
|
||||
List<String> getNamesOfQuestsBeingEdited();
|
||||
|
||||
void setNamesOfQuestsBeingEdited(final List<String> questNames);
|
||||
|
||||
ConversationFactory getConversationFactory();
|
||||
|
||||
Prompt returnToMenu(final ConversationContext context);
|
||||
|
||||
void loadQuest(final ConversationContext context, final Quest q);
|
||||
|
||||
void deleteQuest(final ConversationContext context);
|
||||
|
||||
void saveQuest(final ConversationContext context, final ConfigurationSection section);
|
||||
|
||||
/*void saveRequirements(final ConversationContext context, final ConfigurationSection section);
|
||||
|
||||
void saveStages(final ConversationContext context, final ConfigurationSection section);
|
||||
|
||||
void saveRewards(final ConversationContext context, final ConfigurationSection section);
|
||||
|
||||
void savePlanner(final ConversationContext context, final ConfigurationSection section);
|
||||
|
||||
void saveOptions(final ConversationContext context, final ConfigurationSection section);*/
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.quests.components;
|
||||
|
||||
import me.pikamug.quests.enums.ObjectiveType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public interface Objective {
|
||||
ObjectiveType getType();
|
||||
|
||||
String getMessage();
|
||||
|
||||
int getProgress();
|
||||
|
||||
int getGoal();
|
||||
|
||||
@NotNull Object getProgressObject();
|
||||
|
||||
@NotNull Object getGoalObject();
|
||||
}
|
@ -1,16 +1,14 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.quests;
|
||||
package me.pikamug.quests.quests.components;
|
||||
|
||||
public interface Options {
|
||||
boolean canAllowCommands();
|
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.quests.components;
|
||||
|
||||
public interface Planner {
|
||||
String getStart();
|
||||
|
||||
long getStartInMillis();
|
||||
|
||||
boolean hasStart();
|
||||
|
||||
void setStart(final String start);
|
||||
|
||||
String getEnd();
|
||||
|
||||
long getEndInMillis();
|
||||
|
||||
boolean hasEnd();
|
||||
|
||||
void setEnd(final String end);
|
||||
|
||||
long getRepeat();
|
||||
|
||||
boolean hasRepeat();
|
||||
|
||||
void setRepeat(final long repeat);
|
||||
|
||||
long getCooldown();
|
||||
|
||||
boolean hasCooldown();
|
||||
|
||||
void setCooldown(final long cooldown);
|
||||
|
||||
boolean getOverride();
|
||||
|
||||
void setOverride(final boolean override);
|
||||
}
|
@ -1,18 +1,14 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.quests;
|
||||
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
package me.pikamug.quests.quests.components;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -30,9 +26,7 @@ public interface Requirements {
|
||||
|
||||
void setExp(final int exp);
|
||||
|
||||
List<ItemStack> getItems();
|
||||
|
||||
void setItems(final List<ItemStack> items);
|
||||
List<?> getItems();
|
||||
|
||||
List<Boolean> getRemoveItems();
|
||||
|
@ -1,18 +1,14 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.quests;
|
||||
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
package me.pikamug.quests.quests.components;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -46,9 +42,7 @@ public interface Rewards {
|
||||
|
||||
void setPermissionWorlds(final List<String> worldNames);
|
||||
|
||||
List<ItemStack> getItems();
|
||||
|
||||
void setItems(final List<ItemStack> items);
|
||||
List<?> getItems();
|
||||
|
||||
List<String> getMcmmoSkills();
|
||||
|
220
api/src/main/java/me/pikamug/quests/quests/components/Stage.java
Normal file
220
api/src/main/java/me/pikamug/quests/quests/components/Stage.java
Normal file
@ -0,0 +1,220 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.quests.components;
|
||||
|
||||
import me.pikamug.quests.actions.Action;
|
||||
import me.pikamug.quests.conditions.Condition;
|
||||
import me.pikamug.quests.enums.ObjectiveType;
|
||||
import me.pikamug.quests.module.CustomObjective;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface Stage {
|
||||
LinkedList<?> getBlocksToBreak();
|
||||
|
||||
LinkedList<?> getBlocksToDamage();
|
||||
|
||||
LinkedList<?> getBlocksToPlace();
|
||||
|
||||
LinkedList<?> getBlocksToUse();
|
||||
|
||||
LinkedList<?> getBlocksToCut();
|
||||
|
||||
LinkedList<?> getItemsToCraft();
|
||||
|
||||
LinkedList<?> getItemsToSmelt();
|
||||
|
||||
LinkedList<?> getItemsToEnchant();
|
||||
|
||||
LinkedList<?> getItemsToBrew();
|
||||
|
||||
LinkedList<?> getItemsToConsume();
|
||||
|
||||
LinkedList<?> getItemsToDeliver();
|
||||
|
||||
LinkedList<UUID> getItemDeliveryTargets();
|
||||
|
||||
void setItemDeliveryTargets(final LinkedList<UUID> itemDeliveryTargets);
|
||||
|
||||
LinkedList<String> getDeliverMessages();
|
||||
|
||||
void setDeliverMessages(final LinkedList<String> deliverMessages);
|
||||
|
||||
LinkedList<UUID> getNpcsToInteract();
|
||||
|
||||
void setNpcsToInteract(final LinkedList<UUID> npcsToInteract);
|
||||
|
||||
LinkedList<UUID> getNpcsToKill();
|
||||
|
||||
void setNpcsToKill(final LinkedList<UUID> npcsToKill);
|
||||
|
||||
LinkedList<Integer> getNpcNumToKill();
|
||||
|
||||
void setNpcNumToKill(final LinkedList<Integer> npcNumToKill);
|
||||
|
||||
LinkedList<?> getMobsToKill();
|
||||
|
||||
LinkedList<Integer> getMobNumToKill();
|
||||
|
||||
void setMobNumToKill(final LinkedList<Integer> mobNumToKill);
|
||||
|
||||
LinkedList<?> getLocationsToKillWithin();
|
||||
|
||||
LinkedList<Integer> getRadiiToKillWithin();
|
||||
|
||||
void setRadiiToKillWithin(final LinkedList<Integer> radiiToKillWithin);
|
||||
|
||||
LinkedList<String> getKillNames();
|
||||
|
||||
void setKillNames(final LinkedList<String> killNames);
|
||||
|
||||
LinkedList<?> getLocationsToReach();
|
||||
|
||||
LinkedList<Integer> getRadiiToReachWithin();
|
||||
|
||||
void setRadiiToReachWithin(final LinkedList<Integer> radiiToReachWithin);
|
||||
|
||||
LinkedList<?> getWorldsToReachWithin();
|
||||
|
||||
LinkedList<String> getLocationNames();
|
||||
|
||||
void setLocationNames(final LinkedList<String> locationNames);
|
||||
|
||||
LinkedList<?> getMobsToTame();
|
||||
|
||||
LinkedList<Integer> getMobNumToTame();
|
||||
|
||||
void setMobNumToTame(final LinkedList<Integer> mobNumToTame);
|
||||
|
||||
Integer getFishToCatch();
|
||||
|
||||
void setFishToCatch(final Integer fishToCatch);
|
||||
|
||||
Integer getCowsToMilk();
|
||||
|
||||
void setCowsToMilk(final Integer cowsToMilk);
|
||||
|
||||
Integer getPlayersToKill();
|
||||
|
||||
void setPlayersToKill(final Integer playersToKill);
|
||||
|
||||
LinkedList<?> getSheepToShear();
|
||||
|
||||
LinkedList<Integer> getSheepNumToShear();
|
||||
|
||||
void setSheepNumToShear(final LinkedList<Integer> sheepNumToShear);
|
||||
|
||||
LinkedList<String> getPasswordDisplays();
|
||||
|
||||
void setPasswordDisplays(final LinkedList<String> passwordDisplays);
|
||||
|
||||
LinkedList<String> getPasswordPhrases();
|
||||
|
||||
void setPasswordPhrases(final LinkedList<String> passwordPhrases);
|
||||
|
||||
String getScript();
|
||||
|
||||
void setScript(final String script);
|
||||
|
||||
Action getStartAction();
|
||||
|
||||
void setStartAction(final Action startAction);
|
||||
|
||||
Action getFinishAction();
|
||||
|
||||
void setFinishAction(final Action finishAction);
|
||||
|
||||
Action getFailAction();
|
||||
|
||||
void setFailAction(final Action failAction);
|
||||
|
||||
Action getDeathAction();
|
||||
|
||||
void setDeathAction(final Action deathAction);
|
||||
|
||||
Map<String, Action> getChatActions();
|
||||
|
||||
void setChatActions(final Map<String, Action> chatActions);
|
||||
|
||||
Map<String, Action> getCommandActions();
|
||||
|
||||
void setCommandActions(final Map<String, Action> commandActions);
|
||||
|
||||
Action getDisconnectAction();
|
||||
|
||||
void setDisconnectAction(final Action disconnectAction);
|
||||
|
||||
Condition getCondition();
|
||||
|
||||
void setCondition(final Condition condition);
|
||||
|
||||
long getDelay();
|
||||
|
||||
void setDelay(final long delay);
|
||||
|
||||
String getDelayMessage();
|
||||
|
||||
void setDelayMessage(final String delayMessage);
|
||||
|
||||
String getCompleteMessage();
|
||||
|
||||
void setCompleteMessage(final String completeMessage);
|
||||
|
||||
String getStartMessage();
|
||||
|
||||
void setStartMessage(final String startMessage);
|
||||
|
||||
LinkedList<String> getObjectiveOverrides();
|
||||
|
||||
void setObjectiveOverrides(final LinkedList<String> objectiveOverrides);
|
||||
|
||||
LinkedList<CustomObjective> getCustomObjectives();
|
||||
|
||||
void clearCustomObjectives();
|
||||
|
||||
LinkedList<Integer> getCustomObjectiveCounts();
|
||||
|
||||
void clearCustomObjectiveCounts();
|
||||
|
||||
LinkedList<String> getCustomObjectiveDisplays();
|
||||
|
||||
void clearCustomObjectiveDisplays();
|
||||
|
||||
LinkedList<Map.Entry<String, Object>> getCustomObjectiveData();
|
||||
|
||||
void clearCustomObjectiveData();
|
||||
|
||||
/**
|
||||
* Check if stage has at least one objective<p>
|
||||
*
|
||||
* Excludes start/complete message, delay, and objective-override
|
||||
*
|
||||
* @return true if stage contains an objective
|
||||
*/
|
||||
boolean hasObjective();
|
||||
|
||||
/**
|
||||
* Check if stage has at least one objective of which the target can be located easily<p>
|
||||
*
|
||||
* @return true if stage contains a locatable objective
|
||||
*/
|
||||
boolean hasLocatableObjective();
|
||||
|
||||
/**
|
||||
* Check if stage has the specified type of objective<p>
|
||||
*
|
||||
* @param type The type of objective to check for
|
||||
* @return true if stage contains specified objective
|
||||
*/
|
||||
boolean containsObjective(final ObjectiveType type);
|
||||
}
|
@ -1,20 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.storage;
|
||||
package me.pikamug.quests.storage;
|
||||
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.storage.implementation.StorageImplementation;
|
||||
import me.pikamug.quests.Quests;
|
||||
import me.pikamug.quests.player.Quester;
|
||||
import me.pikamug.quests.storage.implementation.QuesterStorageImpl;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@ -23,20 +21,20 @@ import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CompletionException;
|
||||
|
||||
public class Storage {
|
||||
public class QuesterStorage {
|
||||
private final Quests plugin;
|
||||
private final StorageImplementation implementation;
|
||||
private final QuesterStorageImpl implementation;
|
||||
|
||||
public Storage(final Quests plugin, final StorageImplementation implementation) {
|
||||
public QuesterStorage(final Quests plugin, final QuesterStorageImpl implementation) {
|
||||
this.plugin = plugin;
|
||||
this.implementation = implementation;
|
||||
}
|
||||
|
||||
public StorageImplementation getImplementation() {
|
||||
public QuesterStorageImpl getImplementation() {
|
||||
return implementation;
|
||||
}
|
||||
|
||||
public Collection<StorageImplementation> getImplementations() {
|
||||
public Collection<QuesterStorageImpl> getImplementations() {
|
||||
return Collections.singleton(implementation);
|
||||
}
|
||||
|
||||
@ -71,7 +69,7 @@ public class Storage {
|
||||
try {
|
||||
implementation.init();
|
||||
} catch (final Exception e) {
|
||||
plugin.getLogger().severe("Failed to initialize storage implementation");
|
||||
// Failed to initialize storage implementation
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -80,16 +78,16 @@ public class Storage {
|
||||
try {
|
||||
implementation.close();
|
||||
} catch (final Exception e) {
|
||||
plugin.getLogger().severe("Failed to close storage implementation");
|
||||
// Failed to close storage implementation
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public CompletableFuture<IQuester> loadQuester(final UUID uniqueId) {
|
||||
public CompletableFuture<Quester> loadQuester(final UUID uniqueId) {
|
||||
return makeFuture(() -> implementation.loadQuester(uniqueId));
|
||||
}
|
||||
|
||||
public CompletableFuture<Void> saveQuester(final IQuester quester) {
|
||||
public CompletableFuture<Void> saveQuester(final Quester quester) {
|
||||
return makeFuture(() -> {
|
||||
try {
|
||||
implementation.saveQuester(quester);
|
||||
@ -102,7 +100,7 @@ public class Storage {
|
||||
public CompletableFuture<Void> saveOfflineQuesters() {
|
||||
return makeFuture(() -> {
|
||||
try {
|
||||
for (IQuester quester : plugin.getOfflineQuesters()) {
|
||||
for (Quester quester : plugin.getOfflineQuesters()) {
|
||||
implementation.saveQuester(quester);
|
||||
}
|
||||
} catch (final Exception e) {
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.storage.implementation;
|
||||
|
||||
import me.pikamug.quests.Quests;
|
||||
import me.pikamug.quests.actions.Action;
|
||||
import me.pikamug.quests.exceptions.ActionFormatException;
|
||||
|
||||
public interface ActionStorageImpl {
|
||||
Quests getPlugin();
|
||||
|
||||
String getImplementationName();
|
||||
|
||||
void init() throws Exception;
|
||||
|
||||
void close();
|
||||
|
||||
Action loadAction(final String name) throws ActionFormatException;
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.storage.implementation;
|
||||
|
||||
import me.pikamug.quests.Quests;
|
||||
import me.pikamug.quests.conditions.Condition;
|
||||
import me.pikamug.quests.exceptions.ConditionFormatException;
|
||||
|
||||
public interface ConditionStorageImpl {
|
||||
Quests getPlugin();
|
||||
|
||||
String getImplementationName();
|
||||
|
||||
void init() throws Exception;
|
||||
|
||||
void close();
|
||||
|
||||
Condition loadCondition(final String name) throws ConditionFormatException;
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package me.pikamug.quests.storage.implementation;
|
||||
|
||||
import me.pikamug.quests.Quests;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public interface ModuleStorageImpl {
|
||||
Quests getPlugin();
|
||||
|
||||
String getImplementationName();
|
||||
|
||||
void init();
|
||||
|
||||
void close();
|
||||
|
||||
void loadModule(final File jar);
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.storage.implementation;
|
||||
|
||||
import me.pikamug.quests.Quests;
|
||||
import me.pikamug.quests.exceptions.QuestFormatException;
|
||||
import me.pikamug.quests.quests.Quest;
|
||||
|
||||
public interface QuestStorageImpl {
|
||||
Quests getPlugin();
|
||||
|
||||
String getImplementationName();
|
||||
|
||||
void init() throws Exception;
|
||||
|
||||
void close();
|
||||
|
||||
Quest loadQuest(final String name) throws QuestFormatException;
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.storage.implementation;
|
||||
|
||||
import me.pikamug.quests.Quests;
|
||||
import me.pikamug.quests.player.Quester;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface QuesterStorageImpl {
|
||||
Quests getPlugin();
|
||||
|
||||
String getImplementationName();
|
||||
|
||||
void init() throws Exception;
|
||||
|
||||
void close();
|
||||
|
||||
Quester loadQuester(final UUID uniqueId) throws Exception;
|
||||
|
||||
void saveQuester(final Quester quester) throws Exception;
|
||||
|
||||
void deleteQuester(final UUID uniqueId) throws Exception;
|
||||
|
||||
String getQuesterLastKnownName(final UUID uniqueId) throws Exception;
|
||||
|
||||
Collection<UUID> getSavedUniqueIds() throws Exception;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.storage.implementation.custom;
|
||||
|
||||
import me.pikamug.quests.Quests;
|
||||
import me.pikamug.quests.storage.implementation.QuesterStorageImpl;
|
||||
|
||||
public interface CustomStorageProvider {
|
||||
QuesterStorageImpl provide(Quests plugin);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.storage.implementation.custom;
|
||||
|
||||
public final class CustomStorageProviders {
|
||||
private CustomStorageProviders() {}
|
||||
|
||||
private static CustomStorageProvider provider = null;
|
||||
|
||||
public static void register(final CustomStorageProvider provider) {
|
||||
CustomStorageProviders.provider = provider;
|
||||
}
|
||||
|
||||
public static CustomStorageProvider getProvider() {
|
||||
if (provider == null) {
|
||||
throw new IllegalStateException("Provider not found.");
|
||||
}
|
||||
|
||||
return provider;
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.storage.implementation.sql.connection;
|
||||
|
||||
import me.pikamug.quests.Quests;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
public interface ConnectionFactory {
|
||||
String getImplementationName();
|
||||
|
||||
void init(Quests plugin);
|
||||
|
||||
void close() throws Exception;
|
||||
|
||||
default Map<String, String> getMeta() {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
Function<String, String> getStatementProcessor();
|
||||
|
||||
Connection getConnection() throws SQLException;
|
||||
}
|
@ -1,33 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.storage.implementation.sql.connection.hikari;
|
||||
package me.pikamug.quests.storage.implementation.sql.connection.hikari;
|
||||
|
||||
import com.zaxxer.hikari.HikariConfig;
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
import me.pikamug.quests.Quests;
|
||||
import me.pikamug.quests.storage.implementation.sql.connection.ConnectionFactory;
|
||||
import me.pikamug.quests.storage.misc.StorageCredentials;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import com.zaxxer.hikari.HikariConfig;
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.storage.implementation.sql.connection.ConnectionFactory;
|
||||
import me.blackvein.quests.storage.misc.StorageCredentials;
|
||||
|
||||
public abstract class HikariConnectionFactory implements ConnectionFactory {
|
||||
private final StorageCredentials configuration;
|
||||
private HikariDataSource hikari;
|
||||
@ -128,7 +122,7 @@ public abstract class HikariConnectionFactory implements ConnectionFactory {
|
||||
return connection;
|
||||
}
|
||||
|
||||
public static String identifyClassLoader(final ClassLoader classLoader) throws ReflectiveOperationException {
|
||||
/*public static String identifyClassLoader(final ClassLoader classLoader) throws ReflectiveOperationException {
|
||||
final Class<?> pluginClassLoaderClass = Class.forName("org.bukkit.plugin.java.PluginClassLoader");
|
||||
if (pluginClassLoaderClass.isInstance(classLoader)) {
|
||||
final Method getPluginMethod = pluginClassLoaderClass.getDeclaredMethod("getPlugin");
|
||||
@ -138,5 +132,5 @@ public abstract class HikariConnectionFactory implements ConnectionFactory {
|
||||
return plugin.getName();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}*/
|
||||
}
|
@ -1,24 +1,21 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.storage.implementation.sql.connection.hikari;
|
||||
package me.pikamug.quests.storage.implementation.sql.connection.hikari;
|
||||
|
||||
import com.zaxxer.hikari.HikariConfig;
|
||||
import me.pikamug.quests.storage.misc.StorageCredentials;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.zaxxer.hikari.HikariConfig;
|
||||
|
||||
import me.blackvein.quests.storage.misc.StorageCredentials;
|
||||
|
||||
public class MySqlConnectionFactory extends HikariConnectionFactory {
|
||||
public MySqlConnectionFactory(final StorageCredentials configuration) {
|
||||
super(configuration);
|
@ -1,16 +1,14 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.storage.misc;
|
||||
package me.pikamug.quests.storage.misc;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
@ -1,20 +1,20 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.util;
|
||||
package me.pikamug.quests.util;
|
||||
|
||||
public class CK {
|
||||
/**
|
||||
* Human-readable keys for session data of prompts and factories
|
||||
*/
|
||||
public class Key {
|
||||
|
||||
// Temporary data storage for prompts and factories
|
||||
public static final String ED_QUEST_EDIT = "edit";
|
||||
public static final String ED_QUEST_DELETE = "delQuest";
|
||||
public static final String ED_EVENT_DELETE = "delEvent";
|
||||
@ -152,33 +152,33 @@ public class CK {
|
||||
public static final String OPT_HANDLE_OFFLINE_PLAYERS = "handleOfflinePlayers";
|
||||
public static final String OPT_IGNORE_BLOCK_REPLACE = "ignoreBlockReplace";
|
||||
// Actions
|
||||
public static final String E_OLD_EVENT = "oldEvent";
|
||||
public static final String E_NAME = "evtName";
|
||||
public static final String E_MESSAGE = "evtMessage";
|
||||
public static final String E_CLEAR_INVENTORY = "evtClearInv";
|
||||
public static final String E_FAIL_QUEST = "evtFailQuest";
|
||||
public static final String E_ITEMS = "evtItems";
|
||||
public static final String E_ITEMS_AMOUNTS = "evtItemAmounts";
|
||||
public static final String E_EXPLOSIONS = "evtExplosions";
|
||||
public static final String E_EFFECTS = "evtEffects";
|
||||
public static final String E_EFFECTS_LOCATIONS = "evtEffectLocations";
|
||||
public static final String E_WORLD_STORM = "evtStormWorld";
|
||||
public static final String E_WORLD_STORM_DURATION = "evtStormDuration";
|
||||
public static final String E_WORLD_THUNDER = "evtThunderWorld";
|
||||
public static final String E_WORLD_THUNDER_DURATION = "evtThunderDuration";
|
||||
public static final String E_MOB_TYPES = "evtMobTypes";
|
||||
public static final String E_LIGHTNING = "evtLightningStrikes";
|
||||
public static final String E_POTION_TYPES = "evtPotionTypes";
|
||||
public static final String E_POTION_DURATIONS = "evtPotionDurations";
|
||||
public static final String E_POTION_STRENGTH = "evtPotionMagnitudes";
|
||||
public static final String E_HUNGER = "evtHunger";
|
||||
public static final String E_SATURATION = "evtSaturation";
|
||||
public static final String E_HEALTH = "evtHealth";
|
||||
public static final String E_TELEPORT = "evtTeleportLocation";
|
||||
public static final String E_COMMANDS = "evtCommands";
|
||||
public static final String E_TIMER = "evtTimer";
|
||||
public static final String E_CANCEL_TIMER = "evtCancelTimer";
|
||||
public static final String E_DENIZEN = "evtDenizen";
|
||||
public static final String A_OLD_ACTION = "oldAction";
|
||||
public static final String A_NAME = "actName";
|
||||
public static final String A_MESSAGE = "actMessage";
|
||||
public static final String A_CLEAR_INVENTORY = "actClearInv";
|
||||
public static final String A_FAIL_QUEST = "actFailQuest";
|
||||
public static final String A_ITEMS = "actItems";
|
||||
public static final String A_ITEMS_AMOUNTS = "actItemAmounts";
|
||||
public static final String A_EXPLOSIONS = "actExplosions";
|
||||
public static final String A_EFFECTS = "actEffects";
|
||||
public static final String A_EFFECTS_LOCATIONS = "actEffectLocations";
|
||||
public static final String A_WORLD_STORM = "actStormWorld";
|
||||
public static final String A_WORLD_STORM_DURATION = "actStormDuration";
|
||||
public static final String A_WORLD_THUNDER = "actThunderWorld";
|
||||
public static final String A_WORLD_THUNDER_DURATION = "actThunderDuration";
|
||||
public static final String A_MOBS = "actMobs";
|
||||
public static final String A_LIGHTNING = "actLightningStrikes";
|
||||
public static final String A_POTION_TYPES = "actPotionTypes";
|
||||
public static final String A_POTION_DURATIONS = "actPotionDurations";
|
||||
public static final String A_POTION_STRENGTH = "actPotionMagnitudes";
|
||||
public static final String A_HUNGER = "actHunger";
|
||||
public static final String A_SATURATION = "actSaturation";
|
||||
public static final String A_HEALTH = "actHealth";
|
||||
public static final String A_TELEPORT = "actTeleportLocation";
|
||||
public static final String A_COMMANDS = "actCommands";
|
||||
public static final String A_TIMER = "actTimer";
|
||||
public static final String A_CANCEL_TIMER = "actCancelTimer";
|
||||
public static final String A_DENIZEN = "actDenizen";
|
||||
// Conditions
|
||||
public static final String C_OLD_CONDITION = "oldCondition";
|
||||
public static final String C_NAME = "conName";
|
42
api/src/main/java/me/pikamug/quests/util/RomanNumeral.java
Normal file
42
api/src/main/java/me/pikamug/quests/util/RomanNumeral.java
Normal file
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) PikaMug and contributors
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.pikamug.quests.util;
|
||||
|
||||
import java.util.TreeMap;
|
||||
|
||||
public class RomanNumeral {
|
||||
|
||||
private final static TreeMap<Integer, String> map = new TreeMap<>();
|
||||
|
||||
static {
|
||||
map.put(1000, "M");
|
||||
map.put(900, "CM");
|
||||
map.put(500, "D");
|
||||
map.put(400, "CD");
|
||||
map.put(100, "C");
|
||||
map.put(90, "XC");
|
||||
map.put(50, "L");
|
||||
map.put(40, "XL");
|
||||
map.put(10, "X");
|
||||
map.put(9, "IX");
|
||||
map.put(5, "V");
|
||||
map.put(4, "IV");
|
||||
map.put(1, "I");
|
||||
}
|
||||
|
||||
public static String getNumeral(final int number) {
|
||||
final int l = map.floorKey(number);
|
||||
if ( number == l ) {
|
||||
return map.get(number);
|
||||
}
|
||||
return map.get(l) + getNumeral(number-l);
|
||||
}
|
||||
}
|
43
core/pom.xml
43
core/pom.xml
@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>me.blackvein.quests</groupId>
|
||||
<groupId>me.pikamug.quests</groupId>
|
||||
<artifactId>quests-parent</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
@ -156,29 +156,6 @@
|
||||
<artifactId>spigot-book-api</artifactId>
|
||||
<version>1.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.28</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-java</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zaxxer</groupId>
|
||||
<artifactId>HikariCP</artifactId>
|
||||
<!-- Do not update until Java 11 is min -->
|
||||
<version>4.0.3</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<groupId>org.slf4j</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
@ -190,7 +167,7 @@
|
||||
<version>2.17.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.blackvein.quests</groupId>
|
||||
<groupId>me.pikamug.quests</groupId>
|
||||
<artifactId>quests-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
@ -265,8 +242,6 @@
|
||||
<includes>
|
||||
<include>me.*</include>
|
||||
<include>com.github.PikaMug:LocaleLib</include>
|
||||
<include>com.zaxxer:HikariCP</include>
|
||||
<include>mysql</include>
|
||||
<include>org.slf4j:slf4j-simple</include>
|
||||
<include>org.slf4j:slf4j-api</include>
|
||||
<include>xyz.upperlevel.spigot.book:spigot-book-api</include>
|
||||
@ -289,23 +264,15 @@
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>me.pikamug.localelib</pattern>
|
||||
<shadedPattern>me.blackvein.quests.libs.localelib</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>com.zaxxer.hikari</pattern>
|
||||
<shadedPattern>me.blackvein.quests.libs.hikari</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>com.mysql</pattern>
|
||||
<shadedPattern>me.blackvein.quests.libs.mysql</shadedPattern>
|
||||
<shadedPattern>me.pikamug.quests.libs.localelib</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.slf4j</pattern>
|
||||
<shadedPattern>me.blackvein.quests.libs.slf4j</shadedPattern>
|
||||
<shadedPattern>me.pikamug.quests.libs.slf4j</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>xyz.upperlevel.spigot.book</pattern>
|
||||
<shadedPattern>me.blackvein.quests.libs.bookutil</shadedPattern>
|
||||
<shadedPattern>me.pikamug.quests.libs.bookutil</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,480 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.actions;
|
||||
|
||||
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;
|
||||
import me.blackvein.quests.entity.BukkitQuestMob;
|
||||
import me.blackvein.quests.entity.QuestMob;
|
||||
import me.blackvein.quests.interfaces.ReloadCallback;
|
||||
import me.blackvein.quests.util.CK;
|
||||
import me.blackvein.quests.util.ConfigUtil;
|
||||
import me.blackvein.quests.util.FakeConversable;
|
||||
import me.blackvein.quests.util.ItemUtil;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.InvalidConfigurationException;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.conversations.ConversationAbandonedEvent;
|
||||
import org.bukkit.conversations.ConversationAbandonedListener;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.ConversationFactory;
|
||||
import org.bukkit.conversations.ConversationPrefix;
|
||||
import org.bukkit.conversations.Prompt;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
public class BukkitActionFactory implements ActionFactory, ConversationAbandonedListener {
|
||||
|
||||
private final Quests plugin;
|
||||
private final ConversationFactory conversationFactory;
|
||||
private Map<UUID, Block> selectedExplosionLocations = new HashMap<>();
|
||||
private Map<UUID, Block> selectedEffectLocations = new HashMap<>();
|
||||
private Map<UUID, Block> selectedMobLocations = new HashMap<>();
|
||||
private Map<UUID, Block> selectedLightningLocations = new HashMap<>();
|
||||
private Map<UUID, Block> selectedTeleportLocations = new HashMap<>();
|
||||
private List<String> editingActionNames = new LinkedList<>();
|
||||
|
||||
public BukkitActionFactory(final Quests plugin) {
|
||||
this.plugin = plugin;
|
||||
// Ensure to initialize factory last so that 'this' is fully initialized before it is passed
|
||||
this.conversationFactory = new ConversationFactory(plugin).withModality(false).withLocalEcho(false)
|
||||
.withFirstPrompt(new ActionMenuPrompt(new ConversationContext(plugin, new FakeConversable(),
|
||||
new HashMap<>()))).withTimeout(3600)
|
||||
.withPrefix(new LineBreakPrefix()).addConversationAbandonedListener(this);
|
||||
}
|
||||
|
||||
public static class LineBreakPrefix implements ConversationPrefix {
|
||||
@Override
|
||||
public @NotNull String getPrefix(final @NotNull ConversationContext context) {
|
||||
return "\n";
|
||||
}
|
||||
}
|
||||
|
||||
public Map<UUID, Block> getSelectedExplosionLocations() {
|
||||
return selectedExplosionLocations;
|
||||
}
|
||||
|
||||
public void setSelectedExplosionLocations(
|
||||
final Map<UUID, Block> selectedExplosionLocations) {
|
||||
this.selectedExplosionLocations = selectedExplosionLocations;
|
||||
}
|
||||
|
||||
public Map<UUID, Block> getSelectedEffectLocations() {
|
||||
return selectedEffectLocations;
|
||||
}
|
||||
|
||||
public void setSelectedEffectLocations(final Map<UUID, Block> selectedEffectLocations) {
|
||||
this.selectedEffectLocations = selectedEffectLocations;
|
||||
}
|
||||
|
||||
public Map<UUID, Block> getSelectedMobLocations() {
|
||||
return selectedMobLocations;
|
||||
}
|
||||
|
||||
public void setSelectedMobLocations(final Map<UUID, Block> selectedMobLocations) {
|
||||
this.selectedMobLocations = selectedMobLocations;
|
||||
}
|
||||
|
||||
public Map<UUID, Block> getSelectedLightningLocations() {
|
||||
return selectedLightningLocations;
|
||||
}
|
||||
|
||||
public void setSelectedLightningLocations(
|
||||
final Map<UUID, Block> selectedLightningLocations) {
|
||||
this.selectedLightningLocations = selectedLightningLocations;
|
||||
}
|
||||
|
||||
public Map<UUID, Block> getSelectedTeleportLocations() {
|
||||
return selectedTeleportLocations;
|
||||
}
|
||||
|
||||
public void setSelectedTeleportLocations(
|
||||
final Map<UUID, Block> selectedTeleportLocations) {
|
||||
this.selectedTeleportLocations = selectedTeleportLocations;
|
||||
}
|
||||
|
||||
public ConversationFactory getConversationFactory() {
|
||||
return conversationFactory;
|
||||
}
|
||||
|
||||
public List<String> getNamesOfActionsBeingEdited() {
|
||||
return editingActionNames;
|
||||
}
|
||||
|
||||
public void setNamesOfActionsBeingEdited(final List<String> actionNames) {
|
||||
this.editingActionNames = actionNames;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void conversationAbandoned(final ConversationAbandonedEvent abandonedEvent) {
|
||||
if (abandonedEvent.getContext().getForWhom() instanceof Player) {
|
||||
final UUID uuid = ((Player) abandonedEvent.getContext().getForWhom()).getUniqueId();
|
||||
selectedExplosionLocations.remove(uuid);
|
||||
selectedEffectLocations.remove(uuid);
|
||||
selectedMobLocations.remove(uuid);
|
||||
selectedLightningLocations.remove(uuid);
|
||||
selectedTeleportLocations.remove(uuid);
|
||||
}
|
||||
}
|
||||
|
||||
public Prompt returnToMenu(final ConversationContext context) {
|
||||
return new ActionMainPrompt(context);
|
||||
}
|
||||
|
||||
public void loadData(final IAction event, final ConversationContext context) {
|
||||
if (event.getMessage() != null) {
|
||||
context.setSessionData(CK.E_MESSAGE, event.getMessage());
|
||||
}
|
||||
if (event.isClearInv()) {
|
||||
context.setSessionData(CK.E_CLEAR_INVENTORY, true);
|
||||
} else {
|
||||
context.setSessionData(CK.E_CLEAR_INVENTORY, false);
|
||||
}
|
||||
if (event.isFailQuest()) {
|
||||
context.setSessionData(CK.E_FAIL_QUEST, true);
|
||||
} else {
|
||||
context.setSessionData(CK.E_FAIL_QUEST, false);
|
||||
}
|
||||
if (event.getItems() != null && !event.getItems().isEmpty()) {
|
||||
final LinkedList<ItemStack> items = new LinkedList<>(event.getItems());
|
||||
context.setSessionData(CK.E_ITEMS, items);
|
||||
}
|
||||
if (event.getExplosions() != null && !event.getExplosions().isEmpty()) {
|
||||
final LinkedList<String> locs = new LinkedList<>();
|
||||
for (final Location loc : event.getExplosions()) {
|
||||
locs.add(ConfigUtil.getLocationInfo(loc));
|
||||
}
|
||||
context.setSessionData(CK.E_EXPLOSIONS, locs);
|
||||
}
|
||||
if (event.getEffects() != null && !event.getEffects().isEmpty()) {
|
||||
final LinkedList<String> locs = new LinkedList<>();
|
||||
final LinkedList<String> effs = new LinkedList<>();
|
||||
for (final Entry<Location, Effect> e : event.getEffects().entrySet()) {
|
||||
locs.add(ConfigUtil.getLocationInfo(e.getKey()));
|
||||
effs.add(e.getValue().toString());
|
||||
}
|
||||
context.setSessionData(CK.E_EFFECTS, effs);
|
||||
context.setSessionData(CK.E_EFFECTS_LOCATIONS, locs);
|
||||
}
|
||||
if (event.getStormWorld() != null) {
|
||||
context.setSessionData(CK.E_WORLD_STORM, event.getStormWorld().getName());
|
||||
context.setSessionData(CK.E_WORLD_STORM_DURATION, event.getStormDuration());
|
||||
}
|
||||
if (event.getThunderWorld() != null) {
|
||||
context.setSessionData(CK.E_WORLD_THUNDER, event.getThunderWorld().getName());
|
||||
context.setSessionData(CK.E_WORLD_THUNDER_DURATION, event.getThunderDuration());
|
||||
}
|
||||
if (event.getMobSpawns() != null && !event.getMobSpawns().isEmpty()) {
|
||||
final LinkedList<String> questMobs = new LinkedList<>();
|
||||
for (final QuestMob questMob : event.getMobSpawns()) {
|
||||
questMobs.add(questMob.serialize());
|
||||
}
|
||||
context.setSessionData(CK.E_MOB_TYPES, questMobs);
|
||||
}
|
||||
if (event.getLightningStrikes() != null && !event.getLightningStrikes().isEmpty()) {
|
||||
final LinkedList<String> locs = new LinkedList<>();
|
||||
for (final Location loc : event.getLightningStrikes()) {
|
||||
locs.add(ConfigUtil.getLocationInfo(loc));
|
||||
}
|
||||
context.setSessionData(CK.E_LIGHTNING, locs);
|
||||
}
|
||||
if (event.getPotionEffects() != null && !event.getPotionEffects().isEmpty()) {
|
||||
final LinkedList<String> types = new LinkedList<>();
|
||||
final LinkedList<Long> durations = new LinkedList<>();
|
||||
final LinkedList<Integer> mags = new LinkedList<>();
|
||||
for (final PotionEffect pe : event.getPotionEffects()) {
|
||||
types.add(pe.getType().getName());
|
||||
durations.add((long) pe.getDuration());
|
||||
mags.add(pe.getAmplifier());
|
||||
}
|
||||
context.setSessionData(CK.E_POTION_TYPES, types);
|
||||
context.setSessionData(CK.E_POTION_DURATIONS, durations);
|
||||
context.setSessionData(CK.E_POTION_STRENGTH, mags);
|
||||
}
|
||||
if (event.getHunger() > -1) {
|
||||
context.setSessionData(CK.E_HUNGER, event.getHunger());
|
||||
}
|
||||
if (event.getSaturation() > -1) {
|
||||
context.setSessionData(CK.E_SATURATION, event.getSaturation());
|
||||
}
|
||||
if (event.getHealth() > -1) {
|
||||
context.setSessionData(CK.E_HEALTH, event.getHealth());
|
||||
}
|
||||
if (event.getTeleport() != null) {
|
||||
context.setSessionData(CK.E_TELEPORT, ConfigUtil.getLocationInfo(event.getTeleport()));
|
||||
}
|
||||
if (event.getCommands() != null) {
|
||||
context.setSessionData(CK.E_COMMANDS, event.getCommands());
|
||||
}
|
||||
if (event.getTimer() > 0) {
|
||||
context.setSessionData(CK.E_TIMER, event.getTimer());
|
||||
}
|
||||
if (event.isCancelTimer()) {
|
||||
context.setSessionData(CK.E_CANCEL_TIMER, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void clearData(final ConversationContext context) {
|
||||
context.setSessionData(CK.E_OLD_EVENT, null);
|
||||
context.setSessionData(CK.E_NAME, null);
|
||||
context.setSessionData(CK.E_MESSAGE, null);
|
||||
context.setSessionData(CK.E_CLEAR_INVENTORY, null);
|
||||
context.setSessionData(CK.E_FAIL_QUEST, null);
|
||||
context.setSessionData(CK.E_ITEMS, null);
|
||||
context.setSessionData(CK.E_ITEMS_AMOUNTS, null);
|
||||
context.setSessionData(CK.E_EXPLOSIONS, null);
|
||||
context.setSessionData(CK.E_EFFECTS, null);
|
||||
context.setSessionData(CK.E_EFFECTS_LOCATIONS, null);
|
||||
context.setSessionData(CK.E_WORLD_STORM, null);
|
||||
context.setSessionData(CK.E_WORLD_STORM_DURATION, null);
|
||||
context.setSessionData(CK.E_WORLD_THUNDER, null);
|
||||
context.setSessionData(CK.E_WORLD_THUNDER_DURATION, null);
|
||||
context.setSessionData(CK.E_MOB_TYPES, null);
|
||||
context.setSessionData(CK.E_LIGHTNING, null);
|
||||
context.setSessionData(CK.E_POTION_TYPES, null);
|
||||
context.setSessionData(CK.E_POTION_DURATIONS, null);
|
||||
context.setSessionData(CK.E_POTION_STRENGTH, null);
|
||||
context.setSessionData(CK.E_HUNGER, null);
|
||||
context.setSessionData(CK.E_SATURATION, null);
|
||||
context.setSessionData(CK.E_HEALTH, null);
|
||||
context.setSessionData(CK.E_TELEPORT, null);
|
||||
context.setSessionData(CK.E_COMMANDS, null);
|
||||
context.setSessionData(CK.E_TIMER, null);
|
||||
context.setSessionData(CK.E_CANCEL_TIMER, null);
|
||||
}
|
||||
|
||||
public void deleteAction(final ConversationContext context) {
|
||||
final YamlConfiguration data = new YamlConfiguration();
|
||||
final File actionsFile = new File(plugin.getDataFolder(), "actions.yml");
|
||||
try {
|
||||
data.load(actionsFile);
|
||||
} catch (final IOException | InvalidConfigurationException e) {
|
||||
e.printStackTrace();
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questErrorReadingFile")
|
||||
.replace("<file>", actionsFile.getName()));
|
||||
return;
|
||||
}
|
||||
final String action = (String) context.getSessionData(CK.ED_EVENT_DELETE);
|
||||
String key = "actions";
|
||||
ConfigurationSection sec = data.getConfigurationSection(key);
|
||||
if (sec == null) {
|
||||
key = "events";
|
||||
sec = data.getConfigurationSection(key);
|
||||
}
|
||||
if (sec != null && action != null) {
|
||||
sec.set(action, null);
|
||||
}
|
||||
try {
|
||||
data.save(actionsFile);
|
||||
} catch (final IOException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questSaveError"));
|
||||
return;
|
||||
}
|
||||
final ReloadCallback<Boolean> callback = response -> {
|
||||
if (!response) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("unknownError"));
|
||||
}
|
||||
};
|
||||
plugin.reload(callback);
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("eventEditorDeleted"));
|
||||
if (plugin.getSettings().getConsoleLogging() > 0) {
|
||||
final String identifier = context.getForWhom() instanceof Player ?
|
||||
"Player " + ((Player)context.getForWhom()).getUniqueId() : "CONSOLE";
|
||||
plugin.getLogger().info(identifier + " deleted action " + action);
|
||||
}
|
||||
for (final IQuester q : plugin.getOfflineQuesters()) {
|
||||
for (final IQuest quest : q.getCurrentQuestsTemp().keySet()) {
|
||||
q.checkQuest(quest);
|
||||
}
|
||||
}
|
||||
clearData(context);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void saveAction(final ConversationContext context) {
|
||||
final YamlConfiguration data = new YamlConfiguration();
|
||||
final File actionsFile = new File(plugin.getDataFolder(), "actions.yml");
|
||||
try {
|
||||
data.load(actionsFile);
|
||||
} catch (final IOException | InvalidConfigurationException e) {
|
||||
e.printStackTrace();
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questErrorReadingFile")
|
||||
.replace("<file>", actionsFile.getName()));
|
||||
return;
|
||||
}
|
||||
String key = "actions";
|
||||
if (data.getConfigurationSection(key) == null) {
|
||||
key = "events";
|
||||
}
|
||||
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<IAction> temp = plugin.getLoadedActions();
|
||||
temp.remove(plugin.getAction((String) context.getSessionData(CK.E_OLD_EVENT)));
|
||||
plugin.setLoadedActions(temp);
|
||||
}
|
||||
final ConfigurationSection section = data.createSection(key + "." + context.getSessionData(CK.E_NAME));
|
||||
editingActionNames.remove((String) context.getSessionData(CK.E_NAME));
|
||||
if (context.getSessionData(CK.E_MESSAGE) != null) {
|
||||
section.set("message", context.getSessionData(CK.E_MESSAGE));
|
||||
}
|
||||
if (context.getSessionData(CK.E_CLEAR_INVENTORY) != null) {
|
||||
final Boolean b = (Boolean) context.getSessionData(CK.E_CLEAR_INVENTORY);
|
||||
if (b != null) {
|
||||
section.set("clear-inventory", b);
|
||||
}
|
||||
}
|
||||
if (context.getSessionData(CK.E_FAIL_QUEST) != null) {
|
||||
final Boolean b = (Boolean) context.getSessionData(CK.E_FAIL_QUEST);
|
||||
if (b != null) {
|
||||
section.set("fail-quest", b);
|
||||
}
|
||||
}
|
||||
if (context.getSessionData(CK.E_ITEMS) != null) {
|
||||
section.set("items", context.getSessionData(CK.E_ITEMS));
|
||||
}
|
||||
if (context.getSessionData(CK.E_EXPLOSIONS) != null) {
|
||||
section.set("explosions", context.getSessionData(CK.E_EXPLOSIONS));
|
||||
}
|
||||
if (context.getSessionData(CK.E_EFFECTS) != null) {
|
||||
section.set("effects", context.getSessionData(CK.E_EFFECTS));
|
||||
section.set("effect-locations", context.getSessionData(CK.E_EFFECTS_LOCATIONS));
|
||||
}
|
||||
if (context.getSessionData(CK.E_WORLD_STORM) != null) {
|
||||
section.set("storm-world", context.getSessionData(CK.E_WORLD_STORM));
|
||||
section.set("storm-duration", context.getSessionData(CK.E_WORLD_STORM_DURATION));
|
||||
}
|
||||
if (context.getSessionData(CK.E_WORLD_THUNDER) != null) {
|
||||
section.set("thunder-world", context.getSessionData(CK.E_WORLD_THUNDER));
|
||||
section.set("thunder-duration", context.getSessionData(CK.E_WORLD_THUNDER_DURATION));
|
||||
}
|
||||
try {
|
||||
if (context.getSessionData(CK.E_MOB_TYPES) != null) {
|
||||
int count = 0;
|
||||
for (final String s : (LinkedList<String>) Objects.requireNonNull(context
|
||||
.getSessionData(CK.E_MOB_TYPES))) {
|
||||
ConfigurationSection ss = section.getConfigurationSection("mob-spawns." + count);
|
||||
if (ss == null) {
|
||||
ss = section.createSection("mob-spawns." + count);
|
||||
}
|
||||
final QuestMob questMob = BukkitQuestMob.fromString(s);
|
||||
if (questMob.getName() != null) {
|
||||
ss.set("name", questMob.getName());
|
||||
}
|
||||
ss.set("spawn-location", ConfigUtil.getLocationInfo(questMob.getSpawnLocation()));
|
||||
ss.set("mob-type", questMob.getType().name());
|
||||
ss.set("spawn-amounts", questMob.getSpawnAmounts());
|
||||
ss.set("held-item", ItemUtil.serializeItemStack(questMob.getInventory()[0]));
|
||||
ss.set("held-item-drop-chance", questMob.getDropChances()[0]);
|
||||
ss.set("boots", ItemUtil.serializeItemStack(questMob.getInventory()[1]));
|
||||
ss.set("boots-drop-chance", questMob.getDropChances()[1]);
|
||||
ss.set("leggings", ItemUtil.serializeItemStack(questMob.getInventory()[2]));
|
||||
ss.set("leggings-drop-chance", questMob.getDropChances()[2]);
|
||||
ss.set("chest-plate", ItemUtil.serializeItemStack(questMob.getInventory()[3]));
|
||||
ss.set("chest-plate-drop-chance", questMob.getDropChances()[3]);
|
||||
ss.set("helmet", ItemUtil.serializeItemStack(questMob.getInventory()[4]));
|
||||
ss.set("helmet-drop-chance", questMob.getDropChances()[4]);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (context.getSessionData(CK.E_LIGHTNING) != null) {
|
||||
section.set("lightning-strikes", context.getSessionData(CK.E_LIGHTNING));
|
||||
}
|
||||
if (context.getSessionData(CK.E_COMMANDS) != null) {
|
||||
final LinkedList<String> commands = (LinkedList<String>) context.getSessionData(CK.E_COMMANDS);
|
||||
if (commands != null && !commands.isEmpty()) {
|
||||
section.set("commands", commands);
|
||||
}
|
||||
}
|
||||
if (context.getSessionData(CK.E_POTION_TYPES) != null) {
|
||||
section.set("potion-effect-types", context.getSessionData(CK.E_POTION_TYPES));
|
||||
section.set("potion-effect-durations", context.getSessionData(CK.E_POTION_DURATIONS));
|
||||
section.set("potion-effect-amplifiers", context.getSessionData(CK.E_POTION_STRENGTH));
|
||||
}
|
||||
if (context.getSessionData(CK.E_HUNGER) != null) {
|
||||
section.set("hunger", context.getSessionData(CK.E_HUNGER));
|
||||
}
|
||||
if (context.getSessionData(CK.E_SATURATION) != null) {
|
||||
section.set("saturation", context.getSessionData(CK.E_SATURATION));
|
||||
}
|
||||
if (context.getSessionData(CK.E_HEALTH) != null) {
|
||||
section.set("health", context.getSessionData(CK.E_HEALTH));
|
||||
}
|
||||
if (context.getSessionData(CK.E_TELEPORT) != null) {
|
||||
section.set("teleport-location", context.getSessionData(CK.E_TELEPORT));
|
||||
}
|
||||
if (context.getSessionData(CK.E_TIMER) != null) {
|
||||
final Integer i = (Integer) context.getSessionData(CK.E_TIMER);
|
||||
if (i != null && i > 0) {
|
||||
section.set("timer", context.getSessionData(CK.E_TIMER));
|
||||
}
|
||||
}
|
||||
if (context.getSessionData(CK.E_CANCEL_TIMER) != null) {
|
||||
final Boolean b = (Boolean) context.getSessionData(CK.E_CANCEL_TIMER);
|
||||
if (b != null) {
|
||||
section.set("cancel-timer", b);
|
||||
}
|
||||
}
|
||||
if (context.getSessionData(CK.E_DENIZEN) != null) {
|
||||
section.set("denizen-script", context.getSessionData(CK.E_DENIZEN));
|
||||
}
|
||||
try {
|
||||
data.save(actionsFile);
|
||||
} catch (final IOException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questSaveError"));
|
||||
return;
|
||||
}
|
||||
final ReloadCallback<Boolean> callback = response -> {
|
||||
if (!response) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("unknownError"));
|
||||
}
|
||||
};
|
||||
plugin.reload(callback);
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("eventEditorSaved"));
|
||||
if (plugin.getSettings().getConsoleLogging() > 0) {
|
||||
final String identifier = context.getForWhom() instanceof Player ?
|
||||
"Player " + ((Player)context.getForWhom()).getUniqueId() : "CONSOLE";
|
||||
plugin.getLogger().info(identifier + " saved action " + context.getSessionData(CK.E_NAME));
|
||||
}
|
||||
for (final IQuester q : plugin.getOfflineQuesters()) {
|
||||
for (final IQuest quest : q.getCurrentQuestsTemp().keySet()) {
|
||||
q.checkQuest(quest);
|
||||
}
|
||||
}
|
||||
clearData(context);
|
||||
}
|
||||
}
|
@ -1,191 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.commands.questadmin;
|
||||
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.commands.questadmin.subcommands.QuestadminFinishCommand;
|
||||
import me.blackvein.quests.commands.questadmin.subcommands.QuestadminGiveCommand;
|
||||
import me.blackvein.quests.commands.questadmin.subcommands.QuestadminGivepointsCommand;
|
||||
import me.blackvein.quests.commands.questadmin.subcommands.QuestadminNextstageCommand;
|
||||
import me.blackvein.quests.commands.questadmin.subcommands.QuestadminPointsCommand;
|
||||
import me.blackvein.quests.commands.questadmin.subcommands.QuestadminPointsallCommand;
|
||||
import me.blackvein.quests.commands.questadmin.subcommands.QuestadminQuitCommand;
|
||||
import me.blackvein.quests.commands.questadmin.subcommands.QuestadminReloadCommand;
|
||||
import me.blackvein.quests.commands.questadmin.subcommands.QuestadminRemoveCommand;
|
||||
import me.blackvein.quests.commands.questadmin.subcommands.QuestadminResetCommand;
|
||||
import me.blackvein.quests.commands.questadmin.subcommands.QuestadminSetstageCommand;
|
||||
import me.blackvein.quests.commands.questadmin.subcommands.QuestadminStatsCommand;
|
||||
import me.blackvein.quests.commands.questadmin.subcommands.QuestadminTakepointsCommand;
|
||||
import me.blackvein.quests.commands.QuestsSubCommand;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class QuestadminCommandHandler {
|
||||
|
||||
private final Quests plugin;
|
||||
private final Map<String, QuestsSubCommand> subCommands;
|
||||
|
||||
public QuestadminCommandHandler(Quests plugin) {
|
||||
this.plugin = plugin;
|
||||
subCommands = Stream.of(new QuestadminStatsCommand(plugin),
|
||||
new QuestadminGiveCommand(plugin),
|
||||
new QuestadminQuitCommand(plugin),
|
||||
new QuestadminPointsCommand(plugin),
|
||||
new QuestadminTakepointsCommand(plugin),
|
||||
new QuestadminGivepointsCommand(plugin),
|
||||
new QuestadminPointsallCommand(plugin),
|
||||
new QuestadminFinishCommand(plugin),
|
||||
new QuestadminNextstageCommand(plugin),
|
||||
new QuestadminSetstageCommand(plugin),
|
||||
new QuestadminResetCommand(plugin),
|
||||
new QuestadminRemoveCommand(plugin),
|
||||
new QuestadminReloadCommand(plugin))
|
||||
.collect(Collectors.toMap(QuestsSubCommand::getName, Function.identity()));
|
||||
}
|
||||
|
||||
public boolean check(final CommandSender cs, final String[] args) {
|
||||
if (args.length == 0) {
|
||||
printAdminHelp(cs);
|
||||
return true;
|
||||
}
|
||||
for (Map.Entry<String, QuestsSubCommand> cmd : subCommands.entrySet()) {
|
||||
if (args[0].equalsIgnoreCase(cmd.getKey()) || args[0].equalsIgnoreCase(cmd.getValue().getNameI18N())) {
|
||||
if (args.length < cmd.getValue().getMaxArguments()) {
|
||||
cs.sendMessage(getAdminCommandUsage(cs, args[0]));
|
||||
}
|
||||
cmd.getValue().execute(cs, args);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
cs.sendMessage(ChatColor.YELLOW + Lang.get("questsUnknownAdminCommand"));
|
||||
return true;
|
||||
}
|
||||
|
||||
public List<String> suggest(final CommandSender cs, final String[] args) {
|
||||
if (args.length == 1) {
|
||||
final List<String> results = new ArrayList<>();
|
||||
for (Map.Entry<String, QuestsSubCommand> cmd : subCommands.entrySet()) {
|
||||
if (cmd.getKey().startsWith(args[0]) || cmd.getValue().getNameI18N().startsWith(args[0])) {
|
||||
results.add(cmd.getValue().getNameI18N());
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
for (Map.Entry<String, QuestsSubCommand> cmd : subCommands.entrySet()) {
|
||||
if (args[0].equalsIgnoreCase(cmd.getKey()) || args[0].equalsIgnoreCase(cmd.getValue().getNameI18N())) {
|
||||
return cmd.getValue().tabComplete(cs, args);
|
||||
}
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
private void printAdminHelp(final CommandSender cs) {
|
||||
if (!(cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin"))) {
|
||||
cs.sendMessage(ChatColor.RED + Lang.get("noPermission"));
|
||||
return;
|
||||
}
|
||||
cs.sendMessage(ChatColor.GOLD + Lang.get("questAdminHelpTitle"));
|
||||
cs.sendMessage(ChatColor.YELLOW + "/questadmin" + ChatColor.RED + " " + Lang.get("COMMAND_QUESTADMIN_HELP"));
|
||||
final boolean translateSubCommands = plugin.getSettings().canTranslateSubCommands();
|
||||
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.stats")) {
|
||||
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED + Lang.get("COMMAND_QUESTADMIN_STATS_HELP")
|
||||
.replace("<command>", ChatColor.GOLD + (translateSubCommands ? Lang.get("COMMAND_QUESTADMIN_STATS")
|
||||
: "stats") + ChatColor.RED));
|
||||
}
|
||||
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.give")) {
|
||||
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED + Lang.get("COMMAND_QUESTADMIN_GIVE_HELP")
|
||||
.replace("<command>", ChatColor.GOLD + (translateSubCommands ? Lang.get("COMMAND_QUESTADMIN_GIVE")
|
||||
: "give") + ChatColor.RED));
|
||||
}
|
||||
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.quit")) {
|
||||
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED + Lang.get("COMMAND_QUESTADMIN_QUIT_HELP")
|
||||
.replace("<command>", ChatColor.GOLD + (translateSubCommands ? Lang.get("COMMAND_QUESTADMIN_QUIT")
|
||||
: "quit") + ChatColor.RED));
|
||||
}
|
||||
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.points")) {
|
||||
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED
|
||||
+ Lang.get("COMMAND_QUESTADMIN_POINTS_HELP")
|
||||
.replace("<points>", Lang.get("questPoints"))
|
||||
.replace("<command>", ChatColor.GOLD
|
||||
+ (translateSubCommands ? Lang.get("COMMAND_QUESTADMIN_POINTS") : "points") + ChatColor.RED));
|
||||
}
|
||||
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.takepoints")) {
|
||||
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED
|
||||
+ Lang.get("COMMAND_QUESTADMIN_TAKEPOINTS_HELP")
|
||||
.replace("<points>", Lang.get("questPoints"))
|
||||
.replace("<command>", ChatColor.GOLD
|
||||
+ (translateSubCommands ? Lang.get("COMMAND_QUESTADMIN_TAKEPOINTS") : "takepoints")
|
||||
+ ChatColor.RED));
|
||||
}
|
||||
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.givepoints")) {
|
||||
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED
|
||||
+ Lang.get("COMMAND_QUESTADMIN_GIVEPOINTS_HELP")
|
||||
.replace("<points>", Lang.get("questPoints"))
|
||||
.replace("<command>", ChatColor.GOLD
|
||||
+ (translateSubCommands ? Lang.get("COMMAND_QUESTADMIN_GIVEPOINTS") : "givepoints")
|
||||
+ ChatColor.RED));
|
||||
}
|
||||
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.pointsall")) {
|
||||
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED
|
||||
+ Lang.get("COMMAND_QUESTADMIN_POINTSALL_HELP")
|
||||
.replace("<points>", Lang.get("questPoints"))
|
||||
.replace("<command>", ChatColor.GOLD
|
||||
+ (translateSubCommands ? Lang.get("COMMAND_QUESTADMIN_POINTSALL") : "pointsall") + ChatColor.RED));
|
||||
}
|
||||
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.finish")) {
|
||||
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED
|
||||
+ Lang.get("COMMAND_QUESTADMIN_FINISH_HELP").replace("<command>", ChatColor.GOLD
|
||||
+ (translateSubCommands ? Lang.get("COMMAND_QUESTADMIN_FINISH") : "finish") + ChatColor.RED));
|
||||
}
|
||||
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.nextstage")) {
|
||||
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED
|
||||
+ Lang.get("COMMAND_QUESTADMIN_NEXTSTAGE_HELP").replace("<command>", ChatColor.GOLD
|
||||
+ (translateSubCommands ? Lang.get("COMMAND_QUESTADMIN_NEXTSTAGE") : "nextstage") + ChatColor.RED));
|
||||
}
|
||||
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.setstage")) {
|
||||
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED
|
||||
+ Lang.get("COMMAND_QUESTADMIN_SETSTAGE_HELP").replace("<command>", ChatColor.GOLD
|
||||
+ (translateSubCommands ? Lang.get("COMMAND_QUESTADMIN_SETSTAGE") : "setstage") + ChatColor.RED));
|
||||
}
|
||||
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.reset")) {
|
||||
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED+ Lang.get("COMMAND_QUESTADMIN_RESET_HELP")
|
||||
.replace("<command>", ChatColor.GOLD + (translateSubCommands ? Lang.get("COMMAND_QUESTADMIN_RESET")
|
||||
: "reset") + ChatColor.RED));
|
||||
}
|
||||
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.remove")) {
|
||||
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED
|
||||
+ Lang.get("COMMAND_QUESTADMIN_REMOVE_HELP").replace("<command>", ChatColor.GOLD
|
||||
+ (translateSubCommands ? Lang.get("COMMAND_QUESTADMIN_REMOVE") : "remove") + ChatColor.RED));
|
||||
}
|
||||
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.reload")) {
|
||||
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED
|
||||
+ Lang.get("COMMAND_QUESTADMIN_RELOAD_HELP").replace("<command>", ChatColor.GOLD
|
||||
+ (translateSubCommands ? Lang.get("COMMAND_QUESTADMIN_RELOAD") : "reload") + ChatColor.RED));
|
||||
}
|
||||
}
|
||||
|
||||
private String getAdminCommandUsage(final CommandSender cs, final String cmd) {
|
||||
return ChatColor.RED + Lang.get(cs, "usage") + ": " + ChatColor.YELLOW + "/questadmin "
|
||||
+ Lang.get(cs, Lang.getKeyFromPrefix("COMMAND_QUESTADMIN_", cmd) + "_HELP")
|
||||
.replace("<command>", cmd.toLowerCase());
|
||||
}
|
||||
}
|
@ -1,79 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.commands.questadmin.subcommands;
|
||||
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.commands.QuestsSubCommand;
|
||||
import me.blackvein.quests.interfaces.ReloadCallback;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class QuestadminReloadCommand extends QuestsSubCommand {
|
||||
|
||||
private final Quests plugin;
|
||||
|
||||
public QuestadminReloadCommand(Quests plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "reload";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNameI18N() {
|
||||
return Lang.get("COMMAND_QUESTADMIN_RELOAD");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return Lang.get("COMMAND_QUESTADMIN_RELOAD_HELP");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPermission() {
|
||||
return "quests.admin.reload";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/questadmin reload";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxArguments() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender cs, String[] args) {
|
||||
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.reload")) {
|
||||
final ReloadCallback<Boolean> callback = response -> {
|
||||
if (response) {
|
||||
cs.sendMessage(ChatColor.GOLD + Lang.get("questsReloaded"));
|
||||
String msg = Lang.get("numQuestsLoaded");
|
||||
msg = msg.replace("<number>", ChatColor.DARK_PURPLE + String.valueOf(plugin.getLoadedQuests().size())
|
||||
+ ChatColor.GOLD);
|
||||
cs.sendMessage(ChatColor.GOLD + msg);
|
||||
} else {
|
||||
cs.sendMessage(ChatColor.RED + Lang.get("unknownError"));
|
||||
}
|
||||
};
|
||||
plugin.reload(callback);
|
||||
} else {
|
||||
cs.sendMessage(ChatColor.RED + Lang.get("noPermission"));
|
||||
}
|
||||
}
|
||||
}
|
@ -1,131 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.commands.quests;
|
||||
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.commands.quests.subcommands.QuestsActionsCommand;
|
||||
import me.blackvein.quests.commands.quests.subcommands.QuestsChoiceCommand;
|
||||
import me.blackvein.quests.commands.quests.subcommands.QuestsConditionsCommand;
|
||||
import me.blackvein.quests.commands.quests.subcommands.QuestsEditorCommand;
|
||||
import me.blackvein.quests.commands.quests.subcommands.QuestsInfoCommand;
|
||||
import me.blackvein.quests.commands.quests.subcommands.QuestsJournalCommand;
|
||||
import me.blackvein.quests.commands.quests.subcommands.QuestsListCommand;
|
||||
import me.blackvein.quests.commands.quests.subcommands.QuestsQuitCommand;
|
||||
import me.blackvein.quests.commands.quests.subcommands.QuestsStatsCommand;
|
||||
import me.blackvein.quests.commands.quests.subcommands.QuestsTakeCommand;
|
||||
import me.blackvein.quests.commands.quests.subcommands.QuestsTopCommand;
|
||||
import me.blackvein.quests.commands.QuestsSubCommand;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class QuestsCommandHandler {
|
||||
|
||||
private final Quests plugin;
|
||||
private final Map<String, QuestsSubCommand> subCommands;
|
||||
|
||||
public QuestsCommandHandler(Quests plugin) {
|
||||
this.plugin = plugin;
|
||||
subCommands = Stream.of(new QuestsListCommand(plugin),
|
||||
new QuestsTakeCommand(plugin),
|
||||
new QuestsQuitCommand(plugin),
|
||||
new QuestsStatsCommand(plugin),
|
||||
new QuestsJournalCommand(plugin),
|
||||
new QuestsTopCommand(plugin),
|
||||
new QuestsEditorCommand(plugin),
|
||||
new QuestsActionsCommand(plugin),
|
||||
new QuestsConditionsCommand(plugin),
|
||||
new QuestsInfoCommand(plugin),
|
||||
new QuestsChoiceCommand())
|
||||
.collect(Collectors.toMap(QuestsSubCommand::getName, Function.identity()));
|
||||
}
|
||||
|
||||
public boolean check(final CommandSender cs, final String[] args) {
|
||||
if (args.length == 0) {
|
||||
printHelp(cs);
|
||||
return true;
|
||||
}
|
||||
for (Map.Entry<String, QuestsSubCommand> cmd : subCommands.entrySet()) {
|
||||
if (args[0].equalsIgnoreCase(cmd.getKey()) || args[0].equalsIgnoreCase(cmd.getValue().getNameI18N())) {
|
||||
if (args.length < cmd.getValue().getMaxArguments()) {
|
||||
cs.sendMessage(getCommandUsage(cs, args[0]));
|
||||
}
|
||||
cmd.getValue().execute(cs, args);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
cs.sendMessage(ChatColor.YELLOW + Lang.get(cs, "questsUnknownCommand"));
|
||||
return true;
|
||||
}
|
||||
|
||||
public List<String> suggest(final CommandSender cs, final String[] args) {
|
||||
if (args.length == 1) {
|
||||
final List<String> results = new ArrayList<>();
|
||||
for (Map.Entry<String, QuestsSubCommand> cmd : subCommands.entrySet()) {
|
||||
if (cmd.getKey().startsWith(args[0]) || cmd.getValue().getNameI18N().startsWith(args[0])) {
|
||||
results.add(cmd.getValue().getNameI18N());
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
for (Map.Entry<String, QuestsSubCommand> cmd : subCommands.entrySet()) {
|
||||
if (args[0].equalsIgnoreCase(cmd.getKey()) || args[0].equalsIgnoreCase(cmd.getValue().getNameI18N())) {
|
||||
return cmd.getValue().tabComplete(cs, args);
|
||||
}
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
private void printHelp(final CommandSender cs) {
|
||||
if (!cs.hasPermission("quests.quests")) {
|
||||
cs.sendMessage(ChatColor.RED + Lang.get("noPermission"));
|
||||
return;
|
||||
}
|
||||
cs.sendMessage(ChatColor.GOLD + Lang.get("questHelpTitle"));
|
||||
cs.sendMessage(ChatColor.YELLOW + "/quests " + Lang.get("questDisplayHelp"));
|
||||
for (final QuestsSubCommand cmd : subCommands.values()) {
|
||||
if (cmd.getName().equals("choice")) {
|
||||
continue;
|
||||
}
|
||||
cs.sendMessage(ChatColor.YELLOW + "/quests " + cmd.getDescription().replace("<command>", ChatColor.GOLD
|
||||
+ (plugin.getSettings().canTranslateSubCommands() ? cmd.getNameI18N() : cmd.getName())
|
||||
+ ChatColor.YELLOW));
|
||||
}
|
||||
if (cs instanceof Player) {
|
||||
cs.sendMessage(ChatColor.DARK_AQUA + "/quest " + ChatColor.YELLOW + Lang.get(cs, "COMMAND_QUEST_HELP"));
|
||||
if (cs.hasPermission("quests.questinfo")) {
|
||||
cs.sendMessage(ChatColor.DARK_AQUA + "/quest " + ChatColor.YELLOW
|
||||
+ Lang.get(cs, "COMMAND_QUESTINFO_HELP"));
|
||||
}
|
||||
}
|
||||
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin")) {
|
||||
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED
|
||||
+ Lang.get(cs, "COMMAND_QUESTADMIN_HELP"));
|
||||
}
|
||||
}
|
||||
|
||||
private String getCommandUsage(final CommandSender cs, final String cmd) {
|
||||
return ChatColor.RED + Lang.get(cs, "usage") + ": " + ChatColor.YELLOW + "/quests "
|
||||
+ Lang.get(cs, Lang.getKeyFromPrefix("COMMAND_", cmd) + "_HELP")
|
||||
.replace("<command>", cmd.toLowerCase());
|
||||
}
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.commands.quests.subcommands;
|
||||
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.commands.QuestsSubCommand;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.conversations.Conversable;
|
||||
|
||||
public class QuestsActionsCommand extends QuestsSubCommand {
|
||||
|
||||
private final Quests plugin;
|
||||
|
||||
public QuestsActionsCommand(Quests plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "actions";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNameI18N() {
|
||||
return Lang.get("COMMAND_EVENTS_EDITOR");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return Lang.get("COMMAND_EVENTS_EDITOR_HELP");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPermission() {
|
||||
return "quests.actions";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/quests actions";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxArguments() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender cs, String[] args) {
|
||||
if (cs.hasPermission("quests.events.*") || cs.hasPermission("quests.actions.*")
|
||||
|| cs.hasPermission("quests.actions.editor") || cs.hasPermission("quests.events.editor")
|
||||
|| cs.hasPermission("quests.mode.trial")) {
|
||||
final Conversable c = (Conversable) cs;
|
||||
if (!c.isConversing()) {
|
||||
plugin.getActionFactory().getConversationFactory().buildConversation(c).begin();
|
||||
} else {
|
||||
cs.sendMessage(ChatColor.RED + Lang.get(cs, "duplicateEditor"));
|
||||
}
|
||||
} else {
|
||||
cs.sendMessage(ChatColor.RED + Lang.get(cs, "noPermission"));
|
||||
}
|
||||
}
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 PikaMug and contributors. All rights reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package me.blackvein.quests.commands.quests.subcommands;
|
||||
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.commands.QuestsSubCommand;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.conversations.Conversable;
|
||||
|
||||
public class QuestsConditionsCommand extends QuestsSubCommand {
|
||||
|
||||
private final Quests plugin;
|
||||
|
||||
public QuestsConditionsCommand(Quests plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "conditions";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNameI18N() {
|
||||
return Lang.get("COMMAND_CONDITIONS_EDITOR");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return Lang.get("COMMAND_CONDITIONS_EDITOR_HELP");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPermission() {
|
||||
return "quests.conditions";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/quests conditions";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxArguments() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender cs, String[] args) {
|
||||
if (cs.hasPermission("quests.conditions.*") || cs.hasPermission("quests.conditions.editor")
|
||||
|| cs.hasPermission("quests.mode.trial")) {
|
||||
final Conversable c = (Conversable) cs;
|
||||
if (!c.isConversing()) {
|
||||
plugin.getConditionFactory().getConversationFactory().buildConversation(c).begin();
|
||||
} else {
|
||||
cs.sendMessage(ChatColor.RED + Lang.get(cs, "duplicateEditor"));
|
||||
}
|
||||
} else {
|
||||
cs.sendMessage(ChatColor.RED + Lang.get(cs, "noPermission"));
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user