Compare commits
204 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
452c20f534 | ||
|
|
6002bc0b47 | ||
|
|
120db25a11 | ||
|
|
c4ea85ff7f | ||
|
|
1c98a7257e | ||
|
|
5a810e4dfb | ||
|
|
ddaa9d36b6 | ||
|
|
1f274b57d1 | ||
|
|
1a7a92e6de | ||
|
|
e369e99510 | ||
|
|
6fb565f6db | ||
|
|
c51b29ed35 | ||
|
|
ddbd6479e5 | ||
|
|
84862f7b28 | ||
|
|
9eea5631e7 | ||
|
|
ee3c934858 | ||
|
|
35650efe47 | ||
|
|
6f7b800a7d | ||
|
|
08f3340399 | ||
|
|
d36551a94b | ||
|
|
42ed601fd7 | ||
|
|
3cd800aeac | ||
|
|
a8e4f886a5 | ||
|
|
fffdca4515 | ||
|
|
03fe0f6116 | ||
|
|
93ff547fcf | ||
|
|
60af2e8414 | ||
|
|
37b3aab105 | ||
|
|
1065989f7b | ||
|
|
39545ac9bd | ||
|
|
273b7ee712 | ||
|
|
6dfaf353b2 | ||
|
|
6abcf482f1 | ||
|
|
6f56b11b21 | ||
|
|
6c1b283b1b | ||
|
|
864c909f18 | ||
|
|
6fc68f2121 | ||
|
|
27bef81957 | ||
|
|
73c9d85f61 | ||
|
|
87e4669e29 | ||
|
|
b1fcadc46d | ||
|
|
571b39f0a7 | ||
|
|
db3120f1de | ||
|
|
f1b5bac9cd | ||
|
|
c67eee5af9 | ||
|
|
068ca3e4d6 | ||
|
|
f10084d523 | ||
|
|
99d4b13715 | ||
|
|
03dcdb895e | ||
|
|
a166fe9457 | ||
|
|
a2f3ec89b8 | ||
|
|
28597a8777 | ||
|
|
c9755066b4 | ||
|
|
4215dafafd | ||
|
|
c09c7ae312 | ||
|
|
6e3933ff72 | ||
|
|
30595783e3 | ||
|
|
9898118bf1 | ||
|
|
2a301158b8 | ||
|
|
ba29170e32 | ||
|
|
94ebc73687 | ||
|
|
1cc853e498 | ||
|
|
d6fef2f64c | ||
|
|
bc341b0a86 | ||
|
|
d5d2e3fd00 | ||
|
|
00d2664653 | ||
|
|
b8e1d55242 | ||
|
|
26f381fcfc | ||
|
|
ad84ce7d45 | ||
|
|
dc1bd7ebcb | ||
|
|
0b658c72ee | ||
|
|
03c0d0e444 | ||
|
|
afd0b76b42 | ||
|
|
2736d1fc7a | ||
|
|
71ef09d9f8 | ||
|
|
233f5398d8 | ||
|
|
0b98694b25 | ||
|
|
3fc9d3ecf3 | ||
|
|
7a3c459335 | ||
|
|
67c4c02b36 | ||
|
|
093a0509fa | ||
|
|
159f4ab14c | ||
|
|
d48288efa5 | ||
|
|
7ed96fe6ac | ||
|
|
3146344f39 | ||
|
|
7f6ed7aa89 | ||
|
|
8839d1e2d9 | ||
|
|
f83d646e02 | ||
|
|
6c4437e0cb | ||
|
|
8b8bc294e4 | ||
|
|
94cc573114 | ||
|
|
4f3da3ae84 | ||
|
|
19b52eaaa7 | ||
|
|
e9f33fd298 | ||
|
|
fc66efff53 | ||
|
|
1409620b92 | ||
|
|
f1acc877b7 | ||
|
|
d7e725822c | ||
|
|
d613e569ed | ||
|
|
22274a9bdf | ||
|
|
2ef337d4ca | ||
|
|
aacd247c54 | ||
|
|
1aa419bce7 | ||
|
|
56f948e898 | ||
|
|
d92472c0a4 | ||
|
|
7de03c1459 | ||
|
|
9109e11791 | ||
|
|
a0381e113c | ||
|
|
2d6128eca9 | ||
|
|
985608791b | ||
|
|
dd65bfa58d | ||
|
|
a61cce53c1 | ||
|
|
e7cc186e9c | ||
|
|
7fb3df354d | ||
|
|
971c643203 | ||
|
|
b2381c33fe | ||
|
|
0642ff1421 | ||
|
|
7dc5caec57 | ||
|
|
b006ebab53 | ||
|
|
3bd774265d | ||
|
|
0ff6d68a5b | ||
|
|
a27ebb1b5c | ||
|
|
afafd86eaf | ||
|
|
49a2713017 | ||
|
|
a4263e8397 | ||
|
|
17f3aa8862 | ||
|
|
c94024ea19 | ||
|
|
1daa52e1f4 | ||
|
|
a06808f802 | ||
|
|
91cf08f0ac | ||
|
|
9a7ff1760c | ||
|
|
f2c3f569b7 | ||
|
|
508cb3e216 | ||
|
|
5f998f4bad | ||
|
|
e4b468b0da | ||
|
|
675d2b8508 | ||
|
|
edddd67f58 | ||
|
|
ed676e50c7 | ||
|
|
b36551a179 | ||
|
|
053f22258a | ||
|
|
a3a0783ea2 | ||
|
|
c7f25f17cd | ||
|
|
a489aaa53a | ||
|
|
9e9a68fc45 | ||
|
|
53b24b9dbb | ||
|
|
4977dc1012 | ||
|
|
0bb4aa6d51 | ||
|
|
5b1eda604d | ||
|
|
10e9edc011 | ||
|
|
ec11e9c475 | ||
|
|
eebe7427bc | ||
|
|
d2fa50a08c | ||
|
|
9fb80c594a | ||
|
|
915778d63f | ||
|
|
44911d5f97 | ||
|
|
11a79a5352 | ||
|
|
9473deda7c | ||
|
|
44676515b2 | ||
|
|
4e7317e69a | ||
|
|
8ca8018ab2 | ||
|
|
78e033990b | ||
|
|
033ac785d6 | ||
|
|
6ddf34f7f6 | ||
|
|
fb889b2936 | ||
|
|
dcf89687e3 | ||
|
|
2835eeaa5d | ||
|
|
1647a5dfaf | ||
|
|
3d260e82ae | ||
|
|
1fdbd064a9 | ||
|
|
94d1802b51 | ||
|
|
8604bf7b46 | ||
|
|
c21eecae11 | ||
|
|
80950aecf3 | ||
|
|
6ad33e98fc | ||
|
|
c60c64c6b3 | ||
|
|
9eb67d5204 | ||
|
|
77f08961b8 | ||
|
|
be4c70e0c5 | ||
|
|
614831687f | ||
|
|
3ea5d8f4d3 | ||
|
|
2e472abc98 | ||
|
|
927c1fbcae | ||
|
|
7e6b5c4b80 | ||
|
|
616e0c012b | ||
|
|
226aaac8c1 | ||
|
|
34026be77b | ||
|
|
8b585af4e2 | ||
|
|
4cd7398d76 | ||
|
|
c84a2a10f6 | ||
|
|
6dcfd4ccaa | ||
|
|
428df89ed1 | ||
|
|
ebe542ef2b | ||
|
|
d3d005845a | ||
|
|
5d4eedfef6 | ||
|
|
c362ad0d18 | ||
|
|
2d56e8a9d7 | ||
|
|
56c7268bb9 | ||
|
|
447c2c877a | ||
|
|
1c0c9ba259 | ||
|
|
6f5a8b9df2 | ||
|
|
cbbe5b590e | ||
|
|
fa3c5b8020 | ||
|
|
7a34a2d38c | ||
|
|
0f14f36b2f |
@@ -21,7 +21,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
[](https://discord.gg/ZcwpSsE/)
|
[](https://discord.gg/ZcwpSsE/)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
*Click here to read [the entire license](https://github.com/Auxilor/EcoPets/blob/master/LICENSE.md).*
|
*Click here to read [the entire license](https://github.com/Auxilor/EcoPets/blob/master/LICENSE.md).*
|
||||||
|
|||||||
11
build.gradle
11
build.gradle
@@ -4,7 +4,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,6 +34,7 @@ allprojects {
|
|||||||
maven { url 'https://repo.codemc.io/repository/maven-public/' }
|
maven { url 'https://repo.codemc.io/repository/maven-public/' }
|
||||||
maven { url 'https://repo.dmulloy2.net/repository/public/' }
|
maven { url 'https://repo.dmulloy2.net/repository/public/' }
|
||||||
maven { url 'https://repo.essentialsx.net/releases/' }
|
maven { url 'https://repo.essentialsx.net/releases/' }
|
||||||
|
maven { url 'https://mvn.lumine.io/repository/maven-public/' }
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
@@ -42,17 +43,19 @@ allprojects {
|
|||||||
|
|
||||||
shadowJar {
|
shadowJar {
|
||||||
relocate('com.willfp.libreforge', 'com.willfp.ecopets.libreforge')
|
relocate('com.willfp.libreforge', 'com.willfp.ecopets.libreforge')
|
||||||
|
relocate('com.willfp.ecomponent', 'com.willfp.ecopets.ecomponent')
|
||||||
relocate('org.joml', 'com.willfp.ecopets.libreforge.joml')
|
relocate('org.joml', 'com.willfp.ecopets.libreforge.joml')
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly 'com.willfp:eco:6.37.1'
|
compileOnly 'com.willfp:eco:6.44.0'
|
||||||
implementation 'com.willfp:libreforge:3.63.0'
|
implementation 'com.willfp:libreforge:3.124.0'
|
||||||
|
implementation 'com.willfp:ecomponent:1.0.0'
|
||||||
implementation 'org.joml:joml:1.10.4'
|
implementation 'org.joml:joml:1.10.4'
|
||||||
|
|
||||||
compileOnly 'org.jetbrains:annotations:23.0.0'
|
compileOnly 'org.jetbrains:annotations:23.0.0'
|
||||||
|
|
||||||
compileOnly 'org.jetbrains.kotlin:kotlin-stdlib:1.6.21'
|
compileOnly 'org.jetbrains.kotlin:kotlin-stdlib:1.7.10'
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile) {
|
||||||
|
|||||||
@@ -1,184 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<!DOCTYPE module PUBLIC
|
|
||||||
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
|
|
||||||
"https://checkstyle.org/dtds/configuration_1_3.dtd">
|
|
||||||
|
|
||||||
<!--
|
|
||||||
|
|
||||||
Checkstyle configuration that checks the sun coding conventions from:
|
|
||||||
|
|
||||||
- the Java Language Specification at
|
|
||||||
https://docs.oracle.com/javase/specs/jls/se11/html/index.html
|
|
||||||
|
|
||||||
- the Sun Code Conventions at https://www.oracle.com/java/technologies/javase/codeconventions-contents.html
|
|
||||||
|
|
||||||
- the Javadoc guidelines at
|
|
||||||
https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html
|
|
||||||
|
|
||||||
- the JDK Api documentation https://docs.oracle.com/en/java/javase/11/
|
|
||||||
|
|
||||||
- some best practices
|
|
||||||
|
|
||||||
Checkstyle is very configurable. Be sure to read the documentation at
|
|
||||||
https://checkstyle.org (or in your downloaded distribution).
|
|
||||||
|
|
||||||
Most Checks are configurable, be sure to consult the documentation.
|
|
||||||
|
|
||||||
To completely disable a check, just comment it out or delete it from the file.
|
|
||||||
To suppress certain violations please review suppression filters.
|
|
||||||
|
|
||||||
Finally, it is worth reading the documentation.
|
|
||||||
|
|
||||||
-->
|
|
||||||
|
|
||||||
<module name="Checker">
|
|
||||||
<module name="SuppressionFilter">
|
|
||||||
<property name="file" value="config/checkstyle/suppression.xml"/>
|
|
||||||
</module>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
If you set the basedir property below, then all reported file
|
|
||||||
names will be relative to the specified directory. See
|
|
||||||
https://checkstyle.org/config.html#Checker
|
|
||||||
|
|
||||||
<property name="basedir" value="${basedir}"/>
|
|
||||||
-->
|
|
||||||
<property name="severity" value="error"/>
|
|
||||||
|
|
||||||
<property name="fileExtensions" value="java, properties, xml"/>
|
|
||||||
|
|
||||||
<!-- Excludes all 'module-info.java' files -->
|
|
||||||
<!-- See https://checkstyle.org/config_filefilters.html -->
|
|
||||||
<module name="BeforeExecutionExclusionFileFilter">
|
|
||||||
<property name="fileNamePattern" value="module\-info\.java$"/>
|
|
||||||
</module>
|
|
||||||
|
|
||||||
<!-- Checks whether files end with a new line. -->
|
|
||||||
<!-- See https://checkstyle.org/config_misc.html#NewlineAtEndOfFile -->
|
|
||||||
<module name="NewlineAtEndOfFile"/>
|
|
||||||
|
|
||||||
<!-- Checks that property files contain the same keys. -->
|
|
||||||
<!-- See https://checkstyle.org/config_misc.html#Translation -->
|
|
||||||
<module name="Translation"/>
|
|
||||||
|
|
||||||
<!-- Checks for Size Violations. -->
|
|
||||||
<!-- See https://checkstyle.org/config_sizes.html -->
|
|
||||||
<module name="FileLength"/>
|
|
||||||
<module name="LineLength">
|
|
||||||
<property name="fileExtensions" value="java"/>
|
|
||||||
<property name="max" value="200"/>
|
|
||||||
</module>
|
|
||||||
|
|
||||||
<!-- Checks for whitespace -->
|
|
||||||
<!-- See https://checkstyle.org/config_whitespace.html -->
|
|
||||||
<module name="FileTabCharacter"/>
|
|
||||||
|
|
||||||
<!-- Miscellaneous other checks. -->
|
|
||||||
<!-- See https://checkstyle.org/config_misc.html -->
|
|
||||||
<module name="RegexpSingleline">
|
|
||||||
<property name="format" value="\s+$"/>
|
|
||||||
<property name="minimum" value="0"/>
|
|
||||||
<property name="maximum" value="0"/>
|
|
||||||
<property name="message" value="Line has trailing spaces."/>
|
|
||||||
</module>
|
|
||||||
|
|
||||||
<!-- Checks for Headers -->
|
|
||||||
<!-- See https://checkstyle.org/config_header.html -->
|
|
||||||
<!-- <module name="Header"> -->
|
|
||||||
<!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
|
|
||||||
<!-- <property name="fileExtensions" value="java"/> -->
|
|
||||||
<!-- </module> -->
|
|
||||||
|
|
||||||
<module name="TreeWalker">
|
|
||||||
|
|
||||||
<!-- Checks for Javadoc comments. -->
|
|
||||||
<!-- See https://checkstyle.org/config_javadoc.html -->
|
|
||||||
<module name="InvalidJavadocPosition"/>
|
|
||||||
<module name="JavadocMethod"/>
|
|
||||||
<module name="JavadocType"/>
|
|
||||||
<module name="JavadocVariable"/>
|
|
||||||
<module name="JavadocStyle"/>
|
|
||||||
<module name="MissingJavadocMethod"/>
|
|
||||||
|
|
||||||
<!-- Checks for Naming Conventions. -->
|
|
||||||
<!-- See https://checkstyle.org/config_naming.html -->
|
|
||||||
<module name="ConstantName"/>
|
|
||||||
<module name="LocalFinalVariableName"/>
|
|
||||||
<module name="LocalVariableName"/>
|
|
||||||
<module name="MemberName"/>
|
|
||||||
<module name="MethodName"/>
|
|
||||||
<module name="PackageName"/>
|
|
||||||
<module name="ParameterName"/>
|
|
||||||
<module name="StaticVariableName"/>
|
|
||||||
<module name="TypeName"/>
|
|
||||||
|
|
||||||
<!-- Checks for imports -->
|
|
||||||
<!-- See https://checkstyle.org/config_imports.html -->
|
|
||||||
<module name="AvoidStarImport"/>
|
|
||||||
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
|
|
||||||
<module name="RedundantImport"/>
|
|
||||||
<module name="UnusedImports">
|
|
||||||
<property name="processJavadoc" value="true"/>
|
|
||||||
</module>
|
|
||||||
|
|
||||||
<!-- Checks for Size Violations. -->
|
|
||||||
<!-- See https://checkstyle.org/config_sizes.html -->
|
|
||||||
<!-- <module name="MethodLength"/> -->
|
|
||||||
<module name="ParameterNumber"/>
|
|
||||||
|
|
||||||
<!-- Checks for whitespace -->
|
|
||||||
<!-- See https://checkstyle.org/config_whitespace.html -->
|
|
||||||
<module name="EmptyForIteratorPad"/>
|
|
||||||
<module name="GenericWhitespace"/>
|
|
||||||
<module name="MethodParamPad"/>
|
|
||||||
<module name="NoWhitespaceAfter"/>
|
|
||||||
<module name="NoWhitespaceBefore"/>
|
|
||||||
<module name="OperatorWrap"/>
|
|
||||||
<module name="ParenPad"/>
|
|
||||||
<module name="TypecastParenPad"/>
|
|
||||||
<module name="WhitespaceAfter"/>
|
|
||||||
<module name="WhitespaceAround"/>
|
|
||||||
|
|
||||||
<!-- Modifier Checks -->
|
|
||||||
<!-- See https://checkstyle.org/config_modifiers.html -->
|
|
||||||
<module name="ModifierOrder"/>
|
|
||||||
<module name="RedundantModifier"/>
|
|
||||||
|
|
||||||
<!-- Checks for blocks. You know, those {}'s -->
|
|
||||||
<!-- See https://checkstyle.org/config_blocks.html -->
|
|
||||||
<module name="AvoidNestedBlocks"/>
|
|
||||||
<module name="EmptyBlock"/>
|
|
||||||
<module name="LeftCurly"/>
|
|
||||||
<module name="NeedBraces"/>
|
|
||||||
<module name="RightCurly"/>
|
|
||||||
|
|
||||||
<!-- Checks for common coding problems -->
|
|
||||||
<!-- See https://checkstyle.org/config_coding.html -->
|
|
||||||
<module name="EmptyStatement"/>
|
|
||||||
<module name="EqualsHashCode"/>
|
|
||||||
<module name="IllegalInstantiation"/>
|
|
||||||
<module name="InnerAssignment"/>
|
|
||||||
<!-- <module name="MagicNumber"/> -->
|
|
||||||
<module name="MissingSwitchDefault"/>
|
|
||||||
<module name="MultipleVariableDeclarations"/>
|
|
||||||
<module name="SimplifyBooleanExpression"/>
|
|
||||||
<module name="SimplifyBooleanReturn"/>
|
|
||||||
|
|
||||||
<!-- Checks for class design -->
|
|
||||||
<!-- See https://checkstyle.org/config_design.html -->
|
|
||||||
<!-- <module name="DesignForExtension"/> -->
|
|
||||||
<module name="FinalClass"/>
|
|
||||||
<!-- <module name="HideUtilityClassConstructor"/> -->
|
|
||||||
<module name="InterfaceIsType"/>
|
|
||||||
<module name="VisibilityModifier"/>
|
|
||||||
<module name="RequireThis"/>
|
|
||||||
|
|
||||||
<!-- Miscellaneous other checks. -->
|
|
||||||
<!-- See https://checkstyle.org/config_misc.html -->
|
|
||||||
<module name="ArrayTypeStyle"/>
|
|
||||||
<module name="FinalParameters"/>
|
|
||||||
<module name="TodoComment"/>
|
|
||||||
<module name="UpperEll"/>
|
|
||||||
|
|
||||||
</module>
|
|
||||||
</module>
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
|
|
||||||
<!DOCTYPE suppressions PUBLIC
|
|
||||||
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
|
|
||||||
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
|
|
||||||
|
|
||||||
<suppressions>
|
|
||||||
<!-- Fields don't need javadoc -->
|
|
||||||
<suppress files="Effects.java" checks="JavadocVariable"/>
|
|
||||||
<suppress files="Skills.java" checks="JavadocVariable"/>
|
|
||||||
<suppress files="Stats.java" checks="JavadocVariable"/>
|
|
||||||
</suppressions>
|
|
||||||
@@ -7,6 +7,7 @@ dependencies {
|
|||||||
compileOnly 'net.kyori:adventure-api:4.10.1'
|
compileOnly 'net.kyori:adventure-api:4.10.1'
|
||||||
compileOnly 'net.essentialsx:EssentialsX:2.19.0'
|
compileOnly 'net.essentialsx:EssentialsX:2.19.0'
|
||||||
compileOnly 'com.github.ben-manes.caffeine:caffeine:3.0.6'
|
compileOnly 'com.github.ben-manes.caffeine:caffeine:3.0.6'
|
||||||
|
compileOnly 'com.ticxo.modelengine:api:R3.0.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
build.dependsOn publishToMavenLocal
|
build.dependsOn publishToMavenLocal
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.willfp.ecopets
|
|||||||
|
|
||||||
import com.willfp.ecopets.api.EcoPetsAPI
|
import com.willfp.ecopets.api.EcoPetsAPI
|
||||||
import com.willfp.ecopets.pets.Pet
|
import com.willfp.ecopets.pets.Pet
|
||||||
|
import com.willfp.ecopets.pets.activePet
|
||||||
import com.willfp.ecopets.pets.getPetLevel
|
import com.willfp.ecopets.pets.getPetLevel
|
||||||
import com.willfp.ecopets.pets.getPetProgress
|
import com.willfp.ecopets.pets.getPetProgress
|
||||||
import com.willfp.ecopets.pets.getPetXP
|
import com.willfp.ecopets.pets.getPetXP
|
||||||
@@ -14,6 +15,12 @@ import org.bukkit.entity.Player
|
|||||||
internal object EcoPetsAPIImpl : EcoPetsAPI {
|
internal object EcoPetsAPIImpl : EcoPetsAPI {
|
||||||
override fun hasPet(player: OfflinePlayer, pet: Pet) = player.hasPet(pet)
|
override fun hasPet(player: OfflinePlayer, pet: Pet) = player.hasPet(pet)
|
||||||
|
|
||||||
|
override fun getActivePet(player: OfflinePlayer): Pet? = player.activePet
|
||||||
|
|
||||||
|
override fun setActivePet(player: OfflinePlayer, pet: Pet?) {
|
||||||
|
player.activePet = pet
|
||||||
|
}
|
||||||
|
|
||||||
override fun getPetLevel(player: OfflinePlayer, pet: Pet) = player.getPetLevel(pet)
|
override fun getPetLevel(player: OfflinePlayer, pet: Pet) = player.getPetLevel(pet)
|
||||||
|
|
||||||
override fun givePetExperience(player: Player, pet: Pet, amount: Double) =
|
override fun givePetExperience(player: Player, pet: Pet, amount: Double) =
|
||||||
|
|||||||
@@ -1,32 +1,34 @@
|
|||||||
package com.willfp.ecopets
|
package com.willfp.ecopets
|
||||||
|
|
||||||
import com.willfp.eco.core.command.impl.PluginCommand
|
import com.willfp.eco.core.command.impl.PluginCommand
|
||||||
|
import com.willfp.eco.core.integrations.IntegrationLoader
|
||||||
import com.willfp.eco.core.placeholder.PlayerPlaceholder
|
import com.willfp.eco.core.placeholder.PlayerPlaceholder
|
||||||
import com.willfp.eco.util.toSingletonList
|
import com.willfp.eco.util.toSingletonList
|
||||||
import com.willfp.ecopets.commands.CommandEcopets
|
import com.willfp.ecopets.commands.CommandEcopets
|
||||||
import com.willfp.ecopets.commands.CommandPets
|
import com.willfp.ecopets.commands.CommandPets
|
||||||
import com.willfp.ecopets.config.PetsYml
|
import com.willfp.ecopets.pets.DiscoverRecipeListener
|
||||||
import com.willfp.ecopets.pets.PetDisplay
|
import com.willfp.ecopets.pets.PetDisplay
|
||||||
import com.willfp.ecopets.pets.PetLevelListener
|
import com.willfp.ecopets.pets.PetLevelListener
|
||||||
import com.willfp.ecopets.pets.PetTriggerXPGainListener
|
import com.willfp.ecopets.pets.PetTriggerXPGainListener
|
||||||
import com.willfp.ecopets.pets.SpawnEggHandler
|
import com.willfp.ecopets.pets.SpawnEggHandler
|
||||||
import com.willfp.ecopets.pets.activePet
|
import com.willfp.ecopets.pets.activePet
|
||||||
import com.willfp.ecopets.pets.activePetLevel
|
import com.willfp.ecopets.pets.activePetLevel
|
||||||
|
import com.willfp.ecopets.pets.entity.ModelEnginePetEntity
|
||||||
|
import com.willfp.ecopets.pets.entity.PetEntity
|
||||||
import com.willfp.libreforge.LibReforgePlugin
|
import com.willfp.libreforge.LibReforgePlugin
|
||||||
import org.bukkit.event.Listener
|
import org.bukkit.event.Listener
|
||||||
|
|
||||||
class EcoPetsPlugin : LibReforgePlugin() {
|
class EcoPetsPlugin : LibReforgePlugin() {
|
||||||
val petsYml: PetsYml
|
|
||||||
|
|
||||||
private val petDisplay = PetDisplay(this)
|
private val petDisplay = PetDisplay(this)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
instance = this
|
instance = this
|
||||||
petsYml = PetsYml(this)
|
|
||||||
registerHolderProvider { it.activePetLevel?.toSingletonList() ?: emptyList() }
|
registerHolderProvider { it.activePetLevel?.toSingletonList() ?: emptyList() }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun handleEnableAdditional() {
|
override fun handleEnableAdditional() {
|
||||||
|
this.copyConfigs("pets")
|
||||||
|
|
||||||
PlayerPlaceholder(
|
PlayerPlaceholder(
|
||||||
this,
|
this,
|
||||||
"pet"
|
"pet"
|
||||||
@@ -48,6 +50,16 @@ class EcoPetsPlugin : LibReforgePlugin() {
|
|||||||
petDisplay.shutdown()
|
petDisplay.shutdown()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun loadAdditionalIntegrations(): List<IntegrationLoader> {
|
||||||
|
return listOf(
|
||||||
|
IntegrationLoader("ModelEngine") {
|
||||||
|
PetEntity.registerPetEntity("modelengine") { pet, id ->
|
||||||
|
ModelEnginePetEntity(pet, id, this)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
override fun loadPluginCommands(): List<PluginCommand> {
|
override fun loadPluginCommands(): List<PluginCommand> {
|
||||||
return listOf(
|
return listOf(
|
||||||
CommandEcopets(this),
|
CommandEcopets(this),
|
||||||
@@ -60,14 +72,11 @@ class EcoPetsPlugin : LibReforgePlugin() {
|
|||||||
PetLevelListener(this),
|
PetLevelListener(this),
|
||||||
PetTriggerXPGainListener,
|
PetTriggerXPGainListener,
|
||||||
SpawnEggHandler(this),
|
SpawnEggHandler(this),
|
||||||
petDisplay
|
petDisplay,
|
||||||
|
DiscoverRecipeListener(this)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getMinimumEcoVersion(): String {
|
|
||||||
return "6.37.0"
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
lateinit var instance: EcoPetsPlugin
|
lateinit var instance: EcoPetsPlugin
|
||||||
|
|||||||
@@ -18,6 +18,27 @@ interface EcoPetsAPI {
|
|||||||
pet: Pet
|
pet: Pet
|
||||||
): Boolean
|
): Boolean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a player's active pet.
|
||||||
|
*
|
||||||
|
* @param player The player.
|
||||||
|
* @return The active pet.
|
||||||
|
*/
|
||||||
|
fun getActivePet(
|
||||||
|
player: OfflinePlayer
|
||||||
|
): Pet?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set a player's active pet.
|
||||||
|
*
|
||||||
|
* @param player The player.
|
||||||
|
* @param pet The pet.
|
||||||
|
*/
|
||||||
|
fun setActivePet(
|
||||||
|
player: OfflinePlayer,
|
||||||
|
pet: Pet?
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a player's level of a certain pet.
|
* Get a player's level of a certain pet.
|
||||||
*
|
*
|
||||||
@@ -59,7 +80,8 @@ interface EcoPetsAPI {
|
|||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get progress to next level between 0 and 1, where 0 is none and 1 is complete.
|
* Get progress to next level between 0 and 1, where 0 is none and 1 is
|
||||||
|
* complete.
|
||||||
*
|
*
|
||||||
* @param player The player.
|
* @param player The player.
|
||||||
* @param pet The pet.
|
* @param pet The pet.
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
package com.willfp.ecopets.commands
|
||||||
|
|
||||||
|
import com.willfp.eco.core.EcoPlugin
|
||||||
|
import com.willfp.eco.core.command.impl.Subcommand
|
||||||
|
import com.willfp.eco.util.StringUtils
|
||||||
|
import com.willfp.ecopets.pets.Pets
|
||||||
|
import com.willfp.ecopets.pets.activePet
|
||||||
|
import com.willfp.ecopets.pets.hasPet
|
||||||
|
import org.bukkit.command.CommandSender
|
||||||
|
import org.bukkit.entity.Player
|
||||||
|
import org.bukkit.util.StringUtil
|
||||||
|
|
||||||
|
class CommandActivate(plugin: EcoPlugin) : Subcommand(plugin, "activate", "ecopets.command.activate", true) {
|
||||||
|
override fun onExecute(player: CommandSender, args: List<String>) {
|
||||||
|
player as Player
|
||||||
|
|
||||||
|
if (args.isEmpty()) {
|
||||||
|
player.sendMessage(plugin.langYml.getMessage("needs-pet"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val id = args[0]
|
||||||
|
|
||||||
|
val pet = Pets.getByID(id)
|
||||||
|
|
||||||
|
if (pet == null || !player.hasPet(pet)) {
|
||||||
|
player.sendMessage(plugin.langYml.getMessage("invalid-pet"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.activePet == pet) {
|
||||||
|
player.sendMessage(plugin.langYml.getMessage("pet-already-active"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
player.sendMessage(
|
||||||
|
plugin.langYml.getMessage("activated-pet", StringUtils.FormatOption.WITHOUT_PLACEHOLDERS)
|
||||||
|
.replace("%pet%", pet.name)
|
||||||
|
)
|
||||||
|
player.activePet = pet
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun tabComplete(sender: CommandSender, args: List<String>): List<String> {
|
||||||
|
if (sender !is Player) {
|
||||||
|
return emptyList()
|
||||||
|
}
|
||||||
|
|
||||||
|
val completions = mutableListOf<String>()
|
||||||
|
if (args.isEmpty()) {
|
||||||
|
// Currently, this case is not ever reached
|
||||||
|
return Pets.values().filter { sender.hasPet(it) }.map { it.id }
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.size == 1) {
|
||||||
|
StringUtil.copyPartialMatches(
|
||||||
|
args[1],
|
||||||
|
Pets.values().filter { sender.hasPet(it) }.map { it.id },
|
||||||
|
completions
|
||||||
|
)
|
||||||
|
return completions
|
||||||
|
}
|
||||||
|
|
||||||
|
return emptyList()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.willfp.ecopets.commands
|
||||||
|
|
||||||
|
import com.willfp.eco.core.EcoPlugin
|
||||||
|
import com.willfp.eco.core.command.impl.Subcommand
|
||||||
|
import com.willfp.eco.util.StringUtils
|
||||||
|
import com.willfp.ecopets.pets.activePet
|
||||||
|
import org.bukkit.command.CommandSender
|
||||||
|
import org.bukkit.entity.Player
|
||||||
|
|
||||||
|
class CommandDeactivate(plugin: EcoPlugin) : Subcommand(plugin, "deactivate", "ecopets.command.deactivate", true) {
|
||||||
|
override fun onExecute(player: CommandSender, args: List<String>) {
|
||||||
|
player as Player
|
||||||
|
|
||||||
|
if (player.activePet == null) {
|
||||||
|
player.sendMessage(plugin.langYml.getMessage("no-pet-active"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
player.sendMessage(
|
||||||
|
plugin.langYml.getMessage("deactivated-pet", StringUtils.FormatOption.WITHOUT_PLACEHOLDERS)
|
||||||
|
.replace("%pet%", player.activePet?.name ?: "")
|
||||||
|
)
|
||||||
|
|
||||||
|
player.activePet = null
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,14 +1,29 @@
|
|||||||
package com.willfp.ecopets.commands
|
package com.willfp.ecopets.commands
|
||||||
|
|
||||||
import com.willfp.eco.core.EcoPlugin
|
|
||||||
import com.willfp.eco.core.command.impl.PluginCommand
|
import com.willfp.eco.core.command.impl.PluginCommand
|
||||||
|
import com.willfp.ecopets.pets.Pets
|
||||||
|
import com.willfp.libreforge.LibReforgePlugin
|
||||||
|
import com.willfp.libreforge.lrcdb.CommandExport
|
||||||
|
import com.willfp.libreforge.lrcdb.CommandImport
|
||||||
|
import com.willfp.libreforge.lrcdb.ExportableConfig
|
||||||
import org.bukkit.command.CommandSender
|
import org.bukkit.command.CommandSender
|
||||||
|
|
||||||
class CommandEcopets(plugin: EcoPlugin) : PluginCommand(plugin, "ecopets", "ecopets.command.ecopets", false) {
|
class CommandEcopets(plugin: LibReforgePlugin) : PluginCommand(plugin, "ecopets", "ecopets.command.ecopets", false) {
|
||||||
init {
|
init {
|
||||||
this.addSubcommand(CommandReload(plugin))
|
this.addSubcommand(CommandReload(plugin))
|
||||||
.addSubcommand(CommandGive(plugin))
|
.addSubcommand(CommandGive(plugin))
|
||||||
.addSubcommand(CommandGiveEgg(plugin))
|
.addSubcommand(CommandGiveEgg(plugin))
|
||||||
|
.addSubcommand(CommandGiveXP(plugin))
|
||||||
|
.addSubcommand(CommandReset(plugin))
|
||||||
|
.addSubcommand(CommandImport("pets", plugin))
|
||||||
|
.addSubcommand(CommandExport(plugin) {
|
||||||
|
Pets.values().map {
|
||||||
|
ExportableConfig(
|
||||||
|
it.id,
|
||||||
|
it.config
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onExecute(sender: CommandSender, args: List<String>) {
|
override fun onExecute(sender: CommandSender, args: List<String>) {
|
||||||
|
|||||||
@@ -0,0 +1,89 @@
|
|||||||
|
package com.willfp.ecopets.commands
|
||||||
|
|
||||||
|
import com.willfp.eco.core.EcoPlugin
|
||||||
|
import com.willfp.eco.core.command.impl.Subcommand
|
||||||
|
import com.willfp.eco.util.StringUtils
|
||||||
|
import com.willfp.eco.util.savedDisplayName
|
||||||
|
import com.willfp.eco.util.toNiceString
|
||||||
|
import com.willfp.ecopets.pets.Pets
|
||||||
|
import com.willfp.ecopets.pets.givePetExperience
|
||||||
|
import com.willfp.ecopets.pets.hasPet
|
||||||
|
import org.bukkit.Bukkit
|
||||||
|
import org.bukkit.command.CommandSender
|
||||||
|
import org.bukkit.entity.Player
|
||||||
|
import org.bukkit.util.StringUtil
|
||||||
|
|
||||||
|
class CommandGiveXP(plugin: EcoPlugin) : Subcommand(plugin, "givexp", "ecopets.command.givexp", false) {
|
||||||
|
override fun onExecute(sender: CommandSender, args: List<String>) {
|
||||||
|
if (args.isEmpty()) {
|
||||||
|
sender.sendMessage(plugin.langYml.getMessage("needs-player"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.size == 1) {
|
||||||
|
sender.sendMessage(plugin.langYml.getMessage("needs-pet"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.size == 2) {
|
||||||
|
sender.sendMessage(plugin.langYml.getMessage("needs-amount"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val playerName = args[0]
|
||||||
|
|
||||||
|
val player = Bukkit.getPlayer(playerName)
|
||||||
|
|
||||||
|
if (player == null) {
|
||||||
|
sender.sendMessage(plugin.langYml.getMessage("invalid-player"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val pet = Pets.getByID(args[1])
|
||||||
|
|
||||||
|
if (pet == null) {
|
||||||
|
sender.sendMessage(plugin.langYml.getMessage("invalid-pet"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!player.hasPet(pet)) {
|
||||||
|
sender.sendMessage(plugin.langYml.getMessage("doesnt-have-pet"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val amount = args[2].toDoubleOrNull()
|
||||||
|
|
||||||
|
if (amount == null) {
|
||||||
|
sender.sendMessage(plugin.langYml.getMessage("invalid-amount"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
player.givePetExperience(
|
||||||
|
pet,
|
||||||
|
amount
|
||||||
|
)
|
||||||
|
|
||||||
|
sender.sendMessage(
|
||||||
|
plugin.langYml.getMessage("gave-xp", StringUtils.FormatOption.WITHOUT_PLACEHOLDERS)
|
||||||
|
.replace("%player%", player.savedDisplayName)
|
||||||
|
.replace("%xp%", amount.toNiceString())
|
||||||
|
.replace("%pet%", pet.name)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun tabComplete(sender: CommandSender, args: List<String>): List<String> {
|
||||||
|
if (args.size == 1) {
|
||||||
|
return Bukkit.getOnlinePlayers().map { it.name }
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.size == 2) {
|
||||||
|
return Pets.values().map { it.id }
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.size == 3) {
|
||||||
|
return listOf("10", "100", "1000", "10000")
|
||||||
|
}
|
||||||
|
|
||||||
|
return emptyList()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,6 +7,11 @@ import org.bukkit.command.CommandSender
|
|||||||
import org.bukkit.entity.Player
|
import org.bukkit.entity.Player
|
||||||
|
|
||||||
class CommandPets(plugin: EcoPlugin) : PluginCommand(plugin, "pets", "ecopets.command.pets", true) {
|
class CommandPets(plugin: EcoPlugin) : PluginCommand(plugin, "pets", "ecopets.command.pets", true) {
|
||||||
|
init {
|
||||||
|
this.addSubcommand(CommandActivate(plugin))
|
||||||
|
.addSubcommand(CommandDeactivate(plugin))
|
||||||
|
}
|
||||||
|
|
||||||
override fun onExecute(player: CommandSender, args: List<String>) {
|
override fun onExecute(player: CommandSender, args: List<String>) {
|
||||||
player as Player
|
player as Player
|
||||||
PetsGUI.open(player)
|
PetsGUI.open(player)
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package com.willfp.ecopets.commands
|
||||||
|
|
||||||
|
import com.willfp.eco.core.EcoPlugin
|
||||||
|
import com.willfp.eco.core.command.impl.Subcommand
|
||||||
|
import com.willfp.eco.util.StringUtils
|
||||||
|
import com.willfp.eco.util.savedDisplayName
|
||||||
|
import com.willfp.eco.util.toNiceString
|
||||||
|
import com.willfp.ecopets.pets.Pets
|
||||||
|
import com.willfp.ecopets.pets.activePet
|
||||||
|
import com.willfp.ecopets.pets.givePetExperience
|
||||||
|
import com.willfp.ecopets.pets.hasPet
|
||||||
|
import com.willfp.ecopets.pets.setPetLevel
|
||||||
|
import com.willfp.ecopets.pets.setPetXP
|
||||||
|
import org.bukkit.Bukkit
|
||||||
|
import org.bukkit.command.CommandSender
|
||||||
|
import org.bukkit.entity.Player
|
||||||
|
import org.bukkit.util.StringUtil
|
||||||
|
|
||||||
|
class CommandReset(plugin: EcoPlugin) : Subcommand(plugin, "reset", "ecopets.command.reset", false) {
|
||||||
|
override fun onExecute(sender: CommandSender, args: List<String>) {
|
||||||
|
if (args.isEmpty()) {
|
||||||
|
sender.sendMessage(plugin.langYml.getMessage("needs-player"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.size == 1) {
|
||||||
|
sender.sendMessage(plugin.langYml.getMessage("needs-pet"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val playerName = args[0]
|
||||||
|
|
||||||
|
val player = Bukkit.getPlayer(playerName)
|
||||||
|
|
||||||
|
if (player == null) {
|
||||||
|
sender.sendMessage(plugin.langYml.getMessage("invalid-player"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val pet = Pets.getByID(args[1])
|
||||||
|
|
||||||
|
if (pet == null) {
|
||||||
|
sender.sendMessage(plugin.langYml.getMessage("invalid-pet"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!player.hasPet(pet)) {
|
||||||
|
sender.sendMessage(plugin.langYml.getMessage("doesnt-have-pet"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.activePet == pet) {
|
||||||
|
player.activePet = null
|
||||||
|
}
|
||||||
|
player.setPetXP(pet, 0.0)
|
||||||
|
player.setPetLevel(pet, 0)
|
||||||
|
|
||||||
|
sender.sendMessage(
|
||||||
|
plugin.langYml.getMessage("reset-xp", StringUtils.FormatOption.WITHOUT_PLACEHOLDERS)
|
||||||
|
.replace("%player%", player.savedDisplayName)
|
||||||
|
.replace("%pet%", pet.name)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun tabComplete(sender: CommandSender, args: List<String>): List<String> {
|
||||||
|
if (args.size == 1) {
|
||||||
|
return Bukkit.getOnlinePlayers().map { it.name }
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.size == 2) {
|
||||||
|
return Pets.values().map { it.id }
|
||||||
|
}
|
||||||
|
|
||||||
|
return emptyList()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package com.willfp.ecopets.config
|
|
||||||
|
|
||||||
import com.willfp.eco.core.EcoPlugin
|
|
||||||
import com.willfp.eco.core.config.BaseConfig
|
|
||||||
import com.willfp.eco.core.config.ConfigType
|
|
||||||
|
|
||||||
class PetsYml(plugin: EcoPlugin) : BaseConfig("pets", plugin, false, ConfigType.YAML)
|
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.willfp.ecopets.pets
|
||||||
|
|
||||||
|
import com.willfp.eco.core.EcoPlugin
|
||||||
|
import org.bukkit.Bukkit
|
||||||
|
import org.bukkit.Keyed
|
||||||
|
import org.bukkit.event.EventHandler
|
||||||
|
import org.bukkit.event.Listener
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent
|
||||||
|
import org.bukkit.inventory.Recipe
|
||||||
|
|
||||||
|
class DiscoverRecipeListener(private val plugin: EcoPlugin) : Listener {
|
||||||
|
@EventHandler
|
||||||
|
fun onJoin(event: PlayerJoinEvent) {
|
||||||
|
if (!plugin.configYml.getBool("discover-recipes")) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
mutableListOf<Recipe>()
|
||||||
|
.apply { Bukkit.getServer().recipeIterator().forEachRemaining(this::add) }
|
||||||
|
.filterIsInstance<Keyed>().map { it.key }
|
||||||
|
.filter { it.namespace == plugin.name.lowercase() }
|
||||||
|
.filter { !it.key.contains("displayed") }
|
||||||
|
.forEach { event.player.discoverRecipe(it) }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,7 +9,6 @@ import com.willfp.eco.core.fast.fast
|
|||||||
import com.willfp.eco.core.items.CustomItem
|
import com.willfp.eco.core.items.CustomItem
|
||||||
import com.willfp.eco.core.items.Items
|
import com.willfp.eco.core.items.Items
|
||||||
import com.willfp.eco.core.items.builder.ItemStackBuilder
|
import com.willfp.eco.core.items.builder.ItemStackBuilder
|
||||||
import com.willfp.eco.core.items.builder.SkullBuilder
|
|
||||||
import com.willfp.eco.core.placeholder.PlayerPlaceholder
|
import com.willfp.eco.core.placeholder.PlayerPlaceholder
|
||||||
import com.willfp.eco.core.placeholder.PlayerStaticPlaceholder
|
import com.willfp.eco.core.placeholder.PlayerStaticPlaceholder
|
||||||
import com.willfp.eco.core.placeholder.PlayerlessPlaceholder
|
import com.willfp.eco.core.placeholder.PlayerlessPlaceholder
|
||||||
@@ -21,6 +20,7 @@ import com.willfp.eco.util.toNiceString
|
|||||||
import com.willfp.ecopets.EcoPetsPlugin
|
import com.willfp.ecopets.EcoPetsPlugin
|
||||||
import com.willfp.ecopets.api.event.PlayerPetExpGainEvent
|
import com.willfp.ecopets.api.event.PlayerPetExpGainEvent
|
||||||
import com.willfp.ecopets.api.event.PlayerPetLevelUpEvent
|
import com.willfp.ecopets.api.event.PlayerPetLevelUpEvent
|
||||||
|
import com.willfp.ecopets.pets.entity.PetEntity
|
||||||
import com.willfp.libreforge.conditions.Conditions
|
import com.willfp.libreforge.conditions.Conditions
|
||||||
import com.willfp.libreforge.conditions.ConfiguredCondition
|
import com.willfp.libreforge.conditions.ConfiguredCondition
|
||||||
import com.willfp.libreforge.effects.ConfiguredEffect
|
import com.willfp.libreforge.effects.ConfiguredEffect
|
||||||
@@ -32,15 +32,15 @@ import org.bukkit.OfflinePlayer
|
|||||||
import org.bukkit.entity.Player
|
import org.bukkit.entity.Player
|
||||||
import org.bukkit.inventory.ItemStack
|
import org.bukkit.inventory.ItemStack
|
||||||
import org.bukkit.persistence.PersistentDataType
|
import org.bukkit.persistence.PersistentDataType
|
||||||
import java.util.*
|
import java.util.Objects
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
import kotlin.math.abs
|
import kotlin.math.abs
|
||||||
|
|
||||||
class Pet(
|
class Pet(
|
||||||
|
val id: String,
|
||||||
val config: Config,
|
val config: Config,
|
||||||
private val plugin: EcoPetsPlugin
|
private val plugin: EcoPetsPlugin
|
||||||
) {
|
) {
|
||||||
val id = config.getString("id")
|
|
||||||
val name = config.getFormattedString("name")
|
val name = config.getFormattedString("name")
|
||||||
val description = config.getFormattedString("description")
|
val description = config.getFormattedString("description")
|
||||||
|
|
||||||
@@ -107,21 +107,20 @@ class Pet(
|
|||||||
"${this.id}_spawn_egg",
|
"${this.id}_spawn_egg",
|
||||||
egg,
|
egg,
|
||||||
config.getStrings("spawn-egg.recipe"),
|
config.getStrings("spawn-egg.recipe"),
|
||||||
config.getString("spawn-egg.recipe-permission")
|
config.getStringOrNull("spawn-egg.recipe-permission")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val petEntityItem: ItemStack = SkullBuilder()
|
val entityTexture = config.getString("entity-texture")
|
||||||
.setSkullTexture(config.getString("entity-texture"))
|
val modelEngineAnimation = config.getStringOrNull("modelengine-animation")
|
||||||
.build()
|
|
||||||
|
|
||||||
val levelGUI = PetLevelGUI(plugin, this)
|
|
||||||
|
|
||||||
private val levelXpRequirements = listOf(0) + config.getInts("level-xp-requirements")
|
private val levelXpRequirements = listOf(0) + config.getInts("level-xp-requirements")
|
||||||
|
|
||||||
val maxLevel = levelXpRequirements.size
|
val maxLevel = levelXpRequirements.size
|
||||||
|
|
||||||
|
val levelGUI = PetLevelGUI(plugin, this)
|
||||||
|
|
||||||
private val baseItem: ItemStack = Items.lookup(config.getString("icon")).item
|
private val baseItem: ItemStack = Items.lookup(config.getString("icon")).item
|
||||||
|
|
||||||
private val effects: Set<ConfiguredEffect>
|
private val effects: Set<ConfiguredEffect>
|
||||||
@@ -153,12 +152,16 @@ class Pet(
|
|||||||
private val petXpGains = config.getSubsections("xp-gain-methods").mapNotNull {
|
private val petXpGains = config.getSubsections("xp-gain-methods").mapNotNull {
|
||||||
val trigger = Triggers.getById(it.getString("id")) ?: return@mapNotNull null
|
val trigger = Triggers.getById(it.getString("id")) ?: return@mapNotNull null
|
||||||
val multiplier = it.getDouble("multiplier")
|
val multiplier = it.getDouble("multiplier")
|
||||||
|
val conditions = it.getSubsections("conditions")
|
||||||
|
.mapNotNull { cfg -> Conditions.compile(cfg, "Pet $id XP Gain methods") }
|
||||||
|
|
||||||
PetXPGain(
|
trigger to PetXPGain(
|
||||||
trigger,
|
trigger,
|
||||||
multiplier
|
multiplier,
|
||||||
|
conditions,
|
||||||
|
it.getSubsection("filters")
|
||||||
)
|
)
|
||||||
}
|
}.toMap()
|
||||||
|
|
||||||
init {
|
init {
|
||||||
config.injectPlaceholders(
|
config.injectPlaceholders(
|
||||||
@@ -169,13 +172,15 @@ class Pet(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
effects = config.getSubsections("effects").mapNotNull {
|
effects = Effects.compile(
|
||||||
Effects.compile(it, "Pet $id")
|
config.getSubsections("effects"),
|
||||||
}.toSet()
|
"Pet $id"
|
||||||
|
)
|
||||||
|
|
||||||
conditions = config.getSubsections("conditions").mapNotNull {
|
conditions = Conditions.compile(
|
||||||
Conditions.compile(it, "Pet $id")
|
config.getSubsections("conditions"),
|
||||||
}.toSet()
|
"Pet $id"
|
||||||
|
)
|
||||||
|
|
||||||
for (string in config.getStrings("level-commands")) {
|
for (string in config.getStrings("level-commands")) {
|
||||||
val split = string.split(":")
|
val split = string.split(":")
|
||||||
@@ -203,6 +208,13 @@ class Pet(
|
|||||||
(it.getPetProgress(this) * 100).toNiceString()
|
(it.getPetProgress(this) * 100).toNiceString()
|
||||||
}.register()
|
}.register()
|
||||||
|
|
||||||
|
PlayerPlaceholder(
|
||||||
|
plugin,
|
||||||
|
id
|
||||||
|
) {
|
||||||
|
it.getPetLevel(this).toString()
|
||||||
|
}.register()
|
||||||
|
|
||||||
PlayerPlaceholder(
|
PlayerPlaceholder(
|
||||||
plugin,
|
plugin,
|
||||||
"${id}_current_xp"
|
"${id}_current_xp"
|
||||||
@@ -232,6 +244,10 @@ class Pet(
|
|||||||
}.register()
|
}.register()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun makePetEntity(): PetEntity {
|
||||||
|
return PetEntity.create(this)
|
||||||
|
}
|
||||||
|
|
||||||
fun getLevel(level: Int): PetLevel = levels.get(level) {
|
fun getLevel(level: Int): PetLevel = levels.get(level) {
|
||||||
PetLevel(this, it, effects, conditions)
|
PetLevel(this, it, effects, conditions)
|
||||||
}
|
}
|
||||||
@@ -304,7 +320,14 @@ class Pet(
|
|||||||
.map {
|
.map {
|
||||||
it.replace("%percentage_progress%", (player.getPetProgress(this) * 100).toNiceString())
|
it.replace("%percentage_progress%", (player.getPetProgress(this) * 100).toNiceString())
|
||||||
.replace("%current_xp%", player.getPetXP(this).toNiceString())
|
.replace("%current_xp%", player.getPetXP(this).toNiceString())
|
||||||
.replace("%required_xp%", this.getExpForLevel(player.getPetLevel(this) + 1).toNiceString())
|
.replace("%required_xp%", this.getExpForLevel(player.getPetLevel(this) + 1).let { req ->
|
||||||
|
if (req == Int.MAX_VALUE) {
|
||||||
|
plugin.langYml.getFormattedString("infinity")
|
||||||
|
} else {
|
||||||
|
req.toNiceString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
.replace("%description%", this.description)
|
.replace("%description%", this.description)
|
||||||
.replace("%pet%", this.name)
|
.replace("%pet%", this.name)
|
||||||
.replace("%level%", (forceLevel ?: player.getPetLevel(this)).toString())
|
.replace("%level%", (forceLevel ?: player.getPetLevel(this)).toString())
|
||||||
@@ -382,12 +405,8 @@ class Pet(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun canGainXPFromTrigger(trigger: Trigger): Boolean {
|
fun getPetXPGain(trigger: Trigger): PetXPGain? {
|
||||||
return petXpGains.any { it.trigger == trigger }
|
return petXpGains[trigger]
|
||||||
}
|
|
||||||
|
|
||||||
fun getTriggerXPMultiplier(trigger: Trigger): Double {
|
|
||||||
return petXpGains.firstOrNull { it.trigger == trigger }?.multiplier ?: 1.0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean {
|
override fun equals(other: Any?): Boolean {
|
||||||
|
|||||||
@@ -6,23 +6,20 @@ import com.willfp.eco.util.formatEco
|
|||||||
import org.bukkit.Bukkit
|
import org.bukkit.Bukkit
|
||||||
import org.bukkit.Location
|
import org.bukkit.Location
|
||||||
import org.bukkit.entity.ArmorStand
|
import org.bukkit.entity.ArmorStand
|
||||||
import org.bukkit.entity.EntityType
|
|
||||||
import org.bukkit.entity.Player
|
import org.bukkit.entity.Player
|
||||||
import org.bukkit.event.EventHandler
|
import org.bukkit.event.EventHandler
|
||||||
import org.bukkit.event.Listener
|
import org.bukkit.event.Listener
|
||||||
import org.bukkit.event.player.PlayerQuitEvent
|
import org.bukkit.event.player.PlayerQuitEvent
|
||||||
import org.bukkit.inventory.EquipmentSlot
|
import java.util.UUID
|
||||||
import java.util.*
|
|
||||||
import kotlin.math.PI
|
import kotlin.math.PI
|
||||||
import kotlin.math.abs
|
import kotlin.math.abs
|
||||||
import kotlin.math.sin
|
|
||||||
|
|
||||||
class PetDisplay(
|
class PetDisplay(
|
||||||
private val plugin: EcoPlugin
|
private val plugin: EcoPlugin
|
||||||
) : Listener {
|
) : Listener {
|
||||||
private var tick = 0
|
private var tick = 0
|
||||||
|
|
||||||
private val trackedEntities = mutableMapOf<UUID, ArmorStand>()
|
private val trackedEntities = mutableMapOf<UUID, PetArmorStand>()
|
||||||
|
|
||||||
fun tickAll() {
|
fun tickAll() {
|
||||||
for (player in Bukkit.getOnlinePlayers()) {
|
for (player in Bukkit.getOnlinePlayers()) {
|
||||||
@@ -37,7 +34,6 @@ class PetDisplay(
|
|||||||
val pet = player.activePet
|
val pet = player.activePet
|
||||||
|
|
||||||
if (pet != null) {
|
if (pet != null) {
|
||||||
stand.equipment?.helmet = pet.petEntityItem
|
|
||||||
stand.customName = plugin.configYml.getString("pet-entity.name")
|
stand.customName = plugin.configYml.getString("pet-entity.name")
|
||||||
.replace("%player%", player.displayName)
|
.replace("%player%", player.displayName)
|
||||||
.replace("%pet%", pet.name)
|
.replace("%pet%", pet.name)
|
||||||
@@ -48,23 +44,53 @@ class PetDisplay(
|
|||||||
|
|
||||||
location.y += NumberUtils.fastSin(tick / (2 * PI) * 0.5) * 0.15
|
location.y += NumberUtils.fastSin(tick / (2 * PI) * 0.5) * 0.15
|
||||||
|
|
||||||
|
if (location.world != null) {
|
||||||
|
try {
|
||||||
stand.teleport(location)
|
stand.teleport(location)
|
||||||
|
} catch (_: Throwable) {
|
||||||
|
/*
|
||||||
|
For anyone reading - I KNOW TO NEVER CATCH THROWABLE
|
||||||
|
but NMS is really stupid and does this sometimes:
|
||||||
|
java.lang.Throwable: null
|
||||||
|
at net.minecraft.world.entity.Entity.teleportTo(Entity.java:3336) ~[paper-1.19.2.jar:git-Paper-186]
|
||||||
|
so I guess that's what has to be done. Not sure what the actual cause is.
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!pet.entityTexture.contains(":")) {
|
||||||
stand.setRotation((20 * tick / (2 * PI)).toFloat(), 0f)
|
stand.setRotation((20 * tick / (2 * PI)).toFloat(), 0f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun getLocation(player: Player): Location {
|
private fun getLocation(player: Player): Location {
|
||||||
val offset = player.eyeLocation.direction.clone().normalize()
|
val offset = player.eyeLocation.direction.clone().normalize()
|
||||||
.multiply(-1)
|
.multiply(-1)
|
||||||
.apply { y = abs(y) }
|
.apply {
|
||||||
|
y = abs(y)
|
||||||
|
|
||||||
|
if (abs(x) < 0.5) {
|
||||||
|
x = 0.5
|
||||||
|
}
|
||||||
|
|
||||||
|
if (abs(z) < 0.5) {
|
||||||
|
z = 0.5
|
||||||
|
}
|
||||||
|
}
|
||||||
.rotateAroundY(PI / 6)
|
.rotateAroundY(PI / 6)
|
||||||
|
|
||||||
return player.eyeLocation.clone().add(offset)
|
return player.eyeLocation.clone().add(offset)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getOrNew(player: Player): ArmorStand? {
|
private fun getOrNew(player: Player): ArmorStand? {
|
||||||
val existing = trackedEntities[player.uniqueId]
|
val tracked = trackedEntities[player.uniqueId]
|
||||||
|
val existing = tracked?.stand
|
||||||
|
|
||||||
val pet = player.activePet
|
val pet = player.activePet
|
||||||
|
if (pet != tracked?.pet) {
|
||||||
|
tracked?.stand?.remove()
|
||||||
|
}
|
||||||
|
|
||||||
if (existing == null || existing.isDead || pet == null) {
|
if (existing == null || existing.isDead || pet == null) {
|
||||||
existing?.remove()
|
existing?.remove()
|
||||||
@@ -75,32 +101,17 @@ class PetDisplay(
|
|||||||
}
|
}
|
||||||
|
|
||||||
val location = getLocation(player)
|
val location = getLocation(player)
|
||||||
val newStand = location.world!!.spawnEntity(location, EntityType.ARMOR_STAND) as ArmorStand
|
val stand = pet.makePetEntity().spawn(location)
|
||||||
newStand.isVisible = false
|
|
||||||
newStand.isInvulnerable = true
|
|
||||||
newStand.isPersistent = true
|
|
||||||
newStand.removeWhenFarAway = false
|
|
||||||
newStand.isSmall = true
|
|
||||||
newStand.setGravity(false)
|
|
||||||
newStand.isCollidable = false
|
|
||||||
|
|
||||||
for (slot in EquipmentSlot.values()) {
|
trackedEntities[player.uniqueId] = PetArmorStand(stand, pet)
|
||||||
newStand.addEquipmentLock(slot, ArmorStand.LockType.ADDING_OR_CHANGING)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
newStand.equipment?.helmet = pet.petEntityItem
|
return trackedEntities[player.uniqueId]?.stand
|
||||||
newStand.isCustomNameVisible = true
|
|
||||||
newStand.customName = pet.name
|
|
||||||
|
|
||||||
trackedEntities[player.uniqueId] = newStand
|
|
||||||
}
|
|
||||||
|
|
||||||
return trackedEntities[player.uniqueId]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun shutdown() {
|
fun shutdown() {
|
||||||
for (stand in trackedEntities.values) {
|
for (stand in trackedEntities.values) {
|
||||||
stand.remove()
|
stand.stand.remove()
|
||||||
}
|
}
|
||||||
|
|
||||||
trackedEntities.clear()
|
trackedEntities.clear()
|
||||||
@@ -108,7 +119,12 @@ class PetDisplay(
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
fun onLeave(event: PlayerQuitEvent) {
|
fun onLeave(event: PlayerQuitEvent) {
|
||||||
trackedEntities[event.player.uniqueId]?.remove()
|
trackedEntities[event.player.uniqueId]?.stand?.remove()
|
||||||
trackedEntities.remove(event.player.uniqueId)
|
trackedEntities.remove(event.player.uniqueId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private data class PetArmorStand(
|
||||||
|
val stand: ArmorStand,
|
||||||
|
val pet: Pet
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,22 +3,25 @@ package com.willfp.ecopets.pets
|
|||||||
import com.willfp.eco.core.EcoPlugin
|
import com.willfp.eco.core.EcoPlugin
|
||||||
import com.willfp.eco.core.gui.menu
|
import com.willfp.eco.core.gui.menu
|
||||||
import com.willfp.eco.core.gui.menu.Menu
|
import com.willfp.eco.core.gui.menu.Menu
|
||||||
|
import com.willfp.eco.core.gui.menu.MenuLayer
|
||||||
|
import com.willfp.eco.core.gui.onLeftClick
|
||||||
|
import com.willfp.eco.core.gui.page.PageChanger
|
||||||
import com.willfp.eco.core.gui.slot
|
import com.willfp.eco.core.gui.slot
|
||||||
|
import com.willfp.eco.core.gui.slot.ConfigSlot
|
||||||
import com.willfp.eco.core.gui.slot.FillerMask
|
import com.willfp.eco.core.gui.slot.FillerMask
|
||||||
import com.willfp.eco.core.gui.slot.MaskItems
|
import com.willfp.eco.core.gui.slot.MaskItems
|
||||||
import com.willfp.eco.core.items.Items
|
import com.willfp.eco.core.items.Items
|
||||||
import com.willfp.eco.core.items.builder.ItemStackBuilder
|
import com.willfp.eco.core.items.builder.ItemStackBuilder
|
||||||
import com.willfp.eco.util.NumberUtils
|
import com.willfp.eco.util.NumberUtils
|
||||||
import com.willfp.eco.util.toNiceString
|
import com.willfp.ecomponent.components.LevelComponent
|
||||||
import org.bukkit.Material
|
import com.willfp.ecomponent.components.LevelState
|
||||||
import org.bukkit.entity.Player
|
import org.bukkit.entity.Player
|
||||||
import org.bukkit.inventory.ItemStack
|
import org.bukkit.inventory.ItemStack
|
||||||
import kotlin.math.ceil
|
|
||||||
import kotlin.math.max
|
|
||||||
|
|
||||||
class PetLevelGUI(
|
class PetLevelGUI(
|
||||||
plugin: EcoPlugin,
|
plugin: EcoPlugin,
|
||||||
pet: Pet
|
private val pet: Pet
|
||||||
) {
|
) {
|
||||||
private val menu: Menu
|
private val menu: Menu
|
||||||
|
|
||||||
@@ -26,38 +29,46 @@ class PetLevelGUI(
|
|||||||
val maskPattern = plugin.configYml.getStrings("level-gui.mask.pattern").toTypedArray()
|
val maskPattern = plugin.configYml.getStrings("level-gui.mask.pattern").toTypedArray()
|
||||||
val maskItems = MaskItems.fromItemNames(plugin.configYml.getStrings("level-gui.mask.materials"))
|
val maskItems = MaskItems.fromItemNames(plugin.configYml.getStrings("level-gui.mask.materials"))
|
||||||
|
|
||||||
val progressionOrder = "123456789abcdefghijklmnopqrstuvwxyz"
|
|
||||||
val progressionPattern = plugin.configYml.getStrings("level-gui.progression-slots.pattern")
|
val progressionPattern = plugin.configYml.getStrings("level-gui.progression-slots.pattern")
|
||||||
|
|
||||||
val progressionSlots = mutableMapOf<Int, Pair<Int, Int>>()
|
val component = object : LevelComponent(progressionPattern, pet.maxLevel) {
|
||||||
|
override fun getLevelItem(player: Player, menu: Menu, level: Int, levelState: LevelState): ItemStack {
|
||||||
|
val key = levelState.name.lowercase().replace("_", "-")
|
||||||
|
|
||||||
var x = 0
|
return ItemStackBuilder(Items.lookup(plugin.configYml.getString("level-gui.progression-slots.$key.item")))
|
||||||
for (row in progressionPattern) {
|
.setDisplayName(
|
||||||
x++
|
plugin.configYml.getFormattedString("level-gui.progression-slots.$key.name")
|
||||||
var y = 0
|
.replace("%pet%", pet.name)
|
||||||
for (char in row) {
|
.replace("%level%", level.toString())
|
||||||
y++
|
.replace("%level_numeral%", NumberUtils.toNumeral(level))
|
||||||
if (char == '0') {
|
)
|
||||||
continue
|
.addLoreLines(
|
||||||
|
pet.injectPlaceholdersInto(
|
||||||
|
plugin.configYml.getFormattedStrings("level-gui.progression-slots.$key.lore"),
|
||||||
|
player,
|
||||||
|
forceLevel = level
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.setAmount(
|
||||||
|
if (plugin.configYml.getBool("level-gui.progression-slots.level-as-amount")) level else 1
|
||||||
|
)
|
||||||
|
.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
val pos = progressionOrder.indexOf(char)
|
override fun getLevelState(player: Player, level: Int): LevelState {
|
||||||
|
return when {
|
||||||
if (pos == -1) {
|
level <= player.getPetLevel(pet) -> LevelState.UNLOCKED
|
||||||
continue
|
level == player.getPetLevel(pet) + 1 -> LevelState.IN_PROGRESS
|
||||||
}
|
else -> LevelState.LOCKED
|
||||||
|
}
|
||||||
progressionSlots[pos + 1] = Pair(x, y)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val pages = ceil(pet.maxLevel.toDouble() / progressionSlots.size).toInt()
|
|
||||||
val levelsPerPage = progressionSlots.size
|
|
||||||
|
|
||||||
val pageKey = "page"
|
|
||||||
|
|
||||||
menu = menu(plugin.configYml.getInt("level-gui.rows")) {
|
menu = menu(plugin.configYml.getInt("level-gui.rows")) {
|
||||||
setTitle(pet.name)
|
title = pet.name
|
||||||
|
|
||||||
|
maxPages(component.pages)
|
||||||
|
|
||||||
setMask(
|
setMask(
|
||||||
FillerMask(
|
FillerMask(
|
||||||
maskItems,
|
maskItems,
|
||||||
@@ -65,58 +76,11 @@ class PetLevelGUI(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
for ((level, value) in progressionSlots) {
|
addComponent(1, 1, component)
|
||||||
setSlot(
|
|
||||||
value.first,
|
|
||||||
value.second,
|
|
||||||
slot(ItemStack(Material.BLACK_STAINED_GLASS_PANE)) {
|
|
||||||
setUpdater { player, menu, _ ->
|
|
||||||
val page = menu.getState<Int>(player, pageKey) ?: 1
|
|
||||||
|
|
||||||
val slotLevel = ((page - 1) * levelsPerPage) + level
|
// Instead of the page changer, this will show up when on the first page
|
||||||
|
addComponent(
|
||||||
fun getItem(section: String) =
|
MenuLayer.LOWER,
|
||||||
ItemStackBuilder(Items.lookup(plugin.configYml.getString("level-gui.progression-slots.$section.item")))
|
|
||||||
.setDisplayName(
|
|
||||||
plugin.configYml.getFormattedString("level-gui.progression-slots.$section.name")
|
|
||||||
.replace("%pet%", pet.name)
|
|
||||||
.replace("%level%", slotLevel.toString())
|
|
||||||
.replace("%level_numeral%", NumberUtils.toNumeral(slotLevel))
|
|
||||||
)
|
|
||||||
.addLoreLines(
|
|
||||||
pet.injectPlaceholdersInto(
|
|
||||||
plugin.configYml.getFormattedStrings("level-gui.progression-slots.$section.lore"),
|
|
||||||
player,
|
|
||||||
forceLevel = slotLevel
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.build()
|
|
||||||
|
|
||||||
if (slotLevel > pet.maxLevel) {
|
|
||||||
maskItems.items[0].item
|
|
||||||
} else {
|
|
||||||
val item = when {
|
|
||||||
slotLevel <= player.getPetLevel(pet) -> {
|
|
||||||
getItem("unlocked")
|
|
||||||
}
|
|
||||||
slotLevel == player.getPetLevel(pet) + 1 -> {
|
|
||||||
getItem("in-progress")
|
|
||||||
}
|
|
||||||
else -> {
|
|
||||||
getItem("locked")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (plugin.configYml.getBool("level-gui.progression-slots.level-as-amount")) {
|
|
||||||
item.amount = slotLevel
|
|
||||||
}
|
|
||||||
item
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
setSlot(
|
|
||||||
plugin.configYml.getInt("level-gui.progression-slots.prev-page.location.row"),
|
plugin.configYml.getInt("level-gui.progression-slots.prev-page.location.row"),
|
||||||
plugin.configYml.getInt("level-gui.progression-slots.prev-page.location.column"),
|
plugin.configYml.getInt("level-gui.progression-slots.prev-page.location.column"),
|
||||||
slot(
|
slot(
|
||||||
@@ -124,32 +88,32 @@ class PetLevelGUI(
|
|||||||
.setDisplayName(plugin.configYml.getString("level-gui.progression-slots.prev-page.name"))
|
.setDisplayName(plugin.configYml.getString("level-gui.progression-slots.prev-page.name"))
|
||||||
.build()
|
.build()
|
||||||
) {
|
) {
|
||||||
onLeftClick { event, _, menu ->
|
onLeftClick { player, _, _, _ -> PetsGUI.open(player) }
|
||||||
val player = event.whoClicked as Player
|
|
||||||
var page = menu.getState(player, pageKey) ?: 1
|
|
||||||
page--
|
|
||||||
menu.addState(player, pageKey, page)
|
|
||||||
if (page == 0) {
|
|
||||||
PetsGUI.open(event.whoClicked as Player)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
setSlot(
|
|
||||||
|
addComponent(
|
||||||
|
plugin.configYml.getInt("level-gui.progression-slots.prev-page.location.row"),
|
||||||
|
plugin.configYml.getInt("level-gui.progression-slots.prev-page.location.column"),
|
||||||
|
PageChanger(
|
||||||
|
ItemStackBuilder(Items.lookup(plugin.configYml.getString("level-gui.progression-slots.prev-page.material")))
|
||||||
|
.setDisplayName(plugin.configYml.getString("level-gui.progression-slots.prev-page.name"))
|
||||||
|
.build(),
|
||||||
|
PageChanger.Direction.BACKWARDS
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
addComponent(
|
||||||
plugin.configYml.getInt("level-gui.progression-slots.next-page.location.row"),
|
plugin.configYml.getInt("level-gui.progression-slots.next-page.location.row"),
|
||||||
plugin.configYml.getInt("level-gui.progression-slots.next-page.location.column"),
|
plugin.configYml.getInt("level-gui.progression-slots.next-page.location.column"),
|
||||||
slot(
|
PageChanger(
|
||||||
ItemStackBuilder(Items.lookup(plugin.configYml.getString("level-gui.progression-slots.next-page.material")))
|
ItemStackBuilder(Items.lookup(plugin.configYml.getString("level-gui.progression-slots.next-page.material")))
|
||||||
.setDisplayName(plugin.configYml.getString("level-gui.progression-slots.next-page.name"))
|
.setDisplayName(plugin.configYml.getString("level-gui.progression-slots.next-page.name"))
|
||||||
.build()
|
.build(),
|
||||||
) {
|
PageChanger.Direction.FORWARDS
|
||||||
onLeftClick { event, _, menu ->
|
|
||||||
val player = event.whoClicked as Player
|
|
||||||
val newPage = max(pages, (menu.getState(player, pageKey) ?: 1) + 1)
|
|
||||||
menu.addState(player, pageKey, newPage)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
|
||||||
setSlot(
|
setSlot(
|
||||||
plugin.configYml.getInt("level-gui.progression-slots.close.location.row"),
|
plugin.configYml.getInt("level-gui.progression-slots.close.location.row"),
|
||||||
plugin.configYml.getInt("level-gui.progression-slots.close.location.column"),
|
plugin.configYml.getInt("level-gui.progression-slots.close.location.column"),
|
||||||
@@ -163,8 +127,18 @@ class PetLevelGUI(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
for (config in plugin.configYml.getSubsections("level-gui.custom-slots")) {
|
||||||
|
setSlot(
|
||||||
|
config.getInt("row"),
|
||||||
|
config.getInt("column"),
|
||||||
|
ConfigSlot(config)
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun open(player: Player) = menu.open(player)
|
fun open(player: Player) {
|
||||||
|
menu.open(player)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,29 +1,44 @@
|
|||||||
package com.willfp.ecopets.pets
|
package com.willfp.ecopets.pets
|
||||||
|
|
||||||
|
import com.willfp.eco.core.config.interfaces.Config
|
||||||
|
import com.willfp.libreforge.conditions.ConfiguredCondition
|
||||||
import com.willfp.libreforge.events.TriggerPreProcessEvent
|
import com.willfp.libreforge.events.TriggerPreProcessEvent
|
||||||
|
import com.willfp.libreforge.filters.Filter
|
||||||
|
import com.willfp.libreforge.filters.Filters
|
||||||
import com.willfp.libreforge.triggers.Trigger
|
import com.willfp.libreforge.triggers.Trigger
|
||||||
import org.bukkit.event.EventHandler
|
import org.bukkit.event.EventHandler
|
||||||
import org.bukkit.event.Listener
|
import org.bukkit.event.Listener
|
||||||
|
|
||||||
data class PetXPGain(
|
data class PetXPGain(
|
||||||
val trigger: Trigger,
|
val trigger: Trigger,
|
||||||
val multiplier: Double
|
val multiplier: Double,
|
||||||
|
val conditions: Iterable<ConfiguredCondition>,
|
||||||
|
val filters: Config
|
||||||
)
|
)
|
||||||
|
|
||||||
object PetTriggerXPGainListener: Listener {
|
object PetTriggerXPGainListener : Listener {
|
||||||
@EventHandler(ignoreCancelled = true)
|
@EventHandler(ignoreCancelled = true)
|
||||||
fun handle(event: TriggerPreProcessEvent) {
|
fun handle(event: TriggerPreProcessEvent) {
|
||||||
val player = event.player
|
val player = event.player
|
||||||
val trigger = event.trigger
|
val trigger = event.trigger
|
||||||
val value = event.value
|
val value = event.value
|
||||||
|
val data = event.data
|
||||||
|
|
||||||
val pet = event.player.activePet ?: return
|
val pet = event.player.activePet ?: return
|
||||||
|
|
||||||
if (pet.canGainXPFromTrigger(trigger)) {
|
val xpGain = pet.getPetXPGain(trigger) ?: return
|
||||||
|
|
||||||
|
if (xpGain.conditions.any { !it.isMet(player) }) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Filters.passes(data, xpGain.filters)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
player.givePetExperience(
|
player.givePetExperience(
|
||||||
pet,
|
pet,
|
||||||
value * pet.getTriggerXPMultiplier(trigger)
|
value * xpGain.multiplier
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,11 @@ package com.willfp.ecopets.pets
|
|||||||
import com.google.common.collect.BiMap
|
import com.google.common.collect.BiMap
|
||||||
import com.google.common.collect.HashBiMap
|
import com.google.common.collect.HashBiMap
|
||||||
import com.google.common.collect.ImmutableList
|
import com.google.common.collect.ImmutableList
|
||||||
|
import com.willfp.eco.core.config.ConfigType
|
||||||
|
import com.willfp.eco.core.config.readConfig
|
||||||
import com.willfp.eco.core.config.updating.ConfigUpdater
|
import com.willfp.eco.core.config.updating.ConfigUpdater
|
||||||
import com.willfp.ecopets.EcoPetsPlugin
|
import com.willfp.ecopets.EcoPetsPlugin
|
||||||
import com.willfp.libreforge.chains.EffectChains
|
import java.io.File
|
||||||
|
|
||||||
object Pets {
|
object Pets {
|
||||||
private val BY_ID: BiMap<String, Pet> = HashBiMap.create()
|
private val BY_ID: BiMap<String, Pet> = HashBiMap.create()
|
||||||
@@ -39,14 +41,18 @@ object Pets {
|
|||||||
@ConfigUpdater
|
@ConfigUpdater
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun update(plugin: EcoPetsPlugin) {
|
fun update(plugin: EcoPetsPlugin) {
|
||||||
plugin.petsYml.getSubsections("chains").mapNotNull {
|
|
||||||
EffectChains.compile(it, "Effect Chains")
|
|
||||||
}
|
|
||||||
for (set in values()) {
|
for (set in values()) {
|
||||||
removePet(set)
|
removePet(set)
|
||||||
}
|
}
|
||||||
for (petConfig in plugin.petsYml.getSubsections("pets")) {
|
|
||||||
addNewPet(Pet(petConfig, plugin))
|
val petsYml = File(plugin.dataFolder, "pets.yml").readConfig(ConfigType.YAML)
|
||||||
|
|
||||||
|
for ((id, petConfig) in plugin.fetchConfigs("pets")) {
|
||||||
|
addNewPet(Pet(id, petConfig, plugin))
|
||||||
|
}
|
||||||
|
|
||||||
|
for (petConfig in petsYml.getSubsections("pets")) {
|
||||||
|
addNewPet(Pet(petConfig.getString("id"), petConfig, plugin))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.willfp.eco.core.config.updating.ConfigUpdater
|
|||||||
import com.willfp.eco.core.gui.menu
|
import com.willfp.eco.core.gui.menu
|
||||||
import com.willfp.eco.core.gui.menu.Menu
|
import com.willfp.eco.core.gui.menu.Menu
|
||||||
import com.willfp.eco.core.gui.slot
|
import com.willfp.eco.core.gui.slot
|
||||||
|
import com.willfp.eco.core.gui.slot.ConfigSlot
|
||||||
import com.willfp.eco.core.gui.slot.FillerMask
|
import com.willfp.eco.core.gui.slot.FillerMask
|
||||||
import com.willfp.eco.core.gui.slot.MaskItems
|
import com.willfp.eco.core.gui.slot.MaskItems
|
||||||
import com.willfp.eco.core.items.Items
|
import com.willfp.eco.core.items.Items
|
||||||
@@ -13,10 +14,24 @@ import org.bukkit.Material
|
|||||||
import org.bukkit.Sound
|
import org.bukkit.Sound
|
||||||
import org.bukkit.entity.Player
|
import org.bukkit.entity.Player
|
||||||
import org.bukkit.inventory.ItemStack
|
import org.bukkit.inventory.ItemStack
|
||||||
|
import kotlin.math.ceil
|
||||||
|
import kotlin.math.max
|
||||||
|
import kotlin.math.min
|
||||||
|
|
||||||
object PetsGUI {
|
object PetsGUI {
|
||||||
private lateinit var menu: Menu
|
private lateinit var menu: Menu
|
||||||
private val petAreaSlots = mutableListOf<Pair<Int, Int>>()
|
private val petAreaSlots = mutableListOf<Pair<Int, Int>>()
|
||||||
|
private const val pageKey = "page"
|
||||||
|
|
||||||
|
private fun getPage(menu: Menu, player: Player): Int {
|
||||||
|
val pages = ceil(Pets.values()
|
||||||
|
.filter { player.getPetLevel(it) > 0 }
|
||||||
|
.size.toDouble() / petAreaSlots.size).toInt()
|
||||||
|
|
||||||
|
val page = menu.getState(player, pageKey) ?: 1
|
||||||
|
|
||||||
|
return max(min(pages, page + 1), 1)
|
||||||
|
}
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
@ConfigUpdater
|
@ConfigUpdater
|
||||||
@@ -27,8 +42,8 @@ object PetsGUI {
|
|||||||
val bottomRightColumn = plugin.configYml.getInt("gui.pet-area.bottom-right.column")
|
val bottomRightColumn = plugin.configYml.getInt("gui.pet-area.bottom-right.column")
|
||||||
|
|
||||||
petAreaSlots.clear()
|
petAreaSlots.clear()
|
||||||
for (column in topLeftColumn..bottomRightColumn) {
|
|
||||||
for (row in topLeftRow..bottomRightRow) {
|
for (row in topLeftRow..bottomRightRow) {
|
||||||
|
for (column in topLeftColumn..bottomRightColumn) {
|
||||||
petAreaSlots.add(Pair(row, column))
|
petAreaSlots.add(Pair(row, column))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -50,6 +65,19 @@ object PetsGUI {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val petIconBuilder = { player: Player, menu: Menu, index: Int ->
|
||||||
|
val page = getPage(menu, player)
|
||||||
|
|
||||||
|
val unlockedPets = Pets.values()
|
||||||
|
.sortedByDescending { player.getPetLevel(it) }
|
||||||
|
.filter { player.getPetLevel(it) > 0 }
|
||||||
|
|
||||||
|
val pagedIndex = ((page - 1) * petAreaSlots.size) + index
|
||||||
|
|
||||||
|
val pet = unlockedPets.getOrNull(pagedIndex)
|
||||||
|
pet?.getIcon(player) ?: ItemStack(Material.AIR)
|
||||||
|
}
|
||||||
|
|
||||||
return menu(plugin.configYml.getInt("gui.rows")) {
|
return menu(plugin.configYml.getInt("gui.rows")) {
|
||||||
setTitle(plugin.langYml.getString("menu.title"))
|
setTitle(plugin.langYml.getString("menu.title"))
|
||||||
|
|
||||||
@@ -74,20 +102,23 @@ object PetsGUI {
|
|||||||
for ((index, pair) in petAreaSlots.withIndex()) {
|
for ((index, pair) in petAreaSlots.withIndex()) {
|
||||||
val (row, column) = pair
|
val (row, column) = pair
|
||||||
|
|
||||||
setSlot(row, column, slot(ItemStack(Material.AIR)) {
|
setSlot(row, column, slot({ p, m -> petIconBuilder(p, m, index) }) {
|
||||||
setUpdater { player, _, _ ->
|
setUpdater { p, m, _ ->
|
||||||
val unlockedPets = Pets.values().filter { player.getPetLevel(it) > 0 }
|
petIconBuilder(p, m, index)
|
||||||
val pet = unlockedPets.getOrNull(index)
|
|
||||||
pet?.getIcon(player) ?: ItemStack(Material.AIR)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onLeftClick { event, _, _ ->
|
onLeftClick { event, _, _ ->
|
||||||
val player = event.whoClicked as Player
|
val player = event.whoClicked as Player
|
||||||
|
|
||||||
|
val page = getPage(menu, player)
|
||||||
|
|
||||||
val unlockedPets = Pets.values()
|
val unlockedPets = Pets.values()
|
||||||
.sortedByDescending { player.getPetLevel(it) }
|
.sortedByDescending { player.getPetLevel(it) }
|
||||||
.filter { player.getPetLevel(it) > 0 }
|
.filter { player.getPetLevel(it) > 0 }
|
||||||
|
|
||||||
val pet = unlockedPets.getOrNull(index) ?: return@onLeftClick
|
val pagedIndex = ((page - 1) * petAreaSlots.size) + index
|
||||||
|
|
||||||
|
val pet = unlockedPets.getOrNull(pagedIndex) ?: return@onLeftClick
|
||||||
|
|
||||||
if (player.activePet != pet) {
|
if (player.activePet != pet) {
|
||||||
player.activePet = pet
|
player.activePet = pet
|
||||||
@@ -103,6 +134,49 @@ object PetsGUI {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setSlot(
|
||||||
|
plugin.configYml.getInt("gui.prev-page.location.row"),
|
||||||
|
plugin.configYml.getInt("gui.prev-page.location.column"),
|
||||||
|
slot(
|
||||||
|
ItemStackBuilder(Items.lookup(plugin.configYml.getString("gui.prev-page.item")))
|
||||||
|
.setDisplayName(plugin.configYml.getString("gui.prev-page.name"))
|
||||||
|
.build()
|
||||||
|
) {
|
||||||
|
onLeftClick { event, _, menu ->
|
||||||
|
val player = event.whoClicked as Player
|
||||||
|
val page = getPage(menu, player)
|
||||||
|
|
||||||
|
val newPage = max(1, page - 1)
|
||||||
|
|
||||||
|
menu.setState(player, pageKey, newPage)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
setSlot(
|
||||||
|
plugin.configYml.getInt("gui.next-page.location.row"),
|
||||||
|
plugin.configYml.getInt("gui.next-page.location.column"),
|
||||||
|
slot(
|
||||||
|
ItemStackBuilder(Items.lookup(plugin.configYml.getString("gui.next-page.item")))
|
||||||
|
.setDisplayName(plugin.configYml.getString("gui.next-page.name"))
|
||||||
|
.build()
|
||||||
|
) {
|
||||||
|
onLeftClick { event, _, menu ->
|
||||||
|
val player = event.whoClicked as Player
|
||||||
|
|
||||||
|
val pages = ceil(Pets.values()
|
||||||
|
.filter { player.getPetLevel(it) > 0 }
|
||||||
|
.size.toDouble() / petAreaSlots.size).toInt()
|
||||||
|
|
||||||
|
val page = getPage(menu, player)
|
||||||
|
|
||||||
|
val newPage = min(pages, page + 1)
|
||||||
|
|
||||||
|
menu.setState(player, pageKey, newPage)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
setSlot(plugin.configYml.getInt("gui.close.location.row"),
|
setSlot(plugin.configYml.getInt("gui.close.location.row"),
|
||||||
plugin.configYml.getInt("gui.close.location.column"),
|
plugin.configYml.getInt("gui.close.location.column"),
|
||||||
slot(
|
slot(
|
||||||
@@ -127,6 +201,14 @@ object PetsGUI {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
for (config in plugin.configYml.getSubsections("gui.custom-slots")) {
|
||||||
|
setSlot(
|
||||||
|
config.getInt("row"),
|
||||||
|
config.getInt("column"),
|
||||||
|
ConfigSlot(config)
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.willfp.ecopets.pets.entity
|
||||||
|
|
||||||
|
import com.ticxo.modelengine.api.ModelEngineAPI
|
||||||
|
import com.willfp.ecopets.EcoPetsPlugin
|
||||||
|
import com.willfp.ecopets.pets.Pet
|
||||||
|
import org.bukkit.Location
|
||||||
|
import org.bukkit.entity.ArmorStand
|
||||||
|
|
||||||
|
class ModelEnginePetEntity(
|
||||||
|
pet: Pet,
|
||||||
|
private val modelID: String,
|
||||||
|
private val plugin: EcoPetsPlugin
|
||||||
|
) : PetEntity(pet) {
|
||||||
|
override fun spawn(location: Location): ArmorStand {
|
||||||
|
val stand = emptyArmorStandAt(location, pet)
|
||||||
|
val meAnimation = pet.modelEngineAnimation
|
||||||
|
|
||||||
|
val model = ModelEngineAPI.createActiveModel(modelID)
|
||||||
|
|
||||||
|
if (meAnimation != null) {
|
||||||
|
val animationHandler = model.animationHandler
|
||||||
|
val animationProperty = animationHandler.getAnimation(meAnimation)
|
||||||
|
|
||||||
|
if (animationProperty != null) {
|
||||||
|
animationHandler.playAnimation(animationProperty, true)
|
||||||
|
} else {
|
||||||
|
plugin.logger.warning("Animation $meAnimation not found in model $modelID, defaulting to walk!")
|
||||||
|
val animationPropertyWalk = animationHandler.getAnimation("walk")
|
||||||
|
if (animationPropertyWalk != null) {
|
||||||
|
animationHandler.playAnimation(animationPropertyWalk, true)
|
||||||
|
} else {
|
||||||
|
plugin.logger.warning("Walk animation not found in $modelID!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val modelled = ModelEngineAPI.createModeledEntity(stand)
|
||||||
|
modelled.addModel(model, true)
|
||||||
|
|
||||||
|
return stand
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.willfp.ecopets.pets.entity
|
||||||
|
|
||||||
|
import com.willfp.ecopets.pets.Pet
|
||||||
|
import org.bukkit.Location
|
||||||
|
import org.bukkit.entity.ArmorStand
|
||||||
|
import org.bukkit.entity.EntityType
|
||||||
|
import org.bukkit.inventory.EquipmentSlot
|
||||||
|
|
||||||
|
abstract class PetEntity(
|
||||||
|
val pet: Pet
|
||||||
|
) {
|
||||||
|
abstract fun spawn(location: Location): ArmorStand
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private val registrations = mutableMapOf<String, (Pet, String) -> PetEntity>()
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
|
fun registerPetEntity(id: String, parse: (Pet, String) -> PetEntity) {
|
||||||
|
registrations[id] = parse
|
||||||
|
}
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
|
fun create(pet: Pet): PetEntity {
|
||||||
|
val texture = pet.entityTexture
|
||||||
|
|
||||||
|
if (!texture.contains(":")) {
|
||||||
|
return SkullPetEntity(pet)
|
||||||
|
}
|
||||||
|
|
||||||
|
val id = texture.split(":")[0]
|
||||||
|
val parse = registrations[id] ?: return SkullPetEntity(pet)
|
||||||
|
return parse(pet, texture.removePrefix("$id:"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun emptyArmorStandAt(location: Location, pet: Pet): ArmorStand {
|
||||||
|
val stand = location.world!!.spawnEntity(location, EntityType.ARMOR_STAND) as ArmorStand
|
||||||
|
|
||||||
|
stand.isVisible = false
|
||||||
|
stand.isInvulnerable = true
|
||||||
|
stand.isSmall = true
|
||||||
|
stand.setGravity(false)
|
||||||
|
stand.isCollidable = false
|
||||||
|
stand.isPersistent = false
|
||||||
|
|
||||||
|
for (slot in EquipmentSlot.values()) {
|
||||||
|
stand.addEquipmentLock(slot, ArmorStand.LockType.ADDING_OR_CHANGING)
|
||||||
|
}
|
||||||
|
|
||||||
|
stand.isCustomNameVisible = true
|
||||||
|
stand.customName = pet.name
|
||||||
|
|
||||||
|
return stand
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.willfp.ecopets.pets.entity
|
||||||
|
|
||||||
|
import com.willfp.eco.core.items.builder.SkullBuilder
|
||||||
|
import com.willfp.ecopets.pets.Pet
|
||||||
|
import org.bukkit.Location
|
||||||
|
import org.bukkit.entity.ArmorStand
|
||||||
|
import org.bukkit.inventory.ItemStack
|
||||||
|
|
||||||
|
class SkullPetEntity(pet: Pet) : PetEntity(pet) {
|
||||||
|
override fun spawn(location: Location): ArmorStand {
|
||||||
|
val stand = emptyArmorStandAt(location, pet)
|
||||||
|
|
||||||
|
val skull: ItemStack = SkullBuilder()
|
||||||
|
.setSkullTexture(pet.entityTexture)
|
||||||
|
.build()
|
||||||
|
|
||||||
|
stand.equipment?.helmet = skull
|
||||||
|
|
||||||
|
return stand
|
||||||
|
}
|
||||||
|
}
|
||||||
21
eco-core/core-plugin/src/main/resources/chains.yml
Normal file
21
eco-core/core-plugin/src/main/resources/chains.yml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Read more about chains: https://plugins.auxilor.io/effects/configuring-an-effect#effect-chains
|
||||||
|
|
||||||
|
chains:
|
||||||
|
- id: example_chain
|
||||||
|
effects:
|
||||||
|
- id: teleport
|
||||||
|
- id: potion_effect
|
||||||
|
args:
|
||||||
|
effect: blindness
|
||||||
|
level: 3
|
||||||
|
duration: 30
|
||||||
|
apply_to_player: true
|
||||||
|
- id: send_message
|
||||||
|
args:
|
||||||
|
message: "&fYou have been teleported!"
|
||||||
|
action_bar: true
|
||||||
|
- id: play_sound
|
||||||
|
args:
|
||||||
|
sound: entity_dragon_fireball_explode
|
||||||
|
pitch: 1.5
|
||||||
|
volume: 4
|
||||||
@@ -3,6 +3,8 @@
|
|||||||
# by Auxilor
|
# by Auxilor
|
||||||
#
|
#
|
||||||
|
|
||||||
|
discover-recipes: true
|
||||||
|
|
||||||
gui:
|
gui:
|
||||||
rows: 6
|
rows: 6
|
||||||
|
|
||||||
@@ -25,7 +27,7 @@ gui:
|
|||||||
- "100000001"
|
- "100000001"
|
||||||
- "100000001"
|
- "100000001"
|
||||||
- "100000001"
|
- "100000001"
|
||||||
- "101101111"
|
- "101000111"
|
||||||
|
|
||||||
pet-area:
|
pet-area:
|
||||||
top-left:
|
top-left:
|
||||||
@@ -86,6 +88,20 @@ gui:
|
|||||||
sound: ui_button_click
|
sound: ui_button_click
|
||||||
pitch: 1
|
pitch: 1
|
||||||
|
|
||||||
|
prev-page:
|
||||||
|
item: arrow
|
||||||
|
name: "&fPrevious Page"
|
||||||
|
location:
|
||||||
|
row: 6
|
||||||
|
column: 4
|
||||||
|
|
||||||
|
next-page:
|
||||||
|
item: arrow
|
||||||
|
name: "&fNext Page"
|
||||||
|
location:
|
||||||
|
row: 6
|
||||||
|
column: 6
|
||||||
|
|
||||||
close:
|
close:
|
||||||
item: barrier
|
item: barrier
|
||||||
name: "&cClose"
|
name: "&cClose"
|
||||||
@@ -100,6 +116,9 @@ gui:
|
|||||||
row: 6
|
row: 6
|
||||||
column: 2
|
column: 2
|
||||||
|
|
||||||
|
# Custom GUI slots; see here for a how-to: https://plugins.auxilor.io/all-plugins/custom-gui-slots
|
||||||
|
custom-slots: [ ]
|
||||||
|
|
||||||
level-gui:
|
level-gui:
|
||||||
rows: 6
|
rows: 6
|
||||||
|
|
||||||
@@ -194,6 +213,9 @@ level-gui:
|
|||||||
row: 6
|
row: 6
|
||||||
column: 5
|
column: 5
|
||||||
|
|
||||||
|
# Custom GUI slots; see here for a how-to: https://plugins.auxilor.io/all-plugins/custom-gui-slots
|
||||||
|
custom-slots: [ ]
|
||||||
|
|
||||||
pet-entity:
|
pet-entity:
|
||||||
name: "%player%&f's %pet%&f (Lvl. %level%)"
|
name: "%player%&f's %pet%&f (Lvl. %level%)"
|
||||||
|
|
||||||
@@ -202,7 +224,7 @@ level-up:
|
|||||||
enabled: true
|
enabled: true
|
||||||
message:
|
message:
|
||||||
- "&f"
|
- "&f"
|
||||||
- " &#d977c2You levelled up your %pet%&#d977c2 petW to &eLevel %level%&#d977c2!"
|
- " &#d977c2You levelled up your %pet%&#d977c2 pet to &eLevel %level%&#d977c2!"
|
||||||
- "&f"
|
- "&f"
|
||||||
- " &#d977c2&lREWARDS:"
|
- " &#d977c2&lREWARDS:"
|
||||||
- " %level_up_messages%"
|
- " %level_up_messages%"
|
||||||
@@ -236,12 +258,18 @@ cannot-afford-type:
|
|||||||
sound: "BLOCK_NOTE_BLOCK_PLING"
|
sound: "BLOCK_NOTE_BLOCK_PLING"
|
||||||
pitch: 0.5
|
pitch: 0.5
|
||||||
|
|
||||||
|
cannot-afford-price:
|
||||||
|
in-actionbar: true
|
||||||
|
sound:
|
||||||
|
enabled: true
|
||||||
|
sound: "BLOCK_NOTE_BLOCK_PLING"
|
||||||
|
pitch: 0.5
|
||||||
|
|
||||||
point-names: # If you have point names that look ugly (eg g_souls) then you can map them to nice names to be shown to players.
|
point-names: # If you have point names that look ugly (eg g_souls) then you can map them to nice names to be shown to players.
|
||||||
example_point: "Nicely Formatted Point"
|
example_point: "Nicely Formatted Point"
|
||||||
|
|
||||||
use-faster-move-trigger: true # Disable if you want move trigger to detect sub-1-block movements
|
use-faster-move-trigger: true # Disable if you want move trigger to detect sub-1-block movements
|
||||||
raytrace-distance: 80 # The distance that alt_click should check for a location
|
raytrace-distance: 80 # The distance that alt_click should check for a location
|
||||||
block-item-drop-place-check: true # If the block_item_drop trigger should only fire on naturally placed blocks (prevents dupes)
|
|
||||||
|
|
||||||
potions:
|
potions:
|
||||||
icon:
|
icon:
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
resource-id: 0
|
resource-id: 2534
|
||||||
bstats-id: 15502
|
bstats-id: 15502
|
||||||
color: "&#d977c2"
|
color: "&#d977c2"
|
||||||
@@ -6,16 +6,36 @@ messages:
|
|||||||
reloaded: "Reloaded!"
|
reloaded: "Reloaded!"
|
||||||
cannot-afford: "&cYou can't afford to do this! &fCost: &a$$%cost%"
|
cannot-afford: "&cYou can't afford to do this! &fCost: &a$$%cost%"
|
||||||
cannot-afford-type: "&cYou can't afford to do this! &fCost: &a%cost% %type%"
|
cannot-afford-type: "&cYou can't afford to do this! &fCost: &a%cost% %type%"
|
||||||
|
cannot-afford-price: "&cYou can't afford to do this! &fPrice: %price%"
|
||||||
on-cooldown: "&cThis effect is on cooldown! &fTime left: &a%seconds% seconds"
|
on-cooldown: "&cThis effect is on cooldown! &fTime left: &a%seconds% seconds"
|
||||||
cannot-transmit: "&cYou can't transmit here!"
|
cannot-transmit: "&cYou can't transmit here!"
|
||||||
|
must-specify-lrcdb-id: "&cYou must specify the ID of the config to download! Not sure what this means? Go to &alrcdb.auxilor.io"
|
||||||
|
lrcdb-import-error: "&cError importing config: &f%message%"
|
||||||
|
lrcdb-import-success: "&fImported &a%name%&f! Reload the plugin to install it"
|
||||||
|
must-specify-config-name: "&cYou must specify the config name!"
|
||||||
|
invalid-config-name: "&cInvalid config name!"
|
||||||
|
lrcdb-export-error: "&cError exporting config: &f%message%"
|
||||||
|
lrcdb-export-success: "&fExported &a%name%&f! View it on &alrcdb.auxilor.io&f, or share your config ID: &f%id%"
|
||||||
|
|
||||||
needs-player: "&cYou must specify a player!"
|
needs-player: "&cYou must specify a player!"
|
||||||
|
gave-xp: "&fYou have given &a%xp% &fXP to %player%&f's %pet%&f!"
|
||||||
|
reset-xp: "&fYou have reset %player%&f's %pet%&f XP!"
|
||||||
needs-pet: "&cYou must specify a pet!"
|
needs-pet: "&cYou must specify a pet!"
|
||||||
|
need-amount: "&cYou must specify a amount!"
|
||||||
invalid-player: "&cInvalid player!"
|
invalid-player: "&cInvalid player!"
|
||||||
invalid-pet: "&cInvalid pet!"
|
invalid-pet: "&cInvalid pet!"
|
||||||
already-has-pet: "&cPlayer already has this pet!"
|
already-has-pet: "&cPlayer already has this pet!"
|
||||||
|
doesnt-have-pet: "&cPlayer doesn't have this pet!"
|
||||||
gave-pet: "&fSuccessfully gave %player%&f the %pet%&f pet!"
|
gave-pet: "&fSuccessfully gave %player%&f the %pet%&f pet!"
|
||||||
gave-pet-egg: "&fSuccessfully gave %player%&f the %pet%&f pet egg!"
|
gave-pet-egg: "&fSuccessfully gave %player%&f the %pet%&f pet egg!"
|
||||||
cannot-spawn-pet: "&cYou already have this pet unlocked!"
|
cannot-spawn-pet: "&cYou already have this pet unlocked!"
|
||||||
|
invalid-amount: "&cInvalid amount!"
|
||||||
|
pet-already-active: "&cYou already have this pet active!"
|
||||||
|
no-pet-active: "&cYou don't have a pet active!"
|
||||||
|
activated-pet: "&fYou have activated the %pet%&f pet!"
|
||||||
|
deactivated-pet: "&fYou have deactivated the %pet%&f pet!"
|
||||||
|
|
||||||
menu:
|
menu:
|
||||||
title: "Pets"
|
title: "Pets"
|
||||||
|
|
||||||
|
infinity: "∞"
|
||||||
|
|||||||
19
eco-core/core-plugin/src/main/resources/lrcdb.yml
Normal file
19
eco-core/core-plugin/src/main/resources/lrcdb.yml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# Options for lrcdb (https://lrcdb.auxilor.io), a website to share configs
|
||||||
|
# with other server owners, so you can get more configs without making them
|
||||||
|
# yourself!
|
||||||
|
|
||||||
|
author: "Unknown Author" # The name attached to configs you export
|
||||||
|
|
||||||
|
# Options about automatically sharing configs you create
|
||||||
|
share-configs:
|
||||||
|
# If you want all your configs to automatically be publicly available,
|
||||||
|
# set this to true. This really helps out other users!
|
||||||
|
publicly: false
|
||||||
|
|
||||||
|
# If you don't want your configs to be usable to gather information about
|
||||||
|
# plugin usage or to improve the plugins in the future, disable this.
|
||||||
|
# Nothing identifying is shared.
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
# If you disable share-configs, you can still share select configs publicly
|
||||||
|
# with /ecopets export <config>.
|
||||||
@@ -1,129 +0,0 @@
|
|||||||
pets:
|
|
||||||
- id: tiger
|
|
||||||
|
|
||||||
# The display name of the pet
|
|
||||||
name: "&6Tiger"
|
|
||||||
|
|
||||||
# The description of the pet
|
|
||||||
description: "&8&oLevel up by dealing melee damage"
|
|
||||||
|
|
||||||
# The xp requirements for each pet level - add new levels by adding more to this list
|
|
||||||
level-xp-requirements:
|
|
||||||
- 50
|
|
||||||
- 125
|
|
||||||
- 200
|
|
||||||
- 300
|
|
||||||
- 500
|
|
||||||
- 750
|
|
||||||
- 1000
|
|
||||||
- 1500
|
|
||||||
- 2000
|
|
||||||
- 3500
|
|
||||||
- 5000
|
|
||||||
- 7500
|
|
||||||
- 10000
|
|
||||||
- 15000
|
|
||||||
- 20000
|
|
||||||
- 30000
|
|
||||||
- 50000
|
|
||||||
- 75000
|
|
||||||
- 100000
|
|
||||||
- 200000
|
|
||||||
- 300000
|
|
||||||
- 400000
|
|
||||||
- 500000
|
|
||||||
- 600000
|
|
||||||
- 700000
|
|
||||||
- 800000
|
|
||||||
- 900000
|
|
||||||
- 1000000
|
|
||||||
- 1100000
|
|
||||||
- 1200000
|
|
||||||
- 1300000
|
|
||||||
- 1400000
|
|
||||||
- 1500000
|
|
||||||
- 1600000
|
|
||||||
- 1700000
|
|
||||||
- 1800000
|
|
||||||
- 1900000
|
|
||||||
- 2000000
|
|
||||||
- 2100000
|
|
||||||
- 2200000
|
|
||||||
- 2300000
|
|
||||||
- 2400000
|
|
||||||
- 2500000
|
|
||||||
- 2600000
|
|
||||||
- 2750000
|
|
||||||
- 2900000
|
|
||||||
- 3100000
|
|
||||||
- 3400000
|
|
||||||
- 3700000
|
|
||||||
|
|
||||||
# An XP Gain method takes a trigger as the ID and a multiplier
|
|
||||||
# The multiplier takes the value produced by the trigger and multiplies it
|
|
||||||
# by some value to calculate the experience that should be given
|
|
||||||
xp-gain-methods:
|
|
||||||
- id: melee_attack
|
|
||||||
multiplier: 0.5
|
|
||||||
|
|
||||||
# Custom placeholders to be used in descriptions,
|
|
||||||
# Don't add % to the IDs, this is done automatically
|
|
||||||
# The value takes a %level% placeholder and is a mathetmatical expression
|
|
||||||
level-placeholders:
|
|
||||||
- id: "damage_multiplier"
|
|
||||||
value: "%level%"
|
|
||||||
|
|
||||||
# The text shown with the %effects% placeholder
|
|
||||||
# The number dictates the minimum level for this text to show for
|
|
||||||
# Adding new levels will override this text on those levels or above
|
|
||||||
effects-description:
|
|
||||||
1:
|
|
||||||
- "&8» &8Gives a &a+%damage_multiplier%%&8 bonus to"
|
|
||||||
- " &8melee damage"
|
|
||||||
|
|
||||||
# Same as above, but for %rewards%
|
|
||||||
rewards-description:
|
|
||||||
1:
|
|
||||||
- "&8» &8Gives a &a+%damage_multiplier%%&8 bonus to"
|
|
||||||
- " &8melee damage"
|
|
||||||
|
|
||||||
# Same as above, but for %level_up_messages%
|
|
||||||
level-up-messages:
|
|
||||||
1:
|
|
||||||
- "&8» &8Gives a &a+%damage_multiplier%%&8 bonus to"
|
|
||||||
- " &8melee damage"
|
|
||||||
|
|
||||||
# Commands to be sent on levelup, can be formatted two ways:
|
|
||||||
# level:command (e.g. 10:eco give %player% 1000), which would execute that command for level 10
|
|
||||||
# command (e.g. eco give %player% 5000), which would execute that command for all levels
|
|
||||||
level-commands: [ ]
|
|
||||||
|
|
||||||
# The effects for the pet, has %level% as a placeholder
|
|
||||||
effects:
|
|
||||||
- id: damage_multiplier
|
|
||||||
args:
|
|
||||||
multiplier: "%level% * 0.01 + 1"
|
|
||||||
triggers:
|
|
||||||
- melee_attack
|
|
||||||
|
|
||||||
# The conditions for the pet, also has %level% as a placeholder
|
|
||||||
conditions: [ ]
|
|
||||||
|
|
||||||
# The texture of the pet entity in game
|
|
||||||
entity-texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTA5NWZjYzFlM2Q3Y2JkMzUwZjE5YjM4OTQ5OGFiOGJiOTZjNjVhZDE4NWQzNDU5MjA2N2E3ZDAzM2FjNDhkZSJ9fX0="
|
|
||||||
|
|
||||||
# The icon in GUIs
|
|
||||||
icon: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTA5NWZjYzFlM2Q3Y2JkMzUwZjE5YjM4OTQ5OGFiOGJiOTZjNjVhZDE4NWQzNDU5MjA2N2E3ZDAzM2FjNDhkZSJ9fX0=
|
|
||||||
|
|
||||||
# The spawn egg
|
|
||||||
spawn-egg:
|
|
||||||
enabled: true # If the pet should have a spawn egg
|
|
||||||
item: blaze_spawn_egg unbreaking:1 hide_enchants
|
|
||||||
name: "&6Tiger&f Spawn Egg"
|
|
||||||
lore:
|
|
||||||
- ""
|
|
||||||
- "&8&oPlace on the ground to"
|
|
||||||
- "&8&ounlock the &r&6Tiger&8&o pet!"
|
|
||||||
craftable: false
|
|
||||||
recipe: [ ]
|
|
||||||
# recipe-permission: ecopets.craft.tiger
|
|
||||||
135
eco-core/core-plugin/src/main/resources/pets/_example.yml
Normal file
135
eco-core/core-plugin/src/main/resources/pets/_example.yml
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
# The ID of the pet is the name of the .yml file,
|
||||||
|
# for example vampire.yml has the ID of vampire
|
||||||
|
# You can place pets anywhere in this folder,
|
||||||
|
# including in subfolders if you want to organize your pet configs
|
||||||
|
# _example.yml is not loaded.
|
||||||
|
|
||||||
|
# The display name of the pet
|
||||||
|
name: "&6Tiger"
|
||||||
|
|
||||||
|
# The description of the pet
|
||||||
|
description: "&8&oLevel up by dealing melee damage"
|
||||||
|
|
||||||
|
# The xp requirements for each pet level - add new levels by adding more to this list
|
||||||
|
level-xp-requirements:
|
||||||
|
- 50
|
||||||
|
- 125
|
||||||
|
- 200
|
||||||
|
- 300
|
||||||
|
- 500
|
||||||
|
- 750
|
||||||
|
- 1000
|
||||||
|
- 1500
|
||||||
|
- 2000
|
||||||
|
- 3500
|
||||||
|
- 5000
|
||||||
|
- 7500
|
||||||
|
- 10000
|
||||||
|
- 15000
|
||||||
|
- 20000
|
||||||
|
- 30000
|
||||||
|
- 50000
|
||||||
|
- 75000
|
||||||
|
- 100000
|
||||||
|
- 200000
|
||||||
|
- 300000
|
||||||
|
- 400000
|
||||||
|
- 500000
|
||||||
|
- 600000
|
||||||
|
- 700000
|
||||||
|
- 800000
|
||||||
|
- 900000
|
||||||
|
- 1000000
|
||||||
|
- 1100000
|
||||||
|
- 1200000
|
||||||
|
- 1300000
|
||||||
|
- 1400000
|
||||||
|
- 1500000
|
||||||
|
- 1600000
|
||||||
|
- 1700000
|
||||||
|
- 1800000
|
||||||
|
- 1900000
|
||||||
|
- 2000000
|
||||||
|
- 2100000
|
||||||
|
- 2200000
|
||||||
|
- 2300000
|
||||||
|
- 2400000
|
||||||
|
- 2500000
|
||||||
|
- 2600000
|
||||||
|
- 2750000
|
||||||
|
- 2900000
|
||||||
|
- 3100000
|
||||||
|
- 3400000
|
||||||
|
- 3700000
|
||||||
|
|
||||||
|
# An XP Gain method takes a trigger as the ID and a multiplier
|
||||||
|
# The multiplier takes the value produced by the trigger and multiplies it
|
||||||
|
# by some value to calculate the experience that should be given
|
||||||
|
xp-gain-methods:
|
||||||
|
- id: melee_attack
|
||||||
|
multiplier: 0.5
|
||||||
|
conditions: [ ] # You can add a list of conditions that must be met on xp gain
|
||||||
|
|
||||||
|
# Custom placeholders to be used in descriptions,
|
||||||
|
# Don't add % to the IDs, this is done automatically
|
||||||
|
# The value takes a %level% placeholder and is a mathetmatical expression
|
||||||
|
level-placeholders:
|
||||||
|
- id: "damage_multiplier"
|
||||||
|
value: "%level%"
|
||||||
|
|
||||||
|
# The text shown with the %effects% placeholder
|
||||||
|
# The number dictates the minimum level for this text to show for
|
||||||
|
# Adding new levels will override this text on those levels or above
|
||||||
|
effects-description:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%damage_multiplier%%&8 bonus to"
|
||||||
|
- " &8melee damage"
|
||||||
|
|
||||||
|
# Same as above, but for %rewards%
|
||||||
|
rewards-description:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%damage_multiplier%%&8 bonus to"
|
||||||
|
- " &8melee damage"
|
||||||
|
|
||||||
|
# Same as above, but for %level_up_messages%
|
||||||
|
level-up-messages:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%damage_multiplier%%&8 bonus to"
|
||||||
|
- " &8melee damage"
|
||||||
|
|
||||||
|
# Commands to be sent on levelup, can be formatted two ways:
|
||||||
|
# level:command (e.g. 10:eco give %player% 1000), which would execute that command for level 10
|
||||||
|
# command (e.g. eco give %player% 5000), which would execute that command for all levels
|
||||||
|
level-commands: [ ]
|
||||||
|
|
||||||
|
# The effects for the pet, has %level% as a placeholder
|
||||||
|
effects:
|
||||||
|
- id: damage_multiplier
|
||||||
|
args:
|
||||||
|
multiplier: "%level% * 0.01 + 1"
|
||||||
|
triggers:
|
||||||
|
- melee_attack
|
||||||
|
|
||||||
|
# The conditions for the pet, also has %level% as a placeholder
|
||||||
|
conditions: [ ]
|
||||||
|
|
||||||
|
# The texture of the pet entity in game
|
||||||
|
# If you're using modelengine, use modelengine:id as the texture
|
||||||
|
entity-texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTA5NWZjYzFlM2Q3Y2JkMzUwZjE5YjM4OTQ5OGFiOGJiOTZjNjVhZDE4NWQzNDU5MjA2N2E3ZDAzM2FjNDhkZSJ9fX0="
|
||||||
|
modelengine-animation: "fly" # If you're using ModelEngine, you can specify an animation here
|
||||||
|
|
||||||
|
# The icon in GUIs
|
||||||
|
icon: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTA5NWZjYzFlM2Q3Y2JkMzUwZjE5YjM4OTQ5OGFiOGJiOTZjNjVhZDE4NWQzNDU5MjA2N2E3ZDAzM2FjNDhkZSJ9fX0=
|
||||||
|
|
||||||
|
# The spawn egg
|
||||||
|
spawn-egg:
|
||||||
|
enabled: true # If the pet should have a spawn egg
|
||||||
|
item: blaze_spawn_egg unbreaking:1 hide_enchants
|
||||||
|
name: "&6Tiger&f Pet Spawn Egg"
|
||||||
|
lore:
|
||||||
|
- ""
|
||||||
|
- "&8&oPlace on the ground to"
|
||||||
|
- "&8&ounlock the &r&6Tiger&8&o pet!"
|
||||||
|
craftable: false
|
||||||
|
recipe: [ ]
|
||||||
|
# recipe-permission: ecopets.craft.tiger
|
||||||
81
eco-core/core-plugin/src/main/resources/pets/blaze.yml
Normal file
81
eco-core/core-plugin/src/main/resources/pets/blaze.yml
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
name: "&#FF6600Blaze"
|
||||||
|
description: "&7Earn more XP from killing mobs"
|
||||||
|
level-xp-requirements:
|
||||||
|
- 50
|
||||||
|
- 125
|
||||||
|
- 200
|
||||||
|
- 300
|
||||||
|
- 500
|
||||||
|
- 750
|
||||||
|
- 1000
|
||||||
|
- 1500
|
||||||
|
- 2000
|
||||||
|
- 3500
|
||||||
|
- 5000
|
||||||
|
- 7500
|
||||||
|
- 10000
|
||||||
|
- 15000
|
||||||
|
- 20000
|
||||||
|
- 30000
|
||||||
|
- 50000
|
||||||
|
- 75000
|
||||||
|
- 100000
|
||||||
|
- 200000
|
||||||
|
- 300000
|
||||||
|
- 400000
|
||||||
|
- 500000
|
||||||
|
- 600000
|
||||||
|
- 700000
|
||||||
|
- 800000
|
||||||
|
- 900000
|
||||||
|
- 1000000
|
||||||
|
- 1100000
|
||||||
|
- 1200000
|
||||||
|
- 1300000
|
||||||
|
- 1400000
|
||||||
|
- 1500000
|
||||||
|
- 1600000
|
||||||
|
- 1700000
|
||||||
|
- 1800000
|
||||||
|
- 1900000
|
||||||
|
- 2000000
|
||||||
|
- 2100000
|
||||||
|
- 2200000
|
||||||
|
- 2300000
|
||||||
|
- 2400000
|
||||||
|
- 2500000
|
||||||
|
- 2600000
|
||||||
|
- 2750000
|
||||||
|
- 2900000
|
||||||
|
- 3100000
|
||||||
|
- 3400000
|
||||||
|
- 3700000
|
||||||
|
xp-gain-methods:
|
||||||
|
- id: kill
|
||||||
|
multiplier: 1
|
||||||
|
level-placeholders:
|
||||||
|
- id: "xp_multiplier"
|
||||||
|
value: "%level% * 2"
|
||||||
|
effects-description:
|
||||||
|
1:
|
||||||
|
- "&6» &7Increased XP gain by %xp_multiplier%%!"
|
||||||
|
rewards-description: []
|
||||||
|
level-up-messages: []
|
||||||
|
level-commands: []
|
||||||
|
effects:
|
||||||
|
- id: xp_multiplier
|
||||||
|
args:
|
||||||
|
multiplier: "%level% * 0.02 + 1"
|
||||||
|
entity-texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjIwNjU3ZTI0YjU2ZTFiMmY4ZmMyMTlkYTFkZTc4OGMwYzI0ZjM2Mzg4YjFhNDA5ZDBjZDJkOGRiYTQ0YWEzYiJ9fX0="
|
||||||
|
icon: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjIwNjU3ZTI0YjU2ZTFiMmY4ZmMyMTlkYTFkZTc4OGMwYzI0ZjM2Mzg4YjFhNDA5ZDBjZDJkOGRiYTQ0YWEzYiJ9fX0=
|
||||||
|
spawn-egg:
|
||||||
|
enabled: true # If the pet should have a spawn egg
|
||||||
|
item: blaze_spawn_egg unbreaking:1 hide_enchants
|
||||||
|
name: "&#FF6600Blaze &fSpawn Egg"
|
||||||
|
lore:
|
||||||
|
- ""
|
||||||
|
- "&8&oPlace on the ground to"
|
||||||
|
- "&8&ounlock the &#FF6600Blaze pet!"
|
||||||
|
craftable: false
|
||||||
|
recipe: []
|
||||||
|
recipe-permission: ecopets.craft.blaze
|
||||||
104
eco-core/core-plugin/src/main/resources/pets/mancubus.yml
Normal file
104
eco-core/core-plugin/src/main/resources/pets/mancubus.yml
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
name: "&6Mancubus"
|
||||||
|
description: "&8&oLevel up by taking damage while on fire"
|
||||||
|
|
||||||
|
level-xp-requirements:
|
||||||
|
- 50
|
||||||
|
- 125
|
||||||
|
- 200
|
||||||
|
- 300
|
||||||
|
- 500
|
||||||
|
- 750
|
||||||
|
- 1000
|
||||||
|
- 1500
|
||||||
|
- 2000
|
||||||
|
- 3500
|
||||||
|
- 5000
|
||||||
|
- 7500
|
||||||
|
- 10000
|
||||||
|
- 15000
|
||||||
|
- 20000
|
||||||
|
- 30000
|
||||||
|
- 50000
|
||||||
|
- 75000
|
||||||
|
- 100000
|
||||||
|
- 200000
|
||||||
|
- 300000
|
||||||
|
- 400000
|
||||||
|
- 500000
|
||||||
|
- 600000
|
||||||
|
- 700000
|
||||||
|
- 800000
|
||||||
|
- 900000
|
||||||
|
- 1000000
|
||||||
|
- 1100000
|
||||||
|
- 1200000
|
||||||
|
- 1300000
|
||||||
|
- 1400000
|
||||||
|
- 1500000
|
||||||
|
- 1600000
|
||||||
|
- 1700000
|
||||||
|
- 1800000
|
||||||
|
- 1900000
|
||||||
|
- 2000000
|
||||||
|
- 2100000
|
||||||
|
- 2200000
|
||||||
|
- 2300000
|
||||||
|
- 2400000
|
||||||
|
- 2500000
|
||||||
|
- 2600000
|
||||||
|
- 2750000
|
||||||
|
- 2900000
|
||||||
|
- 3100000
|
||||||
|
- 3400000
|
||||||
|
- 3700000
|
||||||
|
|
||||||
|
xp-gain-methods:
|
||||||
|
- id: take_damage
|
||||||
|
multiplier: 0.5
|
||||||
|
conditions:
|
||||||
|
- id: on_fire
|
||||||
|
|
||||||
|
level-placeholders:
|
||||||
|
- id: "ignite_chance"
|
||||||
|
value: "1 - (%level% / 100)"
|
||||||
|
|
||||||
|
effects-description:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%ignite_chance%%&8 chance to set enemy on fire"
|
||||||
|
|
||||||
|
rewards-description:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%ignite_chance%%&8 chance to set enemy on fire"
|
||||||
|
|
||||||
|
level-up-messages:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%ignite_chance%%&8 chance to set enemy on fire"
|
||||||
|
|
||||||
|
level-commands: [ ]
|
||||||
|
|
||||||
|
effects:
|
||||||
|
- id: ignite
|
||||||
|
args:
|
||||||
|
damage_per_tick: 8
|
||||||
|
ticks: 300
|
||||||
|
chance: "%level%"
|
||||||
|
triggers:
|
||||||
|
- melee_attack
|
||||||
|
|
||||||
|
conditions: [ ]
|
||||||
|
|
||||||
|
entity-texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTA5NWZjYzFlM2Q3Y2JkMzUwZjE5YjM4OTQ5OGFiOGJiOTZjNjVhZDE4NWQzNDU5MjA2N2E3ZDAzM2FjNDhkZSJ9fX0="
|
||||||
|
|
||||||
|
icon: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTA5NWZjYzFlM2Q3Y2JkMzUwZjE5YjM4OTQ5OGFiOGJiOTZjNjVhZDE4NWQzNDU5MjA2N2E3ZDAzM2FjNDhkZSJ9fX0=
|
||||||
|
|
||||||
|
spawn-egg:
|
||||||
|
enabled: true # If the pet should have a spawn egg
|
||||||
|
item: magma_cube_spawn_egg unbreaking:1 hide_enchants
|
||||||
|
name: "&6Mancubus&f Spawn Egg"
|
||||||
|
lore:
|
||||||
|
- ""
|
||||||
|
- "&8&oPlace on the ground to"
|
||||||
|
- "&8&ounlock the &r&6Mancubus&8&o pet!"
|
||||||
|
craftable: false
|
||||||
|
recipe: [ ]
|
||||||
|
# recipe-permission: ecopets.craft.mancubus
|
||||||
97
eco-core/core-plugin/src/main/resources/pets/ravager.yml
Normal file
97
eco-core/core-plugin/src/main/resources/pets/ravager.yml
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
name: "<gradient:#1e3c72>Ravager</gradient:#2a5298>"
|
||||||
|
description: "&8&oLevel up by successfully defending against village raids"
|
||||||
|
|
||||||
|
level-xp-requirements:
|
||||||
|
- 50
|
||||||
|
- 150
|
||||||
|
- 300
|
||||||
|
- 500
|
||||||
|
- 750
|
||||||
|
- 1000
|
||||||
|
- 1300
|
||||||
|
- 1650
|
||||||
|
- 2050
|
||||||
|
- 2500
|
||||||
|
- 3000
|
||||||
|
- 3550
|
||||||
|
- 4150
|
||||||
|
- 4800
|
||||||
|
- 5500
|
||||||
|
- 6250
|
||||||
|
- 7050
|
||||||
|
- 7900
|
||||||
|
- 8800
|
||||||
|
- 9750
|
||||||
|
- 10750
|
||||||
|
- 11800
|
||||||
|
- 12900
|
||||||
|
- 14050
|
||||||
|
- 15250
|
||||||
|
- 16500
|
||||||
|
- 17800
|
||||||
|
- 19150
|
||||||
|
- 20550
|
||||||
|
- 22000
|
||||||
|
- 23500
|
||||||
|
- 25050
|
||||||
|
- 26650
|
||||||
|
- 28300
|
||||||
|
- 30000
|
||||||
|
- 31750
|
||||||
|
- 33550
|
||||||
|
- 35400
|
||||||
|
- 37300
|
||||||
|
- 39250
|
||||||
|
- 41250
|
||||||
|
- 43300
|
||||||
|
- 45400
|
||||||
|
- 47550
|
||||||
|
- 49700
|
||||||
|
- 51950
|
||||||
|
- 53250
|
||||||
|
- 55600
|
||||||
|
- 57000
|
||||||
|
|
||||||
|
xp-gain-methods:
|
||||||
|
- id: win_raid
|
||||||
|
multiplier: 50
|
||||||
|
|
||||||
|
level-placeholders:
|
||||||
|
- id: "health_boost"
|
||||||
|
value: "%level%"
|
||||||
|
|
||||||
|
effects-description:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%health_boost%%&8 bonus"
|
||||||
|
|
||||||
|
rewards-description:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%health_boost%%&8 bonus"
|
||||||
|
|
||||||
|
level-up-messages:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%health_boost%%&8 bonus"
|
||||||
|
|
||||||
|
level-commands: [ ]
|
||||||
|
|
||||||
|
effects:
|
||||||
|
- id: bonus_health
|
||||||
|
args:
|
||||||
|
health: "%level%"
|
||||||
|
|
||||||
|
conditions: [ ]
|
||||||
|
|
||||||
|
entity-texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2QyMGJmNTJlYzM5MGEwNzk5Mjk5MTg0ZmM2NzhiZjg0Y2Y3MzJiYjFiZDc4ZmQxYzRiNDQxODU4ZjAyMzVhOCJ9fX0="
|
||||||
|
|
||||||
|
icon: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2QyMGJmNTJlYzM5MGEwNzk5Mjk5MTg0ZmM2NzhiZjg0Y2Y3MzJiYjFiZDc4ZmQxYzRiNDQxODU4ZjAyMzVhOCJ9fX0=
|
||||||
|
|
||||||
|
spawn-egg:
|
||||||
|
enabled: true
|
||||||
|
item: ravager_spawn_egg unbreaking:1 hide_enchants
|
||||||
|
name: "<gradient:#1e3c72>Ravager</gradient:#2a5298>&f Pet Spawn Egg"
|
||||||
|
lore:
|
||||||
|
- ""
|
||||||
|
- "&8&oPlace on the ground to"
|
||||||
|
- "&8&ounlock the &r<gradient:#1e3c72>Ravager</gradient:#2a5298>&8&o pet!"
|
||||||
|
craftable: false
|
||||||
|
recipe: [ ]
|
||||||
120
eco-core/core-plugin/src/main/resources/pets/sea_serpent.yml
Normal file
120
eco-core/core-plugin/src/main/resources/pets/sea_serpent.yml
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
name: "&9Sea Serpent"
|
||||||
|
description: "&8&oIncrease swimming speed and damage in water. Level up by swimming"
|
||||||
|
|
||||||
|
level-xp-requirements:
|
||||||
|
- 50
|
||||||
|
- 125
|
||||||
|
- 200
|
||||||
|
- 300
|
||||||
|
- 500
|
||||||
|
- 750
|
||||||
|
- 1000
|
||||||
|
- 1500
|
||||||
|
- 2000
|
||||||
|
- 3500
|
||||||
|
- 5000
|
||||||
|
- 7500
|
||||||
|
- 10000
|
||||||
|
- 15000
|
||||||
|
- 20000
|
||||||
|
- 30000
|
||||||
|
- 50000
|
||||||
|
- 75000
|
||||||
|
- 100000
|
||||||
|
- 200000
|
||||||
|
- 300000
|
||||||
|
- 400000
|
||||||
|
- 500000
|
||||||
|
- 600000
|
||||||
|
- 700000
|
||||||
|
- 800000
|
||||||
|
- 900000
|
||||||
|
- 1000000
|
||||||
|
- 1100000
|
||||||
|
- 1200000
|
||||||
|
- 1300000
|
||||||
|
- 1400000
|
||||||
|
- 1500000
|
||||||
|
- 1600000
|
||||||
|
- 1700000
|
||||||
|
- 1800000
|
||||||
|
- 1900000
|
||||||
|
- 2000000
|
||||||
|
- 2100000
|
||||||
|
- 2200000
|
||||||
|
- 2300000
|
||||||
|
- 2400000
|
||||||
|
- 2500000
|
||||||
|
- 2600000
|
||||||
|
- 2750000
|
||||||
|
- 2900000
|
||||||
|
- 3100000
|
||||||
|
- 3400000
|
||||||
|
- 3700000
|
||||||
|
- 4000000
|
||||||
|
- 4500000
|
||||||
|
|
||||||
|
xp-gain-methods:
|
||||||
|
- id: move
|
||||||
|
multiplier: 0.5
|
||||||
|
conditions:
|
||||||
|
- id: is_sprinting
|
||||||
|
- id: in_water
|
||||||
|
|
||||||
|
level-placeholders:
|
||||||
|
- id: "multiplier"
|
||||||
|
value: "%level%"
|
||||||
|
|
||||||
|
effects-description:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%multiplier%%&8 bonus to"
|
||||||
|
- " &8melee damage when in water"
|
||||||
|
2:
|
||||||
|
- "&8» &8Gives a &a+%multiply_velocity%%&8 bonus to"
|
||||||
|
- " &8movement speed when in water"
|
||||||
|
|
||||||
|
rewards-description:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%multiplier%%&8 bonus to"
|
||||||
|
- " &8melee damage when in water"
|
||||||
|
2:
|
||||||
|
- "&8» &8Gives a &a+%multiply_velocity%%&8 bonus to"
|
||||||
|
- " &8movement speed when in water"
|
||||||
|
|
||||||
|
level-up-messages:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%multiplier%%&8 bonus to"
|
||||||
|
- " &8melee damage when in water"
|
||||||
|
2:
|
||||||
|
- "&8» &8Gives a &a+%multiply_velocity%%&8 bonus to"
|
||||||
|
- " &8movement speed when in water"
|
||||||
|
|
||||||
|
level-commands: [ ]
|
||||||
|
|
||||||
|
effects:
|
||||||
|
- id: damage_multiplier
|
||||||
|
args:
|
||||||
|
multiplier: "%level% * 0.01 + 1"
|
||||||
|
triggers:
|
||||||
|
- melee_attack
|
||||||
|
- id: movement_speed_multiplier
|
||||||
|
args:
|
||||||
|
multiplier: "%level% * 1.3 + 1"
|
||||||
|
|
||||||
|
conditions:
|
||||||
|
- id: in_water
|
||||||
|
|
||||||
|
entity-texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTA5NWZjYzFlM2Q3Y2JkMzUwZjE5YjM4OTQ5OGFiOGJiOTZjNjVhZDE4NWQzNDU5MjA2N2E3ZDAzM2FjNDhkZSJ9fX0="
|
||||||
|
|
||||||
|
icon: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTA5NWZjYzFlM2Q3Y2JkMzUwZjE5YjM4OTQ5OGFiOGJiOTZjNjVhZDE4NWQzNDU5MjA2N2E3ZDAzM2FjNDhkZSJ9fX0=
|
||||||
|
|
||||||
|
spawn-egg:
|
||||||
|
enabled: true # If the pet should have a spawn egg
|
||||||
|
item: drowned_spawn_egg unbreaking:1 hide_enchants
|
||||||
|
name: "&9Sea Serpent&f Spawn Egg"
|
||||||
|
lore:
|
||||||
|
- ""
|
||||||
|
- "&8&oPlace on the ground to"
|
||||||
|
- "&8&ounlock the &r&9Sea Serpent&8&o pet!"
|
||||||
|
craftable: false
|
||||||
|
recipe: [ ]
|
||||||
101
eco-core/core-plugin/src/main/resources/pets/skeleton.yml
Normal file
101
eco-core/core-plugin/src/main/resources/pets/skeleton.yml
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
name: "<gradient:#F2F2F2>Skeleton</gradient:#DBDBDB>"
|
||||||
|
description: "&8&oLevel up by dealing bow damage"
|
||||||
|
|
||||||
|
level-xp-requirements:
|
||||||
|
- 50
|
||||||
|
- 125
|
||||||
|
- 200
|
||||||
|
- 300
|
||||||
|
- 500
|
||||||
|
- 750
|
||||||
|
- 1000
|
||||||
|
- 1500
|
||||||
|
- 2000
|
||||||
|
- 3500
|
||||||
|
- 5000
|
||||||
|
- 7500
|
||||||
|
- 10000
|
||||||
|
- 15000
|
||||||
|
- 20000
|
||||||
|
- 30000
|
||||||
|
- 50000
|
||||||
|
- 75000
|
||||||
|
- 100000
|
||||||
|
- 200000
|
||||||
|
- 300000
|
||||||
|
- 400000
|
||||||
|
- 500000
|
||||||
|
- 600000
|
||||||
|
- 700000
|
||||||
|
- 800000
|
||||||
|
- 900000
|
||||||
|
- 1000000
|
||||||
|
- 1100000
|
||||||
|
- 1200000
|
||||||
|
- 1300000
|
||||||
|
- 1400000
|
||||||
|
- 1500000
|
||||||
|
- 1600000
|
||||||
|
- 1700000
|
||||||
|
- 1800000
|
||||||
|
- 1900000
|
||||||
|
- 2000000
|
||||||
|
- 2100000
|
||||||
|
- 2200000
|
||||||
|
- 2300000
|
||||||
|
- 2400000
|
||||||
|
- 2500000
|
||||||
|
- 2600000
|
||||||
|
- 2750000
|
||||||
|
- 2900000
|
||||||
|
- 3100000
|
||||||
|
- 3400000
|
||||||
|
- 3700000
|
||||||
|
|
||||||
|
xp-gain-methods:
|
||||||
|
- id: bow_attack
|
||||||
|
multiplier: 0.5
|
||||||
|
|
||||||
|
level-placeholders:
|
||||||
|
- id: "damage_multiplier"
|
||||||
|
value: "%level%"
|
||||||
|
|
||||||
|
effects-description:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%damage_multiplier%%&8 bonus to"
|
||||||
|
- " &8bow damage"
|
||||||
|
|
||||||
|
rewards-description:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%damage_multiplier%%&8 bonus to"
|
||||||
|
- " &8bow damage"
|
||||||
|
|
||||||
|
level-up-messages:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%damage_multiplier%%&8 bonus to"
|
||||||
|
- " &8bow damage"
|
||||||
|
|
||||||
|
level-commands: [ ]
|
||||||
|
|
||||||
|
effects:
|
||||||
|
- id: damage_multiplier
|
||||||
|
args:
|
||||||
|
multiplier: "%level% * 0.01 + 1"
|
||||||
|
triggers:
|
||||||
|
- bow_attack
|
||||||
|
conditions: [ ]
|
||||||
|
|
||||||
|
entity-texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOWQ0NmViNjQyZGMzYTRkZmJiNWFkNTI5N2VkYWUyOTk2ZWE0Y2ZmZjkyYWMyZWI1NmRmYWU5ZWUxZDU4ZTQwOCJ9fX0="
|
||||||
|
|
||||||
|
icon: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOWQ0NmViNjQyZGMzYTRkZmJiNWFkNTI5N2VkYWUyOTk2ZWE0Y2ZmZjkyYWMyZWI1NmRmYWU5ZWUxZDU4ZTQwOCJ9fX0=
|
||||||
|
|
||||||
|
spawn-egg:
|
||||||
|
enabled: true # If the pet should have a spawn egg
|
||||||
|
item: skeleton_spawn_egg unbreaking:1 hide_enchants
|
||||||
|
name: "<gradient:#F2F2F2>Skeleton</gradient:#DBDBDB>&f Pet Spawn Egg"
|
||||||
|
lore:
|
||||||
|
- ""
|
||||||
|
- "&8&oPlace on the ground to"
|
||||||
|
- "&8&ounlock the &r<gradient:#F2F2F2>Skeleton</gradient:#DBDBDB>&8&o pet!"
|
||||||
|
craftable: false
|
||||||
|
recipe: [ ]
|
||||||
103
eco-core/core-plugin/src/main/resources/pets/tiger.yml
Normal file
103
eco-core/core-plugin/src/main/resources/pets/tiger.yml
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
name: "&6Tiger"
|
||||||
|
description: "&8&oLevel up by dealing melee damage"
|
||||||
|
|
||||||
|
level-xp-requirements:
|
||||||
|
- 50
|
||||||
|
- 125
|
||||||
|
- 200
|
||||||
|
- 300
|
||||||
|
- 500
|
||||||
|
- 750
|
||||||
|
- 1000
|
||||||
|
- 1500
|
||||||
|
- 2000
|
||||||
|
- 3500
|
||||||
|
- 5000
|
||||||
|
- 7500
|
||||||
|
- 10000
|
||||||
|
- 15000
|
||||||
|
- 20000
|
||||||
|
- 30000
|
||||||
|
- 50000
|
||||||
|
- 75000
|
||||||
|
- 100000
|
||||||
|
- 200000
|
||||||
|
- 300000
|
||||||
|
- 400000
|
||||||
|
- 500000
|
||||||
|
- 600000
|
||||||
|
- 700000
|
||||||
|
- 800000
|
||||||
|
- 900000
|
||||||
|
- 1000000
|
||||||
|
- 1100000
|
||||||
|
- 1200000
|
||||||
|
- 1300000
|
||||||
|
- 1400000
|
||||||
|
- 1500000
|
||||||
|
- 1600000
|
||||||
|
- 1700000
|
||||||
|
- 1800000
|
||||||
|
- 1900000
|
||||||
|
- 2000000
|
||||||
|
- 2100000
|
||||||
|
- 2200000
|
||||||
|
- 2300000
|
||||||
|
- 2400000
|
||||||
|
- 2500000
|
||||||
|
- 2600000
|
||||||
|
- 2750000
|
||||||
|
- 2900000
|
||||||
|
- 3100000
|
||||||
|
- 3400000
|
||||||
|
- 3700000
|
||||||
|
|
||||||
|
xp-gain-methods:
|
||||||
|
- id: melee_attack
|
||||||
|
multiplier: 0.5
|
||||||
|
conditions: [ ]
|
||||||
|
|
||||||
|
level-placeholders:
|
||||||
|
- id: "damage_multiplier"
|
||||||
|
value: "%level%"
|
||||||
|
|
||||||
|
effects-description:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%damage_multiplier%%&8 bonus to"
|
||||||
|
- " &8melee damage"
|
||||||
|
|
||||||
|
rewards-description:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%damage_multiplier%%&8 bonus to"
|
||||||
|
- " &8melee damage"
|
||||||
|
|
||||||
|
level-up-messages:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%damage_multiplier%%&8 bonus to"
|
||||||
|
- " &8melee damage"
|
||||||
|
|
||||||
|
level-commands: [ ]
|
||||||
|
|
||||||
|
effects:
|
||||||
|
- id: damage_multiplier
|
||||||
|
args:
|
||||||
|
multiplier: "%level% * 0.01 + 1"
|
||||||
|
triggers:
|
||||||
|
- melee_attack
|
||||||
|
|
||||||
|
conditions: [ ]
|
||||||
|
|
||||||
|
entity-texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTA5NWZjYzFlM2Q3Y2JkMzUwZjE5YjM4OTQ5OGFiOGJiOTZjNjVhZDE4NWQzNDU5MjA2N2E3ZDAzM2FjNDhkZSJ9fX0="
|
||||||
|
|
||||||
|
icon: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTA5NWZjYzFlM2Q3Y2JkMzUwZjE5YjM4OTQ5OGFiOGJiOTZjNjVhZDE4NWQzNDU5MjA2N2E3ZDAzM2FjNDhkZSJ9fX0=
|
||||||
|
|
||||||
|
spawn-egg:
|
||||||
|
enabled: true
|
||||||
|
item: blaze_spawn_egg unbreaking:1 hide_enchants
|
||||||
|
name: "&6Tiger&f Pet Spawn Egg"
|
||||||
|
lore:
|
||||||
|
- ""
|
||||||
|
- "&8&oPlace on the ground to"
|
||||||
|
- "&8&ounlock the &r&6Tiger&8&o pet!"
|
||||||
|
craftable: false
|
||||||
|
recipe: [ ]
|
||||||
160
eco-core/core-plugin/src/main/resources/pets/vampire.yml
Normal file
160
eco-core/core-plugin/src/main/resources/pets/vampire.yml
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
name: "<gradient:#A50000>Vampire</gradient:#FD2424>"
|
||||||
|
description: "&8&oLevel up by taking damage at night."
|
||||||
|
|
||||||
|
level-xp-requirements:
|
||||||
|
- 50
|
||||||
|
- 75
|
||||||
|
- 100
|
||||||
|
- 150
|
||||||
|
- 200
|
||||||
|
- 300
|
||||||
|
- 400
|
||||||
|
- 500
|
||||||
|
- 750
|
||||||
|
- 1000
|
||||||
|
- 1300
|
||||||
|
- 1500
|
||||||
|
- 1750
|
||||||
|
- 2000
|
||||||
|
- 2300
|
||||||
|
- 2500
|
||||||
|
- 3000
|
||||||
|
- 3500
|
||||||
|
- 4000
|
||||||
|
- 4500
|
||||||
|
- 5000
|
||||||
|
- 6000
|
||||||
|
- 8000
|
||||||
|
- 10000
|
||||||
|
- 12000
|
||||||
|
- 15000
|
||||||
|
- 20000
|
||||||
|
- 25000
|
||||||
|
- 30000
|
||||||
|
- 35000
|
||||||
|
- 40000
|
||||||
|
- 44500
|
||||||
|
- 50000
|
||||||
|
- 57000
|
||||||
|
- 64000
|
||||||
|
- 71000
|
||||||
|
- 78000
|
||||||
|
- 80000
|
||||||
|
- 85000
|
||||||
|
- 90000
|
||||||
|
- 95000
|
||||||
|
- 100000
|
||||||
|
- 110000
|
||||||
|
- 115000
|
||||||
|
- 120000
|
||||||
|
- 125000
|
||||||
|
- 150000
|
||||||
|
- 175000
|
||||||
|
- 200000
|
||||||
|
|
||||||
|
xp-gain-methods:
|
||||||
|
- id: take_damage
|
||||||
|
multiplier: 10.0
|
||||||
|
conditions:
|
||||||
|
- id: is_night
|
||||||
|
|
||||||
|
|
||||||
|
level-placeholders:
|
||||||
|
- id: "lifesteal_chance"
|
||||||
|
value: "%level%"
|
||||||
|
- id: "lifesteal_cooldown"
|
||||||
|
value: "1-(%level%/200)"
|
||||||
|
- id: "lifesteal_heal"
|
||||||
|
value: "%level%/20"
|
||||||
|
- id: "bleed_damage"
|
||||||
|
value: "(%level%-15)/10"
|
||||||
|
- id: "bleed_chance"
|
||||||
|
value: "%level%-10"
|
||||||
|
|
||||||
|
effects-description:
|
||||||
|
1:
|
||||||
|
- "&8» &#ff0000This pet can ONLY be levelled at night."
|
||||||
|
- ""
|
||||||
|
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance%% &7to gain"
|
||||||
|
- " &7health from your enemy. Has a &#ff0000%lifesteal_cooldown% &7second cooldown."
|
||||||
|
25:
|
||||||
|
- "&8» &#ff0000This pet can ONLY be levelled at night."
|
||||||
|
- ""
|
||||||
|
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance%% &7to gain"
|
||||||
|
- " &7health from your enemy. Has a &#ff0000%lifesteal_cooldown% &7second cooldown."
|
||||||
|
- ""
|
||||||
|
- "&8» &7When hitting enemies have a &#ff0000%bleed_chance%% &7to bleed"
|
||||||
|
- " &7your enemies dealing &#ff0000%bleed_damage%&7 damage twice."
|
||||||
|
|
||||||
|
rewards-description:
|
||||||
|
1:
|
||||||
|
- "&8» &#ff0000This pet can ONLY be levelled at night."
|
||||||
|
- ""
|
||||||
|
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance%% &7to gain &ff0000%lifesteal_heal%"
|
||||||
|
- " &7health from your enemy. Has a &#ff0000%lifesteal_cooldown% &7second cooldown."
|
||||||
|
25:
|
||||||
|
- "&8» &#ff0000This pet can ONLY be levelled at night."
|
||||||
|
- ""
|
||||||
|
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance%% &7to gain"
|
||||||
|
- " &7health from your enemy. Has a &#ff0000%lifesteal_cooldown% &7second cooldown."
|
||||||
|
- ""
|
||||||
|
- "&8» &7When hitting enemies have a &#ff0000%bleed_chance%% &7to bleed"
|
||||||
|
- " &7your enemies dealing &#ff0000%bleed_damage%&7 damage twice."
|
||||||
|
|
||||||
|
level-up-messages:
|
||||||
|
1:
|
||||||
|
- "&8» &#ff0000This pet can ONLY be levelled at night."
|
||||||
|
- ""
|
||||||
|
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance%% &7to gain"
|
||||||
|
- " &7health from your enemy. Has a &#ff0000%lifesteal_cooldown% &7second cooldown."
|
||||||
|
25:
|
||||||
|
- "&8» &#ff0000This pet can ONLY be levelled at night."
|
||||||
|
- ""
|
||||||
|
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance%% &7to gain"
|
||||||
|
- " &7health from your enemy. Has a &#ff0000%lifesteal_cooldown% &7second cooldown."
|
||||||
|
- ""
|
||||||
|
- "&8» &7When hitting enemies have a &#ff0000%bleed_chance%% &7to bleed"
|
||||||
|
- " &7your enemies dealing &#ff0000%bleed_damage%&7 damage twice."
|
||||||
|
|
||||||
|
level-commands: [ ]
|
||||||
|
|
||||||
|
effects:
|
||||||
|
- id: give_health
|
||||||
|
args:
|
||||||
|
chance: "%level%"
|
||||||
|
cooldown: "1-(%level%/200)"
|
||||||
|
send_cooldown_message: false
|
||||||
|
amount: "%level%/20"
|
||||||
|
triggers:
|
||||||
|
- melee_attack
|
||||||
|
|
||||||
|
- id: bleed
|
||||||
|
args:
|
||||||
|
chance: "%level%-10"
|
||||||
|
damage: "(%level%-15)/10"
|
||||||
|
interval: 15
|
||||||
|
amount: 2
|
||||||
|
conditions:
|
||||||
|
- id: has_pet_level
|
||||||
|
args:
|
||||||
|
pet: vampire
|
||||||
|
level: 25
|
||||||
|
triggers:
|
||||||
|
- melee_attack
|
||||||
|
|
||||||
|
conditions: []
|
||||||
|
|
||||||
|
entity-texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzgyMGExMGRiMjIyZjY5YWMyMjE1ZDdkMTBkY2E0N2VlYWZhMjE1NTUzNzY0YTJiODFiYWZkNDc5ZTc5MzNkMSJ9fX0="
|
||||||
|
|
||||||
|
icon: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzgyMGExMGRiMjIyZjY5YWMyMjE1ZDdkMTBkY2E0N2VlYWZhMjE1NTUzNzY0YTJiODFiYWZkNDc5ZTc5MzNkMSJ9fX0=
|
||||||
|
|
||||||
|
spawn-egg:
|
||||||
|
enabled: true
|
||||||
|
item: bat_spawn_egg unbreaking:2 hide_enchants
|
||||||
|
name: "<gradient:#A50000>Vampire</gradient:#FD2424>&f Pet Spawn Egg"
|
||||||
|
lore:
|
||||||
|
- ""
|
||||||
|
- "&8&oPlace on the ground to"
|
||||||
|
- "&8&ounlock the &r<gradient:#A50000>Vampire</gradient:#FD2424>&8&o pet!"
|
||||||
|
craftable: false
|
||||||
|
recipe: [ ]
|
||||||
@@ -23,6 +23,7 @@ softdepend:
|
|||||||
- Boosters
|
- Boosters
|
||||||
- EcoSkills
|
- EcoSkills
|
||||||
- Reforges
|
- Reforges
|
||||||
|
- ModelEngine
|
||||||
commands:
|
commands:
|
||||||
ecopets:
|
ecopets:
|
||||||
description: Base Command
|
description: Base Command
|
||||||
@@ -31,7 +32,8 @@ commands:
|
|||||||
aliases:
|
aliases:
|
||||||
- pet
|
- pet
|
||||||
description: Open the pets menu
|
description: Open the pets menu
|
||||||
permission: ecopets.command.skills
|
permission: ecopets.command.pets
|
||||||
|
default: true
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
ecopets.*:
|
ecopets.*:
|
||||||
@@ -48,6 +50,12 @@ permissions:
|
|||||||
ecopets.command.pets: true
|
ecopets.command.pets: true
|
||||||
ecopets.command.give: true
|
ecopets.command.give: true
|
||||||
ecopets.command.giveegg: true
|
ecopets.command.giveegg: true
|
||||||
|
ecopets.command.givexp: true
|
||||||
|
ecopets.command.reset: true
|
||||||
|
ecopets.command.activate: true
|
||||||
|
ecopets.command.deactivate: true
|
||||||
|
ecopets.command.import: true
|
||||||
|
ecopets.command.export: true
|
||||||
|
|
||||||
ecopets.command.reload:
|
ecopets.command.reload:
|
||||||
description: Allows reloading the config
|
description: Allows reloading the config
|
||||||
@@ -64,6 +72,24 @@ permissions:
|
|||||||
ecopets.command.giveegg:
|
ecopets.command.giveegg:
|
||||||
description: Allows the use of /ecopets giveegg.
|
description: Allows the use of /ecopets giveegg.
|
||||||
default: op
|
default: op
|
||||||
|
ecopets.command.givexp:
|
||||||
|
description: Allows the use of /ecopets givexp.
|
||||||
|
default: op
|
||||||
|
ecopets.command.reset:
|
||||||
|
description: Allows the use of /ecopets reset.
|
||||||
|
default: op
|
||||||
|
ecopets.command.import:
|
||||||
|
description: Allows the use of /ecopets import.
|
||||||
|
default: op
|
||||||
|
ecopets.command.export:
|
||||||
|
description: Allows the use of /ecopets export.
|
||||||
|
default: op
|
||||||
|
ecopets.command.activate:
|
||||||
|
description: Allows the use of /pets activate.
|
||||||
|
default: true
|
||||||
|
ecopets.command.deactivate:
|
||||||
|
description: Allows the use of /pets deactivate.
|
||||||
|
default: true
|
||||||
|
|
||||||
ecopets.xpmultiplier.50percent:
|
ecopets.xpmultiplier.50percent:
|
||||||
description: Gives the player 50% more skill experience
|
description: Gives the player 50% more skill experience
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
version=1.0.0
|
#libreforge-updater
|
||||||
|
#Sun Nov 27 21:45:42 GMT 2022
|
||||||
|
version=1.64.0
|
||||||
plugin-name=EcoPets
|
plugin-name=EcoPets
|
||||||
|
|||||||
Reference in New Issue
Block a user