redstone ore: a right-click lights it, as RedStoneOreBlock.useItemOn does

Fixes #3044.
This commit is contained in:
iLostName committed 2026-10-28 06:52:15 +01:00
1 parent 56f968e11c
commit e06134f71a
2 files changed
+28

No files matched your search

+4
View File
@@ -4233,6 +4233,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
@@ -1577,6 +1577,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