From d1cfd7443ccb5e19f97884c0a3f400a089ced0de Mon Sep 17 00:00:00 2001 From: alexcrea <42614139+alexcrea@users.noreply.github.com> Date: Sun, 11 Aug 2024 04:24:53 +0200 Subject: [PATCH] Only remove experience on custom anvil craft if player not in creative. Remove the right amount of experience for custom craft. --- src/main/kotlin/io/delilaheve/AnvilEventListener.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/io/delilaheve/AnvilEventListener.kt b/src/main/kotlin/io/delilaheve/AnvilEventListener.kt index 4b8b880..576963e 100644 --- a/src/main/kotlin/io/delilaheve/AnvilEventListener.kt +++ b/src/main/kotlin/io/delilaheve/AnvilEventListener.kt @@ -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)