mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-11-07 11:06:11 -10:00
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:
1 parent
d9e5bc1bc8
commit
c928a17802
2 files changed
+3
-2
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
@@ -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!(
|
||||
|
||||
Reference in new issue
Block a user