Skip to content

Commit

Permalink
Merge branch 'Auxilor:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
LangZongz authored Dec 20, 2023
2 parents 0157880 + 1c49c32 commit 282f330
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,17 @@ import org.bukkit.enchantments.Enchantment

@Suppress("UNCHECKED_CAST")
object LegacyEnchantmentRegisterer : EnchantmentRegisterer {
init {
/**
* Register an enchantment to bukkit (for replacing vanilla CraftEnchantments)
*/
fun registerToBukkit(enchantment: Enchantment) {
// Allow registering new enchantments
Enchantment::class.java.getDeclaredField("acceptingNew")
.apply {
isAccessible = true
set(null, true)
}
}

/**
* Register an enchantment to bukkit (for replacing vanilla CraftEnchantments)
*/
fun registerToBukkit(enchantment: Enchantment) {
Enchantment::class.java.getDeclaredField("byKey")
.apply {
isAccessible = true
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#Sun Dec 03 16:00:06 GMT 2023
kotlin.code.style=official
libreforge-version=4.49.2
version=11.0.3
version=11.0.4

0 comments on commit 282f330

Please sign in to comment.