OreGuard

by drdozer

OreGuard keeps ore patches for mining: tiered allowances (drills & pumpjacks, poles, belts, pipes - more with higher tiers) protect naturally spawned resources from being built over. Toggles for decorative tiles and ground rail over ore; elevated rails span ore freely. Blocked items are returned; robots and ghosts obey the same rules.

Tweaks
18 hours ago
2.0 - 2.1
38

Changelog

Version: 0.4.0
Date: 2026-10-20
  Features:
  - Factorio 2.1 compatibility: factorio_version 2.0 -> 2.1, dependency floor base >= 2.1.0.
  - Underground belts/splitters and underground pipes are now allowed wherever transport belts and pipes are allowed on ore.
  - Modular settings: tile paving over ore is governed by its own runtime toggle ("Allow decorative tiles over ore"); the former Decorative tier is gone (existing saves fall back to the Default tier — flip the toggle to keep paving tiles).
  - New startup toggle "Allow rail tracks, signals and stations over ore": ground rail no longer carries the ore collision layer and the rail planner is no longer forced onto elevated bridges across ore.
  - Construction robots now obey the guard: blocked builds are dismantled and the item dropped at the build site for the robot to re-collect into network storage; robot-placed tiles on ore are restored likewise.
  - Blocked blueprint/shift-placed ghosts are refused at placement instead of waiting to be blocked at revival; blocked ghosts left by older saves are removed after the update.
  - Remote interface added ("oreguard"): set_tier/set_tiles_toggle/get_state — lets integration or test harnesses drive runtime settings in the owning mod's context (settings writes are owner-only by engine policy).
  - The floating warning text is composed from the active families, so it always matches the current tier and toggles — including a "Tiles (paving)" entry while the decorative-tiles toggle is on.
  - Settings reworked for clarity: the tier description spells out every tier's exact allowances, titles say what they do (e.g. "Keep ground rails off ore (collision layer)"), and dropdown labels rephrased consistently.
  - "Mining" tier renamed "Belt Mining" (label only — existing saves keep their setting).
  - Pumpjacks are allowed wherever mining drills are; the engine itself restricts pumpjacks to fluid resources (oil, brine, geysers), which OreGuard does not alter.
  Bug Fixes:
  - Fixed a crash on the first blocked construction-robot build: spill_item_stack was called with the 1.x positional signature — 2.x takes a single parameter table. 0.4.0 was never portal-published, so this fix ships folded into 0.4.0.
  - Blocked-robot item recovery now logs its outcome unconditionally; end-to-end the returned item is spilled at the build site (the engine refuses cargo writes during the event) and the same robot takes it to the network's storage chest — verified in the behavior matrix.
  Packaging:
  - Removed the vestigial optional dependency on cargo-ships (elevated-rails remains the only optional dependency, and it is genuinely used).
  - Changelog hygiene: portal releases to date are 0.1.0-0.3.1, all Factorio 2.0-declared; entries below keep their original labels/dates (the 0.3.2 entry predates the underground-belt features it describes, which first ship here).
Version: 0.3.2
Date: 2025-01-16
  Features:
    - Added underground belts and splitters to allowed entities wherever transport belts are allowed
    - Added underground pipes to allowed entities wherever pipes are allowed
Version: 0.3.0
Date: 2025-01-15
  Features:
  - Added startup setting to prevent regular rails from being built over ore patches.
  - If elevated rails mod is present, rail bridges can automatically span over ore patches.
  - Rail planner now automatically creates elevated rails when regular rails would conflict with ore.
  Bug Fixes:
  - Fixed blueprints not respecting ore protection rules.
Version: 0.2.1
Date: 2025-06-15
  Features:
  - Added explicit support for elevated rails and rail supports, allowing them to be placed over ore patches.
  Bug Fixes:
  - Fixed a crash that occurred when building rails (or other entities without a direct item) over ore patches.
Version: 0.2.0
Date: 2024-02-15
  Features:
  - Added tiered build restrictions as a map setting with selectable levels: Hardcore, Mining, Bot Mining, Default, and Decorative.
  - Warning messages now use floating text instead of chat.
  - Improved locale and settings integration.
Version: 0.1.0
Date: 2024-01-01
  Major Features:
  - Initial release.
  - Prevents building most entities and flooring tiles directly on top of ore patches.
  - Allows placement of mining drills, power poles, belts, beacons, pipes, roboports, boxes, and furnaces on ore.
  - Returns blocked items to the player's inventory or spills them on the ground if inventory is full.
  - Displays a warning message when a build is blocked.