1.2.0
Compatibility
Required content
Changes
What' s changed.
Fixing repeated creation of SaveHandler covering session.lock causing save interruptions, and adding persistent per-save difficulty for unlocked archives.
Root cause: Multiple calls to getActiveAnvilConverter().getSaveLoader(name, false) create new SaveHandler for running worlds, whose constructor setSessionLock() overwrites the archive's session.lock. Subsequently, saveLevel()'s checkSessionLock() throws exceptions due to timestamp mismatch and aborts saving, causing two symptoms:
- Archive list sorting degrades to 'creation order' (LastPlayed cannot be updated, should normally be 'recent play priority');
- Difficulty of unlocked archives resets to default (normal) upon exiting and re-entering. These are two manifestations of the same root cause 'save interrupted'.
Fix: Change all 8 calls to create new SaveHandler to reuse the running world's server.worldServers[0].getSaveHandler() (all with worldServers null protection):
- MixinIntegratedServer: loadAllWorlds(hardcore) and initiateShutdown are changed to reuse; startServer keeps difficulty loading deferred until loadAllWorlds completes;
- MixinGuiOptions: hardcore auto-lock, lock confirmation, unlock confirmation are refactored to reuse via @unique helper method;
- DifficultyLocker.onServerStarting is changed to reuse;
- GuiWorldSettings.saveWorldData is changed to reuse.
New addition: WorldDifficultyData adds a currentDifficulty snapshot field (stored in difficultylocker.dat). On exit, record the current world difficulty; on loading, restore it, so unlocked worlds retain independent difficulty per save like 1.8+; New worlds without records do not override game default difficulty. Old archives without this key are handled as -1 for backward compatibility.
Full Changelog: https://github.com/song682/ModernDifficultyLocker/compare/v1.1.0...v1.2.0
Optional dependencies
Supplementary resources
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:1aVhG7wK:F4D3PIXP"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:1aVhG7wK:F4D3PIXP"
}



