From 88f683a8361406919f31f18792f0cfe64440fea3 Mon Sep 17 00:00:00 2001 From: Matt Artist Date: Thu, 9 Oct 2025 10:23:32 -0400 Subject: [PATCH 1/3] fix: attach clientSideOnly to mods toml if found in root --- packages/mod-parser/forge.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/mod-parser/forge.ts b/packages/mod-parser/forge.ts index 84055d8f..c9880530 100644 --- a/packages/mod-parser/forge.ts +++ b/packages/mod-parser/forge.ts @@ -196,6 +196,10 @@ export interface ForgeModTOMLData { * A URL to refer people to when problems occur with this mod */ issueTrackerURL: string + /** + * If true, the mod is client side only + */ + clientSideOnly: boolean } export interface ForgeModASMData { @@ -500,6 +504,7 @@ export async function readForgeModToml(mod: ForgeModInput, manifest?: Record Date: Fri, 10 Oct 2025 11:32:26 -0400 Subject: [PATCH 2/3] feat: write test --- .../mods/sample-mod-1.13-no-deps-client-only.jar | Bin 0 -> 1109 bytes packages/mod-parser/forge.test.ts | 7 ++++++- packages/mod-parser/forge.ts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 mock/mods/sample-mod-1.13-no-deps-client-only.jar diff --git a/mock/mods/sample-mod-1.13-no-deps-client-only.jar b/mock/mods/sample-mod-1.13-no-deps-client-only.jar new file mode 100644 index 0000000000000000000000000000000000000000..1d67cc59e3ba88b2d72e4feed8f3b446a0be6079 GIT binary patch literal 1109 zcmWIWW@Zs#;Nak3&@ylGXFvj+3@i-3t|5-Po_=on|4uP5Ff#;rvvYt{FhP|CfHgBP za4@jOctyW?mjBV1nStRZ8v}z7Pz79bZhlI!UP*p#&fHM%{L2mk`+kS>@U7^bqNebm z$>0L>RH?6u7Y{6bv|*$Aw{5Ru%jG?TkJP89z1{Kdb<-4&Z|}~0ul@XmLrgS^#j(CU zdyA8!Zi(WajnNUFA+61S1M5xZG1zW8DVF8zw@=8fYW6Yj#jQ%O?>?@WWng#LHGx$- zIooJD-<))p=mU@bd|6^W|G=-eUmkzat)44+Kk;|m{DwO%Zi07Kl?Gp`WDlCm>$q-- zQUnL?sQFkzwo>HrO9UU z>+ky>_w4?@dhfYQr_1Hl9xp#t_s=5H)|~OJnNfS&x{Du+*KlOdKE%3h&*$#Xo6oVt zH1CW#xkvYGy56zrDOch)$vUQM8orat^zdL@r*VUgcPrEWe61@NA~uIaSQ}Kz=@hu^ zZF8{_FGzH)>os$-5B?_g{$1MV2Y?B^2l8)TK36(aqYeK>us8%{o~4>`5v;bRBtW3UuE92{{Io%a@DfWKfj+$c~>NQyK(cq z#U { test('should not crash if the toml does not have the dependencies', async ({ mock }) => { const metadata = await readForgeModToml(`${mock}/mods/sample-mod-1.13-no-deps.jar`) // eslint-disable-next-line no-template-curly-in-string - expect(metadata).toEqual([{ authors: 'mezz', credits: '', dependencies: [], description: 'JEI is an item and recipe viewing mod for Minecraft, built from the ground up for stability and performance.\n', displayName: 'Just Enough Items', displayURL: 'https://minecraft.curseforge.com/projects/jei', issueTrackerURL: 'https://github.com/mezz/JustEnoughItems/issues?q=is%3Aissue', loaderVersion: '[14,)', logoFile: '', modLoader: 'javafml', modid: 'jei', provides: [], updateJSONURL: '', version: '${file.jarVersion}' }]) + expect(metadata).toEqual([{ authors: 'mezz', credits: '', dependencies: [], description: 'JEI is an item and recipe viewing mod for Minecraft, built from the ground up for stability and performance.\n', displayName: 'Just Enough Items', displayURL: 'https://minecraft.curseforge.com/projects/jei', issueTrackerURL: 'https://github.com/mezz/JustEnoughItems/issues?q=is%3Aissue', loaderVersion: '[14,)', logoFile: '', modLoader: 'javafml', modid: 'jei', provides: [], updateJSONURL: '', version: '${file.jarVersion}', clientSideOnly: false }]) + }) + + test('should read if the mod is client side only', async ({ mock }) => { + const metadata = await readForgeModToml(`${mock}/mods/sample-mod-1.13-no-deps-client-only.jar`) + expect(metadata).toEqual([{ authors: 'mezz', credits: '', dependencies: [], description: 'JEI is an item and recipe viewing mod for Minecraft, built from the ground up for stability and performance.\n', displayName: 'Just Enough Items', displayURL: 'https://minecraft.curseforge.com/projects/jei', issueTrackerURL: 'https://github.com/mezz/JustEnoughItems/issues?q=is%3Aissue', loaderVersion: '[14,)', logoFile: '', modLoader: 'javafml', modid: 'jei', provides: [], updateJSONURL: '', version: '${file.jarVersion}', clientSideOnly: true }]) }) test('should read >1.13 forge mod jar', async ({ mock }) => { diff --git a/packages/mod-parser/forge.ts b/packages/mod-parser/forge.ts index c9880530..d83ea4f4 100644 --- a/packages/mod-parser/forge.ts +++ b/packages/mod-parser/forge.ts @@ -504,7 +504,7 @@ export async function readForgeModToml(mod: ForgeModInput, manifest?: Record Date: Fri, 10 Oct 2025 11:34:16 -0400 Subject: [PATCH 3/3] fix: other test --- packages/mod-parser/forge.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/mod-parser/forge.test.ts b/packages/mod-parser/forge.test.ts index d4edc4d8..993bd979 100644 --- a/packages/mod-parser/forge.test.ts +++ b/packages/mod-parser/forge.test.ts @@ -72,6 +72,7 @@ describe('Forge', () => { modLoader: 'javafml', loaderVersion: '[14,)', version: '6.0.0.26', + clientSideOnly: false, }, ], usedForgePackage: true,