Integer Limit bf4055fbe4
Update Nomi-Labs, GT, GCYM, GrS and More (#790)
This PR updates Nomi-Labs to 0.7.0, allowing for associate updates to GT, GCYM, GrS and Architecture Craft, as well as the removal of Random Patches, Just Enough Dimensions, and Difficulty Lock.

Although GT 2.8.10 also fixed Extreme RAM Usage in Alfheim 1.3, (See PR https://github.com/GregTechCEu/GregTech/pull/2475) this PR **does not** update Alfheim to 1.3. This is because Alfheim 1.3, although not consuming large amounts of memory, still consumes more memory than 1.1.1, and causes fps spikes.

Also, because Nomi-Labs now implements a native and better difficulty lock, of which works on dedicated servers, `server.properties` overrides, as well as previously changed parts in README and Pack Mode Switchers (in https://github.com/Nomi-CEu/Nomi-CEu/pull/292), have been removed.

This PR also fixes an issue with corrupted images and jar files in built packs.

/* Github Stuff */

[FIXUP]
[[fixes]]
sha = "bd58b9072f45d647734ae66168cbd27bf9b2f220"
newTitle = "Update GT and Related Mods for 1.7"
newBody = '''
  [EXPAND]
  [[messages]]
    messageTitle = "Update GT to 2.8+, add Nomi Labs"
    messageBody = """
      [BREAKING]
      [DETAILS]
      details = [
        \"**Please DO NOT revert any saves that have been loaded in this release to 1.6.1b, 1.6.1a, or prior!**\",
        \"**Lots of Recipes have been moved to the Assembly Line, and now require Assembly Line Research.**\",
        \"Adds Assembly Line Research\",
        \"Adds ME Hatches and Buses, for combining Multiblocks with AE Networks\",
        \"Adds Filtered Output Hatches\",
        \"Adds EU Multiblock Power Storage\",
        \"Adds Multiblock Transformer and Laser Power Transfer\",
        \"Adds Long Distance Pipes\",
        \"Creating Waypoints in the Prospector\",
        \"Fixing many Bugs\",
        \"And many more!\"
      ]
      [DETAILS]
      [PRIORITY]
        priority = 100
      [PRIORITY]
    """

  [[messages]]
    messageTitle = "Multiblock Changes"
    messageBody = """
      [BREAKING]
      [DETAILS]
      details = [
        \"Multiblocks accept a new **maximum** of 2 Energy Hatches.\",
        \"All Custom Multiblocks, such as Naquadah Reactors and Multiverse Projectors, now have **minimum casing requirements** and a **maintenance hatch**.\",
        \"Some Custom Multiblocks now have Distinct Mode\",
        \"All Custom Multiblocks now have custom Front Overlays\",
        \"Reworked & Improved Multiblock UIs\"
      ]
      [DETAILS]
      [PRIORITY]
        priority = 50
      [PRIORITY]
    """
  [EXPAND]
  '''
[FIXUP]

[EXPAND]
  [[messages]]
  messageTitle = "Upgrade AE2 Stuff to AE2 Stuff Unofficial"
  messageBody = '''
    [BREAKING]
  
    [DETAILS]
      details = [
        "Pattern Encoders have been Removed!",
        "Any existing Pattern Encoders, whether items, in patterns or placed, have been remapped to AE2 Interfaces.",
        "All Usages in Recipes have also been changed to AE2 Interfaces!",
      ]
    [DETAILS]
    
    [PRIORITY]
      priority=25
    [PRIORITY]
  '''
  
  [[messages]]
  messageTitle = "Update GT to 2.8.10"
  messageBody = '''
    [BREAKING]
  
    [DETAILS]
      details = [
        "Allows GregTech Data Sticks to Copy ME Hatch Settings",
        "Adds an 'Stocking' Version of ME Hatches and Buses",
        "Support for Displaying Power Substation on Central Monitor",
      ]
    [DETAILS]
    
    [PRIORITY]
      priority=20
    [PRIORITY]
    
    [IGNORE]
      checks = { compareBefore = "1.7-alpha-4" } # Only apply this if the commit being compared against is 1.7-alpha-4 or newer
    [IGNORE]
  '''
  
  [[messages]]
  messageTitle = "Update Nomi Labs to 0.7.0"
  messageBody = '''
    [BREAKING]
    
    [DETAILS]
      details = [
        "Improvement of DME Simulation Chamber (now increases Tiers and Data Counts of Models)",
        "Custom Implementation of Difficulty Lock, now works on Dedicated Servers",
        "Replacement of the Void Dimension, fixing issues with Difficulty Changing",
        "Replacement of Custom Window Titles and Logos, Allowing the Removal of Random Patches",
        "Improvements to FTB Utils and Effortless Building",
        "Allows Setting of Default Keybinds for New Players",
      ]
    [DETAILS]
    
    [PRIORITY]
      priority=15
    [PRIORITY]
    
    [IGNORE]
      checks = { compareBefore = "1.7-alpha-4" } # Only apply this if the commit being compared against is 1.7-alpha-4 or newer
    [IGNORE]
  '''
[EXPAND]

[MOD INFO]
  [[infos]]
  projectID = 254317
  info = "Replaced by Nomi Labs"


  [[infos]]
  projectID = 285612
  info = "Replaced by Nomi Labs"
  
  [[infos]]
  projectID = 390886
  info = "Replaced by Nomi Labs"
  
  [[infos]]
  projectID = 538092
  info = "Replaced by Betterer P2P"
[MOD INFO]
2024-07-11 21:32:57 +10:00

238 lines
5.5 KiB
TypeScript

import gulp, { dest, symlink } from "gulp";
import {
clientDestDirectory,
modpackManifest,
sharedDestDirectory,
} from "#globals";
import fs from "fs";
import upath from "upath";
import buildConfig from "#buildConfig";
import { deleteAsync } from "del";
import { createModList, ModFileInfo } from "../misc/createModList.ts";
import dedent from "dedent-js";
import { cleanupVersion } from "#utils/util.ts";
import filter from "gulp-filter";
async function clientCleanUp() {
return deleteAsync(upath.join(clientDestDirectory, "*"), { force: true });
}
/**
* Checks and creates all necessary directories so we can build the client safely.
*/
async function createClientDirs() {
if (!fs.existsSync(clientDestDirectory)) {
return fs.promises.mkdir(clientDestDirectory, { recursive: true });
}
}
/**
* Exports the modpack manifest.
*/
async function exportModpackManifest() {
const manifestPath = upath.join(clientDestDirectory, "manifest.json");
// Filter client side files only and prune build-specific fields.
const newFiles = modpackManifest.files
.map((file) => {
if (file.sides) {
if (!file.sides.includes("client")) return;
const newFile = Object.assign({}, file);
delete newFile.sides;
return newFile;
}
return file;
})
.filter(Boolean);
return fs.promises.writeFile(
manifestPath,
JSON.stringify(
{
...modpackManifest,
files: newFiles,
},
null,
" ",
),
);
}
/**
* Copies the license file.
*/
async function copyClientLicense() {
return gulp.src("../LICENSE").pipe(gulp.dest(clientDestDirectory));
}
/**
* Copies the update notes file.
*/
function copyClientUpdateNotes() {
return gulp
.src("../UPDATENOTES.md", { allowEmpty: true })
.pipe(gulp.dest(clientDestDirectory));
}
/**
* Copies the changelog file.
*/
function copyClientChangelog() {
return gulp
.src(upath.join(buildConfig.buildDestinationDirectory, "CHANGELOG.md"))
.pipe(dest(clientDestDirectory));
}
/**
* Copies modpack overrides.
*/
function copyClientOverrides() {
const f = filter((f) => !f.isDirectory());
return gulp
.src(buildConfig.copyFromSharedClientGlobs, {
cwd: sharedDestDirectory,
allowEmpty: true,
resolveSymlinks: true,
encoding: false,
})
.pipe(f)
.pipe(symlink(upath.join(clientDestDirectory, "overrides")));
}
/**
* Fetches mod links and builds modlist.html.
*/
async function fetchModList() {
const modList = await createModList();
const formattedModList = dedent`
<!DOCTYPE html>
<html lang="en">
<head>
<title>Nomi-CEu Mod Information</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel = "icon" href = "https://github.com/Nomi-CEu/Nomi-CEu/assets/103940576/672808a8-0ad0-4d07-809e-08336a928909" type = "image/x-icon">
<style>
caption {
font-size: 30px;
color: #fff;
font-family: "Comic Sans MS", "sans-serif";
font-weight: 700;
border-radius: 10px;
border-collapse: collapse;
background-color: #795B97;
}
table {
border-collapse: collapse;
width: 100%;
color: #333;
font-family: "Comic Sans MS", "sans-serif";
font-size: 13px;
text-align: left;
border-radius: 10px;
overflow: hidden;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}
table th {
background-color: #9973BD;
color: #fff;
font-family: "Comic Sans MS", "sans-serif";
font-weight: bold;
padding: 10px;
text-transform: uppercase;
letter-spacing: 1px;
border-top: 1px solid #fff;
border-bottom: 1px solid #ccc;
font-size: 15px;
}
table tr:nth-child(even) td {
background-color: #E7E7E7;
}
table tr:hover td {
background-color: rgba(160, 210, 235, 0.5);
}
table td {
background-color: #fff;
padding: 10px;
border-bottom: 1px solid #ccc;
font-weight: bold;
}
table tr:last-of-type {
border-bottom: 2px solid #9973BD;
}
.redCross {
color: #ff0000;
font-size: 20px;
}
.greenTick {
color: #32cd32;
font-size: 20px;
}
</style>
</head>
<body>
<table>
<caption>Nomi-CEu Mod List (${modList.length} Mods):</caption>
<tr>
<th>Mod Name</th>
<th>Mod Version</th>
<th>Client?</th>
<th>Server?</th>
<th>Author(s)</th>
</tr>
${formatModList(modList)}
</table>
</body>
</html>
`;
return fs.promises.writeFile(
upath.join(clientDestDirectory, "modlist.html"),
formattedModList,
);
}
/**
* Formats the mod list.
*/
function formatModList(modList: ModFileInfo[]): string {
const output: string[] = [];
modList.forEach((modFile) => {
output.push(dedent`
<tr>
<td><a href="${modFile.modInfo.links.websiteUrl}">${modFile.modInfo.name}</a></td>
<td><a href="${modFile.fileInfo.downloadUrl}">v${cleanupVersion(modFile.fileInfo.displayName)}</a></td>
${getTickCross(modFile.inClient)}
${getTickCross(modFile.inServer)}
<td>${modFile.modInfo.authors.map((author) => `<a href=${author.url}>${author.name}</a>`).join(", ")}</td>
</tr>
`);
});
return output.join("\n");
}
/**
* Gets the tick/cross used in the mod list.
*/
function getTickCross(bool: boolean): string {
if (bool) {
return '<td class="greenTick">&#10004;</td>';
}
return '<td class="redCross">&#10006;</td>';
}
export default gulp.series(
clientCleanUp,
createClientDirs,
copyClientOverrides,
exportModpackManifest,
copyClientLicense,
copyClientOverrides,
copyClientChangelog,
copyClientUpdateNotes,
fetchModList,
);