Moving piston click: CONSUME, not SUCCESS

MovingPistonBlock.useWithoutItem returns InteractionResult.CONSUME when it
removes an orphaned moving piston, so the player's arm does not swing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Ludovic MarieandClaude Opus 5.5 committed 2026-11-02 12:34:33 +01:00
1 parent d9e5bc1bc8
commit c928a17802
2 files changed
+3 -2

No files matched your search

+2 -1
View File
@@ -443,7 +443,8 @@ impl<L: LevelAccess + ?Sized> Sim<'_, L> {
Class::MovingPiston => {
if !self.level.is_client_side() && self.moving_piston(pos).is_none() {
self.remove_block(pos, false);
Success
// CONSUME: the action is used, the arm does not swing.
Consume
} else {
Pass
}
+1 -1
View File
@@ -1972,7 +1972,7 @@ fn a_moving_piston_without_a_block_entity_is_removed_by_a_click() {
id: 0,
},
));
assert_eq!(w.use_block(orphan), InteractionResult::Success);
assert_eq!(w.use_block(orphan), InteractionResult::Consume);
assert_eq!(w.get(orphan), air, "the orphan moving piston is removed");
assert_eq!(w.use_block(in_flight), InteractionResult::Pass);
assert_eq!(