mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
Fix issue with custom anvil craft (#23)
Only remove experience on custom anvil craft if player not in creative. (fix #21) Remove the right amount of experience for custom craft.
This commit is contained in:
commit
d472e19499
1 changed files with 4 additions and 1 deletions
|
|
@ -361,7 +361,10 @@ class AnvilEventListener(private val packetManager: PacketManager) : Listener {
|
||||||
rightItem.amount -= amount * recipe.rightItem!!.amount
|
rightItem.amount -= amount * recipe.rightItem!!.amount
|
||||||
inventory.setItem(ANVIL_INPUT_RIGHT, rightItem)
|
inventory.setItem(ANVIL_INPUT_RIGHT, rightItem)
|
||||||
}
|
}
|
||||||
player.level -= amount
|
|
||||||
|
if(player.gameMode != GameMode.CREATIVE){
|
||||||
|
player.level -= xpCost
|
||||||
|
}
|
||||||
|
|
||||||
// Then we try to find the new values for the anvil
|
// Then we try to find the new values for the anvil
|
||||||
val newAmount = getCustomRecipeAmount(recipe, leftItem, rightItem)
|
val newAmount = getCustomRecipeAmount(recipe, leftItem, rightItem)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue