Commit Graph

28 Commits

Author SHA1 Message Date
George 881f716115 Fix two live simulation bugs: profiler crash + regions never updating
forceUpdateRegion crashed with "no profiling cycle is active" because
runModulesForRegion calls profiler.beginModule() which requires an active
cycle. Wrapped the call in startCycle/endCycle in a try/finally.

Regions showed tick=0 and no module data because SimulationScheduler's
priority queue was never populated for normal rolling updates — only
explicit queueRegion() calls worked. Fixed by auto-enqueueing all active
regions in onMinecraftServerTick() just before each simulation cycle fires.
Auto-enqueueing is placed there (not in runSimulationCycle()) so unit tests
that drive cycles directly are unaffected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 16:42:11 +01:00
George 6e6de00f0d Add debug commands, force-update, and weather feedback loop
Track E — commands:
  /lw region info — now shows all 7 module data classes (air/ground/water pollution,
    soil fertility/moisture/contamination, succession stage, depletion levels, etc.)
  /lw region info <x> <z> — inspect any region by block coordinates
  /lw region force-update — runs full module pipeline on current region immediately
  /lw stats — shows last cycle duration, per-module timings, budget overrun flag

Track F — weather feedback:
  Each simulation tick, active overworld regions receive a moisture boost when it
  rains (+0.3 waterAvailability, -0.15 droughtRisk) and a drought increase when
  dry (+0.05 droughtRisk). The rain state is supplied by LivingWorldMod via a
  BooleanSupplier set on ServerStartedEvent and cleared on stop.

400 tests, all passing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 16:20:48 +01:00
George 4fd9bb97aa Wire world effect executor — ecosystem simulation now mutates blocks in-game
NeoForgeWorldEffectExecutor translates WorldEffectRequests into actual Minecraft
block operations: GRASS_DEGRADES_TO_DIRT replaces grass with dirt, VEGETATION_SPREADS
spreads grass onto lit dirt, POLLUTION_VISUAL_INDICATOR spawns smoke particles.
SAPLING_GROWTH_SLOWED/BOOSTED are stubs pending mixin hooks.

Block writes are guarded by isLoaded() checks so no chunks are force-loaded.
Intensity scales the number of block candidates attempted per tick (max 8).
MinecraftServer is captured in LivingWorldMod on ServerStartedEvent and cleared
on stop; the executor receives it via Supplier to stay null-safe across restarts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 16:01:57 +01:00
George 6427677db5 Add Volume 2 ecosystem modules, event hooks, and module data persistence
Eight simulation modules (pollution, soil, water, vegetation, resource depletion,
recovery, ecosystem, world effects) form the full ecosystem pipeline. Each module
owns typed RegionData and writes summary metrics back to RegionMetrics.

Player block-break events are wired through BlockBreakInfo across the platform
boundary; the NeoForge adapter translates BreakEvent and routes it to the
bootstrap handler which records mining/logging/farming depletion on the
affected region.

Module state now survives server restarts: FileRegionPersistenceService accepts
per-module codecs (via PropertiesPersistenceWriter/Reader) that serialise every
RegionData instance alongside the region's core state. Bootstrap registers codecs
for all seven data-bearing modules at startup.

395 tests, all passing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 15:53:06 +01:00
George ae2a8db3ce Wire Volume 1 server lifecycle 2026-06-07 14:11:10 +01:00
George 96747a37db Add file-backed region persistence 2026-06-07 14:08:44 +01:00
George 69d60f7c13 Add NeoForge platform adapter 2026-06-07 14:06:53 +01:00
George cd5ffea24d Add Minecraft coordinate boundary mapper 2026-06-07 14:04:34 +01:00
George 7045df9a21 Add platform adapter contract 2026-06-07 14:04:27 +01:00
George 482e981c36 Consolidate persistence service contract 2026-06-07 14:03:55 +01:00
George 4f5a067300 Complete persistence metadata foundation 2026-06-07 14:02:50 +01:00
George e23f362b12 Add sustained simulation validation 2026-06-07 13:36:54 +01:00
George 025487dd40 Add direct event bus contract tests 2026-06-07 13:35:16 +01:00
George fbe1ccbbc3 Test and fix scheduler cycle budgets 2026-06-07 13:34:35 +01:00
George f1ceb5e019 Lock lifecycle transition matrix 2026-06-07 13:33:49 +01:00
George a46a945850 Complete region coordinate boundary coverage 2026-06-07 13:33:19 +01:00
George b0815db6c1 Add deterministic test simulation module 2026-06-07 13:32:42 +01:00
George 0ce71b727a Harden simulation profile snapshots 2026-06-07 13:31:39 +01:00
George 2202ff0680 Add simulation profiler 2026-06-07 13:01:14 +01:00
George 11d8c2db49 Add forced simulation command 2026-06-07 12:59:25 +01:00
George 0358c2e5bf Add region info command 2026-06-07 12:58:30 +01:00
George 44f06c04a5 Register Living World command root 2026-06-07 12:57:36 +01:00
George 524ccb2e60 Implement region manager 2026-06-07 12:56:23 +01:00
George 2c52b9b2e7 Implement region query engine 2026-06-07 12:55:03 +01:00
George f31e711dbb Add RegionStorage class with persistence delegation 2026-06-07 12:47:21 +01:00
George 5bbde601dc Add PersistenceService interface for region persistence operations 2026-06-07 12:42:25 +01:00
George 3edc507af2 Fix milestone 11 simulation flow 2026-06-07 12:22:59 +01:00
George 9f9b85e1f2 Initial commit 2026-06-07 12:18:45 +01:00