mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 08:14:00 +02:00
use correct anvil combine method
This commit is contained in:
parent
ea6c5724fa
commit
377bc4c1d8
1 changed files with 14 additions and 5 deletions
|
|
@ -184,11 +184,20 @@ class ExcellentEnchantsDependency {
|
|||
)
|
||||
this.handleRechargeMethod.setAccessible(true)
|
||||
|
||||
this.handleCombineMethod = this.usedAnvilListener.javaClass.getDeclaredMethod(
|
||||
"handleCombine",
|
||||
PrepareAnvilEvent::class.java, ItemStack::class.java, ItemStack::class.java, ItemStack::class.java
|
||||
)
|
||||
this.handleCombineMethod.setAccessible(true)
|
||||
try {
|
||||
this.usedAnvilListener.javaClass.methods.forEach { method -> CustomAnvil.instance.logger.warning { method.name } }
|
||||
this.handleCombineMethod = this.usedAnvilListener.javaClass.getDeclaredMethod(
|
||||
"anvilCombine",
|
||||
PrepareAnvilEvent::class.java, ItemStack::class.java, ItemStack::class.java, ItemStack::class.java
|
||||
)
|
||||
this.handleCombineMethod.setAccessible(true)
|
||||
} catch (_: NoSuchMethodException) {
|
||||
this.handleCombineMethod = this.usedAnvilListener.javaClass.getDeclaredMethod(
|
||||
"handleCombine",
|
||||
PrepareAnvilEvent::class.java, ItemStack::class.java, ItemStack::class.java, ItemStack::class.java
|
||||
)
|
||||
this.handleCombineMethod.setAccessible(true)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue