9
0
mirror of https://github.com/Auxilor/EcoArmor.git synced 2026-01-04 15:31:51 +00:00

libreforge-updater

This commit is contained in:
Auxilor
2022-10-24 17:05:53 +01:00
parent 02241f3ccb
commit fdc3918b11
8 changed files with 59 additions and 263 deletions

View File

@@ -62,8 +62,8 @@ allprojects {
}
dependencies {
compileOnly 'com.willfp:eco:6.34.0'
implementation 'com.willfp:libreforge:3.114.1'
compileOnly 'com.willfp:eco:6.44.0'
implementation 'com.willfp:libreforge:3.115.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,17 +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>
<!-- Effects don't need javadoc. -->
<suppress files="[\\/]effects[\\/]effects[\\/]" checks="MissingJavadocMethod"/>
<suppress files="[\\/]effects[\\/]effects[\\/]" checks="JavadocVariable"/>
<suppress files="[\\/]conditions[\\/]conditions[\\/]" checks="MissingJavadocMethod"/>
<suppress files="[\\/]conditions[\\/]conditions[\\/]" checks="JavadocVariable"/>
<!-- Fields don't need javadoc -->
<suppress files="Effects.java" checks="JavadocVariable"/>
<suppress files="Conditions.java" checks="JavadocVariable"/>
</suppressions>

View File

@@ -56,10 +56,6 @@ class EcoArmorPlugin : LibReforgePlugin() {
return ArmorDisplay(this)
}
override fun getMinimumEcoVersion(): String {
return "6.35.1"
}
companion object {
@JvmStatic
lateinit var instance: EcoArmorPlugin

View File

@@ -27,7 +27,8 @@ import org.bukkit.Bukkit
import org.bukkit.Sound
import org.bukkit.inventory.ItemStack
import org.bukkit.persistence.PersistentDataType
import java.util.*
import java.util.Locale
import java.util.Objects
import java.util.stream.Collectors
class ArmorSet(
@@ -35,39 +36,25 @@ class ArmorSet(
val config: Config,
private val plugin: EcoPlugin
) {
/**
* The advanced holder.
*/
/** The advanced holder. */
val advancedHolder: Holder
/**
* The regular holder.
*/
/** The regular holder. */
val regularHolder: Holder
/**
* Items in set.
*/
/** Items in set. */
private val items = notNullMapOf<ArmorSlot, ItemStack>()
/**
* Holders in set.
*/
/** Holders in set. */
private val slotHolders = notNullMapOf<ArmorSlot, Holder>()
/**
* Items in advanced set.
*/
/** Items in advanced set. */
private val advancedItems = notNullMapOf<ArmorSlot, ItemStack>()
/**
* Holders in advanced set.
*/
/** Holders in advanced set. */
private val advancedSlotHolders = notNullMapOf<ArmorSlot, Holder>()
/**
* Advancement shard item.
*/
/** Advancement shard item. */
val advancementShardItem: ItemStack
/*
@@ -103,21 +90,22 @@ class ArmorSet(
)
} else null
/**
* Create a new Armor Set.
*/
/** Create a new Armor Set. */
init {
val conditions = config.getSubsections("conditions").mapNotNull {
Conditions.compile(it, "Armor Set $id")
}.toSet()
val conditions = Conditions.compile(
config.getSubsections("conditions"),
"Armor Set $id"
)
val effects = config.getSubsections("effects").mapNotNull {
Effects.compile(it, "Armor Set $id")
}.toSet()
val effects = Effects.compile(
config.getSubsections("effects"),
"Armor Set $id"
)
val advancedEffects = config.getSubsections("advancedEffects").mapNotNull {
Effects.compile(it, "Armor Set $id (Advanced)")
}.toSet()
val advancedEffects = Effects.compile(
config.getSubsections("advancedEffects"),
"Armor Set $id (advanced)"
)
regularHolder = SimpleHolder(conditions, effects, id)
advancedHolder = SimpleHolder(conditions, advancedEffects, "${id}_advanced")
@@ -133,22 +121,26 @@ class ArmorSet(
advancedItems[slot] = advancedItem
slotHolders[slot] = SimpleHolder(
slotConfig.getSubsections("conditions").mapNotNull {
Conditions.compile(it, "Armor Set $id - ${slot.name}")
}.toSet(),
slotConfig.getSubsections("effects").mapNotNull {
Effects.compile(it, "Armor Set $id - ${slot.name}")
}.toSet(),
Conditions.compile(
slotConfig.getSubsections("conditions"),
"Armor Set $id - ${slot.name}"
),
Effects.compile(
slotConfig.getSubsections("effects"),
"Armor Set $id - ${slot.name}"
),
"${id}_${slot.name.lowercase()}"
)
advancedSlotHolders[slot] = SimpleHolder(
slotConfig.getSubsections("conditions").mapNotNull {
Conditions.compile(it, "Armor Set $id - ${slot.name}")
}.toSet(),
slotConfig.getSubsections("advancedEffects").mapNotNull {
Effects.compile(it, "Armor Set $id - ${slot.name} (Advanced)")
}.toSet(),
Conditions.compile(
slotConfig.getSubsections("conditions"),
"Armor Set $id - ${slot.name}"
),
Effects.compile(
slotConfig.getSubsections("advancedEffects"),
"Armor Set $id - ${slot.name} (Advanced)"
),
"${id}_${slot.name.lowercase()}_advanced"
)
}

View File

@@ -28,6 +28,13 @@ cannot-afford-type:
sound: "BLOCK_NOTE_BLOCK_PLING"
pitch: 0.5
cannot-afford-point:
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

@@ -3,15 +3,11 @@ messages:
no-permission: "&cYou don't have permission to do this!"
not-player: "&cThis command must be run by a player"
invalid-command: "&cUnknown subcommand!"
reloaded: "Reloaded! (Restart if you're removed armor sets!)"
needs-player: "&cYou must specify a player"
invalid-player: "&cInvalid player!"
needs-item: "&cYou must specify an item!"
invalid-item: "&cInvalid item!"
give-success: "Gave &a%item%&r to &a%recipient%"
on-cooldown: "&cThis effect is on cooldown! &fTime left: &a%seconds% seconds"
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%"
@@ -19,4 +15,10 @@ messages:
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%"
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"
invalid-player: "&cInvalid player!"
needs-item: "&cYou must specify an item!"
invalid-item: "&cInvalid item!"
give-success: "Gave &a%item%&r to &a%recipient%"

View File

@@ -1,4 +1,4 @@
#libreforge-updater
#Fri Oct 21 19:27:19 BST 2022
version=7.130.1
#Mon Oct 24 17:05:53 BST 2022
version=7.131.0
plugin-name=EcoArmor