[PR #2367] [MERGED] Apply /xp, /clear and /spawnpoint to each target, not only the host #4246

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

📋 Pull Request Information

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

Base: main ← Head: fix/xp-clear-spawnpoint-targets


📝 Commits (1)

  • 8ca15ae Apply /xp, /clear and /spawnpoint to each target, not only the host

📊 Changes

1 file changed (+103 additions, -68 deletions)

View changed files

📝 crates/horizon-client/src/game/commands.rs (+103 -68)

📄 Description

What and why

/xp, /clear and /spawnpoint ignored who they were aimed at and always changed the host's own experience, inventory or spawn point. With LAN guests or on a server, /xp add @a 5 levels, /clear Steve or /spawnpoint @a did nothing to the others (and /xp query Steve showed the host's level).

Each of them now applies to every target, one player at a time, the same way /give reaches a guest. The messages follow vanilla's response tracker: the target's name when one player was changed (or had items), a count otherwise. /clear gives each player their own maxCount and reports the total, and fails only when no target had a matching item. /xp set ... points is refused only for the targets whose level cannot hold that many points, and fails when none can.

Vanilla reference

  • ExperienceCommand.addExperience, setExperience, queryExperience (CommandResponseTracker)
  • ClearInventoryCommands.clearInventory (per player clearOrCountMatchingItems, RESPONSE_CLEAR, ERROR_DISPATCH)
  • SetSpawnCommand.setSpawn (setRespawnPosition for each target, the source's level)

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/2367 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/xp-clear-spawnpoint-targets` --- ### 📝 Commits (1) - [`8ca15ae`](https://github.com/horizon-rust/horizon/commit/8ca15ae2ca47df8857c611cde8c2208568a74101) Apply /xp, /clear and /spawnpoint to each target, not only the host ### 📊 Changes **1 file changed** (+103 additions, -68 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/commands.rs` (+103 -68) </details> ### 📄 Description ## What and why `/xp`, `/clear` and `/spawnpoint` ignored who they were aimed at and always changed the host's own experience, inventory or spawn point. With LAN guests or on a server, `/xp add @a 5 levels`, `/clear Steve` or `/spawnpoint @a` did nothing to the others (and `/xp query Steve` showed the host's level). Each of them now applies to every target, one player at a time, the same way `/give` reaches a guest. The messages follow vanilla's response tracker: the target's name when one player was changed (or had items), a count otherwise. `/clear` gives each player their own `maxCount` and reports the total, and fails only when no target had a matching item. `/xp set ... points` is refused only for the targets whose level cannot hold that many points, and fails when none can. ## Vanilla reference - `ExperienceCommand.addExperience`, `setExperience`, `queryExperience` (`CommandResponseTracker`) - `ClearInventoryCommands.clearInventory` (per player `clearOrCountMatchingItems`, `RESPONSE_CLEAR`, `ERROR_DISPATCH`) - `SetSpawnCommand.setSpawn` (`setRespawnPosition` for each target, the source's level) ## 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:15:46 +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#4246
No description provided.