Skip to content

Commit

Permalink
Update Item.kt
Browse files Browse the repository at this point in the history
Oops forgot to set the damage and use LivingEntity instead and player(stack) as default.
  • Loading branch information
EngineMachiner committed May 25, 2024
1 parent 3211cec commit 8ab2de4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/com/enginemachiner/harmony/Item.kt
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ private interface HarmonyItem {
fun player( stack: ItemStack ): PlayerEntity { return stack.holder as PlayerEntity }

/** Damage the stack. */
fun damage( stack: ItemStack, player: PlayerEntity, damage: Int = 1 ) {
fun damage( stack: ItemStack, entity: LivingEntity = player(stack), damage: Int = 1 ) {

stack.damage(1, player) { breakEquipment(it, stack) }
stack.damage( damage, entity ) { breakEquipment(entity, stack) }

}

Expand Down

0 comments on commit 8ab2de4

Please sign in to comment.