Compare commits

..
Author SHA1 Message Date
cf748edf05 fix: use correct tag for the OCI image 2026-05-31 01:33:31 +01:00
3a3a1905ed fix: client target
- correctly evaluate moddir
- only patch the AE2 mod for server target
2026-05-31 01:32:51 +01:00

View file

@ -38,6 +38,25 @@
commonDir = ./patches/common;
prefix = if name == "client" then "overrides/" else "";
sideDir = toString ./patches + "/${name}";
ae-fix =
if name == "server" then
''
# Strip AE2 coremod registration from the jar — bansoukou already provides
# patched classes. The original jar's AE2ELTransformer would add
# readItemStack_ae2el_old to PacketBuffer, but bansoukou's patched
# PacketBuffer already has it, causing Duplicate method name error.
# We keep the jar for mod registration but remove the FMLCorePlugin
# manifest entry so the coremod (and its transformer) doesn't load.
mkdir -p mods/ae2-uel-v0.56.7
cd mods/ae2-uel-v0.56.7
unzip -qo ../ae2-uel-v0.56.7.jar
sed -i '/^FMLCorePlugin:/d' META-INF/MANIFEST.MF
zip -qr ../ae2-uel-v0.56.7.jar .
cd ../..
rm -rf mods/ae2-uel-v0.56.7
''
else
"";
in
pkgs.runCommand "nomifactory-harder-${name}"
{
@ -86,23 +105,11 @@
done
fi
# Strip AE2 coremod registration from the jar — bansoukou already provides
# patched classes. The original jar's AE2ELTransformer would add
# readItemStack_ae2el_old to PacketBuffer, but bansoukou's patched
# PacketBuffer already has it, causing Duplicate method name error.
# We keep the jar for mod registration but remove the FMLCorePlugin
# manifest entry so the coremod (and its transformer) doesn't load.
mkdir -p mods/ae2-uel-v0.56.7
cd mods/ae2-uel-v0.56.7
unzip -qo ../ae2-uel-v0.56.7.jar
sed -i '/^FMLCorePlugin:/d' META-INF/MANIFEST.MF
zip -qr ../ae2-uel-v0.56.7.jar .
cd ../..
rm -rf mods/ae2-uel-v0.56.7
${ae-fix}
# Inject extra mod jars into the correct directory for this side
mkdir -p "${modsDir name}"
${builtins.concatStringsSep "\n" (map (m: "cp ${m.src} \"${modsDir name}/${m.jar}\"") extraMods)}
mkdir -p "${modsDir}"
${builtins.concatStringsSep "\n" (map (m: "cp ${m.src} \"${modsDir}/${m.jar}\"") extraMods)}
# Repack (zip auto-appends .zip; fix if it does)
zip -qr "$out" .
@ -145,8 +152,8 @@
default = self.packages.${system}.server;
server-oci = pkgs.dockerTools.buildImage {
name = "nomifactory-harder-server";
tag = "latest";
name = "git.dzuchun.ing/dzu/nomisuffory";
tag = "main";
copyToRoot = pkgs.writeShellScriptBin "entrypoint" ''
exec ${launch-server} /srv