mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-02-16 04:31:22 +01:00
fix: anvil event resets result -> collides with other plugins
This commit is contained in:
parent
199bd8e621
commit
a4857ed028
@ -78,9 +78,6 @@ class AnvilSupport(
|
||||
val old = left?.clone()
|
||||
val right = event.inventory.getItem(1)?.clone()
|
||||
|
||||
event.result = null
|
||||
event.inventory.setItem(2, null)
|
||||
|
||||
val result = doMerge(
|
||||
left,
|
||||
right,
|
||||
@ -88,6 +85,13 @@ class AnvilSupport(
|
||||
player
|
||||
)
|
||||
|
||||
if (result == FAIL) {
|
||||
return@run
|
||||
}
|
||||
|
||||
event.result = null
|
||||
event.inventory.setItem(2, null)
|
||||
|
||||
val price = result.xp ?: 0
|
||||
val outItem = result.result ?: ItemStack(Material.AIR)
|
||||
|
||||
@ -95,10 +99,6 @@ class AnvilSupport(
|
||||
|
||||
val oldLeft = event.inventory.getItem(0)
|
||||
|
||||
if (result == FAIL) {
|
||||
return@run
|
||||
}
|
||||
|
||||
if (oldLeft == null || oldLeft.type != outItem.type) {
|
||||
return@run
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user