Merge pull request #1102 from ludovic111/fix/no-use-while-using-item

🤖 Agent: merged. Verify passes; CI parity passes except dedicated_server, which fails the same way on main (play-pearl teleported 0 vs 1, the known flake in FEATURES.md LATER).
This commit is contained in:
Ludovic Marie
2026-10-21 23:02:37 +02:00
committed by GitHub
+6 -1
View File
@@ -4159,8 +4159,11 @@ impl Game<'_> {
});
horizon_client::spans::time("tick_particles", || self.tick_particles());
}
// Minecraft.handleKeybinds: held use repeats only while no item is in
// use (a raised shield or a drawn bow places and uses nothing).
if self.right
&& self.use_delay == 0
&& self.using.is_none()
&& self.screen == Screen::Playing
&& self.sleeping.is_none()
{
@@ -9828,7 +9831,9 @@ impl Game<'_> {
self.toggles
.button(3, pressed, false, self.settings.toggle_use);
self.right = self.toggles.is_down(3);
if pressed {
// handleKeybinds consumes use clicks without acting while an
// item is in use.
if pressed && self.using.is_none() {
self.use_with_hand()?;
self.use_delay = 4;
}