Compare commits

...

8 Commits

Author SHA1 Message Date
Auxilor
c51b29ed35 libreforge-updater 2022-11-01 16:24:09 +00:00
Auxilor
ddbd6479e5 libreforge-updater 2022-10-28 11:36:22 +01:00
Auxilor
84862f7b28 libreforge-updater 2022-10-26 22:13:11 +01:00
Auxilor
9eea5631e7 Fix 2022-10-24 17:15:22 +01:00
Auxilor
ee3c934858 libreforge-updater 2022-10-24 17:05:58 +01:00
Auxilor
35650efe47 libreforge-updater 2022-10-21 19:27:28 +01:00
Auxilor
6f7b800a7d Fix 2022-10-19 21:03:56 +01:00
Auxilor
08f3340399 libreforge-updater 2022-10-19 20:45:39 +01:00
12 changed files with 36 additions and 224 deletions

View File

@@ -47,8 +47,8 @@ allprojects {
}
dependencies {
compileOnly 'com.willfp:eco:6.42.0'
implementation 'com.willfp:libreforge:3.113.0'
compileOnly 'com.willfp:eco:6.44.0'
implementation 'com.willfp:libreforge:3.117.0'
implementation 'org.joml:joml:1.10.4'
compileOnly 'org.jetbrains:annotations:23.0.0'

View File

@@ -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>

View File

@@ -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>

View File

@@ -77,10 +77,6 @@ class EcoPetsPlugin : LibReforgePlugin() {
)
}
override fun getMinimumEcoVersion(): String {
return "6.37.0"
}
companion object {
@JvmStatic
lateinit var instance: EcoPetsPlugin

View File

@@ -172,13 +172,15 @@ class Pet(
}
)
effects = config.getSubsections("effects").mapNotNull {
Effects.compile(it, "Pet $id")
}.toSet()
effects = Effects.compile(
config.getSubsections("effects"),
"Pet $id"
)
conditions = config.getSubsections("conditions").mapNotNull {
Conditions.compile(it, "Pet $id")
}.toSet()
conditions = Conditions.compile(
config.getSubsections("conditions"),
"Pet $id"
)
for (string in config.getStrings("level-commands")) {
val split = string.split(":")

View File

@@ -142,7 +142,7 @@ class PetLevelGUI(
if (newPage == 0) {
PetsGUI.open(player)
} else {
menu.addState(player, pageKey, newPage)
menu.setState(player, pageKey, newPage)
}
}
}
@@ -162,7 +162,7 @@ class PetLevelGUI(
val newPage = min(pages, page + 1)
menu.addState(player, pageKey, newPage)
menu.setState(player, pageKey, newPage)
}
}
)

View File

@@ -4,6 +4,7 @@ import com.willfp.eco.core.config.interfaces.Config
import com.willfp.libreforge.conditions.ConfiguredCondition
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 org.bukkit.event.EventHandler
import org.bukkit.event.Listener
@@ -31,7 +32,7 @@ object PetTriggerXPGainListener : Listener {
return
}
if (!Filter.matches(data, xpGain.filters)) {
if (!Filters.passes(data, xpGain.filters)) {
return
}

View File

@@ -4,7 +4,7 @@ import com.google.common.collect.BiMap
import com.google.common.collect.HashBiMap
import com.google.common.collect.ImmutableList
import com.willfp.eco.core.config.ConfigType
import com.willfp.eco.core.config.TransientConfig
import com.willfp.eco.core.config.readConfig
import com.willfp.eco.core.config.updating.ConfigUpdater
import com.willfp.ecopets.EcoPetsPlugin
import java.io.File
@@ -45,7 +45,7 @@ object Pets {
removePet(set)
}
val petsYml = TransientConfig(File(plugin.dataFolder, "pets.yml"), ConfigType.YAML)
val petsYml = File(plugin.dataFolder, "pets.yml").readConfig(ConfigType.YAML)
for ((id, petConfig) in plugin.fetchConfigs("pets")) {
addNewPet(Pet(id, petConfig, plugin))

View File

@@ -148,7 +148,7 @@ object PetsGUI {
val newPage = max(1, page - 1)
menu.addState(player, pageKey, newPage)
menu.setState(player, pageKey, newPage)
}
}
)
@@ -172,7 +172,7 @@ object PetsGUI {
val newPage = min(pages, page + 1)
menu.addState(player, pageKey, newPage)
menu.setState(player, pageKey, newPage)
}
}
)

View File

@@ -258,6 +258,13 @@ cannot-afford-type:
sound: "BLOCK_NOTE_BLOCK_PLING"
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.
example_point: "Nicely Formatted Point"

View File

@@ -6,8 +6,17 @@ messages:
reloaded: "Reloaded!"
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-price: "&cYou can't afford to do this! &fPrice: %price%"
on-cooldown: "&cThis effect is on cooldown! &fTime left: &a%seconds% seconds"
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!"
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!"
@@ -25,13 +34,6 @@ messages:
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!"
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%"
menu:
title: "Pets"

View File

@@ -1,4 +1,4 @@
#libreforge-updater
#Tue Oct 18 14:15:28 BST 2022
version=1.52.0
#Tue Nov 01 16:24:09 GMT 2022
version=1.56.0
plugin-name=EcoPets