mirror of https://github.com/PikaMug/Quests.git
Compare commits
336 Commits
Author | SHA1 | Date |
---|---|---|
PikaMug | 2a48e147d1 | |
PikaMug | d3ee8c6c4b | |
PikaMug | dde8aa252b | |
PikaMug | 5d9bab93c3 | |
PikaMug | 3f9d43c93d | |
PikaMug | c56d358153 | |
PikaMug | 7ce87b8644 | |
PikaMug | 4dacb4532f | |
PikaMug | a7e9e41d68 | |
PikaMug | 0b19116362 | |
PikaMug | 37316238e2 | |
PikaMug | abe97e558e | |
PikaMug | 15044ba9e2 | |
PikaMug | 9f26e9d053 | |
PikaMug | 181f4e0dec | |
PikaMug | 90f8f0ec27 | |
PikaMug | 1fdb1b8a80 | |
PikaMug | 3d6c0fad63 | |
PikaMug | 94fee10e96 | |
PikaMug | 74a3d093fa | |
PikaMug | d0c1f92acf | |
PikaMug | 6c4f0b2196 | |
PikaMug | a40054d420 | |
PikaMug | a6635bb79c | |
PikaMug | c31362baa7 | |
PikaMug | 63f6ea0402 | |
PikaMug | d8a7addc9b | |
PikaMug | 605e63d2a4 | |
PikaMug | c58e591e43 | |
PikaMug | 00046d1dcb | |
PikaMug | 085cb1e53f | |
PikaMug | 190e4f4b34 | |
PikaMug | 2c1a0e8551 | |
PikaMug | f908d1c353 | |
PikaMug | a4446cc3d5 | |
PikaMug | f440ea43cd | |
PikaMug | ff4dcacea8 | |
PikaMug | 9a5b5725bb | |
PikaMug | a153702387 | |
PikaMug | f619b6c091 | |
PikaMug | d75aa9b248 | |
PikaMug | 307326d1b1 | |
PikaMug | 8eae46ad07 | |
PikaMug | 0cc6d7770b | |
PikaMug | f0eb129843 | |
PikaMug | d35301d1e5 | |
PikaMug | a85c2d4b81 | |
PikaMug | 5ebeb77cd7 | |
PikaMug | 76397b6e1a | |
PikaMug | 2695d4008d | |
PikaMug | c91e2f6149 | |
PikaMug | 38d58088be | |
PikaMug | 3f2465fe6c | |
PikaMug | 3e59fc5659 | |
PikaMug | 3413895abf | |
PikaMug | 969bac022d | |
PikaMug | 82de833b60 | |
PikaMug | a587a0c1c0 | |
PikaMug | f565a6d263 | |
PikaMug | 0675b357fc | |
PikaMug | 7e42ec5ecb | |
PikaMug | 577f4d13ce | |
PikaMug | 5805b47e88 | |
PikaMug | 45a64a05ed | |
PikaMug | 5c5d4dd0b3 | |
PikaMug | 7a581532cf | |
PikaMug | 3359fd3175 | |
PikaMug | bc65715551 | |
PikaMug | dfd987dd32 | |
PikaMug | c9ae34c146 | |
PikaMug | 85c99bac5a | |
PikaMug | 8507ebcb64 | |
D3v1s0m | 24272a7243 | |
PikaMug | 46e5364b88 | |
D3v1s0m | 90a38e06ae | |
PikaMug | 2e6ab6c038 | |
PikaMug | 4a935b0346 | |
PikaMug | 521f7ab278 | |
PikaMug | 8240d0555c | |
PikaMug | 977a386366 | |
PikaMug | 6c15c41d97 | |
PikaMug | 162db479d2 | |
PikaMug | 07c1ae8610 | |
PikaMug | 10fc926395 | |
PikaMug | fa2c34d36e | |
PikaMug | 16ee58326b | |
PikaMug | 19c6f02cc8 | |
PikaMug | f5f872bd25 | |
PikaMug | 720538d0f8 | |
PikaMug | e0970db2a4 | |
PikaMug | 93e57c2573 | |
PikaMug | 45235ec59e | |
PikaMug | d08df181a7 | |
PikaMug | d76082d484 | |
PikaMug | 3eb180a36e | |
Drăghiciu Nicolae | 870eb02540 | |
PikaMug | af1469a913 | |
PikaMug | 90bf028624 | |
PikaMug | 56a75acc37 | |
PikaMug | 8d4b39c9d7 | |
PikaMug | 5b63533e7b | |
PikaMug | 5e2e122a05 | |
PikaMug | 7ae0551bf3 | |
PikaMug | 068ac6fe6d | |
PikaMug | a34978a14a | |
PikaMug | efb42f4d2c | |
PikaMug | b3bd277478 | |
PikaMug | 7f821a8b17 | |
PikaMug | b2b20144d0 | |
PikaMug | 85d0f035a6 | |
PikaMug | 3d8179f55d | |
PikaMug | 60368fddd9 | |
PikaMug | ab0879d5a3 | |
PikaMug | 7c30a0ce8e | |
PikaMug | 778c41f254 | |
PikaMug | cc916c5af4 | |
PikaMug | 85b0e0017a | |
PikaMug | 8b9385c0de | |
PikaMug | e5322074b8 | |
PikaMug | 3c8acea21a | |
PikaMug | 0ee5e9e730 | |
PikaMug | 1f5ede8f2c | |
PikaMug | 5344c4c6d7 | |
Drăghiciu Nicolae | 5f681e7e92 | |
PikaMug | a91b033d4e | |
PikaMug | ccea1acba5 | |
PikaMug | c5a753e19e | |
PikaMug | 49392e5d1c | |
PikaMug | 496e8eedce | |
PikaMug | 87e7bdbd6c | |
PikaMug | b82cf9e377 | |
PikaMug | ec24e5f0ea | |
PikaMug | e7a6456a34 | |
PikaMug | 0fe72d418b | |
PikaMug | fc2d558e5c | |
PikaMug | 9b3736be87 | |
PikaMug | 447023626e | |
PikaMug | 5c061f17a6 | |
PikaMug | df9c40785d | |
PikaMug | aa02e57735 | |
PikaMug | 656b99703b | |
PikaMug | 4a428c014f | |
PikaMug | 858c81bcd6 | |
PikaMug | dea6d561b3 | |
PikaMug | fcdff55310 | |
PikaMug | 7f2430441a | |
PikaMug | 0d106297ad | |
PikaMug | be0dce3cbe | |
PikaMug | a77771cf72 | |
PikaMug | b8aa2d0379 | |
PikaMug | 0520145baf | |
PikaMug | 0e177afdc1 | |
PikaMug | e6472bcae2 | |
PikaMug | 40b78b68ff | |
PikaMug | 64aa1387a0 | |
PikaMug | 609d8e9c4d | |
PikaMug | 12c8e1e4a8 | |
PikaMug | 3277eef7d3 | |
PikaMug | 43e9b6a7ae | |
PikaMug | e38e6006c4 | |
PikaMug | 20bbd3d6e8 | |
PikaMug | aa4d7b6d3d | |
PikaMug | 763be3bb94 | |
PikaMug | 9e4c1de8e2 | |
PikaMug | 60cefdaf1c | |
PikaMug | 5261576517 | |
PikaMug | 12e540e923 | |
PikaMug | 32913081f2 | |
PikaMug | aec6219f21 | |
PikaMug | 387913e173 | |
PikaMug | 2b2fdc69b0 | |
PikaMug | 328aba4bc3 | |
PikaMug | b32b2b6ef2 | |
PikaMug | fd40f15b8b | |
PikaMug | f14040c7fe | |
PikaMug | d9292e0222 | |
PikaMug | 11a251bbf4 | |
PikaMug | 354c72ba4a | |
PikaMug | e0bbbe7e90 | |
PikaMug | 0329e71f3c | |
PikaMug | 5604392814 | |
PikaMug | cd4818bfee | |
PikaMug | 35819b619c | |
PikaMug | 676eae4819 | |
PikaMug | 96780c0bfd | |
PikaMug | e83db9a0fe | |
PikaMug | 4c4c0dc21c | |
PikaMug | a5429d3ede | |
PikaMug | ee45d26a5a | |
PikaMug | a28e94813d | |
PikaMug | 71abe19187 | |
PikaMug | f78dccf90e | |
PikaMug | b5d7dccbad | |
PikaMug | 7bc860248d | |
PikaMug | dd227102d6 | |
PikaMug | d676f86758 | |
PikaMug | 0a0952eaa6 | |
PikaMug | ee2a3190aa | |
PikaMug | 468491e8d8 | |
PikaMug | af4c6232c6 | |
PikaMug | 19dc1dce37 | |
PikaMug | ec4dc943c5 | |
PikaMug | 3423424908 | |
PikaMug | 4b50760c2e | |
PikaMug | a9446d9168 | |
PikaMug | 56e2fb1cf9 | |
PikaMug | d6586bec9f | |
PikaMug | cfe2a660ec | |
datatags | a070255c0b | |
PikaMug | 0df7b37529 | |
PikaMug | 7e194579d2 | |
PikaMug | 74ad68d49c | |
PikaMug | c8d4b02060 | |
PikaMug | 8d7fe3e108 | |
PikaMug | 72ab32c71a | |
PikaMug | b38ee19dab | |
PikaMug | 67a72d31c6 | |
PikaMug | 55d2679f56 | |
PikaMug | e5d00e04d4 | |
PikaMug | abe4570d6e | |
PikaMug | b634348cd7 | |
PikaMug | a367831405 | |
PikaMug | 03136d8945 | |
PikaMug | f12a592f06 | |
PikaMug | 565bfe02e0 | |
PikaMug | 70615b30c9 | |
PikaMug | 1eb85f0178 | |
PikaMug | a54700a870 | |
PikaMug | 6c322582dc | |
PikaMug | 4d9a102a7d | |
dependabot[bot] | 635de4a0fd | |
PikaMug | c59f1882e8 | |
PikaMug | 581e00c6a1 | |
PikaMug | 78f5766b78 | |
PikaMug | 1e1175d061 | |
PikaMug | df2716074f | |
PikaMug | 86df2aa0b0 | |
PikaMug | 5c66d01d7c | |
PikaMug | fae968c3e6 | |
PikaMug | 5a78e20efc | |
PikaMug | 6ff11bed03 | |
PikaMug | 12174c5164 | |
PikaMug | 2f360562a6 | |
PikaMug | 7cbf317b42 | |
PikaMug | 2d1387cda1 | |
PikaMug | 5c212cb5d3 | |
PikaMug | ea1d720b51 | |
PikaMug | b234e097e3 | |
PikaMug | a7be8e9eb6 | |
PikaMug | 9dbbce3ea1 | |
PikaMug | 1eb79a6d14 | |
therbz | 11612439f9 | |
PikaMug | baf377e304 | |
PikaMug | 67b8018f93 | |
PikaMug | ae70523ac6 | |
PikaMug | 69f6d0acc4 | |
PikaMug | 53a4e5ef6e | |
PikaMug | 44ce64a7e9 | |
PikaMug | a02ca87d79 | |
PikaMug | ea6e50a49f | |
PikaMug | 74d071ffe8 | |
PikaMug | 054d86d6bc | |
PikaMug | 8fc1ad4bda | |
PikaMug | 5ef365c861 | |
therbz | 56ccaaab32 | |
PikaMug | c351ad699d | |
PikaMug | e40a00b236 | |
PikaMug | 68a626b117 | |
PikaMug | 9aa26d5b28 | |
PikaMug | 86d9e2c665 | |
PikaMug | 2a1c78b947 | |
PikaMug | 939b6b8f63 | |
PikaMug | 2d3592a89c | |
PikaMug | 684a3ebbdb | |
PikaMug | 9bf260ad59 | |
PikaMug | 3338001a97 | |
PikaMug | 002c4607cc | |
PikaMug | c1ef9b8fb2 | |
PikaMug | 1345b8251b | |
PikaMug | 298b18a536 | |
PikaMug | c593c210a3 | |
PikaMug | b7282cbada | |
PikaMug | d3c3b1d6c9 | |
PikaMug | 0ba111ec6a | |
PikaMug | 39633f2d15 | |
PikaMug | 67dc1dfe88 | |
Maximilian Dorn | 89922c3255 | |
PikaMug | 746f294628 | |
PikaMug | 025badce6b | |
PikaMug | 2c34ace51e | |
PikaMug | 33474fbc5c | |
PikaMug | 17e8510335 | |
PikaMug | 11ffbf46be | |
PikaMug | acf3daac60 | |
PikaMug | d07a777818 | |
PikaMug | 77d392dba2 | |
PikaMug | 260c66f4de | |
PikaMug | 38ab11e088 | |
PikaMug | 5c93285df2 | |
PikaMug | 2db149067d | |
PikaMug | 80088d7f52 | |
PikaMug | 81f7fb4d3c | |
PikaMug | d363d6d81c | |
PikaMug | e036074af5 | |
PikaMug | b8e8c97b3e | |
PikaMug | 9302fe0e54 | |
PikaMug | 126e531fe2 | |
PikaMug | 91cb2c6851 | |
PikaMug | 9528042751 | |
PikaMug | b81e4fc16b | |
PikaMug | d38d09f482 | |
PikaMug | d382da8a42 | |
PikaMug | 965071a907 | |
PikaMug | 51d55ac626 | |
PikaMug | 02e7f284b3 | |
PikaMug | 570d3ea854 | |
PikaMug | 34eb2e458a | |
PikaMug | 83c720c021 | |
PikaMug | c999f7697d | |
PikaMug | d1875ae377 | |
PikaMug | 609eb183bd | |
PikaMug | 637ac02ee2 | |
PikaMug | 0c699b2de8 | |
PikaMug | ba14b57741 | |
PikaMug | ea80add107 | |
PikaMug | 8dd848ae16 | |
PikaMug | b25449f89f | |
PikaMug | 945e06c33f | |
PikaMug | 2bfbc68cfa | |
PikaMug | 5befbb1e8c | |
PikaMug | 08ae5b4f76 | |
PikaMug | ce5039d67b | |
PikaMug | 5b2d9a97dd | |
PikaMug | afcc682261 | |
PikaMug | 77b79f0689 | |
PikaMug | ee82e62805 |
|
@ -0,0 +1,13 @@
|
|||
# These are supported funding model platforms
|
||||
|
||||
github: PikaMug
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||
custom: paypal.com/donate/?hosted_button_id=FZAFJVB7FC4GU
|
|
@ -8,7 +8,7 @@ body:
|
|||
Thanks for submitting a bug report! Please answer the following questions:
|
||||
- type: 'textarea'
|
||||
attributes:
|
||||
label: 'What is your Quests version / build number (do _not_ say "latest")?'
|
||||
label: 'What is your Quests version / build number (do *not* say "latest")?'
|
||||
description: 'You can find this using the `/quests info` command.'
|
||||
placeholder: 'The version used is...'
|
||||
validations:
|
||||
|
@ -31,6 +31,6 @@ body:
|
|||
attributes:
|
||||
label: 'If applicable, can you provide an example quest from quests.yml?'
|
||||
description: 'Do not upload the file itself.'
|
||||
render: shell
|
||||
render: yaml
|
||||
validations:
|
||||
required: false
|
||||
|
|
|
@ -19,10 +19,11 @@ nbdist/
|
|||
# Maven files
|
||||
*/target
|
||||
*dependency-reduced-pom.xml
|
||||
*.flattened-pom.xml
|
||||
|
||||
# Java files
|
||||
*.class
|
||||
*.log
|
||||
*.ctxt
|
||||
hs_err_pid*
|
||||
/target/
|
||||
hs_err_pid*
|
||||
/target/
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 64 KiB |
|
@ -5,7 +5,7 @@ Thank you for your interest in contributing to Quests! We appreciate your
|
|||
effort, but to make sure that the inclusion of your patch is a smooth process, we
|
||||
ask that you make note of the following guidelines.
|
||||
|
||||
* **Target Java 16 for source and compilation.** Make sure to mark methods with
|
||||
* **Target Java 8 for source and compilation.** Make sure to mark methods with
|
||||
` @Override` that override methods of parent classes, or that implement
|
||||
methods of interfaces.
|
||||
* **Use only spaces for indentation.** Our indents are 4-spaces long, and tabs
|
||||
|
@ -30,7 +30,7 @@ Branches
|
|||
----------------
|
||||
When submitting a feature or bugfix, base your code on the newest development branch,
|
||||
and PR against that same branch. If such a branch does not exist, base your code
|
||||
against the `master` branch, and PR against that same branch.
|
||||
against the `main` branch, and PR against that same branch.
|
||||
|
||||
|
||||
Checklist
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
MIT License
|
||||
|
||||
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.
|
|
@ -17,8 +17,8 @@ Download
|
|||
|
||||
Distributed through these fine vendors:
|
||||
- CurseForge (https://www.curseforge.com/minecraft/bukkit-plugins/quests/)
|
||||
- Modrinth (https://modrinth.com/plugin/quests.classic)
|
||||
- SpigotMC (https://www.spigotmc.org/resources/quests.3711/)
|
||||
- MC-Market (https://www.mc-market.org/resources/19187/)
|
||||
|
||||
Usage
|
||||
---
|
||||
|
@ -28,7 +28,7 @@ Read about usage in the documentation: https://pikamug.gitbook.io/quests/
|
|||
Compile
|
||||
---
|
||||
|
||||
Requires Java 8 and Maven: https://pikamug.gitbook.io/quests/master/plugin-compilation
|
||||
Java 8 and Maven required: https://pikamug.gitbook.io/quests/master/plugin-compilation
|
||||
|
||||
Translate
|
||||
---
|
||||
|
|
173
api/pom.xml
173
api/pom.xml
|
@ -1,11 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>me.blackvein.quests</groupId>
|
||||
<groupId>me.pikamug.quests</groupId>
|
||||
<artifactId>quests-parent</artifactId>
|
||||
<version>4.2.2</version>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<artifactId>quests-api</artifactId>
|
||||
|
||||
|
@ -14,40 +15,10 @@
|
|||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<!-- CitizensBooks, DungeonsXL, GPS, mcMMO Classic, PhatLoots -->
|
||||
<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>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
|
@ -58,76 +29,32 @@
|
|||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.citizensnpcs</groupId>
|
||||
<artifactId>citizensapi</artifactId>
|
||||
<version>2.0.21-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.3-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-stripped</artifactId>
|
||||
<version>4dd3dd85</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.9.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.nicuch</groupId>
|
||||
<artifactId>CitizensBooks</artifactId>
|
||||
<version>2.5.5</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.1.6</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.PikaMug</groupId>
|
||||
<artifactId>Unite</artifactId>
|
||||
<version>1.1.2</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>
|
||||
|
||||
|
@ -139,7 +66,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<version>3.10.1</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
|
@ -151,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,103 +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.IAction;
|
||||
import me.blackvein.quests.actions.ActionFactory;
|
||||
import me.blackvein.quests.conditions.ICondition;
|
||||
import me.blackvein.quests.conditions.ConditionFactory;
|
||||
import me.blackvein.quests.config.ISettings;
|
||||
import me.blackvein.quests.dependencies.IDependencies;
|
||||
import me.blackvein.quests.module.ICustomObjective;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.quests.QuestFactory;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.conversations.ConversationFactory;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface QuestsAPI extends Plugin {
|
||||
|
||||
boolean isLoading();
|
||||
|
||||
String getDetectedServerSoftwareVersion();
|
||||
|
||||
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);
|
||||
|
||||
LinkedList<Integer> getQuestNpcIds();
|
||||
|
||||
void setQuestNpcIds(final LinkedList<Integer> questNpcIds);
|
||||
|
||||
CommandExecutor getCommandExecutor();
|
||||
|
||||
ConversationFactory getConversationFactory();
|
||||
|
||||
ConversationFactory getNpcConversationFactory();
|
||||
|
||||
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,67 +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 me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
public interface ICondition extends Comparable<ICondition> {
|
||||
String getName();
|
||||
|
||||
void setName(final String name);
|
||||
|
||||
boolean isFailQuest();
|
||||
|
||||
void setFailQuest(final boolean failQuest);
|
||||
|
||||
LinkedList<String> getEntitiesWhileRiding();
|
||||
|
||||
void setEntitiesWhileRiding(final LinkedList<String> entitiesWhileRiding);
|
||||
|
||||
LinkedList<Integer> getNpcsWhileRiding();
|
||||
|
||||
void setNpcsWhileRiding(final LinkedList<Integer> npcsWhileRiding);
|
||||
|
||||
LinkedList<String> getPermissions();
|
||||
|
||||
void setPermissions(final LinkedList<String> permissions);
|
||||
|
||||
LinkedList<ItemStack> getItemsWhileHoldingMainHand();
|
||||
|
||||
void setItemsWhileHoldingMainHand(final LinkedList<ItemStack> itemsWhileHoldingMainHand);
|
||||
|
||||
LinkedList<String> getWorldsWhileStayingWithin();
|
||||
|
||||
void setWorldsWhileStayingWithin(final LinkedList<String> worldsWhileStayingWithin);
|
||||
|
||||
LinkedList<String> getBiomesWhileStayingWithin();
|
||||
|
||||
void setBiomesWhileStayingWithin(final LinkedList<String> biomesWhileStayingWithin);
|
||||
|
||||
LinkedList<String> getRegionsWhileStayingWithin();
|
||||
|
||||
void setRegionsWhileStayingWithin(final LinkedList<String> biomesWhileStayingWithin);
|
||||
|
||||
LinkedList<String> getPlaceholdersCheckIdentifier();
|
||||
|
||||
void setPlaceholdersCheckIdentifier(final LinkedList<String> placeholdersCheckIdentifier);
|
||||
|
||||
LinkedList<String> getPlaceholdersCheckValue();
|
||||
|
||||
void setPlaceholdersCheckValue(final LinkedList<String> placeholdersCheckValue);
|
||||
|
||||
boolean check(final IQuester quester, final IQuest quest);
|
||||
}
|
|
@ -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,83 +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.codisimus.plugins.phatloots.PhatLoots;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.herocraftonline.heroes.Heroes;
|
||||
import com.herocraftonline.heroes.characters.Hero;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.reflect.denizen.DenizenAPI;
|
||||
import me.blackvein.quests.reflect.worldguard.WorldGuardAPI;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
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.nicuch.citizensbooks.CitizensBooksAPI;
|
||||
|
||||
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();
|
||||
|
||||
PhatLoots getPhatLoots();
|
||||
|
||||
PlaceholderAPIPlugin getPlaceholderApi();
|
||||
|
||||
CitizensPlugin getCitizens();
|
||||
|
||||
void linkCitizens();
|
||||
|
||||
void unlinkCitizens();
|
||||
|
||||
DenizenAPI getDenizenApi();
|
||||
|
||||
CitizensBooksAPI getCitizensBooksApi();
|
||||
|
||||
PartiesAPI getPartiesApi();
|
||||
|
||||
boolean isPluginAvailable(final String pluginName);
|
||||
|
||||
boolean runDenizenScript(final String scriptName, final IQuester quester);
|
||||
|
||||
Location getNPCLocation(final int id);
|
||||
|
||||
String getNPCName(final int id);
|
||||
|
||||
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,260 +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 net.citizensnpcs.api.npc.NPC;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentSkipListSet;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
|
||||
public interface IQuester extends Comparable<IQuester> {
|
||||
UUID getUUID();
|
||||
|
||||
void setUUID(final UUID id);
|
||||
|
||||
String getQuestIdToTake();
|
||||
|
||||
void setQuestIdToTake(final String questIdToTake);
|
||||
|
||||
String 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);
|
||||
|
||||
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);
|
||||
|
||||
LinkedList<String> getCurrentRequirements(final IQuest quest, final boolean ignoreOverrides);
|
||||
|
||||
LinkedList<String> getCurrentObjectives(final IQuest quest, final boolean ignoreOverrides);
|
||||
|
||||
LinkedList<String> getObjectives(final IQuest quest, final boolean ignoreOverrides);
|
||||
|
||||
boolean containsObjective(final IQuest quest, final String name);
|
||||
|
||||
boolean hasCustomObjective(final IQuest quest, final String name);
|
||||
|
||||
void breakBlock(final IQuest quest, final ItemStack itemStack);
|
||||
|
||||
void damageBlock(final IQuest quest, final ItemStack itemStack);
|
||||
|
||||
void placeBlock(final IQuest quest, final ItemStack itemStack);
|
||||
|
||||
void useBlock(final IQuest quest, final ItemStack itemStack);
|
||||
|
||||
void cutBlock(final IQuest quest, final ItemStack itemStack);
|
||||
|
||||
void craftItem(final IQuest quest, final ItemStack itemStack);
|
||||
|
||||
void smeltItem(final IQuest quest, final ItemStack itemStack);
|
||||
|
||||
void enchantBook(final IQuest quest, final ItemStack itemStack,
|
||||
final Map<Enchantment, Integer> enchantsToAdd);
|
||||
|
||||
void enchantItem(final IQuest quest, final ItemStack itemStack);
|
||||
|
||||
void brewItem(final IQuest quest, final ItemStack itemStack);
|
||||
|
||||
void consumeItem(final IQuest quest, final ItemStack itemStack);
|
||||
|
||||
void deliverToNPC(final IQuest quest, final NPC npc, final ItemStack itemStack);
|
||||
|
||||
void interactWithNPC(final IQuest quest, final NPC npc);
|
||||
|
||||
void killNPC(final IQuest quest, final NPC npc);
|
||||
|
||||
void milkCow(final IQuest quest);
|
||||
|
||||
void catchFish(final IQuest quest);
|
||||
|
||||
void killMob(final IQuest quest, final Location killedLocation, final EntityType entityType);
|
||||
|
||||
void killPlayer(final IQuest quest, final Player player);
|
||||
|
||||
void reachLocation(final IQuest quest, final Location location);
|
||||
|
||||
void tameMob(final IQuest quest, final EntityType entityType);
|
||||
|
||||
void shearSheep(final IQuest quest, final DyeColor color);
|
||||
|
||||
void sayPassword(final IQuest quest, final AsyncPlayerChatEvent evt);
|
||||
|
||||
void finishObjective(final IQuest quest, final Objective objective, final EntityType mob,
|
||||
final String extra, final NPC npc, final Location location, final DyeColor color,
|
||||
final String pass, final ICustomObjective co);
|
||||
|
||||
boolean testComplete(final IQuest quest);
|
||||
|
||||
void addEmptiesFor(final IQuest quest, final int stage);
|
||||
|
||||
boolean saveData();
|
||||
|
||||
long getCompletionDifference(final IQuest quest);
|
||||
|
||||
long getRemainingCooldown(final IQuest quest);
|
||||
|
||||
FileConfiguration getBaseData();
|
||||
|
||||
boolean hasData();
|
||||
|
||||
boolean hasBaseData();
|
||||
|
||||
void startStageTimer(final IQuest quest);
|
||||
|
||||
void stopStageTimer(final IQuest quest);
|
||||
|
||||
long getStageTime(final IQuest quest);
|
||||
|
||||
void checkQuest(final IQuest quest);
|
||||
|
||||
void showGUIDisplay(final NPC npc, final LinkedList<IQuest> quests);
|
||||
|
||||
void hardQuit(final IQuest quest);
|
||||
|
||||
void hardRemove(final IQuest quest);
|
||||
|
||||
void hardClear();
|
||||
|
||||
void hardStagePut(final IQuest key, final Integer val);
|
||||
|
||||
void hardDataPut(final IQuest key, final QuestData val);
|
||||
|
||||
boolean canUseCompass();
|
||||
|
||||
void resetCompass();
|
||||
|
||||
void findCompassTarget();
|
||||
|
||||
void findNextCompassTarget(final boolean notify);
|
||||
|
||||
boolean hasItem(final ItemStack is);
|
||||
|
||||
Set<String> dispatchMultiplayerEverything(final IQuest quest, final ObjectiveType type,
|
||||
final BiFunction<IQuester, IQuest, Void> fun);
|
||||
|
||||
Set<String> dispatchMultiplayerObjectives(final IQuest quest, final 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,99 +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 net.citizensnpcs.api.npc.NPC;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
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();
|
||||
|
||||
NPC getNpcStart();
|
||||
|
||||
void setNpcStart(final NPC npcStart);
|
||||
|
||||
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,334 +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;
|
||||
|
||||
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<Integer> getItemDeliveryTargets();
|
||||
|
||||
boolean addItemDeliveryTarget(Integer itemDeliveryTarget);
|
||||
|
||||
void setItemDeliveryTargets(final LinkedList<Integer> itemDeliveryTargets);
|
||||
|
||||
LinkedList<String> getDeliverMessages();
|
||||
|
||||
boolean addDeliverMessage(String deliverMessage);
|
||||
|
||||
void setDeliverMessages(final LinkedList<String> deliverMessages);
|
||||
|
||||
LinkedList<Integer> getCitizensToInteract();
|
||||
|
||||
boolean addCitizenToInteract(Integer citizenToInteract);
|
||||
|
||||
void setCitizensToInteract(final LinkedList<Integer> citizensToInteract);
|
||||
|
||||
LinkedList<Integer> getCitizensToKill();
|
||||
|
||||
boolean addCitizenToKill(Integer citizenToKill);
|
||||
|
||||
void setCitizensToKill(final LinkedList<Integer> citizensToKill);
|
||||
|
||||
LinkedList<Integer> getCitizenNumToKill();
|
||||
|
||||
boolean addCitizenNumToKill(Integer citizenNumToKill);
|
||||
|
||||
void setCitizenNumToKill(final LinkedList<Integer> citizenNumToKill);
|
||||
|
||||
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,28 +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.bukkit.inventory.ItemStack;
|
||||
|
||||
public interface Objective {
|
||||
ObjectiveType getType();
|
||||
|
||||
int getProgress();
|
||||
|
||||
int getGoal();
|
||||
|
||||
ItemStack getItemProgress();
|
||||
|
||||
ItemStack getItemGoal();
|
||||
}
|
|
@ -1,32 +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);*/
|
||||
}
|
|
@ -1,292 +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.util;
|
||||
|
||||
import me.blackvein.quests.QuestsAPI;
|
||||
import me.clip.placeholderapi.PlaceholderAPI;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.configuration.InvalidConfigurationException;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Objects;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class Lang {
|
||||
|
||||
private static String iso = "en-US";
|
||||
private static final LinkedHashMap<String, String> langMap = new LinkedHashMap<>();
|
||||
private static final Pattern hexPattern = Pattern.compile("(?i)%#([0-9A-F]{6})%");
|
||||
|
||||
public static String getISO() {
|
||||
return iso;
|
||||
}
|
||||
|
||||
public static void setISO(final String iso) {
|
||||
Lang.iso = iso;
|
||||
}
|
||||
|
||||
public static Collection<String> values() {
|
||||
return langMap.values();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get lang string AND pass Player for use with PlaceholderAPI, if installed
|
||||
*
|
||||
* @param player the Player whom will receive the string
|
||||
* @param key label as it appears in lang file, such as "journalNoQuests"
|
||||
* @return formatted string, plus processing through PlaceholderAPI by clip
|
||||
*/
|
||||
public static String get(final Player player, final String key) {
|
||||
return langMap.containsKey(key) ? LangToken.convertString(player, langMap.get(key)) : "NULL";
|
||||
}
|
||||
|
||||
/**
|
||||
* Get lang string
|
||||
*
|
||||
* @param key label as it appears in lang file, such as "journalNoQuests"
|
||||
* @return formatted string
|
||||
*/
|
||||
public static String get(final String key) {
|
||||
return langMap.containsKey(key) ? LangToken.convertString(langMap.get(key)) : "NULL";
|
||||
}
|
||||
|
||||
/**
|
||||
* Get key for lang string
|
||||
* @param value The lang string
|
||||
* @return key or "NULL" as String
|
||||
*/
|
||||
public static String getKey(final String value) {
|
||||
for (final Entry<String, String> entry : langMap.entrySet()) {
|
||||
if (entry.getValue().equals(value)) {
|
||||
return entry.getKey();
|
||||
}
|
||||
}
|
||||
return "NULL";
|
||||
}
|
||||
|
||||
/**
|
||||
* Get prefixed key for lang value
|
||||
* @param value The lang string
|
||||
* @param keyPrefix String that the key starts with
|
||||
* @return full key or "NULL" as String
|
||||
*/
|
||||
public static String getKeyFromPrefix(final String keyPrefix, final String value) {
|
||||
for (final Entry<String, String> entry : langMap.entrySet()) {
|
||||
if (entry.getValue().equalsIgnoreCase(value) && entry.getKey().toUpperCase().startsWith(keyPrefix)) {
|
||||
return entry.getKey();
|
||||
}
|
||||
}
|
||||
return "NULL";
|
||||
}
|
||||
|
||||
public static void clear() {
|
||||
langMap.clear();
|
||||
}
|
||||
|
||||
public static int size() {
|
||||
return langMap.size();
|
||||
}
|
||||
|
||||
public static String getModified(final String key, final String[] tokens) {
|
||||
String orig = langMap.get(key);
|
||||
for (int i = 0; i < tokens.length; i++) {
|
||||
orig = orig.replace("%" + (i + 1), tokens[i]);
|
||||
}
|
||||
return orig;
|
||||
}
|
||||
|
||||
public static void send(final Player player, final String message) {
|
||||
if (message != null && !ChatColor.stripColor(message).equals("")) {
|
||||
player.sendMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void init(final QuestsAPI plugin) throws InvalidConfigurationException, IOException {
|
||||
final File langFile = new File(plugin.getDataFolder(), File.separator + "lang" + File.separator + iso + File.separator
|
||||
+ "strings.yml");
|
||||
final File langFile_new = new File(plugin.getDataFolder(), File.separator + "lang" + File.separator + iso
|
||||
+ File.separator + "strings_new.yml");
|
||||
final boolean exists_new = langFile_new.exists();
|
||||
final LinkedHashMap<String, String> allStrings = new LinkedHashMap<>();
|
||||
if (langFile.exists() && iso.split("-").length > 1) {
|
||||
final FileConfiguration config= YamlConfiguration
|
||||
.loadConfiguration(new InputStreamReader(new FileInputStream(langFile), StandardCharsets.UTF_8));
|
||||
FileConfiguration config_new = null;
|
||||
if (exists_new) {
|
||||
config_new = YamlConfiguration.loadConfiguration(new InputStreamReader(
|
||||
new FileInputStream(langFile_new), StandardCharsets.UTF_8));
|
||||
}
|
||||
// Load user's lang file and determine new strings
|
||||
for (final String key : config.getKeys(false)) {
|
||||
allStrings.put(key, config.getString(key));
|
||||
if (exists_new) {
|
||||
config_new.set(key, null);
|
||||
}
|
||||
}
|
||||
// Add new strings and notify user
|
||||
if (exists_new) {
|
||||
for (final String key : config_new.getKeys(false)) {
|
||||
final String value = config_new.getString(key);
|
||||
if (value != null) {
|
||||
allStrings.put(key, value);
|
||||
plugin.getLogger().warning("There are new language phrases in /lang/" + iso
|
||||
+ "/strings_new.yml for the current version!"
|
||||
+ " You must transfer them to, or regenerate, strings.yml to remove this warning!");
|
||||
}
|
||||
}
|
||||
config_new.options().header("Below are any new strings for your current version of Quests! "
|
||||
+ "Transfer them to the strings.yml of the"
|
||||
+ " same folder to stay up-to-date and suppress console warnings.");
|
||||
config_new.options().copyHeader(true);
|
||||
config_new.save(langFile_new);
|
||||
}
|
||||
} else {
|
||||
plugin.getLogger().severe("Failed loading lang files for " + iso
|
||||
+ " because they were not found. Using default en-US");
|
||||
plugin.getLogger()
|
||||
.info("If the plugin has not generated language files, ensure Quests has write permissions");
|
||||
plugin.getLogger()
|
||||
.info("For help, visit https://github.com/PikaMug/Quests/wiki/Casual-%E2%80%90-Translations");
|
||||
iso = "en-US";
|
||||
plugin.getLogger().info("CodeSource: " + plugin.getClass().getProtectionDomain().getCodeSource()
|
||||
.toString());
|
||||
plugin.getLogger().info("LocationPath: " + plugin.getClass().getProtectionDomain().getCodeSource()
|
||||
.getLocation().getPath());
|
||||
final FileConfiguration config = YamlConfiguration.loadConfiguration(new InputStreamReader(Objects
|
||||
.requireNonNull(plugin.getResource("strings.yml")), StandardCharsets.UTF_8));
|
||||
for (final String key : config.getKeys(false)) {
|
||||
allStrings.put(key, config.getString(key));
|
||||
}
|
||||
}
|
||||
|
||||
final String cmdAdd = allStrings.get("cmdAdd");
|
||||
final String cmdClear = allStrings.get("cmdClear");
|
||||
final String cmdCancel = allStrings.get("cmdCancel");
|
||||
final String cmdDone = allStrings.get("cmdDone");
|
||||
|
||||
final String missing = "( Missing translation: https://crowdin.com/translate/translate-quests )";
|
||||
final String strAdd = allStrings.get("strAdd") != null
|
||||
? allStrings.get("strAdd").replace("<command>", cmdAdd) : missing;
|
||||
final String strClear = allStrings.get("strClear") != null
|
||||
? allStrings.get("strClear").replace("<command>", cmdClear) : missing;
|
||||
final String strCancel = allStrings.get("strCancel") != null
|
||||
? allStrings.get("strCancel").replace("<command>", cmdCancel) : missing;
|
||||
final String strDone = allStrings.get("strDone") != null
|
||||
? allStrings.get("strDone").replace("<command>", cmdDone) : missing;
|
||||
final String strSpace = allStrings.get("strSpace");
|
||||
final String strSemicolon = allStrings.get("strSemicolon");
|
||||
for (final Entry<String, String> entry : allStrings.entrySet()) {
|
||||
if (entry.getValue().contains("<add>")) {
|
||||
allStrings.put(entry.getKey(), entry.getValue().replace("<add>", strAdd));
|
||||
}
|
||||
if (entry.getValue().contains("<clear>")) {
|
||||
allStrings.put(entry.getKey(), entry.getValue().replace("<clear>", strClear));
|
||||
}
|
||||
if (entry.getValue().contains("<cancel>")) {
|
||||
allStrings.put(entry.getKey(), entry.getValue().replace("<cancel>", strCancel));
|
||||
}
|
||||
if (entry.getValue().contains("<done>")) {
|
||||
allStrings.put(entry.getKey(), entry.getValue().replace("<done>", strDone));
|
||||
}
|
||||
if (entry.getValue().contains("<space>")) {
|
||||
allStrings.put(entry.getKey(), entry.getValue().replace("<space>", strSpace));
|
||||
}
|
||||
if (entry.getValue().contains("<semicolon>")) {
|
||||
allStrings.put(entry.getKey(), entry.getValue().replace("<semicolon>", strSemicolon));
|
||||
}
|
||||
}
|
||||
langMap.putAll(allStrings);
|
||||
plugin.getLogger().info("Loaded language " + iso + ". Translations via Crowdin");
|
||||
}
|
||||
|
||||
private static class LangToken {
|
||||
|
||||
static Map<String, String> tokenMap = new HashMap<>();
|
||||
|
||||
public static void init() {
|
||||
tokenMap.put("%br%", "\n");
|
||||
tokenMap.put("%tab%", "\t");
|
||||
tokenMap.put("%rtr%", "\r");
|
||||
tokenMap.put("%bold%", ChatColor.BOLD.toString());
|
||||
tokenMap.put("%italic%", ChatColor.ITALIC.toString());
|
||||
tokenMap.put("%underline%", ChatColor.UNDERLINE.toString());
|
||||
tokenMap.put("%strikethrough%", ChatColor.STRIKETHROUGH.toString());
|
||||
tokenMap.put("%magic%", ChatColor.MAGIC.toString());
|
||||
tokenMap.put("%reset%", ChatColor.RESET.toString());
|
||||
tokenMap.put("%white%", ChatColor.WHITE.toString());
|
||||
tokenMap.put("%black%", ChatColor.BLACK.toString());
|
||||
tokenMap.put("%aqua%", ChatColor.AQUA.toString());
|
||||
tokenMap.put("%darkaqua%", ChatColor.DARK_AQUA.toString());
|
||||
tokenMap.put("%blue%", ChatColor.BLUE.toString());
|
||||
tokenMap.put("%darkblue%", ChatColor.DARK_BLUE.toString());
|
||||
tokenMap.put("%gold%", ChatColor.GOLD.toString());
|
||||
tokenMap.put("%gray%", ChatColor.GRAY.toString());
|
||||
tokenMap.put("%darkgray%", ChatColor.DARK_GRAY.toString());
|
||||
tokenMap.put("%pink%", ChatColor.LIGHT_PURPLE.toString());
|
||||
tokenMap.put("%purple%", ChatColor.DARK_PURPLE.toString());
|
||||
tokenMap.put("%green%", ChatColor.GREEN.toString());
|
||||
tokenMap.put("%darkgreen%", ChatColor.DARK_GREEN.toString());
|
||||
tokenMap.put("%red%", ChatColor.RED.toString());
|
||||
tokenMap.put("%darkred%", ChatColor.DARK_RED.toString());
|
||||
tokenMap.put("%yellow%", ChatColor.YELLOW.toString());
|
||||
}
|
||||
|
||||
public static String convertString(String s) {
|
||||
if (tokenMap.isEmpty()) {
|
||||
LangToken.init();
|
||||
}
|
||||
for (final String token : tokenMap.keySet()) {
|
||||
s = s.replace(token, tokenMap.get(token));
|
||||
s = s.replace(token.toUpperCase(), tokenMap.get(token));
|
||||
}
|
||||
final Matcher matcher = hexPattern.matcher(s);
|
||||
while (matcher.find()) {
|
||||
final StringBuilder hex = new StringBuilder();
|
||||
hex.append(ChatColor.COLOR_CHAR + "x");
|
||||
final char[] chars = matcher.group(1).toCharArray();
|
||||
for (final char aChar : chars) {
|
||||
hex.append(ChatColor.COLOR_CHAR).append(Character.toLowerCase(aChar));
|
||||
}
|
||||
s = s.replace(matcher.group(), hex.toString());
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
public static String convertString(final Player p, String s) {
|
||||
if (tokenMap.isEmpty()) {
|
||||
LangToken.init();
|
||||
}
|
||||
s = convertString(s);
|
||||
if (Bukkit.getServer().getPluginManager().getPlugin("PlaceholderAPI") != null ) {
|
||||
if (Bukkit.getServer().getPluginManager().getPlugin("PlaceholderAPI").isEnabled()) {
|
||||
s = PlaceholderAPI.setPlaceholders(p, s);
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,102 @@
|
|||
/*
|
||||
* 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 isEnabled();
|
||||
|
||||
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);
|
||||
}
|
|
@ -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);
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* 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 me.pikamug.quests.player.Quester;
|
||||
import me.pikamug.quests.quests.Quest;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface Condition extends Comparable<Condition> {
|
||||
String getName();
|
||||
|
||||
void setName(final String name);
|
||||
|
||||
boolean isFailQuest();
|
||||
|
||||
void setFailQuest(final boolean failQuest);
|
||||
|
||||
LinkedList<String> getEntitiesWhileRiding();
|
||||
|
||||
void setEntitiesWhileRiding(final LinkedList<String> entitiesWhileRiding);
|
||||
|
||||
LinkedList<UUID> getNpcsWhileRiding();
|
||||
|
||||
void setNpcsWhileRiding(final LinkedList<UUID> npcsWhileRiding);
|
||||
|
||||
LinkedList<String> getPermissions();
|
||||
|
||||
void setPermissions(final LinkedList<String> permissions);
|
||||
|
||||
LinkedList<String> getWorldsWhileStayingWithin();
|
||||
|
||||
void setWorldsWhileStayingWithin(final LinkedList<String> worldsWhileStayingWithin);
|
||||
|
||||
int getTickStartWhileStayingWithin();
|
||||
|
||||
void setTickStartWhileStayingWithin(final int tickStartWhileStayingWithin);
|
||||
|
||||
int getTickEndWhileStayingWithin();
|
||||
|
||||
void setTickEndWhileStayingWithin(final int tickEndWhileStayingWithin);
|
||||
|
||||
LinkedList<String> getBiomesWhileStayingWithin();
|
||||
|
||||
void setBiomesWhileStayingWithin(final LinkedList<String> biomesWhileStayingWithin);
|
||||
|
||||
LinkedList<String> getRegionsWhileStayingWithin();
|
||||
|
||||
void setRegionsWhileStayingWithin(final LinkedList<String> biomesWhileStayingWithin);
|
||||
|
||||
LinkedList<String> getPlaceholdersCheckIdentifier();
|
||||
|
||||
void setPlaceholdersCheckIdentifier(final LinkedList<String> placeholdersCheckIdentifier);
|
||||
|
||||
LinkedList<String> getPlaceholdersCheckValue();
|
||||
|
||||
void setPlaceholdersCheckValue(final LinkedList<String> placeholdersCheckValue);
|
||||
|
||||
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();
|
||||
|
@ -35,10 +33,16 @@ public interface ISettings {
|
|||
void setDisableCommandFeedback(final boolean disableCommandFeedback);
|
||||
boolean canGenFilesOnJoin();
|
||||
void setGenFilesOnJoin(final boolean genFilesOnJoin);
|
||||
boolean canGiveJournalItem();
|
||||
void setGiveJournalItem(final boolean giveJournalItem);
|
||||
boolean canIgnoreLockedQuests();
|
||||
void setIgnoreLockedQuests(final boolean ignoreLockedQuests);
|
||||
int getKillDelay();
|
||||
void setKillDelay(final int killDelay);
|
||||
String getLanguage();
|
||||
void setLanguage(final String language);
|
||||
boolean canLanguageOverrideClient();
|
||||
void setLanguageOverrideClient(final boolean languageOverrideClient);
|
||||
int getMaxQuests();
|
||||
void setMaxQuests(final int maxQuests);
|
||||
boolean canNpcEffects();
|
||||
|
@ -47,6 +51,8 @@ public interface ISettings {
|
|||
void setEffect(final String effect);
|
||||
String getRedoEffect();
|
||||
void setRedoEffect(final String redoEffect);
|
||||
boolean canShowCompletedObjs();
|
||||
void setShowCompletedObjs(final boolean showCompletedObjs);
|
||||
boolean canShowQuestReqs();
|
||||
void setShowQuestReqs(final boolean showQuestReqs);
|
||||
boolean canShowQuestTitles();
|
|
@ -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");
|
||||
|
@ -76,7 +73,7 @@ public abstract class QuestsNumericPrompt extends NumericPrompt {
|
|||
final Matcher matcher = NUMBER_PATTERN.matcher(ChatColor.stripColor(line));
|
||||
final TextComponent lineComponent = new TextComponent(TextComponent.fromLegacyText(line));
|
||||
if (matcher.find()) {
|
||||
lineComponent.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, matcher.group(1)));
|
||||
lineComponent.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/quests choice " + matcher.group(1)));
|
||||
}
|
||||
if (first) {
|
||||
first = false;
|
|
@ -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");
|
||||
|
@ -71,7 +68,7 @@ public abstract class QuestsStringPrompt extends StringPrompt {
|
|||
for (int i = 0; i < list.size(); i++) {
|
||||
final TextComponent questName = new TextComponent(list.get(i));
|
||||
questName.setColor(ChatColor.AQUA);
|
||||
questName.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, list.get(i)));
|
||||
questName.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/quests choice " + ChatColor.stripColor(list.get(i))));
|
||||
component.addExtra(questName);
|
||||
if (i < (list.size() - 1)) {
|
||||
component.addExtra(separator);
|
|
@ -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();
|
||||
}
|
|
@ -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;
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
|
@ -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);
|
||||
}
|
|
@ -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<Objective> getCurrentObjectives(final Quest quest, final boolean ignoreOverrides, final boolean formatNames);
|
||||
|
||||
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);
|
||||
}
|
|
@ -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);
|
||||
}
|
|
@ -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.UUID;
|
||||
import java.util.concurrent.ConcurrentSkipListSet;
|
||||
|
||||
public interface QuestFactory {
|
||||
|
||||
ConcurrentSkipListSet<UUID> getSelectingNpcs();
|
||||
|
||||
void setSelectingNpcs(final ConcurrentSkipListSet<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();
|
||||
|
@ -48,4 +46,8 @@ public interface Options {
|
|||
boolean canHandleOfflinePlayers();
|
||||
|
||||
void setHandleOfflinePlayers(final boolean handleOfflinePlayers);
|
||||
|
||||
boolean canIgnoreBlockReplace();
|
||||
|
||||
void setIgnoreBlockReplace(final boolean ignoreBlockReplace);
|
||||
}
|
|
@ -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;
|
||||
|
@ -26,21 +22,23 @@ public interface Requirements {
|
|||
|
||||
void setQuestPoints(final int questPoints);
|
||||
|
||||
List<ItemStack> getItems();
|
||||
int getExp();
|
||||
|
||||
void setItems(final List<ItemStack> items);
|
||||
void setExp(final int exp);
|
||||
|
||||
List<?> getItems();
|
||||
|
||||
List<Boolean> getRemoveItems();
|
||||
|
||||
void setRemoveItems(final List<Boolean> removeItems);
|
||||
|
||||
List<IQuest> getNeededQuests();
|
||||
List<String> getNeededQuestIds();
|
||||
|
||||
void setNeededQuests(final List<IQuest> neededQuests);
|
||||
void setNeededQuestIds(final List<String> neededQuests);
|
||||
|
||||
List<IQuest> getBlockQuests();
|
||||
List<String> getBlockQuestIds();
|
||||
|
||||
void setBlockQuests(final List<IQuest> blockQuests);
|
||||
void setBlockQuestIds(final List<String> blockQuests);
|
||||
|
||||
List<String> getPermissions();
|
||||
|
|
@ -1,54 +1,79 @@
|
|||
/*
|
||||
* 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;
|
||||
|
||||
public interface Rewards {
|
||||
int getMoney();
|
||||
|
||||
void setMoney(final int money);
|
||||
|
||||
int getQuestPoints();
|
||||
|
||||
void setQuestPoints(final int questPoints);
|
||||
|
||||
int getExp();
|
||||
|
||||
void setExp(final int exp);
|
||||
|
||||
List<String> getCommands();
|
||||
|
||||
void setCommands(final List<String> commands);
|
||||
|
||||
List<String> getCommandsOverrideDisplay();
|
||||
|
||||
void setCommandsOverrideDisplay(final List<String> commandsOverrideDisplay);
|
||||
|
||||
List<String> getPermissions();
|
||||
|
||||
void setPermissions(final List<String> permissions);
|
||||
|
||||
List<String> getPermissionWorlds();
|
||||
|
||||
void setPermissionWorlds(final List<String> worldNames);
|
||||
List<ItemStack> getItems();
|
||||
void setItems(final List<ItemStack> items);
|
||||
|
||||
List<?> getItems();
|
||||
|
||||
List<String> getMcmmoSkills();
|
||||
|
||||
void setMcmmoSkills(final List<String> mcmmoSkills);
|
||||
|
||||
List<Integer> getMcmmoAmounts();
|
||||
|
||||
void setMcmmoAmounts(final List<Integer> mcmmoAmounts);
|
||||
|
||||
List<String> getHeroesClasses();
|
||||
|
||||
void setHeroesClasses(final List<String> heroesClasses);
|
||||
|
||||
List<Double> getHeroesAmounts();
|
||||
|
||||
void setHeroesAmounts(final List<Double> heroesAmounts);
|
||||
|
||||
int getPartiesExperience();
|
||||
|
||||
void setPartiesExperience(final int partiesExperience);
|
||||
|
||||
List<String> getPhatLoots();
|
||||
|
||||
void setPhatLoots(final List<String> phatLoots);
|
||||
|
||||
Map<String, Map<String, Object>> getCustomRewards();
|
||||
|
||||
void setCustomRewards(final Map<String, Map<String, Object>> customRewards);
|
||||
|
||||
List<String> getDetailsOverride();
|
||||
|
||||
void setDetailsOverride(final List<String> detailsOverride);
|
||||
|
||||
/**
|
|
@ -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);
|
||||
|
@ -67,6 +64,6 @@ public class MySqlConnectionFactory extends HikariConnectionFactory {
|
|||
|
||||
@Override
|
||||
public Function<String, String> getStatementProcessor() {
|
||||
return s -> s.replace("'", "`");
|
||||
return s -> s.replace('\'', '`');
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
||||
/**
|
||||
* Human-readable keys for session data of prompts and factories
|
||||
*/
|
||||
public class Key {
|
||||
|
||||
public class CK {
|
||||
|
||||
// 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";
|
||||
|
@ -34,6 +34,7 @@ public class CK {
|
|||
public static final String REQ_QUEST_POINTS = "questPointsReq";
|
||||
public static final String REQ_ITEMS = "itemReqs";
|
||||
public static final String REQ_ITEMS_REMOVE = "removeItemReqs";
|
||||
public static final String REQ_EXP = "expReq";
|
||||
public static final String REQ_PERMISSION = "permissionReqs";
|
||||
public static final String REQ_MCMMO_SKILLS = "mcMMOSkillReqs";
|
||||
public static final String REQ_MCMMO_SKILL_AMOUNTS = "mcMMOSkillAmountReqs";
|
||||
|
@ -149,34 +150,35 @@ public class CK {
|
|||
public static final String OPT_SHARE_SAME_QUEST_ONLY = "shareSameQuestOnlyOpt";
|
||||
public static final String OPT_SHARE_DISTANCE = "shareDistance";
|
||||
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";
|
||||
|
@ -185,7 +187,10 @@ public class CK {
|
|||
public static final String C_WHILE_RIDING_NPC = "conRidingNpc";
|
||||
public static final String C_WHILE_PERMISSION = "conPermission";
|
||||
public static final String C_WHILE_HOLDING_MAIN_HAND = "conHoldingMainHand";
|
||||
public static final String C_WHILE_WEARING = "conWearing";
|
||||
public static final String C_WHILE_WITHIN_WORLD = "conWithinWorld";
|
||||
public static final String C_WHILE_WITHIN_TICKS_START = "conWithinTicksStart";
|
||||
public static final String C_WHILE_WITHIN_TICKS_END = "conWithinTicksEnd";
|
||||
public static final String C_WHILE_WITHIN_BIOME = "conWithinBiome";
|
||||
public static final String C_WHILE_WITHIN_REGION = "conWithinRegion";
|
||||
public static final String C_WHILE_PLACEHOLDER_ID = "conPlaceholderId";
|
|
@ -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);
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue