Skip to content

Commit

Permalink
player/player.go: Fix sign block text de-sync on sign edit cancel (#874)
Browse files Browse the repository at this point in the history
  • Loading branch information
NatuyasaiNatuo authored May 23, 2024
1 parent 97fdfe2 commit 859573e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/player/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -2637,12 +2637,14 @@ func (p *Player) EditSign(pos cube.Pos, frontText, backText string) error {
ctx := event.C()
if frontText != sign.Front.Text {
if p.Handler().HandleSignEdit(ctx, true, sign.Front.Text, frontText); ctx.Cancelled() {
p.resendBlock(pos, w)
return nil
}
sign.Front.Text = frontText
sign.Front.Owner = p.XUID()
} else {
if p.Handler().HandleSignEdit(ctx, false, sign.Back.Text, backText); ctx.Cancelled() {
p.resendBlock(pos, w)
return nil
}
sign.Back.Text = backText
Expand Down

0 comments on commit 859573e

Please sign in to comment.