Skip to content

Commit

Permalink
fixup! player/player.go: Fix eating in creative mode
Browse files Browse the repository at this point in the history
  • Loading branch information
DaPigGuy committed Dec 29, 2024
1 parent 53948e3 commit c709972
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions server/player/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -1411,15 +1411,14 @@ func (p *Player) UseItem() {
// The required duration for consuming this item was not met, so we don't consume it.
return
}
// Reset the duration for the next item to be consumed.
p.usingSince = time.Now()
ctx := event.C(p)
if p.Handler().HandleItemConsume(ctx, i); ctx.Cancelled() {
// Consuming was cancelled, but the client will continue consuming the next item.
p.usingSince = time.Now()
return
}
useCtx.CountSub, useCtx.NewItem = 1, usable.Consume(p.tx, p)
p.handleUseContext(useCtx)
p.usingSince = time.Now()
p.tx.PlaySound(p.Position().Add(mgl64.Vec3{0, 1.5}), sound.Burp{})
}
}
Expand Down

0 comments on commit c709972

Please sign in to comment.