mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
Fix eco enchant not being registered as CAEcoEnchant.
This commit is contained in:
parent
ac7f975b02
commit
42a028f2fd
1 changed files with 2 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ import io.delilaheve.CustomAnvil
|
||||||
import org.bukkit.event.inventory.PrepareAnvilEvent
|
import org.bukkit.event.inventory.PrepareAnvilEvent
|
||||||
import org.bukkit.plugin.Plugin
|
import org.bukkit.plugin.Plugin
|
||||||
import xyz.alexcrea.cuanvil.api.EnchantmentApi
|
import xyz.alexcrea.cuanvil.api.EnchantmentApi
|
||||||
|
import xyz.alexcrea.cuanvil.enchant.wrapped.CAEcoEnchant
|
||||||
|
|
||||||
class EcoEnchantDependency(private val ecoEnchantPlugin: Plugin) {
|
class EcoEnchantDependency(private val ecoEnchantPlugin: Plugin) {
|
||||||
|
|
||||||
|
|
@ -21,7 +22,7 @@ class EcoEnchantDependency(private val ecoEnchantPlugin: Plugin) {
|
||||||
|
|
||||||
for (ecoEnchant in EcoEnchants.values()) {
|
for (ecoEnchant in EcoEnchants.values()) {
|
||||||
EnchantmentApi.unregisterEnchantment(ecoEnchant.enchantment) // As eco enchants is loaded before custom anvil and register enchantment to registry, we need to unregister old "vanilla" enchant.
|
EnchantmentApi.unregisterEnchantment(ecoEnchant.enchantment) // As eco enchants is loaded before custom anvil and register enchantment to registry, we need to unregister old "vanilla" enchant.
|
||||||
EnchantmentApi.registerEnchantment(ecoEnchant.enchantment)
|
EnchantmentApi.registerEnchantment(CAEcoEnchant(ecoEnchant))
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomAnvil.instance.logger.info("Eco Enchant should now work as expected !")
|
CustomAnvil.instance.logger.info("Eco Enchant should now work as expected !")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue