From 2e73e94ed12b263e9af3182464e3ed90c1f70ba9 Mon Sep 17 00:00:00 2001 From: Ruling-0 <47913168+Ruling-0@users.noreply.github.com> Date: Sat, 29 Aug 2026 19:23:11 -0500 Subject: [PATCH] Documentation cleanup --- README.md | 24 +++++-------------- .../postea/api/ChunkTransformContext.java | 4 ++-- .../postea/api/IVersionedTransformer.java | 2 +- .../mixins/early/MixinAnvilChunkLoader.java | 2 +- 4 files changed, 10 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 4721561..4af95b6 100644 --- a/README.md +++ b/README.md @@ -519,17 +519,9 @@ public abstract class FMLIgnoreMissingMappingExample { ### 9. Versioned Chunk and Player Transformers -The transformers above answer "this content changed into that content". A versioned transformer answers a different -question: "the meaning of my own stored values changed, and every chunk and every player must be brought forward -exactly once per change". Register an `IVersionedTransformer` through `VersionedReplacementManager.register`, during -mod loading and postInit at the latest. - -Postea keeps a `POSTEA_VERSIONS` compound on each chunk's `Level` tag and on each player's root tag: one int per -registered transformer key. Every chunk and player Postea saves is stamped with each transformer's -`currentVersion()`, and at read time a transformer is invoked only when the stored stamp differs from its current -version. A chunk that slept through five sessions of changes is therefore handed the version it was actually saved -under, once, and a chunk already at the current version is skipped. Stamps belonging to transformers that are not -registered in the running session are carried through untouched, so a temporarily absent mod does not lose them. +Postea provides some API endpoints to allow mods to have versioned changes. The mod declares that it +expects some version, and if Postea detects that a chunk or player was saved on a previous version, runs a transformer +to bring them up-to-date. Register an `IVersionedTransformer` through `VersionedReplacementManager.register`. > [!IMPORTANT] > @@ -599,14 +591,10 @@ public final class VersionedExample implements IVersionedTransformer { ### 10. Retired Ids -Whenever a world loads, every block or item name in its saved id map that no registered content answers to is -recorded, with the id it held, in `/postea/known-ids.json`. This exists because FML drops such a name from -`level.dat` on the first save after its content disappears: from the second session onward the world no longer -remembers that the name ever had an id, and a transformer keyed on it would silently stop running. +Whenever a world loads, every block or item name in its saved id map that no longer exists is recorded, with the id it +held, in `/postea/known-ids.json`. This way, retired objects can still be referenced by transformers. -A retired id is dispatched to that name's transformers only while FML still blocks the id and no live block or item -occupies it, so a name reclaimed by new content never gets its old transformers. When a name resolves only through -retired ids, Postea logs it once per world load: +When a name resolves only through retired ids, Postea logs it once per world load: ``` Block ExtraUtilities:cobblestone_compressed is no longer registered; its transformers target retired id(s) [3402] diff --git a/src/main/java/com/gtnewhorizons/postea/api/ChunkTransformContext.java b/src/main/java/com/gtnewhorizons/postea/api/ChunkTransformContext.java index d80f904..f7b5ebe 100644 --- a/src/main/java/com/gtnewhorizons/postea/api/ChunkTransformContext.java +++ b/src/main/java/com/gtnewhorizons/postea/api/ChunkTransformContext.java @@ -59,8 +59,8 @@ public final class ChunkTransformContext { } /** - * The chunk's {@code Level} tag. Changes to its {@code TileEntities} and {@code Entities} lists are what the - * game loads. + * The chunk's {@code Level} tag. Changes to its {@code TileEntities} and {@code Entities} lists are loaded by + * the game. */ public NBTTagCompound levelTag() { return levelTag; diff --git a/src/main/java/com/gtnewhorizons/postea/api/IVersionedTransformer.java b/src/main/java/com/gtnewhorizons/postea/api/IVersionedTransformer.java index 9efa934..f32ad6b 100644 --- a/src/main/java/com/gtnewhorizons/postea/api/IVersionedTransformer.java +++ b/src/main/java/com/gtnewhorizons/postea/api/IVersionedTransformer.java @@ -18,7 +18,7 @@ package com.gtnewhorizons.postea.api; public interface IVersionedTransformer { /** - * The stamp key, unique across all registered transformers, e.g. {@code "materiallib:idList"}. + * The stamp key, unique across all registered transformers, e.g. {@code "examplemod:idList"}. */ String key(); diff --git a/src/main/java/com/gtnewhorizons/postea/mixins/early/MixinAnvilChunkLoader.java b/src/main/java/com/gtnewhorizons/postea/mixins/early/MixinAnvilChunkLoader.java index 3a20099..64b1fab 100644 --- a/src/main/java/com/gtnewhorizons/postea/mixins/early/MixinAnvilChunkLoader.java +++ b/src/main/java/com/gtnewhorizons/postea/mixins/early/MixinAnvilChunkLoader.java @@ -17,7 +17,7 @@ import com.gtnewhorizons.postea.utility.ChunkFixerUtility; public abstract class MixinAnvilChunkLoader { // Forge-added funnel for sync and async loads; runs after relocation fix-ups and after ChunkAPI's own - // readChunkFromNBT replacement, so one hook covers vanilla, NEID, EndlessIDs, and ChunkAPI. + // readChunkFromNBT replacement, so covers vanilla, NEID, EndlessIDs, and ChunkAPI. @Inject(method = "checkedReadChunkFromNBT__Async", at = @At("RETURN"), remap = false, require = 1) private void postea$chunkHook(CallbackInfoReturnable cir) { Object[] data = cir.getReturnValue();