From d485c688d6a1087227141868ef4493a2cd81db34 Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Tue, 27 Oct 2026 21:45:44 +0100 Subject: [PATCH 1/2] Let armor stands press pressure plates and tripwires A non-marker armor stand is a LivingEntity, so it counts for the mob and weighted plates and trips wires. ArmorStand.isIgnoringBlockTriggers() is only true for markers. --- crates/horizon-client/src/game.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/crates/horizon-client/src/game.rs b/crates/horizon-client/src/game.rs index 8e591cf3b..9d85ddb22 100644 --- a/crates/horizon-client/src/game.rs +++ b/crates/horizon-client/src/game.rs @@ -670,15 +670,22 @@ impl EntityObstructionWorld for BuildingObstruction { } } impl GameLevel<'_> { - /// The mobs that trigger plates and tripwires: living entities that don't - /// ignore block triggers (`Entity.isIgnoringBlockTriggers`: bats; armor - /// stands are not in `mobs`). + /// The living entities that trigger plates and tripwires and don't ignore + /// block triggers (`Entity.isIgnoringBlockTriggers`: bats and marker armor + /// stands). Armor stands live apart from `mobs`. fn mob_trigger_boxes(&self) -> impl Iterator + '_ { self.blockers .mobs .iter() .filter(|m| !m.removed && m.species() != horizon_client::mobs::Species::Bat) .map(Mob::bounds) + .chain( + self.blockers + .armor_stands + .iter() + .filter(|s| !s.marker) + .map(|s| s.bounds()), + ) } /// The non-living entities that trigger plates and tripwires (boats, /// crystals, primed TNT, falling blocks, item entities, experience orbs and From 7acfc655e80325a71cbf2afcdf8a58f171f15b9a Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Tue, 27 Oct 2026 21:45:45 +0100 Subject: [PATCH 2/2] Match vanilla's op warning on item tooltips The warning was missing its bold first line and skipped spawn eggs of op-only entities. Vanilla: ItemStack.OP_NBT_WARNING, BlockItem and SpawnEggItem.shouldPrintOpWarning (non-block items never warn). --- .../horizon-client/src/block_entity_item.rs | 19 ++++++++++++++ crates/horizon-client/src/game/stations.rs | 26 +++++++++++++------ 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/crates/horizon-client/src/block_entity_item.rs b/crates/horizon-client/src/block_entity_item.rs index 2361dcbfb..6eb99ae84 100644 --- a/crates/horizon-client/src/block_entity_item.rs +++ b/crates/horizon-client/src/block_entity_item.rs @@ -35,6 +35,25 @@ pub fn op_warning(stack: &crate::items::ItemStack) -> bool { data(stack).is_some_and(|(id, _)| OP_ONLY.contains(&id.as_str())) } +/// `SpawnEggItem.shouldPrintOpWarning` for a player with game master +/// permission: a spawn egg carries data of an op-only entity type +/// (`EntityTypes.OP_ONLY_CUSTOM_DATA`). +pub fn spawn_egg_op_warning(stack: &crate::items::ItemStack) -> bool { + stack.item.ends_with("_spawn_egg") + && matches!( + stack + .data() + .and_then(|d| d.other("minecraft:entity_data")) + .and_then(|data| data.get("id")), + Some(Tag::String(id)) if matches!( + id.to_string_lossy().as_str(), + "minecraft:falling_block" + | "minecraft:command_block_minecart" + | "minecraft:spawner_minecart" + ) + ) +} + /// `Spawner.getSpawnEntityDisplayName` (`SpawnData.entity.id` of the item's /// data, which `ItemStack.addDetailsToTooltip` reads for spawners and trial /// spawners alike): the entity type a spawner item spawns. diff --git a/crates/horizon-client/src/game/stations.rs b/crates/horizon-client/src/game/stations.rs index 1734cb3ee..38064caad 100644 --- a/crates/horizon-client/src/game/stations.rs +++ b/crates/horizon-client/src/game/stations.rs @@ -2059,9 +2059,16 @@ impl Game<'_> { ); } } - // ItemStack.OP_NBT_WARNING, for a player with game master permission. - if !nested && self.ui.registries.permission >= 2 && block_entity_item::op_warning(stack) { - for (key, fallback) in [ + // ItemStack.OP_NBT_WARNING: `BlockItem` and `SpawnEggItem` + // `.shouldPrintOpWarning` for a player with game master permission; + // a nested projectile has no player. The first line is bold. + if !nested + && self.ui.registries.permission >= 2 + && (item_info.is_some_and(|i| i.block.is_some()) + && block_entity_item::op_warning(stack) + || block_entity_item::spawn_egg_op_warning(stack)) + { + for (i, (key, fallback)) in [ ("item.op_warning.line1", "Warning:"), ( "item.op_warning.line2", @@ -2071,12 +2078,15 @@ impl Game<'_> { "item.op_warning.line3", "Do not use unless you know the exact contents!", ), - ] { - push( - &mut lines, - self.translate(key, fallback), + ] + .into_iter() + .enumerate() + { + let text = horizon_client::text::Text::legacy(&self.translate(key, fallback)); + lines.push(( + if i == 0 { text.bold() } else { text }, rgba(255, 85, 85, 255), - ); + )); } } lines