Skip to content

Commit 985fbf2

Browse files
cadenzaclaude
andcommitted
Replace production servers with test-only servers and mods
- Remove all 9 existing production server configs - Create 5 Forge test servers (1.7.10, 1.12.2, 1.16.5, 1.20.1, 1.20.4) - Create 3 Fabric test servers (1.20.1, 1.20.4, 1.21.1) - Generate minimal test MOD JARs (metadata-only, no Java code) - Add create-test-mods.js script for JAR regeneration Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent def1c3a commit 985fbf2

154 files changed

Lines changed: 278 additions & 2448 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

scripts/create-test-mods.js

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
/**
2+
* Generates minimal test MOD JARs for smoke testing.
3+
* Each JAR contains only metadata (no Java code).
4+
*
5+
* Usage: node scripts/create-test-mods.js
6+
* Requires: jar command (JDK) in PATH or at standard install location
7+
*/
8+
const fs = require('fs')
9+
const path = require('path')
10+
const { execSync } = require('child_process')
11+
const os = require('os')
12+
13+
// Find jar executable
14+
function findJar() {
15+
try {
16+
execSync('jar --version', { stdio: 'ignore' })
17+
return 'jar'
18+
} catch {
19+
// Try standard Windows JDK locations
20+
const javaBase = 'C:\\Program Files\\Java'
21+
if (fs.existsSync(javaBase)) {
22+
const jdks = fs.readdirSync(javaBase).filter(d => d.startsWith('jdk'))
23+
if (jdks.length > 0) {
24+
const jarPath = path.join(javaBase, jdks[jdks.length - 1], 'bin', 'jar')
25+
if (fs.existsSync(jarPath + '.exe') || fs.existsSync(jarPath)) {
26+
return `"${jarPath}"`
27+
}
28+
}
29+
}
30+
throw new Error('jar command not found. Install a JDK.')
31+
}
32+
}
33+
34+
const JAR = findJar()
35+
const SERVERS_DIR = path.resolve(__dirname, '..', 'servers')
36+
37+
// --- Forge servers (mcmod.info for 1.7/1.12, mods.toml for 1.13+) ---
38+
39+
const forgeServers = [
40+
{ id: 'test-forge-1.7.10', mc: '1.7.10', format: 'mcmod.info' },
41+
{ id: 'test-forge-1.12.2', mc: '1.12.2', format: 'mcmod.info' },
42+
{ id: 'test-forge-1.16.5', mc: '1.16.5', format: 'mods.toml' },
43+
{ id: 'test-forge-1.20.1', mc: '1.20.1', format: 'mods.toml' },
44+
{ id: 'test-forge-1.20.4', mc: '1.20.4', format: 'mods.toml' },
45+
]
46+
47+
// --- Fabric servers ---
48+
49+
const fabricServers = [
50+
{ id: 'test-fabric-1.20.1', mc: '1.20.1' },
51+
{ id: 'test-fabric-1.20.4', mc: '1.20.4' },
52+
{ id: 'test-fabric-1.21.1', mc: '1.21.1' },
53+
]
54+
55+
function mcmodInfo(mcVersion) {
56+
return JSON.stringify([{
57+
modid: 'numatest',
58+
name: 'NumaTest',
59+
version: '1.0.0',
60+
description: 'Smoke test mod',
61+
mcversion: mcVersion
62+
}], null, 2)
63+
}
64+
65+
function modsToml() {
66+
return `modLoader = "lowcodelanguage"
67+
loaderVersion = "[1,)"
68+
license = "MIT"
69+
70+
[[mods]]
71+
modId = "numatest"
72+
version = "1.0.0"
73+
displayName = "NumaTest"
74+
description = "Smoke test mod"
75+
`
76+
}
77+
78+
function fabricModJson() {
79+
return JSON.stringify({
80+
schemaVersion: 1,
81+
id: 'numatest',
82+
version: '1.0.0',
83+
name: 'NumaTest',
84+
description: 'Smoke test mod',
85+
environment: '*'
86+
}, null, 2)
87+
}
88+
89+
function createJar(tmpDir, jarPath) {
90+
// Use jar command to create JAR from tmpDir contents
91+
execSync(`${JAR} cf "${jarPath}" -C "${tmpDir}" .`, { stdio: 'inherit' })
92+
}
93+
94+
// Create Forge mod JARs
95+
for (const srv of forgeServers) {
96+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'numatest-'))
97+
const jarName = `numatest-${srv.mc}.jar`
98+
const jarDest = path.join(SERVERS_DIR, srv.id, 'forgemods', 'required', jarName)
99+
100+
if (srv.format === 'mcmod.info') {
101+
fs.writeFileSync(path.join(tmpDir, 'mcmod.info'), mcmodInfo(srv.mc))
102+
} else {
103+
const metaInf = path.join(tmpDir, 'META-INF')
104+
fs.mkdirSync(metaInf)
105+
fs.writeFileSync(path.join(metaInf, 'mods.toml'), modsToml())
106+
}
107+
108+
createJar(tmpDir, jarDest)
109+
fs.rmSync(tmpDir, { recursive: true })
110+
console.log(`Created: ${jarName} -> ${srv.id}`)
111+
}
112+
113+
// Create Fabric mod JARs
114+
for (const srv of fabricServers) {
115+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'numatest-'))
116+
const jarName = `numatest-fabric-${srv.mc}.jar`
117+
const jarDest = path.join(SERVERS_DIR, srv.id, 'fabricmods', 'required', jarName)
118+
119+
fs.writeFileSync(path.join(tmpDir, 'fabric.mod.json'), fabricModJson())
120+
121+
createJar(tmpDir, jarDest)
122+
fs.rmSync(tmpDir, { recursive: true })
123+
console.log(`Created: ${jarName} -> ${srv.id}`)
124+
}
125+
126+
console.log('\nDone! All test mod JARs created.')
Binary file not shown.

servers/SteveVsAlex-1.19.2/servermeta.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

servers/build-1.7.10/files/config/mtsconfig.json

Lines changed: 0 additions & 246 deletions
This file was deleted.

0 commit comments

Comments
 (0)