Download translations on demand instead of bundling them

Locales are fetched from the Iris repository at runtime into
languages/downloaded and cached against the revision the jar was built
from; the artifact ships only a manifest of the available locales.
IrisLanguage gains a player language service, per-audience snapshots and
an in-game message editor that writes locale overrides. The Bukkit
artifact verifier now fails when any locale file is embedded, and the
modded shadow jars drop the Bukkit-only switcher and editor classes.
This commit is contained in:
Brian Neumann-Fopiano
2026-09-03 05:03:21 -04:00
parent 5053a644c7
commit b25937f986
10 changed files with 472 additions and 191 deletions
@@ -47,7 +47,7 @@ public final class BukkitArtifactVerifier {
private BukkitArtifactVerifier() {
}
public static void verify(File artifact, List<String> requiredEntries, int minimumLocales,
public static void verify(File artifact, List<String> requiredEntries,
int minimumMatterSlices, long maximumArtifactBytes) {
if (!artifact.isFile()) {
throw new GradleException("Missing Bukkit Iris artifact: " + artifact.getAbsolutePath());
@@ -92,9 +92,8 @@ public final class BukkitArtifactVerifier {
}
}
if (locales < minimumLocales) {
throw new GradleException(artifact.getName() + " ships " + locales + " locale files; expected at least "
+ minimumLocales);
if (locales != 0) {
throw new GradleException(artifact.getName() + " ships " + locales + " locale files; translations must download on demand");
}
// Matter.read() resolves slice types from the canonical name stored in the payload.
if (matterSlices < minimumMatterSlices) {