From 357832268632dde8284f54108d0059fde2881c97 Mon Sep 17 00:00:00 2001 From: alexcrea <42614139+alexcrea@users.noreply.github.com> Date: Sat, 13 Jun 2026 15:22:39 +0200 Subject: [PATCH 01/21] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 22d9da1..dab8ab6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Custom Anvil **Custom Anvil** is a plugin that allows server administrators to customize every aspect of the anvil's mechanics. -It is expected to work on 1.18 to 1.21.7 minecraft servers running spigot or paper. +It is expected to work on 1.18 to 26.1.2 minecraft servers running spigot or paper. (the plugin support of 1.16.5 to 1.17.1 is experimental and may encounter issues) ### Download Locations: From 593527241a82edbb39f1c78bdcaf7b1333c103d0 Mon Sep 17 00:00:00 2001 From: alexcrea Date: Tue, 16 Jun 2026 02:57:41 +0200 Subject: [PATCH 02/21] fix bugged unit repair & version bump --- build.gradle.kts | 2 +- .../kotlin/xyz/alexcrea/cuanvil/listener/AnvilResultListener.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 6d2047e..7b449fc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -22,7 +22,7 @@ plugins { } group = "xyz.alexcrea" -version = "1.17.1" +version = "1.17.2" val isDevBuild = System.getenv("SMALL_COMMIT_HASH") != null val isPreRelease = System.getenv("IS_GITHUB_PRERELEASE") == "true" diff --git a/src/main/kotlin/xyz/alexcrea/cuanvil/listener/AnvilResultListener.kt b/src/main/kotlin/xyz/alexcrea/cuanvil/listener/AnvilResultListener.kt index feee833..c5de6a8 100644 --- a/src/main/kotlin/xyz/alexcrea/cuanvil/listener/AnvilResultListener.kt +++ b/src/main/kotlin/xyz/alexcrea/cuanvil/listener/AnvilResultListener.kt @@ -121,7 +121,7 @@ class AnvilResultListener : Listener { view, inventory, player, leftItem, rightItem ) - if (unitRepairResult.isEmpty()) { + if (!unitRepairResult.isEmpty()) { onUnitRepairExtract( rightItem, event, player, inventory, unitRepairResult From 151666fd21a59fb3d0c8b87e201a14f05bcb9e29 Mon Sep 17 00:00:00 2001 From: alexcrea Date: Tue, 16 Jun 2026 03:09:41 +0200 Subject: [PATCH 03/21] better excellent enchant fake event [skip ci] --- .../cuanvil/util/ModernPrepareAnvilCreator.kt | 12 ------------ .../plugins/ExcellentEnchantsDependency.kt | 12 +++++------- 2 files changed, 5 insertions(+), 19 deletions(-) delete mode 100644 nms/v1_21R1/src/main/kotlin/xyz/alexcrea/cuanvil/util/ModernPrepareAnvilCreator.kt diff --git a/nms/v1_21R1/src/main/kotlin/xyz/alexcrea/cuanvil/util/ModernPrepareAnvilCreator.kt b/nms/v1_21R1/src/main/kotlin/xyz/alexcrea/cuanvil/util/ModernPrepareAnvilCreator.kt deleted file mode 100644 index 0c51e0a..0000000 --- a/nms/v1_21R1/src/main/kotlin/xyz/alexcrea/cuanvil/util/ModernPrepareAnvilCreator.kt +++ /dev/null @@ -1,12 +0,0 @@ -package xyz.alexcrea.cuanvil.util - -import org.bukkit.event.inventory.PrepareAnvilEvent -import org.bukkit.inventory.InventoryView -import org.bukkit.inventory.ItemStack -import org.bukkit.inventory.view.AnvilView - -object ModernPrepareAnvilCreator { - fun createPrepareAnvil(view: InventoryView, item: ItemStack?): PrepareAnvilEvent { - return PrepareAnvilEvent(view as AnvilView, item) - } -} diff --git a/src/main/kotlin/xyz/alexcrea/cuanvil/dependency/plugins/ExcellentEnchantsDependency.kt b/src/main/kotlin/xyz/alexcrea/cuanvil/dependency/plugins/ExcellentEnchantsDependency.kt index c2d3019..816a4df 100644 --- a/src/main/kotlin/xyz/alexcrea/cuanvil/dependency/plugins/ExcellentEnchantsDependency.kt +++ b/src/main/kotlin/xyz/alexcrea/cuanvil/dependency/plugins/ExcellentEnchantsDependency.kt @@ -13,7 +13,7 @@ import xyz.alexcrea.cuanvil.enchant.wrapped.CAEEPreV5Enchantment import xyz.alexcrea.cuanvil.enchant.wrapped.CAEEV5Enchantment import xyz.alexcrea.cuanvil.enchant.wrapped.CAEEV5_4Enchantment import xyz.alexcrea.cuanvil.enchant.wrapped.CALegacyEEEnchantment -import xyz.alexcrea.cuanvil.util.ModernPrepareAnvilCreator +import java.lang.reflect.Constructor import java.lang.reflect.Method import su.nightexpress.excellentenchants.api.EnchantRegistry as V5EnchantRegistry import su.nightexpress.excellentenchants.enchantment.impl.universal.CurseOfFragilityEnchant as LegacyCurseOfFragilityEnchant @@ -118,6 +118,8 @@ class ExcellentEnchantsDependency { private lateinit var handleRechargeMethod: Method private lateinit var handleCombineMethod: Method + private val prepareAnvilConstructor = PrepareAnvilEvent::class.java.constructors.first() as Constructor + fun redirectListeners() { val toUnregister = ArrayList() // get required PrepareAnvilEvent listener @@ -224,12 +226,8 @@ class ExcellentEnchantsDependency { val first: ItemStack = treatInput(event.leftItem) val second: ItemStack = treatInput(event.rightItem) - val fakeEvent: PrepareAnvilEvent = try { - //TODO remove this on legacy removal - PrepareAnvilEvent(event.view, result) - } catch (_: NoSuchMethodError) { - ModernPrepareAnvilCreator.createPrepareAnvil(event.view, result) - } + val fakeEvent = prepareAnvilConstructor.newInstance(event.view, result) + handleCombineMethod.invoke(this.usedAnvilListener, fakeEvent, first, second, result) event.result = fakeEvent.result From 29e08fe29bb81173916935bdc4987c6a23e2aa8b Mon Sep 17 00:00:00 2001 From: alexcrea Date: Tue, 16 Jun 2026 03:17:53 +0200 Subject: [PATCH 04/21] fix double space issue [ci skip] --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 8c4a93c..66c1ad1 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -157,7 +157,7 @@ jobs: webhook-url: ${{ secrets.RELEASE_WEBHOOK_URL }} content: | ${{ github.event.release.prerelease == false && '<@&1338546156325568642>' || '<@&1352296092989001768>' }} - # New ${{ github.event.release.prerelease && 'beta' || '' }} version of custom anvil ! <:CustomAnvil:1262550667986342001>([Modrinth](https://modrinth.com/plugin/customanvil), [Hangar](https://hangar.papermc.io/alexcrea/CustomAnvil) and [GitHub](${{ github.event.release.html_url }}) links) + # New ${{ github.event.release.prerelease && 'beta ' || '' }}version of custom anvil ! <:CustomAnvil:1262550667986342001>([Modrinth](https://modrinth.com/plugin/customanvil), [Hangar](https://hangar.papermc.io/alexcrea/CustomAnvil) and [GitHub](${{ github.event.release.html_url }}) links) -# note: automated release. spigot is not uploaded yet. ${{ github.event.release.body }} From fc33b6fbd5c0386d88fb2a600064205d4eaf9008 Mon Sep 17 00:00:00 2001 From: alexcrea <42614139+alexcrea@users.noreply.github.com> Date: Tue, 16 Jun 2026 03:27:10 +0200 Subject: [PATCH 05/21] Update README.md --- README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index dab8ab6..5e70842 100644 --- a/README.md +++ b/README.md @@ -63,13 +63,10 @@ See the [Compatibility list](https://github.com/alexcrea/CustomAnvil/blob/v1.x.x One of the configurations allow displaying price about 40 and removing Too Expensive. \ By how the minecraft client work: price above 40 can only be displayed green, even if the player does not own enough experience level. -Minecraft version 1.18 to latest marked as supported do not need any ProtocoLib dependency. \ +spigot version 1.18 to 1.21.11 do not need any ProtocoLib dependency. (26.1.0 or above requires it) \ Any recent paper version also are supported for this feature. -But you should wait for update for new version containing new enchantable item or new enchantments. -Other version need ProtocoLib enabled on your server for this feature. \ -You can also wait for an update of the plugin to support a newer version. - -Please note that 1.16.5 to 1.17.1 are not officially supported. Run at your own risk. +But you should wait for update for new version containing new enchantable item or new enchantments if any of this got added. +Else it is, likely, fine to use the current version you are ussing on a new paper version ### For custom enchantment plugin developers For information about the API, please refer to [the Wiki](https://github.com/alexcrea/CustomAnvil/wiki) \ From c064e4b1e1f5e628f6e903966410be38f3f3371c Mon Sep 17 00:00:00 2001 From: alexcrea <42614139+alexcrea@users.noreply.github.com> Date: Tue, 16 Jun 2026 03:32:46 +0200 Subject: [PATCH 06/21] forgot \ [skip ci] --- defaultconfigs/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/defaultconfigs/README.md b/defaultconfigs/README.md index a413b66..9e85e52 100644 --- a/defaultconfigs/README.md +++ b/defaultconfigs/README.md @@ -1,5 +1,5 @@ ### Default Plugin's Configurations From 1.18 to 1.20.6 use [1.18 configurations](https://github.com/alexcrea/CustomAnvil/tree/master/defaultconfigs/1.18) \ -From 1.21 to 1.21.8 use [1.21 configurations](https://github.com/alexcrea/CustomAnvil/tree/master/defaultconfigs/1.21) -From 1.21.9 to 1.21.10 use [1.21.9 configurations](https://github.com/alexcrea/CustomAnvil/tree/master/defaultconfigs/1.21.9) -From 1.21.11 use [1.21.11 configurations](https://github.com/alexcrea/CustomAnvil/tree/master/defaultconfigs/1.21.11) \ No newline at end of file +From 1.21 to 1.21.8 use [1.21 configurations](https://github.com/alexcrea/CustomAnvil/tree/master/defaultconfigs/1.21) \ +From 1.21.9 to 1.21.10 use [1.21.9 configurations](https://github.com/alexcrea/CustomAnvil/tree/master/defaultconfigs/1.21.9) \ +From 1.21.11 use [1.21.11 configurations](https://github.com/alexcrea/CustomAnvil/tree/master/defaultconfigs/1.21.11) \ From b92b762551ed3e15266b0fb0b1a3ad44cbc6c36a Mon Sep 17 00:00:00 2001 From: alexcrea <42614139+alexcrea@users.noreply.github.com> Date: Tue, 16 Jun 2026 03:33:03 +0200 Subject: [PATCH 07/21] overdid \ [skip ci] --- defaultconfigs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaultconfigs/README.md b/defaultconfigs/README.md index 9e85e52..daa2088 100644 --- a/defaultconfigs/README.md +++ b/defaultconfigs/README.md @@ -2,4 +2,4 @@ From 1.18 to 1.20.6 use [1.18 configurations](https://github.com/alexcrea/CustomAnvil/tree/master/defaultconfigs/1.18) \ From 1.21 to 1.21.8 use [1.21 configurations](https://github.com/alexcrea/CustomAnvil/tree/master/defaultconfigs/1.21) \ From 1.21.9 to 1.21.10 use [1.21.9 configurations](https://github.com/alexcrea/CustomAnvil/tree/master/defaultconfigs/1.21.9) \ -From 1.21.11 use [1.21.11 configurations](https://github.com/alexcrea/CustomAnvil/tree/master/defaultconfigs/1.21.11) \ +From 1.21.11 use [1.21.11 configurations](https://github.com/alexcrea/CustomAnvil/tree/master/defaultconfigs/1.21.11) From 96754fd2606407bc06ff2710434fdd27b007b4bb Mon Sep 17 00:00:00 2001 From: alexcrea <42614139+alexcrea@users.noreply.github.com> Date: Tue, 16 Jun 2026 03:48:47 +0200 Subject: [PATCH 08/21] better readme [skip ci] --- README.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5e70842..3c597b8 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # Custom Anvil **Custom Anvil** is a plugin that allows server administrators to customize every aspect of the anvil's mechanics. -It is expected to work on 1.18 to 26.1.2 minecraft servers running spigot or paper. -(the plugin support of 1.16.5 to 1.17.1 is experimental and may encounter issues) ### Download Locations: @@ -16,7 +14,7 @@ the plugin can be downloaded on - Vanilla like default configuration. - Custom enchantment level limit. - Custom anvil recipes. -- Custom enchant restrictions (allow unsafe enchantment only for a group of item or create new restriction). +- Custom enchant restrictions (allows unsafe enchantment only for a group of item or create new restriction). - Custom items of unit repairs (repair damaged with unit of "material", for example the repair of diamond sword by diamonds). - Custom XP cost for every aspect of the anvil. - Permissions to bypass level limit or enchantment restriction. @@ -25,8 +23,12 @@ the plugin can be downloaded on - Gui to configure the plugin in game. - Support use of color code, hexadecimal color and minimessage for color/decoration - (Experimental) Folia support (gui do not work) +- (Experimental) Dialog rename (allows longer rename) +- (Experimental) Anvil with monetary cost (using vault) (require dialog rename) +And others ! --- ### Permissions: +Note that for most of them you also need to enable feature and in most case enable use of permission for the specfic feature (indicated with `(toggleable)`) ```yml # Generic and bypass permissions ca.affected: Player with this permission will be affected by the plugin @@ -44,17 +46,22 @@ ca.config.edit: Allow administrator to edit the plugin's config in game # ----------------------------------------------------------------------------- # Permissions related to use of color and minimessage ca.color.code: Allow player to use color code on rename if enabled (toggleable) +ca.color.code.[thecode] (for example ca.color.code.a): Allows usage of only certain color code (toggleable) ca.color.hex: Allow player to use hexadecimal color on rename if enabled (toggleable) -ca.rename.minimessage: Allow player to use minimessage formating on rename if enabled (toggleable) (only legacy compatible at the time) +ca.rename.minimessage: Allow player to use minimessage formating on rename if enabled (toggleable) # Permissions related to edition of the lore ca.lore_edit.book: Allow player to edit lore via book and quil if enabled (toggleable) ca.lore_edit.paper: Allow player to edit lore via paper if enabled (toggleable) + +# Others +ca.rename.dialog: Allow player to use the rename dialog (toggleable) ``` ### Commands -run `customanvil help` to get information about available commands (need permissions to use them) +run `/customanvil help` to get information about available commands \ +this only show subcommands you have permission for ### Supported Plugins See the [Compatibility list](https://github.com/alexcrea/CustomAnvil/blob/v1.x.x/COMPATIBILITY.md) @@ -97,3 +104,6 @@ Credits and thanks can be seen [here](https://github.com/alexcrea/CustomAnvil/bl ### Known issue: Most unknown registered enchantments (by unsupported custom enchantment plugin & datapacks) will not have restriction by default. Planned but no eta. + +### Do you need help with the plugin, or have any issue or suggestion? +You can ask on the discussion page, create a [GitHub issue](https://github.com/alexcrea/CustomAnvil/issues) or join my [discord](https://discord.gg/KHUNsUfRYJ)​ From 98d359f59fe0085f5a72b2fbabfe8c438c6cc96a Mon Sep 17 00:00:00 2001 From: alexcrea <42614139+alexcrea@users.noreply.github.com> Date: Tue, 16 Jun 2026 03:49:16 +0200 Subject: [PATCH 09/21] markdown issue [skip ci] --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3c597b8..afe6017 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,8 @@ the plugin can be downloaded on - (Experimental) Folia support (gui do not work) - (Experimental) Dialog rename (allows longer rename) - (Experimental) Anvil with monetary cost (using vault) (require dialog rename) -And others ! + +And more ! --- ### Permissions: Note that for most of them you also need to enable feature and in most case enable use of permission for the specfic feature (indicated with `(toggleable)`) From 4b5133c8720ed4ea344f75714aadc3301da6ab9b Mon Sep 17 00:00:00 2001 From: alexcrea <42614139+alexcrea@users.noreply.github.com> Date: Tue, 16 Jun 2026 03:49:32 +0200 Subject: [PATCH 10/21] =?UTF-8?q?markdown=20issue=C2=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index afe6017..9d9e678 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ the plugin can be downloaded on - (Experimental) Anvil with monetary cost (using vault) (require dialog rename) And more ! + --- ### Permissions: Note that for most of them you also need to enable feature and in most case enable use of permission for the specfic feature (indicated with `(toggleable)`) From cff94a2c5a6eb23ceef009fb1fb88fdc2416d0d1 Mon Sep 17 00:00:00 2001 From: alexcrea Date: Tue, 16 Jun 2026 04:04:49 +0200 Subject: [PATCH 11/21] better thanks and put names in compatibility note [ci skip] --- COMPATIBILITY.md | 28 ++++++++++++++-------------- CREDITS.md | 21 ++++++++------------- 2 files changed, 22 insertions(+), 27 deletions(-) diff --git a/COMPATIBILITY.md b/COMPATIBILITY.md index 66ac561..916a089 100644 --- a/COMPATIBILITY.md +++ b/COMPATIBILITY.md @@ -6,54 +6,54 @@ This is cannot be fixed on geyser or my side. Here is various plugins that had issues with CustomAnvil where efforts was made for compatibility and should be working right: -some of them are cool I recommend checking them out ! +some if not all of them are cool ! I recommend checking them out ! ## Supported By CustomAnvil These plugins have compatibility handled by custom anvil. seek help on custom anvil and do not bother these developers #### Enchantment Plugins -- [ExcellentEnchants](https://www.spigotmc.org/resources/excellentenchants-%E2%AD%90-75-vanilla-like-enchantments.61693/): +- [ExcellentEnchants](https://www.spigotmc.org/resources/excellentenchants-%E2%AD%90-75-vanilla-like-enchantments.61693/) by NightExpress: Use ExcellentEnchants item type -- [EcoEnchant](https://www.spigotmc.org/resources/ecoenchants-%E2%AD%95-250-enchantments-%E2%9C%85-create-custom-enchants-%E2%9C%A8-essentials-cmi-support.79573/): +- [EcoEnchant](https://www.spigotmc.org/resources/ecoenchants-%E2%AD%95-250-enchantments-%E2%9C%85-create-custom-enchants-%E2%9C%A8-essentials-cmi-support.79573/) by Auxilor: Need to use /anvilconfigreload or a server restart to add newly added enchantment. Use EcoEnchant restriction system but new restriction can be added in custom anvil -- [Enchantment²](https://www.spigotmc.org/resources/enchants-squared-the-enchantsplus-rewrite-custom-enchantments-that-act-like-vanilla-ones.86747/): +- [Enchantment²](https://www.spigotmc.org/resources/enchants-squared-the-enchantsplus-rewrite-custom-enchantments-that-act-like-vanilla-ones.86747/) by Athlaeos: Support by Custom Anvil but still experimental. Automatic configuration. Plugin is not actively developed anymore -- [SuperEnchants](https://modrinth.com/plugin/superenchants) +- [SuperEnchants](https://modrinth.com/plugin/superenchants) by Aznos: Use SuperEnchant restrictions system but new restriction can be added in custom anvil #### Custom Items Plugins Custom Items support is considered unstable. If you find issue please report it ! -- [EcoItem](https://www.spigotmc.org/resources/30-sale%E2%8F%B3-ecoitems-%E2%AD%95-create-custom-items-%E2%9C%85-weapons-armors-tools-charms-%E2%9C%A8-item-levels-rarities.94601/) +- [EcoItem](https://www.spigotmc.org/resources/30-sale%E2%8F%B3-ecoitems-%E2%AD%95-create-custom-items-%E2%9C%85-weapons-armors-tools-charms-%E2%9C%A8-item-levels-rarities.94601/) by Exanthiax: May have some issue. but should partially work I hope -- [ItemAdder](https://www.spigotmc.org/resources/%E2%9C%A8itemsadder%E2%AD%90emotes-mobs-items-armors-hud-gui-emojis-blocks-wings-hats-liquids.73355/) +- [ItemAdder](https://www.spigotmc.org/resources/%E2%9C%A8itemsadder%E2%AD%90emotes-mobs-items-armors-hud-gui-emojis-blocks-wings-hats-liquids.73355/) by LoneDev: Need to fix unit item not working completly correctly as in can't have twice same base item #### Anvil Mechanics Plugins -- [Disenchantment](https://www.spigotmc.org/resources/disenchantment-1-21-1-1-20-6-new-book-splitting-mechanics.110741/) +- [Disenchantment](https://www.spigotmc.org/resources/disenchantment-1-21-1-1-20-6-new-book-splitting-mechanics.110741/) by H7KZ Partially use Custom Anvil maximum XP settings (>= 6.1.5) -- [HavenBags](https://www.spigotmc.org/resources/havenbags-shulker-like-player-bound-bags-1-17-1-21-4.110420/) +- [HavenBags](https://www.spigotmc.org/resources/havenbags-shulker-like-player-bound-bags-1-17-1-21-4.110420/) by hyperdefined For bag upgrade and skin via anvil. (version >= 1.31.0) -- [AxPlayerWarp](https://modrinth.com/project/QDJHDKvi) +- [AxPlayerWarp](https://modrinth.com/project/QDJHDKvi) by ArtillexStudios For its anvil inventory usage -- [ToolsStats](https://modrinth.com/project/oBZj9E15) +- [ToolsStats](https://modrinth.com/project/oBZj9E15) by Valorless For token application using anvil ### Known Partially Incompatible -- [UberEnchant](https://modrinth.com/plugin/uberenchant) +- [UberEnchant](https://modrinth.com/plugin/uberenchant) by coltonj96 Anvil handling as they are doing something similar to CustomAnvil. -It is by no mean there faults and I recomend checking them out +It is by no mean there faults and I recommend checking them out especially if custom anvil do not work for your use case ! -- [AdvencedEnchantments](https://ae.advancedplugins.net/) +- [AdvencedEnchantments](https://ae.advancedplugins.net/) by Advanced Plugins Paid plugin I do not own as I did not get commissioned for support. may be able to use api but cannot test on my side diff --git a/CREDITS.md b/CREDITS.md index 528ad15..56409f5 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -5,7 +5,7 @@ Thanks for all the contributors of bukkit, spigot, the paper team and the advent Thanks JetBrain for making IntelliJ ### Dependencies -Here dependencies are used by custom anvil +These dependencies (or a modified version of) are used by custom anvil - [IF](https://github.com/stefvanschie/IF) an inventory framework by stefvanschie - [Mockbukkit](https://github.com/MockBukkit/MockBukkit) for unit testing - [CentralPortalPlus](https://github.com/lalakii/central-portal-plus) by lalakii @@ -17,23 +17,18 @@ Here dependencies are used by custom anvil - [ModrinthUpdateChecker](https://github.com/Clickism/ModrinthUpdateChecker) by Clickism and thanks to the modrinth team ### Compatibility -Here is to credits all the author of plugins -It partially repeat the the [Compatibility list](https://github.com/alexcrea/CustomAnvil/blob/v1.x.x/COMPATIBILITY.md) -- Big Thanks for H7KZ for [Disenchantment](https://github.com/H7KZ/Disenchantment) -- [Enchantment²](https://www.spigotmc.org/resources/enchants-squared-the-enchantsplus-rewrite-custom-enchantments-that-act-like-vanilla-ones.86747/) by Athlaeos -- [EcoEnchant](https://www.spigotmc.org/resources/ecoenchants-%E2%AD%95-250-enchantments-%E2%9C%85-create-custom-enchants-%E2%9C%A8-essentials-cmi-support.79573/) by Auxilor -- [ExcellentEnchants](https://www.spigotmc.org/resources/excellentenchants-%E2%AD%90-75-vanilla-like-enchantments.61693/) by NightExpress -- [HavenBags](https://www.spigotmc.org/resources/havenbags-shulker-like-player-bound-bags-1-17-1-21-4.110420/) by hyperdefined -- [AxPlayerWarp](https://modrinth.com/project/QDJHDKvi) by ArtillexStudios -- [ToolsStats](https://modrinth.com/project/oBZj9E15) by Valorless +Thanks to all the cool creator making the minecraft plugin's ecosystem works ! \ +See [Compatibility list](https://github.com/alexcrea/CustomAnvil/blob/v1.x.x/COMPATIBILITY.md) for details + +but especially, Big Thanks for H7KZ maker of [Disenchantment](https://github.com/H7KZ/Disenchantment) ### Special Thanks -Thanks for Microsoft leading me into using a better operating system \ Thanks for all the users trying my plugin for these niche use cases -and for reporting issues and giving ideas ! +, reporting issues and giving ideas ! Thanks coltonj96 for [UberEnchant](https://modrinth.com/plugin/uberenchant). we may be incompatible with the anvil, but I do think it is a good alternative ! \ -I wish one day to work on cross compatibiltiy +I wish one day to work on cross compatibiltiy \ +* If custom anvil do not work well for you or your use case give it a try ! * From f82ccfa07e34ff5e2dde0256ef9c9013625e3c12 Mon Sep 17 00:00:00 2001 From: alexcrea Date: Wed, 17 Jun 2026 02:14:09 +0200 Subject: [PATCH 12/21] make Version work with experimental 26.1 paper build --- src/main/java/xyz/alexcrea/cuanvil/update/Version.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/xyz/alexcrea/cuanvil/update/Version.java b/src/main/java/xyz/alexcrea/cuanvil/update/Version.java index 15476f5..a49fbdd 100644 --- a/src/main/java/xyz/alexcrea/cuanvil/update/Version.java +++ b/src/main/java/xyz/alexcrea/cuanvil/update/Version.java @@ -21,7 +21,11 @@ public record Version(int major, int minor, int patch) { int[] versionParts = new int[]{0, 0, 0}; for (int i = 0; i < Math.min(3, partialVersion.length); i++) { - versionParts[i] = Integer.parseInt(partialVersion[i]); + try { + versionParts[i] = Integer.parseInt(partialVersion[i]); + } catch (NumberFormatException e) { + break; + } } return new Version(versionParts[0], versionParts[1], versionParts[2]); } From 9d616d2fd0bb4980d14f1fb85f26df207a7301dc Mon Sep 17 00:00:00 2001 From: alexcrea Date: Wed, 17 Jun 2026 02:14:53 +0200 Subject: [PATCH 13/21] remove use of legacy currentMinecraftVersionArray --- .../gui/config/global/BasicConfigGui.java | 12 +++--------- .../alexcrea/cuanvil/update/UpdateUtils.java | 16 ---------------- .../dependency/MinecraftVersionUtil.kt | 19 +++++++++---------- .../packet/PacketManagerSelector.kt | 6 +++--- 4 files changed, 15 insertions(+), 38 deletions(-) diff --git a/src/main/java/xyz/alexcrea/cuanvil/gui/config/global/BasicConfigGui.java b/src/main/java/xyz/alexcrea/cuanvil/gui/config/global/BasicConfigGui.java index 97f8e54..51936c7 100644 --- a/src/main/java/xyz/alexcrea/cuanvil/gui/config/global/BasicConfigGui.java +++ b/src/main/java/xyz/alexcrea/cuanvil/gui/config/global/BasicConfigGui.java @@ -283,15 +283,9 @@ public class BasicConfigGui extends ChestGui implements ValueUpdatableGui { lore.add("§7If the player do not have the required xp level, the action will not be completable."); if(!this.packetManager.getCanSetInstantBuild()){ - if(MinecraftVersionUtil.INSTANCE.isTooNewForSpigot()){ - lore.add(""); - lore.add("§4/!\\§cCaution§4/!\\ §cYou need ProtocoLib installed and working or a paper server."); - lore.add("§cCurrently ProtocoLib is not detected."); - } else { - lore.add(""); - lore.add("§4/!\\§cCaution§4/!\\ §cYou need ProtocoLib installed and working or a newer version of this plugin for this to work."); - lore.add("§cCurrently ProtocoLib is not detected."); - } + lore.add(""); + lore.add("§4/!\\§cCaution§4/!\\ §cYou need ProtocoLib installed and working or a paper server."); + lore.add("§cCurrently ProtocoLib is not detected."); } String[] loreAsArray = new String[lore.size()]; diff --git a/src/main/java/xyz/alexcrea/cuanvil/update/UpdateUtils.java b/src/main/java/xyz/alexcrea/cuanvil/update/UpdateUtils.java index c13515f..2907fef 100644 --- a/src/main/java/xyz/alexcrea/cuanvil/update/UpdateUtils.java +++ b/src/main/java/xyz/alexcrea/cuanvil/update/UpdateUtils.java @@ -15,22 +15,6 @@ public class UpdateUtils { return Version.fromString(versionString); } - @Deprecated - public static int[] currentMinecraftVersionArray() { - String versionString = Bukkit.getServer().getBukkitVersion().split("-")[0]; - return UpdateUtils.readVersionFromString(versionString); - } - - public static int[] readVersionFromString(String versionString) { - String[] partialVersion = versionString.split("\\."); - int[] versionParts = new int[]{0, 0, 0}; - - for (int i = 0; i < Math.min(3, partialVersion.length); i++) { - versionParts[i] = Integer.parseInt(partialVersion[i]); - } - return versionParts; - } - public static void addToStringList(FileConfiguration config, String path, String... toAdd) { List groups = new ArrayList<>(config.getStringList(path)); groups.addAll(Arrays.asList(toAdd)); diff --git a/src/main/kotlin/xyz/alexcrea/cuanvil/dependency/MinecraftVersionUtil.kt b/src/main/kotlin/xyz/alexcrea/cuanvil/dependency/MinecraftVersionUtil.kt index d981f81..cbd2209 100644 --- a/src/main/kotlin/xyz/alexcrea/cuanvil/dependency/MinecraftVersionUtil.kt +++ b/src/main/kotlin/xyz/alexcrea/cuanvil/dependency/MinecraftVersionUtil.kt @@ -6,29 +6,29 @@ object MinecraftVersionUtil { val craftbukkitVersion: String? get() { - val versionParts = UpdateUtils.currentMinecraftVersionArray() - if (versionParts[0] != 1) return null + val version = UpdateUtils.currentMinecraftVersion() + if (version.major != 1) return null - return when (versionParts[1]) { - 17 -> when (versionParts[2]) { + return when (version.minor) { + 17 -> when (version.patch) { 0, 1 -> "1_17R1" else -> null } - 18 -> when (versionParts[2]) { + 18 -> when (version.patch) { 0, 1 -> "1_18R1" 2 -> "1_18R2" else -> null } - 19 -> when (versionParts[2]) { + 19 -> when (version.patch) { 0, 1, 2 -> "1_19R1" 3 -> "1_19R2" 4 -> "1_19R3" else -> null } - 20 -> when (versionParts[2]) { + 20 -> when (version.patch) { 0, 1 -> "1_20R1" 2 -> "1_20R2" 3, 4 -> "1_20R3" @@ -36,7 +36,7 @@ object MinecraftVersionUtil { else -> null } - 21 -> when (versionParts[2]) { + 21 -> when (version.patch) { 0, 1 -> "1_21R1" 2, 3 -> "1_21R2" 4 -> "1_21R3" @@ -52,8 +52,7 @@ object MinecraftVersionUtil { } val isTooNewForSpigot: Boolean get() { - val versionParts = UpdateUtils.currentMinecraftVersionArray() - return versionParts[0] != 1 + return UpdateUtils.currentMinecraftVersion().major != 1 } } \ No newline at end of file diff --git a/src/main/kotlin/xyz/alexcrea/cuanvil/dependency/packet/PacketManagerSelector.kt b/src/main/kotlin/xyz/alexcrea/cuanvil/dependency/packet/PacketManagerSelector.kt index 6c18a75..d74ef08 100644 --- a/src/main/kotlin/xyz/alexcrea/cuanvil/dependency/packet/PacketManagerSelector.kt +++ b/src/main/kotlin/xyz/alexcrea/cuanvil/dependency/packet/PacketManagerSelector.kt @@ -38,8 +38,8 @@ object PacketManagerSelector { // Reobfuscated packet manager for spigot or paper as it remap private val reobfPacketManager: PacketManagerBase? get() { - val versionParts = UpdateUtils.currentMinecraftVersionArray() - if (versionParts[0] != 1) return null + val versionParts = UpdateUtils.currentMinecraftVersion() + if (versionParts.major != 1) return null try { val clazz = Class.forName("xyz.alexcrea.cuanvil.dependency.packet.versions." + @@ -47,7 +47,7 @@ object PacketManagerSelector { val manager = clazz.getConstructor().newInstance() return manager as PacketManagerBase - } catch (e: ClassNotFoundException) { + } catch (_: ClassNotFoundException) { return null } } From bc9cbe0b4459b1c00ccf44b2dde570d98f3b92ec Mon Sep 17 00:00:00 2001 From: alexcrea Date: Fri, 19 Jun 2026 20:29:10 +0200 Subject: [PATCH 14/21] fix and simplify xp handling - Fix xp limit not being respected - Fix player xp not being check causing error --- .../xyz/alexcrea/cuanvil/anvil/AnvilCost.kt | 17 +++++++++ .../cuanvil/listener/AnvilResultListener.kt | 12 ++++-- .../cuanvil/util/anvil/AnvilXpUtil.kt | 38 +++++++------------ 3 files changed, 40 insertions(+), 27 deletions(-) diff --git a/src/main/kotlin/xyz/alexcrea/cuanvil/anvil/AnvilCost.kt b/src/main/kotlin/xyz/alexcrea/cuanvil/anvil/AnvilCost.kt index f8ff89c..710687c 100644 --- a/src/main/kotlin/xyz/alexcrea/cuanvil/anvil/AnvilCost.kt +++ b/src/main/kotlin/xyz/alexcrea/cuanvil/anvil/AnvilCost.kt @@ -1,6 +1,8 @@ package xyz.alexcrea.cuanvil.anvil +import io.delilaheve.util.ConfigOptions import java.math.BigDecimal +import kotlin.math.min import io.delilaheve.util.ConfigOptions.getMonetaryMultiplier as moneyMultiplier open class AnvilCost { @@ -30,6 +32,21 @@ open class AnvilCost { return generic + enchantment + repair + rename + lore + illegalPenalty + workPenalty + recipe } + fun filteredXpCost(ignoreRules: Boolean = false): Int { + val original = asXpCost() + + // Test repair cost limit + return if ( + !ignoreRules && + !ConfigOptions.doRemoveCostLimit && + ConfigOptions.doCapCost + ) { + min(original, ConfigOptions.maxAnvilCost) + } else { + original + } + } + open fun asMonetaryCost(): BigDecimal { // multiply by per use type multipliers return BigDecimal(generic) diff --git a/src/main/kotlin/xyz/alexcrea/cuanvil/listener/AnvilResultListener.kt b/src/main/kotlin/xyz/alexcrea/cuanvil/listener/AnvilResultListener.kt index c5de6a8..e393dbd 100644 --- a/src/main/kotlin/xyz/alexcrea/cuanvil/listener/AnvilResultListener.kt +++ b/src/main/kotlin/xyz/alexcrea/cuanvil/listener/AnvilResultListener.kt @@ -270,13 +270,19 @@ class AnvilResultListener : Listener { } - private fun tryRemoveCost(player: Player, cost: AnvilCost): Boolean { + private fun tryRemoveCost(player: Player, result: AnvilResult): Boolean { if (player.gameMode == GameMode.CREATIVE) return true + + val cost = result.cost if (cost.isMonetary) { val result = EconomyManager.economy!!.remove(player, cost.asMonetaryCost()) if (!result) return false } else { - player.level -= cost.asXpCost() + val xpCost = cost.filteredXpCost() + if (xpCost > AnvilXpUtil.maximumXpCost(result.ignoreXpRules)) return false + if (player.level < xpCost) return false + + player.level -= xpCost } return true @@ -308,7 +314,7 @@ class AnvilResultListener : Listener { // If not creative middle click... if (event.click != ClickType.MIDDLE) { - if (!tryRemoveCost(player, cost)) return false + if (!tryRemoveCost(player, result)) return false // We remove what should be removed if (leftItem != null) leftItem.amount -= leftRemoveCount diff --git a/src/main/kotlin/xyz/alexcrea/cuanvil/util/anvil/AnvilXpUtil.kt b/src/main/kotlin/xyz/alexcrea/cuanvil/util/anvil/AnvilXpUtil.kt index f6ee12f..4846f31 100644 --- a/src/main/kotlin/xyz/alexcrea/cuanvil/util/anvil/AnvilXpUtil.kt +++ b/src/main/kotlin/xyz/alexcrea/cuanvil/util/anvil/AnvilXpUtil.kt @@ -22,7 +22,6 @@ import xyz.alexcrea.cuanvil.dependency.economy.EconomyManager import xyz.alexcrea.cuanvil.group.ConflictType import xyz.alexcrea.cuanvil.util.AnvilTitleUtil import xyz.alexcrea.cuanvil.util.dialog.AnvilRenameDialogUtil -import kotlin.math.min object AnvilXpUtil { @@ -42,7 +41,15 @@ object AnvilXpUtil { cost.isMonetary = true setAnvilPrice(inventory, view, player, cost) } else - setAnvilInvXp(inventory, view, player, cost.asXpCost(), ignoreRules) + setAnvilInvXp(inventory, view, player, cost.filteredXpCost(ignoreRules), ignoreRules) + } + + fun maximumXpCost(ignoreRules: Boolean = false): Int { + return if (ConfigOptions.doRemoveCostLimit || ignoreRules) { + Int.MAX_VALUE + } else { + ConfigOptions.maxAnvilCost + 1 + } } /** @@ -55,28 +62,11 @@ object AnvilXpUtil { anvilCost: Int, ignoreRules: Boolean = false ) { - - // Test repair cost limit - val finalAnvilCost = if ( - !ignoreRules && - !ConfigOptions.doRemoveCostLimit && - ConfigOptions.doCapCost - ) { - min(anvilCost, ConfigOptions.maxAnvilCost) - } else { - anvilCost - } - - val maximumRepairCost = - if (ConfigOptions.doRemoveCostLimit || ignoreRules) { - Int.MAX_VALUE - } else { - ConfigOptions.maxAnvilCost + 1 - } + val maximumRepairCost = maximumXpCost(ignoreRules) // Try first just in case another plugin, or the test need this inventory.maximumRepairCost = maximumRepairCost - inventory.repairCost = finalAnvilCost + inventory.repairCost = anvilCost // TODO for 2.x.x use anvil view & set directly there /* Because Minecraft likes to have the final say in the repair cost displayed @@ -87,15 +77,15 @@ object AnvilXpUtil { ) { // retry after a tick inventory.maximumRepairCost = maximumRepairCost - inventory.repairCost = finalAnvilCost + inventory.repairCost = anvilCost // TODO for 2.x.x use anvil view & set directly there if (player !is Player) return@scheduleOnEntity if (player.gameMode != GameMode.CREATIVE) { val bypassToExpensive = (ConfigOptions.doReplaceTooExpensive) && - (finalAnvilCost >= 40) && - finalAnvilCost < inventory.maximumRepairCost + (anvilCost >= 40) && + anvilCost < inventory.maximumRepairCost DependencyManager.packetManager.setInstantBuild(player, bypassToExpensive) } From 950bad2168c67d8bdd6dd60360e14161c9879662 Mon Sep 17 00:00:00 2001 From: alexcrea Date: Fri, 19 Jun 2026 20:31:31 +0200 Subject: [PATCH 15/21] versions bump --- build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 7b449fc..bb5a97f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -22,7 +22,7 @@ plugins { } group = "xyz.alexcrea" -version = "1.17.2" +version = "1.17.3" val isDevBuild = System.getenv("SMALL_COMMIT_HASH") != null val isPreRelease = System.getenv("IS_GITHUB_PRERELEASE") == "true" @@ -58,7 +58,7 @@ dependencies { compileOnly("org.spigotmc:spigot-api:1.18-R0.1-SNAPSHOT") // fast stats - implementation("dev.faststats.metrics:bukkit:0.26.1") + implementation("dev.faststats.metrics:bukkit:0.27.0") // minimessage implementation("net.kyori:adventure-text-minimessage:4.25.0") From 106cd53b02fcbb3d32331471ce77d471588d7861 Mon Sep 17 00:00:00 2001 From: alexcrea Date: Sat, 20 Jun 2026 03:27:58 +0200 Subject: [PATCH 16/21] mark 26.2.x as supported on modrinth & hangar [ci skip] --- .github/workflows/gradle.yml | 2 +- gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 66c1ad1..a50cacd 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -26,7 +26,7 @@ jobs: contents: write env: - MODRINTH_VERSIONS: '["1.18.x", "1.19.x", "1.20.x", "1.21.x", "26.1.x"]' + MODRINTH_VERSIONS: '["1.18.x", "1.19.x", "1.20.x", "1.21.x", "26.1.x", "26.2.x"]' MODRINTH_PLATFORMS: '["spigot", "paper", "purpur", "folia"]' steps: diff --git a/gradle.properties b/gradle.properties index 19e22ef..4397d2e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,5 +9,5 @@ kotlin.daemon.jvmargs=-Xmx8G subprojects.reobfnms=v1_17R1,v1_18R1,v1_18R2,v1_19R1,v1_19R2,v1_19R3,v1_20R1,v1_20R2,v1_20R3,v1_20R4,v1_21R1,v1_21R2,v1_21R3,v1_21R4,v1_21R5,v1_21R6,v1_21R7 # list of version for hangar release -paperVersion=1.18-26.1.2 +paperVersion=1.18-26.2 From 178b372255d510e63f97958ba9d9a9171941832c Mon Sep 17 00:00:00 2001 From: alexcrea Date: Sat, 20 Jun 2026 14:55:31 +0200 Subject: [PATCH 17/21] paper mns use getter/setter no property access [ci skip] --- build.gradle.kts | 2 +- .../cuanvil/dependency/packet/versions/PaperPacketManager.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index bb5a97f..8fde3e6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -22,7 +22,7 @@ plugins { } group = "xyz.alexcrea" -version = "1.17.3" +version = "1.17.4" val isDevBuild = System.getenv("SMALL_COMMIT_HASH") != null val isPreRelease = System.getenv("IS_GITHUB_PRERELEASE") == "true" diff --git a/nms/nms-paper/src/main/kotlin/xyz/alexcrea/cuanvil/dependency/packet/versions/PaperPacketManager.kt b/nms/nms-paper/src/main/kotlin/xyz/alexcrea/cuanvil/dependency/packet/versions/PaperPacketManager.kt index 7e248e1..ee0c101 100644 --- a/nms/nms-paper/src/main/kotlin/xyz/alexcrea/cuanvil/dependency/packet/versions/PaperPacketManager.kt +++ b/nms/nms-paper/src/main/kotlin/xyz/alexcrea/cuanvil/dependency/packet/versions/PaperPacketManager.kt @@ -24,8 +24,8 @@ class PaperPacketManager : PacketManagerBase(), PacketManager { sendedAbilities.mayfly = playerAbilities.mayfly sendedAbilities.instabuild = instantBuild sendedAbilities.mayBuild = playerAbilities.mayBuild - sendedAbilities.flyingSpeed = playerAbilities.flyingSpeed - sendedAbilities.walkingSpeed = playerAbilities.walkingSpeed + sendedAbilities.setFlyingSpeed(playerAbilities.getFlyingSpeed()) + sendedAbilities.setWalkingSpeed(playerAbilities.getWalkingSpeed()) } val packet = ClientboundPlayerAbilitiesPacket(sendedAbilities) nmsPlayer.connection.send(packet) From 95d3cf3228f1344fb75e8170c705337c7140c541 Mon Sep 17 00:00:00 2001 From: alexcrea Date: Sat, 20 Jun 2026 23:43:01 +0200 Subject: [PATCH 18/21] update nightexpress --- impl/ExcellentEnchant5_4/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/impl/ExcellentEnchant5_4/build.gradle.kts b/impl/ExcellentEnchant5_4/build.gradle.kts index 87694be..f8c103d 100644 --- a/impl/ExcellentEnchant5_4/build.gradle.kts +++ b/impl/ExcellentEnchant5_4/build.gradle.kts @@ -13,5 +13,5 @@ repositories { dependencies { // Excellent Enchant compileOnly("su.nightexpress.excellentenchants:Core:5.4.1") - compileOnly("su.nightexpress.nightcore:main:2.14.1") + compileOnly("su.nightexpress.nightcore:main:2.16.2") } \ No newline at end of file From 37e8ca7da9b0af7546736f147e7ba19bbe0cbe37 Mon Sep 17 00:00:00 2001 From: alexcrea Date: Sat, 20 Jun 2026 23:49:03 +0200 Subject: [PATCH 19/21] update excellentenchants --- impl/ExcellentEnchant5_4/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/impl/ExcellentEnchant5_4/build.gradle.kts b/impl/ExcellentEnchant5_4/build.gradle.kts index f8c103d..9fe598b 100644 --- a/impl/ExcellentEnchant5_4/build.gradle.kts +++ b/impl/ExcellentEnchant5_4/build.gradle.kts @@ -12,6 +12,6 @@ repositories { dependencies { // Excellent Enchant - compileOnly("su.nightexpress.excellentenchants:Core:5.4.1") + compileOnly("su.nightexpress.excellentenchants:Core:5.4.3") compileOnly("su.nightexpress.nightcore:main:2.16.2") } \ No newline at end of file From 7f7f049b7bf74b20228ea21261a587b049858958 Mon Sep 17 00:00:00 2001 From: alexcrea <42614139+alexcrea@users.noreply.github.com> Date: Mon, 22 Jun 2026 01:01:45 +0200 Subject: [PATCH 20/21] Update COMPATIBILITY.md --- COMPATIBILITY.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/COMPATIBILITY.md b/COMPATIBILITY.md index 916a089..9d37521 100644 --- a/COMPATIBILITY.md +++ b/COMPATIBILITY.md @@ -13,7 +13,8 @@ These plugins have compatibility handled by custom anvil. seek help on custom an #### Enchantment Plugins - [ExcellentEnchants](https://www.spigotmc.org/resources/excellentenchants-%E2%AD%90-75-vanilla-like-enchantments.61693/) by NightExpress: - Use ExcellentEnchants item type + Use ExcellentEnchants item type \ + Also use ExcellentEnchant max enchant limit - [EcoEnchant](https://www.spigotmc.org/resources/ecoenchants-%E2%AD%95-250-enchantments-%E2%9C%85-create-custom-enchants-%E2%9C%A8-essentials-cmi-support.79573/) by Auxilor: Need to use /anvilconfigreload or a server restart to add newly added enchantment. From eb2e7b3abb3627cbc16dd83ba414c7e4909b6155 Mon Sep 17 00:00:00 2001 From: alexcrea Date: Mon, 22 Jun 2026 03:11:46 +0200 Subject: [PATCH 21/21] allow enchanted book for super enchant --- build.gradle.kts | 2 +- .../cuanvil/enchant/wrapped/CASuperEnchantEnchantment.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 8fde3e6..a5dc7c3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -22,7 +22,7 @@ plugins { } group = "xyz.alexcrea" -version = "1.17.4" +version = "1.17.5" val isDevBuild = System.getenv("SMALL_COMMIT_HASH") != null val isPreRelease = System.getenv("IS_GITHUB_PRERELEASE") == "true" diff --git a/src/main/java/xyz/alexcrea/cuanvil/enchant/wrapped/CASuperEnchantEnchantment.java b/src/main/java/xyz/alexcrea/cuanvil/enchant/wrapped/CASuperEnchantEnchantment.java index f5943be..6039dc8 100644 --- a/src/main/java/xyz/alexcrea/cuanvil/enchant/wrapped/CASuperEnchantEnchantment.java +++ b/src/main/java/xyz/alexcrea/cuanvil/enchant/wrapped/CASuperEnchantEnchantment.java @@ -5,6 +5,7 @@ import com.maddoxh.superEnchants.enchants.EnchantManager; import com.maddoxh.superEnchants.items.EnchantApplicator; import com.maddoxh.superEnchants.items.EnchantReader; import com.maddoxh.superEnchants.util.ConflictChecker; +import org.bukkit.Material; import org.bukkit.NamespacedKey; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; @@ -68,6 +69,8 @@ public class CASuperEnchantEnchantment extends CAEnchantmentBase implements Addi @Override public boolean isItemConflict(@NotNull Map enchantments, @NotNull NamespacedKey itemType, @NotNull ItemStack item) { + if(Material.ENCHANTED_BOOK.equals(item.getType())) return false; + return !enchant.canApplyTo(item.getType()); } }