MCA: Kingdoms

Discover settlements belonging to different kingdoms, get involved in local affairs, establish a government or build connections through peaceful service.
Back to Files

MCA: Kingdoms 0.4.1 (Forge 1.20.1)

File namemcakingdoms-0.4.1.jar
Uploader
OtectusOtectus
Uploaded
Dec 5, 2026
Downloads
394
Size
14.1 MB
Mod Loaders
Forge
File ID
10047722
Type
R
Release
Supported game versions
  • 1.20.1

Curse Maven Snippet

Forge

implementation fg.deobf("curse.maven:mca-kingdoms-1762717:10047722")

Learn more about Curse Maven

What's new

0.4.1 — 2026-12-04 (server performance)

Kingdoms now does much less of its work on the server thread, and none of its file writing. Nothing changes in gameplay, saves, data packs or the add-on API; worlds from 0.4.0 load as they are.

  • No more lag spikes from saving. Kingdoms' saved data is written in the background. Before, each world save could stop the server for hundreds of milliseconds while Kingdoms wrote its files, and longer on busy disks.
  • MCA: Crime no longer makes Kingdoms rewrite its records every second. With MCA: Crime installed, Living Realms wrote its whole records file once a second whether anything had changed or not. This was the largest cost found.
  • Exploring, building and big old worlds are cheaper: village discovery never reads unloaded chunks from disk, harvests owed to unloaded farms are applied without re-checking every chunk, resource surveys are spread over several turns, and long histories (ledger, owed world edits) are not re-encoded on every save.
  • No more freezes while chunks load: discovery, resource surveys, harvests and construction no longer wait for a chunk that is still loading or generating (a "loaded" check in Minecraft is true before the chunk is ready); that work now happens once the chunk is ready.
  • Fixed: a Living Realms change whose save failed after it had been prepared was kept instead of undone.
  • Fixed: a villager dying during an uprising (or another major event without a sponsor) was not recorded, and the Living Realms death handling paused for five minutes.
  • Operators can measure Kingdoms' own share of each tick with /kingdoms maintenance perf start|report|stop (off by default), and /kingdoms realm status shows writes waiting for the disk.

Details

  • Background store writer (persistence/StoreWriter): one thread writes every store file, in order per file; a waiting write is replaced by a newer one of the same file. Periodic saves return at once and re-mark the store dirty if the write fails. Commits that promise "on disk when this returns" still wait, behind any earlier write of their file. Saves that flush (/save-all flush, backup mods, the stop save) wait for every queued write (FlushSaveMixin), so backups hold current files. See Save durability.
  • Living Realms scheduler: a pass that changes the world queues its write; its world effects run once that write (or a later one) is on disk, usually a tick or two later. A failed write with nothing newer queued undoes the passes since the last save and drops their effects, as before. MCA: Crime receipts are read after every pass without forcing a write. Enrolment writes within 30 seconds instead of at once. Ledger entries and owed world edits are encoded once and reused (byte-for-byte the same file).
  • Rollback fix: RealmStore captured its rollback point after encoding, so a write that failed after encoding kept the unsaved change in memory. It now restores the state from before the change.
  • World edits owed to unloaded chunks are matched per dimension (the same X/Z in another dimension no longer applies them) and visited once per pass instead of once per loaded chunk per dimension.
  • Discovery: village points of interest are read from loaded chunks only (PoiManager.getInSquare read unloaded columns from the region files and kept them in memory); clustering compares neighbours only (same groups); delayed rescans are kept by due time and wait for room instead of being dropped when the scan queue is full.
  • Site surveys run at most 1,536 columns per settlement turn and find what a one-turn survey finds.
  • Chunks still loading: Level.hasChunk/isLoaded are true once a chunk is scheduled to become full, and a read then parks the server thread until loading or generation finishes (seconds in new terrain). Automatic paths (discovery queue, POI reads, the structure detector, surveys, the world-edit journal and harvests, construction steps, immigration, Villager Workers jobs, justice cells, container custody) now use settlement/LoadedChunks (getChunkNow); a chunk still loading is re-queued or kept pending, never dropped.
  • Opt-in timing (perf/KingdomsTiming, -Dmcakingdoms.perf=true): per-tick totals without double counting, per-section figures and work counters. Benchmark harness and fixtures: tools/perf/ (bench.py, report.py).

This mod has no additional files