From 1033ed627580a17c4332a71b78d2f81005c5bad6 Mon Sep 17 00:00:00 2001 From: omo50 <144749186+omo50@users.noreply.github.com> Date: Wed, 22 Apr 2026 21:58:05 -0600 Subject: [PATCH] chore(repo): improve readmes and update licenses and mcmetas --- .github/ISSUE_TEMPLATE/bug-report.yml | 2 +- .github/LICENSE | 21 ++ .gitignore | 4 + modpacks/2k/README | 6 + modpacks/2k/README.md | 6 - modpacks/README | 4 +- .../required/Fixed Chest Models/pack.mcmeta | 16 +- .../required/Language Files/pack.mcmeta | 8 +- modpacks/lce-core/README | 2 + modpacks/rc-plus/README | 3 + modpacks/simply/README.md | 3 +- src/README | 4 + tools/README | 2 + tools/auto-update/pr.ts | 204 ++++++++++++++++++ 14 files changed, 263 insertions(+), 22 deletions(-) create mode 100644 .github/LICENSE create mode 100644 modpacks/2k/README delete mode 100644 modpacks/2k/README.md create mode 100644 modpacks/lce-core/README create mode 100644 modpacks/rc-plus/README create mode 100644 src/README create mode 100644 tools/README create mode 100644 tools/auto-update/pr.ts diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 0f56c015a..4b3c75a86 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -31,7 +31,7 @@ body: label: Minecraft Version description: What version of Minecraft are you running? options: - - 26.1.1 + - 26.1.2 - 1.21.10 - 1.21.8 - 1.21.5 diff --git a/.github/LICENSE b/.github/LICENSE new file mode 100644 index 000000000..5832cb686 --- /dev/null +++ b/.github/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Lasting Legacy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9c7db5f72..5fdde703e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +# General build .DS_Store *.exe @@ -10,16 +11,19 @@ modpacks/**/Logs modpacks/refresh-all.sh modpacks/update-all.sh modpacks/export-all.sh + # IntelliJ .idea/ *.iml *.ipr *.iws + # Visual Studio Code .settings/ .vscode/ .classpath .project + # Logs and errors hs_err_*.log replay_*.log diff --git a/modpacks/2k/README b/modpacks/2k/README new file mode 100644 index 000000000..3b1e70b8f --- /dev/null +++ b/modpacks/2k/README @@ -0,0 +1,6 @@ +# 2000s Edition + +Re-Console+ is a modpack meant to not just re-create Legacy Console Edition entirely from scratch, but expand on top of it with modern Java Edition QoL and features. From OptiFine Parity, to BetterGrass, and a whole lot more! + + + diff --git a/modpacks/2k/README.md b/modpacks/2k/README.md deleted file mode 100644 index b612862d5..000000000 --- a/modpacks/2k/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# 2000s Edition - -2000s Edition is a modpack meant to remake LCE as if it was made for the 6th Generation of Video Game Consoles - - - diff --git a/modpacks/README b/modpacks/README index 79c3136de..823c597f0 100644 --- a/modpacks/README +++ b/modpacks/README @@ -1 +1,3 @@ -This is the general directory for all files for our modpacks. \ No newline at end of file +This is the general directory for all files for our modpacks. + +To run batch updates on every version of a pack, install Packwiz Wrapper and run ``pw batch update --all -y`` to update every mod, and ``pw batch refresh`` to fix any issues in the ``index.toml`` \ No newline at end of file diff --git a/modpacks/lce-core/1.21.10-mr/resources/resourcepack/required/Fixed Chest Models/pack.mcmeta b/modpacks/lce-core/1.21.10-mr/resources/resourcepack/required/Fixed Chest Models/pack.mcmeta index e414aa78f..df126a483 100644 --- a/modpacks/lce-core/1.21.10-mr/resources/resourcepack/required/Fixed Chest Models/pack.mcmeta +++ b/modpacks/lce-core/1.21.10-mr/resources/resourcepack/required/Fixed Chest Models/pack.mcmeta @@ -1,14 +1,10 @@ { - "overlays": { - "entries": [ - {"directory": "1.21.5", "formats": [55, 100]}, - {"directory": "1.21.4", "formats": [46, 100]}, - {"directory": "1.21.1", "formats": [34, 100]} - ] - }, "pack": { "description": "Minor fix to chest models when utilizing the Mash-up packs.", - "pack_format": 15, - "supported_formats": {"max_inclusive": 420, "min_inclusive": 15} + "pack_format": 69, + "pack_format": 16, + "min_format": 16, + "max_format": 999, + "supported_formats": [ 16, 999 ] } -} \ No newline at end of file +} diff --git a/modpacks/lce-core/1.21.10-mr/resources/resourcepack/required/Language Files/pack.mcmeta b/modpacks/lce-core/1.21.10-mr/resources/resourcepack/required/Language Files/pack.mcmeta index 0f7651769..1ec14aa1d 100644 --- a/modpacks/lce-core/1.21.10-mr/resources/resourcepack/required/Language Files/pack.mcmeta +++ b/modpacks/lce-core/1.21.10-mr/resources/resourcepack/required/Language Files/pack.mcmeta @@ -1,6 +1,10 @@ { "pack": { - "pack_format": 34, - "description": "Resources required for the Simply Legacy modpack" + "description": "Resources for Re-Console Plus and Simply Legacy, + "pack_format": 69, + "pack_format": 16, + "min_format": 16, + "max_format": 999, + "supported_formats": [ 16, 999 ] } } diff --git a/modpacks/lce-core/README b/modpacks/lce-core/README new file mode 100644 index 000000000..c4a1d7271 --- /dev/null +++ b/modpacks/lce-core/README @@ -0,0 +1,2 @@ +# LCE Core +WIP modular core for Simply Legacy and Re-Console+ \ No newline at end of file diff --git a/modpacks/rc-plus/README b/modpacks/rc-plus/README new file mode 100644 index 000000000..e34a14621 --- /dev/null +++ b/modpacks/rc-plus/README @@ -0,0 +1,3 @@ +# Re-Console+ + +Re-Console+ is a modpack meant to not just re-create Legacy Console Edition entirely from scratch, but expand on top of it with modern Java Edition QoL and features. From OptiFine Parity, to BetterGrass, and a whole lot more! \ No newline at end of file diff --git a/modpacks/simply/README.md b/modpacks/simply/README.md index e31aeeb82..4e615cde5 100644 --- a/modpacks/simply/README.md +++ b/modpacks/simply/README.md @@ -1,4 +1,3 @@ # Simply Legacy -Simply Legacy is a modpack with the goal of bringing LCE to the modern day, just like Re-Console, but in a more slimmed down package that aims provide a more focused, more performant, and more faithful Legacy Console experience. - +Simply Legacy is a modpack designed to bring the experience of Minecraft's Legacy Console Edition to a more up-to-date version of the game, acting as a vision of what the game would've looked like if it continued to get content updates to this day. diff --git a/src/README b/src/README new file mode 100644 index 000000000..8ff9758af --- /dev/null +++ b/src/README @@ -0,0 +1,4 @@ +# SRC +The actions for the monorepo are written in Rust. + +WIP \ No newline at end of file diff --git a/tools/README b/tools/README new file mode 100644 index 000000000..afed7ec7b --- /dev/null +++ b/tools/README @@ -0,0 +1,2 @@ +# Tools +Tools is intended for CI/CD to utilize, via TypeScript. \ No newline at end of file diff --git a/tools/auto-update/pr.ts b/tools/auto-update/pr.ts new file mode 100644 index 000000000..2bbe4c83e --- /dev/null +++ b/tools/auto-update/pr.ts @@ -0,0 +1,204 @@ +import { execFileSync } from 'child_process'; +import * as fs from 'fs'; +import * as path from 'path'; + +const FORGEJO_URL = 'https://git.nostalgica.net'; +const BRANCH = 'auto-update'; +const TARGET = 'main'; +const PR_TITLE = 'chore: auto-update mods'; + +const token = process.env.FORGEJO_TOKEN; +const repo = process.env.GITHUB_REPOSITORY; + +if (!token) { + console.error('FORGEJO_TOKEN not set'); + process.exit(1); +} +if (!repo) { + console.error('GITHUB_REPOSITORY not set'); + process.exit(1); +} + +const apiBase = `${FORGEJO_URL}/api/v1/repos/${repo}`; + +async function api( + method: string, + path: string, + body?: unknown, +): Promise { + const res = await fetch(`${apiBase}${path}`, { + method, + headers: { + Authorization: `token ${token}`, + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + body: body ? JSON.stringify(body) : undefined, + }); + return res; +} + +interface ForgejoPR { + number: number; + state: string; + head: { ref: string }; + base: { ref: string }; + title: string; +} + +async function findOpenPR(): Promise { + const owner = repo!.split('/')[0]; + const res = await api( + 'GET', + `/pulls?state=open&head=${owner}:${BRANCH}&base=${TARGET}&limit=50`, + ); + if (!res.ok) { + throw new Error(`list PRs failed: ${res.status} ${await res.text()}`); + } + const prs = (await res.json()) as ForgejoPR[]; + const match = prs.find( + (p) => p.head.ref === BRANCH && p.base.ref === TARGET && p.state === 'open', + ); + return match ?? null; +} + +async function postComment(prNumber: number, body: string): Promise { + const res = await api('POST', `/issues/${prNumber}/comments`, { body }); + if (!res.ok) { + throw new Error(`comment failed: ${res.status} ${await res.text()}`); + } +} + +async function createPR(body: string): Promise { + const res = await api('POST', '/pulls', { + title: PR_TITLE, + body, + head: BRANCH, + base: TARGET, + }); + if (!res.ok) { + throw new Error(`create PR failed: ${res.status} ${await res.text()}`); + } + const pr = (await res.json()) as ForgejoPR; + return pr.number; +} + +async function updatePR(prNumber: number, body: string): Promise { + const res = await api('PATCH', `/pulls/${prNumber}`, { body }); + if (!res.ok) { + throw new Error(`update PR failed: ${res.status} ${await res.text()}`); + } +} + +function runModDiff( + oldRef: string, + newRef: string, + pathPrefix: string, +): string { + const bin = process.env.MOD_DIFF_BIN || './updater-bin/mod-diff'; + if (!fs.existsSync(bin)) { + console.warn(`mod-diff bin not found at ${bin}; skipping diff`); + return ''; + } + try { + return execFileSync(bin, [oldRef, newRef, pathPrefix], { + encoding: 'utf-8', + }).trim(); + } catch (e) { + console.warn( + `mod-diff failed for ${pathPrefix}: ${e instanceof Error ? e.message : e}`, + ); + return ''; + } +} + +function findModpackSubdirs(): Array<[string, string]> { + const out: Array<[string, string]> = []; + const root = 'modpacks'; + if (!fs.existsSync(root)) return out; + + for (const pack of fs.readdirSync(root)) { + const packPath = path.join(root, pack); + if (!fs.statSync(packPath).isDirectory()) continue; + for (const sub of fs.readdirSync(packPath)) { + if (!/-mr$|-cf$/.test(sub)) continue; + const subPath = path.join(packPath, sub); + if (fs.statSync(subPath).isDirectory()) { + out.push([`${pack}/${sub}`, subPath]); + } + } + } + return out; +} + +function buildPRBody(): string { + const sections: string[] = []; + sections.push( + 'Automated PR from the auto update action.); + + const subdirs = findModpackSubdirs(); + const diffSections: string[] = []; + + for (const [label, subdir] of subdirs) { + const md = runModDiff(`origin/${TARGET}`, 'HEAD', subdir); + if (md) { + diffSections.push(`### ${label}\n\n${md}`); + } + } + + if (diffSections.length === 0) { + sections.push( + '\n## Mod Updates\n\n_No mod version changes detected.', + ); + } else { + sections.push('\n## Mod Updates\n\n' + diffSections.join('\n\n')); + } + + const timestamp = new Date().toISOString(); + sections.push(`\n---\n_Last updated: ${timestamp}_`); + + return sections.join('\n'); +} + +async function prePush(): Promise { + const existing = await findOpenPR(); + if (!existing) { + console.log('no existing open PR; nothing to announce.'); + return; + } + const timestamp = new Date().toISOString(); + await postComment( + existing.number, + `Force-pushing updated auto-update branch (${timestamp}).`, + ); + console.log(`posted force-push notice to PR #${existing.number}`); +} + +async function postPush(): Promise { + const body = buildPRBody(); + const existing = await findOpenPR(); + if (existing) { + await updatePR(existing.number, body); + console.log(`updated PR #${existing.number}`); + } else { + const num = await createPR(body); + console.log(`created PR #${num}`); + } +} + +const phase = process.argv[2]; +(async () => { + try { + if (phase === 'pre-push') { + await prePush(); + } else if (phase === 'post-push') { + await postPush(); + } else { + console.error('usage: tsx pr.ts '); + process.exit(1); + } + } catch (e) { + console.error(`pr.ts ${phase} failed:`, e instanceof Error ? e.message : e); + process.exit(1); + } +})(); \ No newline at end of file