feat: transfer wowmine to neuro

This commit is contained in:
2026-11-20 10:52:59 +00:00
parent f69752dcc0
commit 53d4ecc2bf
66 changed files with 1319 additions and 425 deletions
+11 -11
View File
@@ -45,7 +45,7 @@ def main():
ap = argparse.ArgumentParser(description=__doc__)
ap.add_argument('mrpack', type=Path)
ap.add_argument('output', type=Path, help='new output directory (must not exist)')
ap.add_argument('--base-url', default='https://store.hectic-lab.com/minecraft/world-of-sosal/')
ap.add_argument('--base-url', default='https://wowmine.bfs.band:8443/minecraft/wowmine/')
ap.add_argument('--server', help='optional initial multiplayer server address')
ap.add_argument('--bootstrap', type=Path)
args = Arguments(**vars(ap.parse_args()))
@@ -103,14 +103,14 @@ def main():
continue
name = item.filename[len(prefix):]
safe_path(name)
if name == 'config/worldofsosal-version.json' and json.loads(z.read(item)) != pack_info:
if name == 'config/wowmine-version.json' and json.loads(z.read(item)) != pack_info:
raise ValueError('Client version metadata disagrees with mrpack manifest')
if not (name.startswith(('config/', 'mods/', 'resourcepacks/', 'shaderpacks/')) or name == 'options.txt'):
raise ValueError('Review unexpected override: ' + name)
if name in destinations:
raise ValueError('Override duplicates downloaded mod: ' + name)
write(name, z.read(item), preserve=name in ('options.txt', 'config/DistantHorizons.toml'))
write('config/worldofsosal-version.json', (json.dumps(pack_info, indent=2) + '\n').encode())
write('config/wowmine-version.json', (json.dumps(pack_info, indent=2) + '\n').encode())
index = 'hash-format = "sha256"\n'
for entry in sorted(entries.values(), key=lambda e: e['file']):
index += '\n[[files]]\n'
@@ -121,36 +121,36 @@ def main():
else:
index += f'{k} = {quote(v)}\n'
(root / 'index.toml').write_text(index)
pack = f'name = "WorldOfSosal"\npack-format = "packwiz:1.1.0"\nversion = {quote(manifest["versionId"])}\n\n[index]\nfile = "index.toml"\nhash-format = "sha256"\nhash = "{digest(index.encode())}"\n\n[versions]\nminecraft = {quote(deps["minecraft"])}\nneoforge = {quote(deps["neoforge"])}\n'
pack = f'name = "wowmine"\npack-format = "packwiz:1.1.0"\nversion = {quote(manifest["versionId"])}\n\n[index]\nfile = "index.toml"\nhash-format = "sha256"\nhash = "{digest(index.encode())}"\n\n[versions]\nminecraft = {quote(deps["minecraft"])}\nneoforge = {quote(deps["neoforge"])}\n'
tomllib.loads(pack)
(root / 'pack.toml').write_text(pack)
(args.output / 'latest.mrpack').write_bytes(archive)
(args.output / download_name).write_bytes(archive)
# Prism otherwise uses its legacy INI parser and corrupts quoted commands.
cfg = '\n'.join(['[General]', 'ConfigVersion=1.2', 'InstanceType=OneSix', 'name=WoS', 'iconKey=default', 'OverrideCommands=true', 'PreLaunchCommand=' + quote(f'"$INST_JAVA" -jar packwiz-installer-bootstrap.jar {base}current/pack.toml'), 'OverrideMemory=true', 'MinMemAlloc=1024', 'MaxMemAlloc=8192', ''])
cfg = '\n'.join(['[General]', 'ConfigVersion=1.2', 'InstanceType=OneSix', 'name=wowmine', 'iconKey=default', 'OverrideCommands=true', 'PreLaunchCommand=' + quote(f'"$INST_JAVA" -jar packwiz-installer-bootstrap.jar {base}current/pack.toml'), 'OverrideMemory=true', 'MinMemAlloc=1024', 'MaxMemAlloc=8192', ''])
mmc = {'formatVersion': 1, 'components': [{'uid':'net.minecraft', 'version':deps['minecraft'], 'important':True}, {'uid':'net.neoforged', 'version':deps['neoforge'], 'important':True}]}
def nbt_string(value):
data = value.encode()
return struct.pack('>H', len(data)) + data
# Initial server list is seeded only during instance import, never overwritten.
servers = b'\x0a\x00\x00\x09' + nbt_string('servers') + b'\x0a\x00\x00\x00\x01'
servers += b'\x08' + nbt_string('name') + nbt_string('WoS')
servers += b'\x08' + nbt_string('name') + nbt_string('wowmine')
servers += b'\x08' + nbt_string('ip') + nbt_string(args.server or '') + b'\x00\x00'
with zipfile.ZipFile(args.output / 'WorldOfSosal-Prism.zip', 'w', zipfile.ZIP_DEFLATED) as z:
with zipfile.ZipFile(args.output / 'wowmine-Prism.zip', 'w', zipfile.ZIP_DEFLATED) as z:
z.writestr('instance.cfg', cfg)
z.writestr('mmc-pack.json', json.dumps(mmc, indent=2))
z.writestr('.minecraft/packwiz-installer-bootstrap.jar', bootstrap)
if args.server:
z.writestr('.minecraft/servers.dat', servers)
page = f'''<!doctype html><html lang="ru"><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>WorldOfSosal</title>
<h1>WorldOfSosal — автоматическое обновление</h1>
<p>Один раз скачайте <a href="WorldOfSosal-Prism.zip" download="WoS.zip">инстанс для Prism Launcher</a>, затем выберите «Добавить сборку → Импорт из zip». Разрешите команду перед запуском: она устанавливает и обновляет моды через packwiz.</p>
page = f'''<!doctype html><html lang="ru"><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>wowmine</title>
<h1>wowmine — автоматическое обновление</h1>
<p>Один раз скачайте <a href="wowmine-Prism.zip" download="wowmine.zip">инстанс для Prism Launcher</a>, затем выберите «Добавить сборку → Импорт из zip». Разрешите команду перед запуском: она устанавливает и обновляет моды через packwiz.</p>
<p>Сборка {html.escape(pack_info['version'])} · Minecraft {html.escape(deps['minecraft'])} · NeoForge {html.escape(deps['neoforge'])} · Java 21 · память 8 ГБ.</p>
<p>{'Сервер: <code>' + html.escape(args.server) + '</code>.' if args.server else 'Адрес игрового сервера будет сообщён отдельно.'}</p>
<p>Моды и конфигурация сборки обновляются при каждом запуске. Личные настройки options.txt и Distant Horizons сохраняются. В новых установках качество LOD — High; Medium можно выбрать в настройках Distant Horizons. При смене Minecraft или NeoForge может потребоваться повторный запуск после обновления версии.</p>
<p><a href="{urllib.parse.quote(download_name)}" download="{html.escape(download_name, quote=True)}">Обычный mrpack без автообновлений</a> · <a href="SHA256SUMS">Контрольные суммы</a></p></html>'''
(args.output / 'index.html').write_text(page)
files = ['WorldOfSosal-Prism.zip', download_name, 'latest.mrpack', 'pack/pack.toml']
files = ['wowmine-Prism.zip', download_name, 'latest.mrpack', 'pack/pack.toml']
(args.output / 'SHA256SUMS').write_text(''.join(f'{digest((args.output/f).read_bytes())} {f.replace("pack/", "current/")}\n' for f in files))
print(json.dumps({'release':release, 'minecraft':deps['minecraft'], 'neoforge':deps['neoforge'], 'managed_files':len(entries), 'server':args.server}))
+13 -30
View File
@@ -1,15 +1,14 @@
#!/usr/bin/env python3
"""Build and publish the same tested server pack on both independent entry points."""
"""Compatibility command: build and publish the tested server pack on neuro."""
import argparse
import hashlib
from pathlib import Path
import subprocess
import sys
import tempfile
import zipfile
def main():
def main() -> None:
ap = argparse.ArgumentParser(description=__doc__)
ap.add_argument('mrpack', type=Path)
ap.add_argument('--bootstrap', type=Path)
@@ -20,37 +19,21 @@ def main():
deployed = subprocess.run([
'ssh', '-o', 'BatchMode=yes', 'neuro',
'systemctl is-active --quiet minecraft-server-wowMineMap && '
'sha256sum /var/lib/minecraft-modpacks/worldOfSosal/WorldOfSosal.mrpack',
'sha256sum /var/lib/minecraft-modpacks/wowmine/wowmine.mrpack',
], capture_output=True, text=True, check=True).stdout.split()[0]
if deployed != expected:
ap.error('Deploy this mrpack on neuro first: the server archive hash differs')
scripts = Path(__file__).resolve().parent
mirrors = [
('hectic-lab', 'https://store.hectic-lab.com/minecraft/world-of-sosal/', 'wowmine.bfs.band:35565'),
('bfs.poland.xray', 'https://store.bfs.band/minecraft/world-of-sosal/', 'wowmine.bfs.band:35565'),
]
with tempfile.TemporaryDirectory(prefix='prism-mirrors-') as temporary:
root = Path(temporary)
bootstrap = args.bootstrap.resolve() if args.bootstrap else None
builds = []
for host, url, server in mirrors:
output = root / host
command = [sys.executable, str(scripts / 'build-prism-pack.py'),
str(archive), str(output), '--base-url', url, '--server', server]
if bootstrap:
command += ['--bootstrap', str(bootstrap)]
subprocess.run(command, check=True)
if bootstrap is None:
bootstrap = root / 'packwiz-installer-bootstrap.jar'
with zipfile.ZipFile(output / 'WorldOfSosal-Prism.zip') as z:
bootstrap.write_bytes(z.read('.minecraft/packwiz-installer-bootstrap.jar'))
builds.append((host, url, output))
# Each switch is atomic on its host. A failed publication exits nonzero;
# rerunning safely verifies existing releases and retries both mirrors.
for host, url, output in builds:
subprocess.run([sys.executable, str(scripts / 'publish-prism-pack.py'),
str(output), host], check=True)
print(url, flush=True)
with tempfile.TemporaryDirectory(prefix='prism-publish-') as temporary:
output = Path(temporary) / 'export'
command = [sys.executable, str(scripts / 'build-prism-pack.py'),
str(archive), str(output), '--server', 'wowmine.bfs.band:35565']
if args.bootstrap:
command += ['--bootstrap', str(args.bootstrap.resolve())]
subprocess.run(command, check=True)
subprocess.run([sys.executable, str(scripts / 'publish-prism-pack.py'),
str(output)], check=True)
print('https://wowmine.bfs.band:8443/minecraft/wowmine/', flush=True)
if __name__ == '__main__':
+5 -5
View File
@@ -12,14 +12,14 @@ import tarfile
import tempfile
root = Path(sys.argv[1]).resolve()
host = sys.argv[2] if len(sys.argv) > 2 else 'hectic-lab'
host = sys.argv[2] if len(sys.argv) > 2 else 'neuro'
if host.startswith('-'):
raise ValueError('Invalid SSH host')
release = hashlib.sha256((root / 'pack/pack.toml').read_bytes()).hexdigest()
with tempfile.TemporaryDirectory(prefix='prism-publish-') as temporary:
archive = Path(temporary) / 'publish.tar.gz'
with tarfile.open(archive, 'w:gz') as tar:
for name in ['pack', 'WorldOfSosal-Prism.zip', 'SHA256SUMS', 'index.html']:
for name in ['pack', 'wowmine-Prism.zip', 'SHA256SUMS', 'index.html']:
tar.add(root / name, arcname=name)
for path in root.glob('*.mrpack'):
tar.add(path, arcname=path.name)
@@ -28,7 +28,7 @@ with tempfile.TemporaryDirectory(prefix='prism-publish-') as temporary:
subprocess.run(['ssh', '-o', 'BatchMode=yes', host, f'cat > {remote}'], stdin=upload, check=True)
script = '''set -eu
umask 022
base=/var/www/store/minecraft/world-of-sosal
base=/var/www/wowmine/public/minecraft/wowmine
release=RELEASE
archive=/tmp/prism-publish-$release.tar.gz
mkdir -p "$base/releases"
@@ -50,7 +50,7 @@ done
for source in "$stage"/*.mrpack; do
mv "$source" "$base/$(basename "$source")"
done
for name in WorldOfSosal-Prism.zip SHA256SUMS index.html; do
for name in wowmine-Prism.zip SHA256SUMS index.html; do
mv "$stage/$name" "$base/$name"
done
ln -s "releases/$release" "$stage/current"
@@ -58,4 +58,4 @@ mv -Tf "$stage/current" "$base/current"
echo "Published $release"
'''.replace('RELEASE', release)
subprocess.run(['ssh', '-o', 'BatchMode=yes', host, 'sh', '-s'], input=script, text=True, check=True)
print(f'Published client files on {host}:/var/www/store/minecraft/world-of-sosal')
print(f'Published client files on {host}:/var/www/wowmine/public/minecraft/wowmine')
@@ -1,5 +1,61 @@
# Build evidence
## wowmine rename build, 2026-11-18
Observed in `/home/yukkop/pj/hearth/script/wowmine-client-info`:
```sh
GRADLE_USER_HOME="$PWD/.gradle-home" sh gradlew --console=plain build
```
Asynchronous monitor `mon_Y4H3XQR200C1WECD`, terminal `bash_5`, reported
`BUILD SUCCESSFUL in 15s` and `watcher completed (exit code 0)`.
Compilation, resource processing, JAR creation, and sources JAR creation ran.
Gradle reported `test NO-SOURCE`; this project has no automated unit tests.
Java was OpenJDK `21.0.7+6-nixos`. Build versions remain Gradle `9.2.1`,
ModDevGradle `2.0.148`, NeoForge `21.1.250`, and addon `1.0.0`.
```text
build/libs/wowmine-client-info-1.0.0.jar
SHA-256 11500779009865f9f87d68ea54726e0c80db4cd2404ccd23d6307880a2705110
build/libs/wowmine-client-info-1.0.0-sources.jar
SHA-256 2310083a7a928f5e770b8c5c861d9e59d2d2b1475abb4a7d78e178b49bea97e9
```
`jar tf` inspected both archives: classes/sources use `net/wowmine`, the
entrypoint is `WowmineClientInfo`, and the mixin resource is
`wowmine-client-info.mixins.json`. `javap -p -constants` confirmed the renamed
classes and `wowmineClientInfo$title` method. No old package or resource names
remain in either archive inventory.
Scoped Bun assertions passed for JSON/TOML parsing, renamed mod/display/mixin
identity, unchanged pinned client dependencies, client-only mixin isolation,
absence of old source references, both archive inventories, and the old
subtree containing only generated `.gradle/` and `build/` directories.
The initial Python validation command could not run because `python3` was
absent; the validation was performed with installed Bun instead.
Java/JSON editor diagnostics remain unavailable (`jdtls`/`biome` absent);
the Java compiler and JSON/TOML parsers succeeded.
Source/text moves and edits used `apply_patch`. The unchanged binary wrapper
JAR and existing `.gradle-home/` dependency cache were relocated directly,
because the text patch tool cannot move a binary JAR. Historical old build
outputs and project caches remain under the old subtree, unused by this build.
Old names below are historical evidence only, not compatibility aliases.
The runtime contract now reads `config/wowmine-version.json`. The pack
builder must supply manifest `name` exactly `wowmine`; title and local login
message still display that manifest value. No fallback to the old filename
or mod ID was added. No GUI/gameplay, launcher, server, publisher, or production
changes were performed. Runtime acceptance remains owned by the main task.
## Historical pre-rename build
The following 2026-11-12 evidence is retained verbatim as historical evidence.
Its old paths, artifact names, classes, and hashes describe that original
build, not the renamed wowmine artifacts.
Observed on 2026-11-12 in `/home/yukkop/pj/hearth/script/worldofsosal-client-info`.
This records an actual successful build, not a proposed command.
@@ -1,4 +1,4 @@
# WorldOfSosal Client Info
# wowmine Client Info
Tiny client-only addon, version 1.0.0, for Minecraft 1.21.1 and NeoForge
21.1.250. Java 21 required. Uses NeoForge's built-in Mixin support and the
@@ -19,8 +19,8 @@ The first build needs network access.
Outputs:
- `build/libs/worldofsosal-client-info-1.0.0.jar`: install in the client's `mods`.
- `build/libs/worldofsosal-client-info-1.0.0-sources.jar`: Java source/resources.
- `build/libs/wowmine-client-info-1.0.0.jar`: install in the client's `mods`.
- `build/libs/wowmine-client-info-1.0.0-sources.jar`: Java source/resources.
The repository directory also contains the complete build definition and
wrapper. Keep those files with the sources to rebuild; the sources JAR alone
@@ -28,7 +28,7 @@ is not a build project.
## Pack metadata contract
The pack builder owns `<game directory>/config/worldofsosal-version.json`.
The pack builder owns `<game directory>/config/wowmine-version.json`.
It must generate this UTF-8 JSON object from the same mrpack manifest used
for the release:
@@ -39,6 +39,10 @@ for the release:
| `minecraft` | `dependencies.minecraft` |
| `neoforge` | `dependencies.neoforge` |
The release manifest's `name` must be exactly lower-case `wowmine` for the
window title and local login message to show the intended branding. The addon
continues to display the manifest name rather than hardcoding a release name.
All four values must be strings, nonblank, and contain no control characters.
Extra properties are ignored. No pack release version is compiled into this
addon. The displayed Minecraft and NeoForge versions come from this metadata,
@@ -3,11 +3,11 @@ plugins {
id 'net.neoforged.moddev' version '2.0.148'
}
group = 'net.worldofsosal'
group = 'net.wowmine'
version = '1.0.0'
base {
archivesName = 'worldofsosal-client-info'
archivesName = 'wowmine-client-info'
}
java {
@@ -18,7 +18,7 @@ java {
neoForge {
version = '21.1.250'
mods {
worldofsosal_client_info {
wowmine_client_info {
sourceSet(sourceSets.main)
}
}
@@ -5,4 +5,4 @@ pluginManagement {
}
}
rootProject.name = 'worldofsosal-client-info'
rootProject.name = 'wowmine-client-info'
@@ -1,4 +1,4 @@
package net.worldofsosal.clientinfo;
package net.wowmine.clientinfo;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
@@ -26,7 +26,7 @@ public record PackInfo(String name, String version, String minecraft, String neo
}
private static PackInfo read() {
Path path = FMLPaths.CONFIGDIR.get().resolve("worldofsosal-version.json");
Path path = FMLPaths.CONFIGDIR.get().resolve("wowmine-version.json");
try (Reader reader = Files.newBufferedReader(path, StandardCharsets.UTF_8);
JsonReader jsonReader = new JsonReader(reader)) {
JsonElement json = new Gson().getAdapter(JsonElement.class).read(jsonReader);
@@ -1,4 +1,4 @@
package net.worldofsosal.clientinfo;
package net.wowmine.clientinfo;
import net.minecraft.client.Minecraft;
import net.minecraft.network.chat.Component;
@@ -7,10 +7,10 @@ import net.neoforged.fml.common.Mod;
import net.neoforged.neoforge.client.event.ClientPlayerNetworkEvent;
import net.neoforged.neoforge.common.NeoForge;
@Mod(value = "worldofsosal_client_info", dist = Dist.CLIENT)
public final class WorldOfSosalClientInfo {
public WorldOfSosalClientInfo() {
NeoForge.EVENT_BUS.addListener(WorldOfSosalClientInfo::onLogin);
@Mod(value = "wowmine_client_info", dist = Dist.CLIENT)
public final class WowmineClientInfo {
public WowmineClientInfo() {
NeoForge.EVENT_BUS.addListener(WowmineClientInfo::onLogin);
}
private static void onLogin(ClientPlayerNetworkEvent.LoggingIn event) {
@@ -1,7 +1,7 @@
package net.worldofsosal.clientinfo.mixin;
package net.wowmine.clientinfo.mixin;
import net.minecraft.client.Minecraft;
import net.worldofsosal.clientinfo.PackInfo;
import net.wowmine.clientinfo.PackInfo;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
@@ -10,7 +10,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(Minecraft.class)
public abstract class MinecraftTitleMixin {
@Inject(method = "createTitle()Ljava/lang/String;", at = @At("RETURN"), cancellable = true)
private void worldofsosalClientInfo$title(CallbackInfoReturnable<String> callback) {
private void wowmineClientInfo$title(CallbackInfoReturnable<String> callback) {
callback.setReturnValue(PackInfo.current().display() + " | " + callback.getReturnValue());
}
}
@@ -3,22 +3,22 @@ loaderVersion="[4,)"
license="All Rights Reserved"
[[mods]]
modId="worldofsosal_client_info"
modId="wowmine_client_info"
version="1.0.0"
displayName="WorldOfSosal Client Info"
displayName="wowmine Client Info"
description='''Local pack information in the window title and client chat.'''
[[mixins]]
config="worldofsosal-client-info.mixins.json"
config="wowmine-client-info.mixins.json"
[[dependencies.worldofsosal_client_info]]
[[dependencies.wowmine_client_info]]
modId="neoforge"
type="required"
versionRange="[21.1.250]"
ordering="NONE"
side="CLIENT"
[[dependencies.worldofsosal_client_info]]
[[dependencies.wowmine_client_info]]
modId="minecraft"
type="required"
versionRange="[1.21.1]"
@@ -1,7 +1,7 @@
{
"required": true,
"minVersion": "0.8",
"package": "net.worldofsosal.clientinfo.mixin",
"package": "net.wowmine.clientinfo.mixin",
"compatibilityLevel": "JAVA_21",
"client": [
"MinecraftTitleMixin"