fix anvil degradation not working for

This commit is contained in:
alexcrea 2026-08-03 14:29:30 +02:00
parent d846ce51d8
commit 6f077a576b
Signed by: alexcrea
GPG key ID: E59DF23EE2A2266C

View file

@ -243,6 +243,8 @@ class AnvilResultListener : Listener {
player.updateInventory() player.updateInventory()
} }
handleAnvilMechanic(player, view)
return true return true
} }
@ -355,7 +357,7 @@ class AnvilResultListener : Listener {
} }
if (event.click != ClickType.MIDDLE) if (event.click != ClickType.MIDDLE)
handleAnvilMechanic(player, view, player.gameMode != GameMode.CREATIVE) handleAnvilMechanic(player, view)
return true return true
} }
@ -384,6 +386,11 @@ class AnvilResultListener : Listener {
} }
} }
// Process both sound & degradation
private fun handleAnvilMechanic(player: HumanEntity, view: AnvilView) {
return handleAnvilMechanic(player, view, player.gameMode != GameMode.CREATIVE)
}
// Process both sound & degradation // Process both sound & degradation
private fun handleAnvilMechanic(player: HumanEntity, view: AnvilView, canDegrade: Boolean) { private fun handleAnvilMechanic(player: HumanEntity, view: AnvilView, canDegrade: Boolean) {
// ok so we do not provide a getLocation on view ? // ok so we do not provide a getLocation on view ?