libreforge-updater

This commit is contained in:
Auxilor 2022-10-24 17:06:17 +01:00
parent 29f8d27bb0
commit 678eaa5187
13 changed files with 90 additions and 232 deletions

View File

@ -45,8 +45,8 @@ allprojects {
}
dependencies {
compileOnly 'com.willfp:eco:6.43.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,10 +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="EcoEnchants.java" checks="JavadocVariable"/>
</suppressions>

View File

@ -10,6 +10,4 @@ import org.bukkit.enchantments.Enchantment
class TypesYml(plugin: EcoPlugin) : BaseConfig("types", plugin, true, ConfigType.YAML)
class TargetsYml(plugin: EcoPlugin) : BaseConfig("targets", plugin, true, ConfigType.YAML)
class RarityYml(plugin: EcoPlugin) : BaseConfig("rarity", plugin, true, ConfigType.YAML)
class VanillaEnchantsYml(plugin: EcoPlugin) : ExtendableConfig("vanillaenchants", true, plugin,
plugin.javaClass, "", ConfigType.YAML, *Enchantment.values().filter { it !is EcoEnchant }
.map { it.key.key.lowercase() }.toTypedArray())
class VanillaEnchantsYml(plugin: EcoPlugin) : BaseConfig("vanillaenchants", plugin, false, ConfigType.YAML)

View File

@ -2,9 +2,9 @@ package com.willfp.ecoenchants.enchants
import com.github.benmanes.caffeine.cache.Caffeine
import com.willfp.eco.core.config.ConfigType
import com.willfp.eco.core.config.TransientConfig
import com.willfp.eco.core.config.config
import com.willfp.eco.core.config.interfaces.Config
import com.willfp.eco.core.config.readConfig
import com.willfp.eco.core.fast.fast
import com.willfp.eco.core.placeholder.PlayerStaticPlaceholder
import com.willfp.eco.util.StringUtils
@ -99,13 +99,8 @@ abstract class EcoEnchant(
.walk()
.firstOrNull { file -> file.nameWithoutExtension == id }
if (file == null) {
// If config is deleted, don't register it
config {
"dont-register" to true
}
} else {
TransientConfig(file, ConfigType.YAML)
file?.readConfig(ConfigType.YAML) ?: config {
"dont-register" to true
}
}
},
@ -123,9 +118,10 @@ abstract class EcoEnchant(
}
)
conditions = if (plugin.isLoaded) config.getSubsections("conditions").mapNotNull {
Conditions.compile(it, "Enchantment $id")
}.toSet() else emptySet()
conditions = if (plugin.isLoaded) Conditions.compile(
config.getSubsections("conditions"),
"Enchantment $id"
) else emptySet()
if (Bukkit.getPluginManager().getPermission("ecoenchants.fromtable.$id") == null) {
val permission = Permission(

View File

@ -76,9 +76,9 @@ object EnchantGUI {
onRender { player, menu ->
val atCaptive = menu.getCaptiveItem(player, captiveRow, captiveColumn)
if (atCaptive.isEmpty || atCaptive == null || atCaptive.type == Material.BOOK) {
menu.addState(player, "enchants", EcoEnchants.values().sortForDisplay())
menu.setState(player, "enchants", EcoEnchants.values().sortForDisplay())
} else {
menu.addState(
menu.setState(
player,
"enchants",
atCaptive.applicableEnchantments.sortForDisplay()
@ -88,7 +88,7 @@ object EnchantGUI {
}
if (menu.getPage(player) > menu.getMaxPage(player)) {
menu.addState(player, Page.PAGE_KEY, 1)
menu.setState(player, Page.PAGE_KEY, 1)
}
}

View File

@ -20,9 +20,10 @@ class LibReforgeEcoEnchant(
private val effects: Set<ConfiguredEffect>
init {
effects = if (plugin.isLoaded) config.getSubsections("effects").mapNotNull {
Effects.compile(it, "Enchantment $id")
}.toSet() else emptySet()
effects = if (plugin.isLoaded) Effects.compile(
config.getSubsections("effects"),
"Enchantment $id"
) else emptySet()
}
override fun createLevel(level: Int): EcoEnchantLevel =

View File

@ -188,7 +188,14 @@ cannot-afford-type:
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.
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 souls) then you can map them to nice names to be shown to players.
example_point: "Nicely Formatted Point"
use-faster-move-trigger: true # Disable if you want move trigger to detect sub-1-block movements

View File

@ -23,7 +23,14 @@ effects:
- id: mine_radius
args:
radius: 1
blacklisted_blocks: [ ]
blacklisted_blocks:
- bedrock
- obsidian
- crying_obsidian
- chest
- barrel
- barrier
- reinforced_deepslate
check_hardness: true
disable_on_sneak: true
args:

View File

@ -32,6 +32,24 @@ effects:
- jungle_log
- birch_log
- spruce_log
filters:
blocks:
- oak_wood
- dark_oak_wood
- acacia_wood
- jungle_wood
- birch_wood
- mangrove_wood
- crimson_stem
- spruce_wood
- warped_stem
- oak_log
- dark_oak_log
- acacia_log
- jungle_log
- birch_log
- spruce_log
- mangrove_log
triggers:
- mine_block

View File

@ -38,6 +38,27 @@ effects:
- deepslate_lapis_ore
- deepslate_diamond_ore
- deepslate_redstone_ore
filters:
blocks:
- coal_ore
- iron_ore
- copper_ore
- gold_ore
- ancient_debris
- lapis_ore
- diamond_ore
- redstone_ore
- nether_quartz_ore
- gilded_blackstone
- nether_gold_ore
- glowstone
- deepslate_coal_ore
- deepslate_iron_ore
- deepslate_copper_ore
- deepslate_gold_ore
- deepslate_lapis_ore
- deepslate_diamond_ore
- deepslate_redstone_ore
triggers:
- mine_block

View File

@ -3,20 +3,12 @@ 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! Took %time%ms"
on-cooldown: "&cThis effect is on cooldown! &fTime left: &a%seconds% seconds"
invalid-player: "&cInvalid Player!"
requires-player: "&cRequires a Player!"
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!"
enabled-descriptions: "&fYou have successfully &aenabled &fenchantment descriptions!"
disabled-descriptions: "&fYou have successfully &cdisabled &fenchantment descriptions!"
descriptions-disabled: "&cEnchantment descriptions are disabled on this server."
not-found: "&cCannot find an enchantment matching name: &f%name%."
missing-enchant: "&cYou must specify an enchantment!"
gave-random-book: "&fGave &a%player%&f a random book (&r%enchantment%&f)!"
no-enchantments-found: "&cNo enchantments found!"
invalid-levels: "&cMinimum level can't be higher than maximum level!"
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"
@ -25,6 +17,18 @@ messages:
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%"
invalid-player: "&cInvalid Player!"
requires-player: "&cRequires a Player!"
enabled-descriptions: "&fYou have successfully &aenabled &fenchantment descriptions!"
disabled-descriptions: "&fYou have successfully &cdisabled &fenchantment descriptions!"
descriptions-disabled: "&cEnchantment descriptions are disabled on this server."
not-found: "&cCannot find an enchantment matching name: &f%name%."
missing-enchant: "&cYou must specify an enchantment!"
gave-random-book: "&fGave &a%player%&f a random book (&r%enchantment%&f)!"
no-enchantments-found: "&cNo enchantments found!"
invalid-levels: "&cMinimum level can't be higher than maximum level!"
all: "All"
no-conflicts: "No Conflicts"
all-conflicts: "All Other Enchantments"

View File

@ -1,4 +1,4 @@
#libreforge-updater
#Fri Oct 21 19:27:47 BST 2022
version=9.2.1
#Mon Oct 24 17:06:17 BST 2022
version=9.3.0
plugin-name=EcoEnchants