From fe28214bb67a6ba868b7261412a08b020772df4a Mon Sep 17 00:00:00 2001 From: Ruling-0 <47913168+Ruling-0@users.noreply.github.com> Date: Tue, 24 Nov 2026 15:44:56 -0600 Subject: [PATCH] Tidy readiness gate and player hook docs --- .../postea/api/CustomDataReplacementManager.java | 2 +- .../postea/mixins/early/MixinSaveHandler.java | 4 ++-- .../java/com/gtnewhorizons/postea/utility/IDRegistry.java | 7 ++++--- .../postea/utility/PlayerDataFixerUtility.java | 3 +-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/gtnewhorizons/postea/api/CustomDataReplacementManager.java b/src/main/java/com/gtnewhorizons/postea/api/CustomDataReplacementManager.java index da8a1dc..f030a0a 100644 --- a/src/main/java/com/gtnewhorizons/postea/api/CustomDataReplacementManager.java +++ b/src/main/java/com/gtnewhorizons/postea/api/CustomDataReplacementManager.java @@ -23,7 +23,7 @@ public abstract class CustomDataReplacementManager { /// Transforms `root` in place through every registered transformer whose stamp differs from its current /// version, then writes the updated stamps onto `root`. Throws [IllegalStateException] when called before the - /// world's info, and with it any saved id map, has loaded. + /// world's info and saved id map have loaded. public static void transform(String storageId, NBTTagCompound root) { if (!serverRunning()) return; if (!IDRegistry.isMappingApplied()) { diff --git a/src/main/java/com/gtnewhorizons/postea/mixins/early/MixinSaveHandler.java b/src/main/java/com/gtnewhorizons/postea/mixins/early/MixinSaveHandler.java index 63e1e2f..5562862 100644 --- a/src/main/java/com/gtnewhorizons/postea/mixins/early/MixinSaveHandler.java +++ b/src/main/java/com/gtnewhorizons/postea/mixins/early/MixinSaveHandler.java @@ -12,11 +12,11 @@ import com.gtnewhorizons.postea.utility.IDRegistry; import cpw.mods.fml.common.FMLCommonHandler; +/// Opens [IDRegistry]'s mapping gate when `loadWorldInfo` returns on the server thread, after FML has applied any saved +/// id map. @Mixin(SaveHandler.class) public abstract class MixinSaveHandler { - /// Returns come after FML's `handleWorldDataLoad` applies any saved id map, or when the world has no readable - /// `level.dat`. FML applies the map only on the server thread. @Inject(method = "loadWorldInfo", at = @At("RETURN"), require = 1) private void postea$markWorldInfoLoaded(CallbackInfoReturnable cir) { if (FMLCommonHandler.instance() diff --git a/src/main/java/com/gtnewhorizons/postea/utility/IDRegistry.java b/src/main/java/com/gtnewhorizons/postea/utility/IDRegistry.java index c8538e0..6c492cd 100644 --- a/src/main/java/com/gtnewhorizons/postea/utility/IDRegistry.java +++ b/src/main/java/com/gtnewhorizons/postea/utility/IDRegistry.java @@ -41,7 +41,7 @@ public abstract class IDRegistry { private static volatile boolean mappingApplied; /// Loads the retired id table of the world about to load. [#registerWorldSpecificIDs] records into it until - /// [#endWorld()]. [#isMappingApplied] stays false until [#onWorldInfoLoaded]. + /// [#endWorld()]. Resets [#isMappingApplied] to false. public static void beginWorld(File worldDirectory) { tableFile = new File(new File(worldDirectory, Postea.MODID), WorldIdTable.FILE_NAME); table = WorldIdTable.load(tableFile); @@ -57,8 +57,9 @@ public abstract class IDRegistry { ITEM_NAME_TO_ID.clear(); } - /// Whether the loading world's info has loaded on the server thread. FML applies the world's saved id map, if - /// it has one, during that load. + /// Whether the loading world's id mappings are in place. [#onWorldInfoLoaded] sets it once the world's info, and + /// with it any saved id map, has loaded on the server thread. [#onMappingUpdated] sets it when FML's remap event + /// fires. public static boolean isMappingApplied() { return mappingApplied; } diff --git a/src/main/java/com/gtnewhorizons/postea/utility/PlayerDataFixerUtility.java b/src/main/java/com/gtnewhorizons/postea/utility/PlayerDataFixerUtility.java index 5f8fff6..750425d 100644 --- a/src/main/java/com/gtnewhorizons/postea/utility/PlayerDataFixerUtility.java +++ b/src/main/java/com/gtnewhorizons/postea/utility/PlayerDataFixerUtility.java @@ -10,8 +10,7 @@ import com.gtnewhorizons.postea.api.VersionedReplacementManager; /// Runs versioned transformers over a server player's NBT as it is read, and stamps it as it is written. /// -/// Hooks `Entity.readFromNBT` and `writeToNBT`, which covers `playerdata/.dat` and the single-player host's -/// copy inside `level.dat`. +/// Runs on every server player NBT read and write, which covers `playerdata` and the host player in `level.dat`. public final class PlayerDataFixerUtility { private PlayerDataFixerUtility() {}