Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions .github/scripts/check-artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def audit():
if "=" in line and not line.startswith("#") for key, _, value in [line.partition("=")]}
version = properties["modVersion"]
result = []
for minecraft, library, major in [("1.20.1", "2.0.0-rc.1", 61), ("1.21.1", "2.0.0-rc.1", 65)]:
for minecraft, library, major in [("1.20.1", "2.0.0-rc.1", 61), ("1.21.1", "2.0.0-rc.1", 65), ("26.1.2", "2.0.0-rc.1", 69)]:
common = Path("projects/core/versions") / minecraft / "build"
for loader in ("fabric", "forge"):
build = Path("projects") / loader / "versions" / minecraft / "build"
Expand All @@ -37,6 +37,10 @@ def audit():
assert not actual.intersection(fixtures), f"{binary}: test/docs classes leaked"
assert not any("testiarium" in name.lower() or "/.cache/" in name for name in entries), f"{binary}: test dependency/cache leaked"
assert all(struct.unpack(">H", archive.read(name)[6:8])[0] <= major for name in actual), f"{binary}: wrong JVM target"
if minecraft != "26.1.2":
assert all(b"net/minecraft/resources/Identifier" not in archive.read(name) and
b"net/minecraft/world/level/saveddata/SavedDataType" not in archive.read(name)
for name in actual), f"{binary}: target API leaked into a legacy node"
for old, new, count in [("advancements", "advancement", 14), ("recipes", "recipe", 2), ("loot_tables", "loot_table", 2),
("computercraft/turtle_upgrades", "computercraft/turtle_upgrade", 2), ("computercraft/pocket_upgrades", "computercraft/pocket_upgrade", 2)]:
right, wrong = (old, new) if minecraft == "1.20.1" else (new, old)
Expand All @@ -47,6 +51,9 @@ def audit():
metadata = json.loads(archive.read("fabric.mod.json"))
assert metadata["id"] == "digitalitems" and metadata["version"] == version
assert metadata["depends"]["java"] == f">={major - 44}"
if minecraft == "26.1.2":
assert metadata["depends"]["minecraft"] == minecraft
assert archive.read(metadata["accessWidener"]).startswith(b"accessWidener v2 official")
nested = [entry["file"] for entry in metadata["jars"]]
assert sorted(nested) == [f"META-INF/jars/{name}-fabric-{minecraft}-{library}.jar" for name in ("broccolium", "tweakium")]
assert not any(name.endswith("mods.toml") for name in entries)
Expand All @@ -61,13 +68,24 @@ def audit():
assert "fabric.mod.json" not in entries
assert ("digitalitems.mixins.json" in entries) == (minecraft == "1.20.1")
assert all(name in entries for name in nested), f"{binary}: missing nested dependencies"
nested_hashes = {name: hashlib.sha256(archive.read(name)).hexdigest() for name in nested}
if minecraft == "26.1.2":
pack = json.loads(archive.read("pack.mcmeta"))["pack"]
assert pack["min_format"] == [84, 0] and pack["max_format"] == [101, 1], f"{binary}: client/data pack formats"
for upgrade in ("digitizer", "advanced_digitizer"):
model = json.loads(archive.read(f"assets/digitalitems/computercraft/turtle_upgrade/{upgrade}.json"))
assert model["type"] == "computercraft:sided"
for side in ("left", "right"):
assert model[side] == f"digitalitems:turtle/{upgrade}_{side}"
assert f"assets/digitalitems/models/turtle/{upgrade}_{side}.json" in entries
with zipfile.ZipFile(binary.with_name(binary.stem + "-sources.jar")) as source_archive:
assert any(name.endswith("DigitalItemsSavedData.kt") for name in source_archive.namelist()), f"{binary}: common sources missing"
for name in ("pom-default.xml", "module.json"):
metadata = (build / "publications/maven" / name).read_text()
assert "testiarium" not in metadata and "testMod" not in metadata, f"{binary}: published fixture dependency"
result.append({"minecraft": minecraft, "loader": loader, "path": str(binary), "sha256": hashlib.sha256(binary.read_bytes()).hexdigest(),
"bytes": binary.stat().st_size, "classes": len(actual), "nested": nested, "fixture_classes_checked": len(fixtures)})
"bytes": binary.stat().st_size, "classes": len(actual), "nested": nested, "nested_sha256": nested_hashes,
"fixture_classes_checked": len(fixtures)})
return result


Expand Down
4 changes: 3 additions & 1 deletion .github/scripts/check-gametest-reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"pocketrematerializeconservation", "turtlerematerializeconservation", "blockrematerializeconservation",
"baselimitdigitize", "remotelimitdigitize", "fluiddigitize", "energydigitize", "olddigitize", "sameversionpersistence",
}
TARGET_EXPECTED = EXPECTED | {"minecraft:alwayspass", "inventorycallbacks", "menupacketvalidation", "removalconservation"}


def check_report(path):
Expand All @@ -21,7 +22,8 @@ def check_report(path):
suites = [root] if root.tag == "testsuite" else root.findall(".//testsuite")
assert sum(int(s.get("tests", "0")) for s in suites) == len(cases), f"{path}: count mismatch"
names = [c.get("name", "").split(".")[-1].lower().replace("_", "") for c in cases]
assert len(names) == len(EXPECTED) and set(names) == EXPECTED, f"{path}: unexpected inventory {names}"
expected = TARGET_EXPECTED if "26.1.2" in path.parts else EXPECTED
assert len(names) == len(expected) and set(names) == expected, f"{path}: unexpected inventory {names}"
return {"report": str(path), "tests": len(cases), "names": names}


Expand Down
5 changes: 3 additions & 2 deletions .github/scripts/docs-multiversion.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import { dirname, join } from "node:path";
import test from "node:test";
import { COMMON_DOC_FILES, discover, normalizePlan } from "./docs-site.mjs";

test("discover reads both maintained versions from one commit with historical URLs", async () => {
test("discover reads all maintained versions from one commit with historical URLs", async () => {
const root = await mkdtemp(join(tmpdir(), "docs-discover-"));
try {
for (const path of [...COMMON_DOC_FILES, "projects/typed-peripheral-digitalitems/mkdocs.yml",
"projects/typed-peripheral-digitalitems/requirements-docs.txt", "projects/typed-peripheral-digitalitems/documentation/generate-docs.mjs"]) {
await mkdir(dirname(join(root, path)), { recursive: true });
await writeFile(join(root, path), path.endsWith("package.json") ? '{"version":"0.2.1"}' : "generateDocs");
}
await writeFile(join(root, "gradle.properties"), "minecraftVersion=1.20.1\nmaintainedMinecraftVersions=1.20.1,1.21.1\n");
await writeFile(join(root, "gradle.properties"), "minecraftVersion=1.20.1\nmaintainedMinecraftVersions=1.20.1,1.21.1,26.1.2\n");
const git = (...args) => {
const result = spawnSync("git", ["-C", root, ...args], { encoding: "utf8" });
assert.equal(result.status, 0, result.stderr);
Expand All @@ -26,6 +26,7 @@ test("discover reads both maintained versions from one commit with historical UR
const sha = git("rev-parse", "HEAD");
const { plan } = discover(root, "HEAD");
assert.deepEqual(plan.map(({ path, minecraftVersion, javaVersion, ref, sha }) => ({ path, minecraftVersion, javaVersion, ref, sha })), [
{ path: "branch/26.1", minecraftVersion: "26.1.2", javaVersion: "25", ref: "origin/multiversion", sha },
{ path: "branch/1.21", minecraftVersion: "1.21.1", javaVersion: "21", ref: "origin/multiversion", sha },
{ path: "branch/1.20", minecraftVersion: "1.20.1", javaVersion: "17", ref: "origin/multiversion", sha },
]);
Expand Down
8 changes: 4 additions & 4 deletions .github/scripts/docs-site.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const DOC_GENERATORS = [
["projects/typed-peripheral-digitalitems/mkdocs.yml", "projects/typed-peripheral-digitalitems/requirements-docs.txt", "projects/typed-peripheral-digitalitems/documentation/generate-docs.mjs"],
];

const BRANCHES = ["1.20", "1.21"];
const BRANCHES = ["1.20", "1.21", "26.1"];
const TAG_RE = /^v\d+(?:\.\d+)+(?:-[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?$/;
const SHA_RE = /^[0-9a-f]{40}$/;
const HELP = `Usage: node .github/scripts/docs-site.mjs <command> [options]
Expand Down Expand Up @@ -110,7 +110,7 @@ export function normalizePlan(value) {
sha: raw.sha,
minecraftVersion: typeof raw.minecraftVersion === "string" ? raw.minecraftVersion : null,
packageVersion: typeof raw.packageVersion === "string" ? raw.packageVersion : null,
javaVersion: raw.javaVersion === "21" ? "21" : "17",
javaVersion: ["21", "25"].includes(raw.javaVersion) ? raw.javaVersion : "17",
};
});
return sortEntries(entries);
Expand All @@ -134,7 +134,7 @@ function metadata(repository, ref) {
return {
packageVersion: packageJson.version ?? null,
minecraftVersion,
javaVersion: minecraftVersion?.startsWith("1.21") ? "21" : "17",
javaVersion: minecraftVersion?.startsWith("26.") ? "25" : minecraftVersion?.startsWith("1.21") ? "21" : "17",
};
}

Expand All @@ -157,7 +157,7 @@ export function discover(repository = ".", sourceRef = "origin/multiversion") {
const details = metadata(repository, candidate.ref);
if (candidate.minecraftVersion) {
details.minecraftVersion = candidate.minecraftVersion;
details.javaVersion = candidate.minecraftVersion.startsWith("1.21") ? "21" : "17";
details.javaVersion = candidate.minecraftVersion.startsWith("26.") ? "25" : candidate.minecraftVersion.startsWith("1.21") ? "21" : "17";
}
entries.push({
...candidate,
Expand Down
16 changes: 16 additions & 0 deletions .github/scripts/test_gametest_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@


class ReportTests(unittest.TestCase):
def test_target_native_inventory(self):
with TemporaryDirectory() as directory:
path = Path(directory) / "26.1.2" / "report.xml"
path.parent.mkdir()
expected = MODULE["TARGET_EXPECTED"]
root = ET.Element("testsuite", tests=str(len(expected)))
for name in sorted(expected):
ET.SubElement(root, "testcase", name=name)
ET.ElementTree(root).write(path)
self.assertEqual(MODULE["check_report"](path)["tests"], len(expected))
root.remove(root[0])
root.set("tests", str(len(root)))
ET.ElementTree(root).write(path)
with self.assertRaises(AssertionError):
MODULE["check_report"](path)

def test_inventory_and_failure_guards(self):
with TemporaryDirectory() as directory:
path = Path(directory) / "report.xml"
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/docs-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
java-version: |
17
21
25
- uses: gradle/actions/setup-gradle@v4
- uses: actions/setup-python@v5
with:
Expand All @@ -36,7 +39,7 @@ jobs:
cache-dependency-path: projects/typed-peripheral-digitalitems/requirements-docs.txt
- name: Install documentation dependencies
run: timeout --foreground 120s python -m pip install -r projects/typed-peripheral-digitalitems/requirements-docs.txt
- name: Build package, fixtures and both documentation versions
- name: Build package, fixtures and all maintained documentation versions
run: |
set -euo pipefail
mkdir -p build
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/docs-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,15 @@ jobs:
fetch-depth: 0
fetch-tags: true

- name: Set up build JVM
- name: Set up build JVM and maintained toolchains
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
# The last JVM runs Gradle; historical documentation refs still need Java 21.
java-version: |
17
25
21

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/gametest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:

jobs:
build:
name: Four-node build
name: Six-node build
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
Expand All @@ -28,6 +28,7 @@ jobs:
java-version: |
17
21
25
- uses: gradle/actions/setup-gradle@v4
- name: Compile fixtures and build every node
run: |
Expand All @@ -38,7 +39,7 @@ jobs:
- uses: actions/upload-artifact@v4
if: always()
with:
name: four-node-build
name: six-node-build
path: |
build/*.log
build/artifact-manifest.json
Expand All @@ -51,7 +52,7 @@ jobs:
fail-fast: false
matrix:
loader: [fabric, forge]
minecraft: [1.20.1, 1.21.1]
minecraft: [1.20.1, 1.21.1, 26.1.2]
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
Expand All @@ -65,6 +66,7 @@ jobs:
java-version: |
17
21
25
- uses: gradle/actions/setup-gradle@v4
- name: Run native GameTests and verify exact inventory
env:
Expand Down
102 changes: 102 additions & 0 deletions MIGRATION-26.1.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Additive Minecraft 26.1.2 implementation brief

## Baseline and compatibility

Start: qualified `multiversion` merge `48ca204bd18afce4e05820fddc2b5585ad49f321`.
Retain 1.20.1 Fabric/Forge (Java 17) and 1.21.1 Fabric/NeoForge (Java 21).
Add exact **26.1.2 Fabric/NeoForge**, universal client/dedicated server.
**26.1.2 supports new worlds only. Cross-Minecraft-version world upgrades and downgrades are unsupported and untested.** Only disposable same-version saves may be used for persistence qualification.

Preserve `digitalitems` registry, block, criterion, stat, upgrade and peripheral IDs,
all Lua/TypeScript signatures/results and config keys/defaults/limits. Keep the
TypeScript API and Lua fixture projects version-independent. No mod/npm release,
merge, default-branch change or repository-policy change is authorized here.

## Toolchain and dependencies

The existing wrapper is Gradle 9.5.0. Target reference is the public libraries
`2.0.0-rc.1` source tag (commit `79fb93aa91d3d59bb5389bc542b6ed8c8ddd112b`),
`gradle/minecraft-26-1.gradle.kts`. Match its Java 25, Kotlin 2.4.0,
non-remapping `net.fabricmc.fabric-loom` 1.17.11 and ModDevGradle 2.0.142
contracts. Legacy Kotlin language/API metadata remains 2.0 and legacy remapping
and JVM targets remain unchanged. Official unobfuscated target names; no mappings
dependency or remapJar on target. Existing sources already use Mojang mappings,
so there is no Yarn conversion phase.

Target pins: NeoForge 26.1.2.122 (also exact target MDK); Fabric Loader 0.19.5,
Fabric API 0.155.3+26.1.2, Fabric Language Kotlin 1.13.12+kotlin.2.4.0,
KotlinForForge 6.4.0, CC:Tweaked 1.120.0, Broccolium/Tweakium/Testiarium
2.0.0-rc.1, Team Reborn Energy 5.0.0 through the library adapter.
Forge Config API Port 26.1.5 Fabric is published on Modrinth (`jUe0ucoE`);
its actual JAR contains NeoForge ModConfigSpec and the v5 ConfigRegistry API.
Use native NeoForge config on NeoForge. Required dependencies must resolve before
feature porting; no local producer substitution or invented compatibility.

## Source ownership and feature inventory

Canonical/VCS remains 1.20.1 across core/fabric/forge controllers. Target-only build
script and authored `versions/26.1.2/src` overrides follow the library's committed
strategy. Never edit processed Stonecutter outputs. Keep common behavior in core;
loader lifecycle/capabilities/metadata remain in their adapters.

| Surface | Port boundary |
| --- | --- |
| Build/publication | Add three target leaves and two playable JARs; ordinary target jar and official access namespace; preserve artifact naming and legacy toolchains. |
| Gameplay/public API | Normal/advanced digitizers, server-owned digital IDs and item/fluid/energy operations, block/turtle/pocket owners, existing validation/errors and conservation. |
| Persistence/data | Server-global codec-backed SavedData, stable IDs/counts/owners/decay fields; registry-aware item components; ValueInput/ValueOutput for block entities; no cross-version file mover. |
| Networking/menus | Trace native menu payload registration and validation through target platform toolkit; no new public wire protocol. Validate positions/type/distance before server mutations. |
| Client/rendering | Digitizer menus/screens, CC turtle models and item definitions; extraction APIs and gated client entrypoints. No direct raw OpenGL renderer in production. |
| Registration/config | Registry keys supplied before item/block construction; criteria codecs; config semantics unchanged. |
| Resources/datagen | Port actual providers, regenerate recipe/loot/advancement/tag/model/translation/upgrade JSON per loader; review deterministic second generation. |
| Tests | Port real Testiarium registry/annotations/structures and CCT harness; retain all nine Lua fixtures and four persistence/conservation cases; expand invalid-input/runtime coverage as needed. |
| Documentation/CI | Six playable nodes, literal head CI; retain historical routes and 1.20 default. Target docs use native target outputs. |

## Cumulative boundary review

Authoritative vanilla primers retrieved for every boundary, not only the last delta:
[1.21.2](https://github.com/neoforged/.github/blob/main/primers/1.21.2/index.md)
(registry keys/interaction signatures),
[1.21.4](https://github.com/neoforged/.github/blob/main/primers/1.21.4/index.md)
(item definitions and datagen split),
[1.21.5](https://github.com/neoforged/.github/blob/main/primers/1.21.5/index.md)
(components, models/render pipelines),
[1.21.6](https://github.com/neoforged/.github/blob/main/primers/1.21.6/index.md)
(ValueInput/Output and rendering),
[1.21.7](https://github.com/neoforged/.github/blob/main/primers/1.21.7/index.md),
[1.21.8](https://github.com/neoforged/.github/blob/main/primers/1.21.8/index.md),
[1.21.9](https://github.com/neoforged/.github/blob/main/primers/1.21.9/index.md)
(transactional transfer, render extraction),
[1.21.10](https://github.com/neoforged/.github/blob/main/primers/1.21.10/index.md),
[1.21.11](https://github.com/neoforged/.github/blob/main/primers/1.21.11/index.md)
(Identifier, render/material changes), and
[26.1](https://github.com/neoforged/.github/blob/main/primers/26.1/index.md)
(Java25/deobfuscation, templates, SavedData ownership and GUI extraction).
Patch-only 1.21.7/8/10 primers do not replace adjacent substantive boundaries.

Fabric maintained source pins are 0.92.3+1.20.1 / 0.116.14+1.21.1,
Loader0.18.4, Loom1.17.11; target uses the above RC pins. Inspect exact resolved
API sources for renamed level lifecycle/network/datagen/model APIs, not vanilla
primers alone. Official [Fabric porting](https://docs.fabricmc.net/26.1.2/develop/porting/)
and [API renames](https://docs.fabricmc.net/26.1.2/develop/porting/fabric-api)
and [target MDK](https://github.com/NeoForgeMDKs/MDK-26.1.2-ModDevGradle)
are reference contracts. Downloaded research and actual dependency inspection are
under ignored `build/migration`; source/bytecode wins over examples.

## Acceptance and current status

No target verification has passed at brief creation. Completion requires:

- resolve public dependencies, bootstrap target build, compile production/testmod;
- complete native target GameTests on both loaders with fresh nonempty XML and
exact declared/case identity counts; TypeScript compilation/contract tests;
- datagen and deterministic resources, packaged JAR/nested/access/metadata audit;
- dedicated startup to ready/clean stop, connected client join, blocks/menus and
turtle/pocket item/fluid/energy functional smoke;
- disposable same-version save/restart and invalid-network-input checks;
- six-node build/GameTest matrix and canonical switch-back source equality;
- scoped commit/push/new PR into multiversion, exact-head hosted CI success,
durable attached command/log/report/hash receipts. Stage gate reviews/merges.

Known inherited limitation: Pages environment excludes multiversion; generation
and assembly are required, but do not change policy or claim live deployment.
No integration is approved for silent removal or temporary no-op substitution.
Loading
Loading