Skip to content

MinecraftIsTooEasy/MITE-Mod-Updater

Repository files navigation

MITE Mod Updater for FML 3.x

A client-side version checker for MITE modpacks built on FishModLoader.

What it does

  • Scans all loaded FML mods on client startup
  • Queries a Cloudflare Worker endpoint for update metadata
  • Compares local mod versions against GitHub release tags
  • Shows update notices in chat and/or a popup screen
  • Supports manyLib configuration UI

Requirements

  • MITE + FishModLoader 3.x
  • manyLib
  • A Cloudflare Worker endpoint
  • A Cloudflare KV namespace bound to the Worker

Client configuration

The mod is client-side only.

Main options:

  • enabled: turn update checks on or off
  • updateUrl: Cloudflare Worker JSON endpoint
  • notificationMode: CHAT, SCREEN, BOTH, or OFF
  • includePrerelease: allow prerelease versions

Cloudflare setup

  1. Create a Worker.
  2. Create a KV namespace.
  3. Bind the namespace to the Worker with the binding name UPDATE_CACHE.
  4. Deploy the Worker code from cloudflare/worker.js.
  5. Store your mod index in KV under the key mod-index.

Example KV value:

{
  "mods": {
    "playerrevive": {
      "name": "Player Revive",
      "source": "github",
      "owner": "MinecraftIsTooEasy",
      "repo": "PlayerRevive",
      "releaseType": "latest",
      "assetPattern": "\\.jar$"
    }
  }
}

The client calls the worker as:

https://<worker-domain>/v1/mods/latest?mods=playerrevive,carryon,modern-mite

Cloudflare files

The cloudflare/ folder contains reference files only:

  • worker.js: Worker runtime logic
  • wrangler.toml.example: example deployment config
  • mod-index.example.json: example mod index
  • generate-mod-index.mjs: helper to generate an index from the MinecraftIsTooEasy GitHub organization
  • sync-r2-releases.mjs: helper to mirror GitHub release jars into Cloudflare R2

Generate the mod index

Use this command to rebuild the full mod-index JSON from the organization:

node cloudflare/generate-mod-index.mjs MinecraftIsTooEasy > cloudflare/mod-index.generated.json

If you are using PowerShell and want to avoid UTF-16 redirection, use:

node cloudflare/generate-mod-index.mjs MinecraftIsTooEasy | Out-File -Encoding utf8 cloudflare/mod-index.generated.json

Then copy the generated JSON into the KV key mod-index.

Mirror releases to R2

Create an R2 bucket named mite-mod-downloads and bind a custom domain such as:

https://downloads.moddedmite.top

Install or run Wrangler, then log in once:

npx wrangler login

Test with a single mod first:

$env:R2_LIMIT="1"; node cloudflare/sync-r2-releases.mjs cloudflare/mod-index.generated.json

Mirror all indexed releases:

Remove-Item Env:R2_LIMIT -ErrorAction SilentlyContinue
node cloudflare/sync-r2-releases.mjs cloudflare/mod-index.generated.json

Useful environment variables:

R2_BUCKET=mite-mod-downloads
R2_PUBLIC_BASE_URL=https://downloads.moddedmite.top
GITHUB_TOKEN=<optional GitHub token>
UPDATE_CACHE_NAMESPACE_ID=<KV namespace id>
R2_CONCURRENCY=4
R2_DRY_RUN=1
R2_FORCE=1
R2_SYNC_KV=0
WRANGLER=npx --yes wrangler

The script downloads the selected release jar, uploads it to R2 under:

mods/<modid>/<version>/<file>

and writes:

cloudflare/r2-mirror-index.generated.json

If UPDATE_CACHE_NAMESPACE_ID is set, the script also writes that JSON into the same KV namespace with the key:

r2-mirror-index

If the variable is not set, copy the JSON manually into that KV key before testing automatic install.

When a mirrored version matches the latest GitHub release, the Worker returns the R2 URL as downloadUrl and the GitHub URL as fallbackDownloadUrl.

For automation, the repository includes .github/workflows/sync-r2-releases.yml.

Add these GitHub Actions secrets:

CLOUDFLARE_API_TOKEN
CLOUDFLARE_ACCOUNT_ID
UPDATE_CACHE_NAMESPACE_ID
MITE_GITHUB_TOKEN

MITE_GITHUB_TOKEN is optional for public repositories, but recommended to avoid GitHub API rate limits.

The workflow runs daily at 19:15 UTC and can also be started manually from the Actions tab. The sync script reads the existing r2-mirror-index from KV, skips mods whose latest mirrored version is unchanged, uploads only changed releases to R2, and writes the updated mirror index back to KV.

Build

./gradlew build

Notes

  • Release tags like v1.0.0 and 1.0.0 are both supported.
  • The worker strips a leading v before comparing versions.
  • The startup check retries up to 3 times on failure.

About

Checks for mod updates.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors