[PR #2660] [MERGED] Translate the sleep messages and send the respawn point message only when it changes #4516

Closed
opened 2026-11-03 04:17:44 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2660
Author: @kacpherek
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/sleep-messages


📝 Commits (1)

  • f2db04b Translate the sleep messages and send the respawn point message only when it changes

📊 Changes

1 file changed (+63 additions, -24 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+63 -24)

📄 Description

What and why

Sleep messages were English text in the code, and "Respawn point set" showed on every successful sleep as a line above the hotbar.

Now:

  • The bed messages (too far away, obstructed, only at night, monsters nearby) use the game's translations. For a guest on the server they go out as translatable text, so the guest's own client picks the language.
  • "Respawn point set" is a chat message, sent only when the respawn point actually changes (a different bed or dimension). It is sent before the night check, as in vanilla, so it also shows when you click a bed by day.
  • "No amount of rest can pass this night" shows when players_sleeping_percentage is above 100.

Vanilla reference

  • ServerPlayer.setRespawnPosition(config, showMessage): block.minecraft.set_spawn as a system message when !isSamePosition.
  • ServerPlayer.startSleepInBed: the problem messages block.minecraft.bed.too_far_away, obstructed, no_sleep and not_safe (shown on the action bar), and sleep.not_possible when !canSleepThroughNights().

Self-check

cargo check -p horizon-client passes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2660 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/sleep-messages` --- ### 📝 Commits (1) - [`f2db04b`](https://github.com/horizon-rust/horizon/commit/f2db04bd64b049a936700261be9f139c84ef730b) Translate the sleep messages and send the respawn point message only when it changes ### 📊 Changes **1 file changed** (+63 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+63 -24) </details> ### 📄 Description ## What and why Sleep messages were English text in the code, and "Respawn point set" showed on every successful sleep as a line above the hotbar. Now: - The bed messages (too far away, obstructed, only at night, monsters nearby) use the game's translations. For a guest on the server they go out as translatable text, so the guest's own client picks the language. - "Respawn point set" is a chat message, sent only when the respawn point actually changes (a different bed or dimension). It is sent before the night check, as in vanilla, so it also shows when you click a bed by day. - "No amount of rest can pass this night" shows when `players_sleeping_percentage` is above 100. ## Vanilla reference - `ServerPlayer.setRespawnPosition(config, showMessage)`: `block.minecraft.set_spawn` as a system message when `!isSamePosition`. - `ServerPlayer.startSleepInBed`: the problem messages `block.minecraft.bed.too_far_away`, `obstructed`, `no_sleep` and `not_safe` (shown on the action bar), and `sleep.not_possible` when `!canSleepThroughNights()`. ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:17:44 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4516
No description provided.