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:
alexcrea 2024-08-11 04:24:53 +02:00
parent 1746cdfbde
commit d1cfd7443c
No known key found for this signature in database
GPG key ID: 43FD265DB0DBF91F

View file

@ -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)