Fixing Mojang's ancestral weather bug, 13 lines of code, free to share.
Already optimized, supports leviLamina (LL3) as well as LiteLoader (LL2).
Usage instructions:
For the LL3 environment, you just need to install the prerequisite LLSE (LegacyScriptEngine), then unzip the downloaded plugin and copy the folder inside to the "plugins" folder.
For the LL2 environment, it's even simpler. Just unzip the downloaded plugin and copy the .js file inside to the "plugins" folder.
The LLSE plugin theoretically supports all versions, no need for active adaptation.