Merge pull request #3063 from iLostName/redstone-ore-lights-on-use

🤖 Agent: read the diff at e06134f71 ("redstone ore: a right-click lights it, as RedStoneOreBlock.useItemOn d") against the 26.3 source it cites; verify green, merges cleanly with main. Proof: cg25 union a051cc285 (local branch cg25/union in t3-ef805fdb: main 6d3489d30 + 38 contributor heads merged cleanly, no fixups): clippy -p horizon-client --all-targets -D warnings clean, horizon-client lib 1105 + bin 133 + integration tests pass, parity --changed 355/355 harnesses PASS on the Mac mini (Cargo.lock changed by #3210, so every harness ran; tab_list passed on its one retry).
This commit is contained in:
Ludovic Marie
2026-10-28 19:50:51 +01:00
committed by GitHub
2 changed files with 28 additions and 0 deletions
+4
View File
@@ -4279,6 +4279,10 @@ impl Game<'_> {
self.swing_arm();
return Ok(true);
}
if self.use_redstone_ore(hit.pos, held.as_ref())? {
self.swing_arm();
return Ok(true);
}
match self.use_respawn_anchor(hit.pos, held.as_ref())? {
respawn_anchor::AnchorUse::Charged => {
self.swing_arm();
+24
View File
@@ -1592,6 +1592,30 @@ impl Game<'_> {
}
}
/// `RedStoneOreBlock.useItemOn`: a right-click lights the ore whatever the
/// hand holds. False (PASS) when the hand holds a block item, which goes on
/// to be placed; true (SUCCESS) otherwise.
pub(super) fn use_redstone_ore(
&mut self,
pos: [i32; 3],
held: Option<&horizon_client::items::ItemStack>,
) -> Result<bool> {
if !matches!(
&*self.block_name(pos),
"minecraft:redstone_ore" | "minecraft:deepslate_redstone_ore"
) {
return Ok(false);
}
self.attack_block(pos)?;
let block_item = held.is_some_and(|s| {
self.res
.items()
.get(&s.item)
.is_some_and(|i| i.block.is_some())
});
Ok(!block_item)
}
fn tick_mob_sculk_events(&mut self) {
let snapshot: Vec<(u32, [f64; 3], bool, bool, Species, Option<i64>)> = self
.mobs