Repository navigation
How it works
PackUpdater ships one jar containing two loader integrations:
- On ModLauncher-based NeoForge, an
ITransformationServiceruns before mod discovery. A small public-API bridge handles both the originalnet.minecraftforgenamespace used by NeoForge 1.20.1 and the laternet.neoforgednamespace. - On newer NeoForge without ModLauncher, a highest-priority
IModFileCandidateLocatorruns before the built-in mods-folder locator takes its directory snapshot. This also runs on dedicated servers; it is not a graphics-only hook.
Both call the same startup entrypoint, with a shared guard against duplicate updates. Ordinary mods downloaded during the update can therefore load in the same launch. There is no Java agent, extra JVM argument, or version-specific jar to configure. See Compatibility for the supported version range and regression checks.
On launch:
- Read the configuration. See Configuration.
- Extract the embedded bootstrap jar to a temp directory.
- Start a child JVM, unless the platform forbids it.
- The bootstrap self-updates the PackWiz installer from its GitHub release, then runs it against the game directory.
There is a self-update step in the middle because the installer is worth keeping current, and because the bootstrap is the only thing that can replace a running file. It keeps a copy of its own jar in memory and restores it if a download fails.
| File | Role |
|---|---|
UpdatePlugin |
Existing ModLauncher transformation-service entrypoint. |
modern/ModernUpdateLocator |
Newer NeoForge's early mod-file locator. |
UpdaterStartup |
Shared config/update entrypoint and duplicate-run guard. |
UpdaterBootstrap |
Starts the updater, chooses an engine, drives the loading screen. |
LoadingProgress |
Owns an updater progress bar; cosmetic failures do not interrupt updating. |
LoaderAccess |
Public loader APIs across the original and renamed package namespaces. |
UpdaterConfig |
Key resolution: JVM argument, then config file, then default. |
GuiCapability |
Asks a short-lived child JVM whether it can open a window. |
GuiProbe |
Builds a real off-screen window and reports the result. |
OptionalModFilter |
Rebuilds a pack index without optional mods the pack disables. |
InProcessInstaller |
Downloads and verifies a pack without forking. |
bootstrap/ |
The bootstrap's source, and the script that builds its jar. |
When a window is available, PackUpdater reports progress on the NeoForge loading screen by parsing
the installer's output. It recognises two shapes: a leading (3/259) counter, and a set of known
phrases such as Checking local files or Finished successfully.
This is matched by pattern, which has a real consequence: wording changes upstream silently degrade the display without affecting the update itself. If the loading screen stops updating but the update still works, that is the likely cause.
PackUpdater creates its own progress bar using public loader methods, replacing it
when the number of steps changes and removing it when updating finishes. It no
longer reflects into the private ProgressMeter.steps field or modifies the
loader's own bar. Missing progress/window APIs are caught and logged without
interrupting the installer.
It was originally an opaque 100 KB binary committed straight into src/main/resources. It is now
readable source under bootstrap/,
built by bootstrap/build.sh.
The code is a decompilation-derived fork of the PackWiz bootstrap, so it is functional rather than idiomatic. Two things in it were changed for this project, both to do with argument handling:
- the release asset name became a system property rather than a new command-line option, because the
bootstrap forwards its entire argv to the installer, and the installer's parser only accepts a
fixed set of
bootstrap-*options. An invented option reached the installer and was rejected, failing every update withUnrecognized option. -
filterArgsnow skips empty arguments, which previously threw onarg.charAt(0).
bootstrap/build.sh pins two things that are easy to get wrong:
-
--release 17. The oldest supported game uses Java 17, which loads class files up to version 61. A jar built on a newer local JDK carries a higher version and every forked install dies withUnsupportedClassVersionError. CI asserts the version on every build. -
--date. Without fixed entry timestamps, two builds of identical sources produce different archives.
The PackWiz installer's CLI path force-enables every optional mod:
iOptionDetails.setOptionValue(true);Any non-interactive install therefore installs the union of all optional mods. Both of PackUpdater's fallback paths work around this by rebuilding the index instead. See Restricted platforms.
The transformation-service approach, the bootstrap-then-installer hand-off, and the loading-screen progress reporting all originate in BrassUpdater by swzo. See How it works for the full lineage.