From 678eaa5187c861ce68c99118a25e70df997ec80a Mon Sep 17 00:00:00 2001 From: Auxilor Date: Mon, 24 Oct 2022 17:06:17 +0100 Subject: [PATCH] libreforge-updater --- build.gradle | 4 +- config/checkstyle/checkstyle.xml | 184 ------------------ config/checkstyle/suppression.xml | 10 - .../com/willfp/ecoenchants/config/Configs.kt | 4 +- .../willfp/ecoenchants/enchants/EcoEnchant.kt | 18 +- .../willfp/ecoenchants/enchants/EnchantGUI.kt | 6 +- .../enchants/LibReforgeEcoEnchant.kt | 7 +- .../core-plugin/src/main/resources/config.yml | 9 +- .../main/resources/enchants/blast_mining.yml | 9 +- .../main/resources/enchants/lumberjack.yml | 18 ++ .../src/main/resources/enchants/veinminer.yml | 21 ++ .../core-plugin/src/main/resources/lang.yml | 28 +-- gradle.properties | 4 +- 13 files changed, 90 insertions(+), 232 deletions(-) delete mode 100644 config/checkstyle/checkstyle.xml delete mode 100644 config/checkstyle/suppression.xml diff --git a/build.gradle b/build.gradle index 4c44149c..1c6d24ec 100644 --- a/build.gradle +++ b/build.gradle @@ -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' diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml deleted file mode 100644 index 1e777eee..00000000 --- a/config/checkstyle/checkstyle.xml +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/config/checkstyle/suppression.xml b/config/checkstyle/suppression.xml deleted file mode 100644 index 12c9ad42..00000000 --- a/config/checkstyle/suppression.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/config/Configs.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/config/Configs.kt index afbbf118..b47b0233 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/config/Configs.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/config/Configs.kt @@ -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) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/EcoEnchant.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/EcoEnchant.kt index 3d371fd2..a29016fc 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/EcoEnchant.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/EcoEnchant.kt @@ -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( diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/EnchantGUI.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/EnchantGUI.kt index 5bfb2d8c..aa6fda4f 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/EnchantGUI.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/EnchantGUI.kt @@ -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) } } diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/LibReforgeEcoEnchant.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/LibReforgeEcoEnchant.kt index f41ebab4..c69c37aa 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/LibReforgeEcoEnchant.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/LibReforgeEcoEnchant.kt @@ -20,9 +20,10 @@ class LibReforgeEcoEnchant( private val effects: Set 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 = diff --git a/eco-core/core-plugin/src/main/resources/config.yml b/eco-core/core-plugin/src/main/resources/config.yml index a47848b0..41281103 100644 --- a/eco-core/core-plugin/src/main/resources/config.yml +++ b/eco-core/core-plugin/src/main/resources/config.yml @@ -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 diff --git a/eco-core/core-plugin/src/main/resources/enchants/blast_mining.yml b/eco-core/core-plugin/src/main/resources/enchants/blast_mining.yml index 1a43379f..d797b825 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/blast_mining.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/blast_mining.yml @@ -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: diff --git a/eco-core/core-plugin/src/main/resources/enchants/lumberjack.yml b/eco-core/core-plugin/src/main/resources/enchants/lumberjack.yml index f88af1fb..699bf7e7 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/lumberjack.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/lumberjack.yml @@ -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 diff --git a/eco-core/core-plugin/src/main/resources/enchants/veinminer.yml b/eco-core/core-plugin/src/main/resources/enchants/veinminer.yml index dd163ec5..c937789b 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/veinminer.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/veinminer.yml @@ -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 diff --git a/eco-core/core-plugin/src/main/resources/lang.yml b/eco-core/core-plugin/src/main/resources/lang.yml index 44cc84d0..5eb80f0e 100644 --- a/eco-core/core-plugin/src/main/resources/lang.yml +++ b/eco-core/core-plugin/src/main/resources/lang.yml @@ -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" \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index f0a4d074..6bc95a95 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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