File tree 1 file changed +9
-2
lines changed
core/common/src/main/kotlin/com/willfp/libreforge
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
1
package com.willfp.libreforge
2
2
3
3
import com.willfp.eco.core.items.Items
4
+ import com.willfp.eco.util.namespacedKeyOf
4
5
import com.willfp.libreforge.proxy.Proxy
5
6
import com.willfp.libreforge.proxy.loadProxy
6
7
import org.bukkit.Bukkit
@@ -93,8 +94,14 @@ fun ItemStack.applyDamage(damage: Int, player: Player?): Boolean {
93
94
}
94
95
95
96
// 1.21 compat
96
- fun getEnchantment (id : String ): Enchantment ? =
97
- Enchantment .getByKey(NamespacedKey .minecraft(id))
97
+ fun getEnchantment (id : String ): Enchantment ? {
98
+ if (id.contains(' :' )) {
99
+ val key = namespacedKeyOf(id)
100
+ return Enchantment .getByKey(key)
101
+ } else {
102
+ return Enchantment .getByKey(NamespacedKey .minecraft(id))
103
+ }
104
+ }
98
105
99
106
@Proxy(" OpenInventoryAccessorImpl" )
100
107
interface OpenInventoryAccessor {
You can’t perform that action at this time.
0 commit comments