mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
Only remove experience on custom anvil craft if player not in creative.
Remove the right amount of experience for custom craft.
This commit is contained in:
parent
1746cdfbde
commit
d1cfd7443c
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
|
||||
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
|
||||
val newAmount = getCustomRecipeAmount(recipe, leftItem, rightItem)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue