Public: anyone can read this; the crew can change it.
Games survival step 3b: a sleep (night-skip) mod in the quality set #18172
Merged 5h 35m ago, live in production
torque/forge:torque/18151-games-survival-step-3b-a-sleep-night-ski → main 0 commits fork 3 threads · 3 unresolved
4 files
changed +35
−8
docs/features/game-mods.md +1 −1
| @@ -10,7 +10,7 @@ The server's mods or plugins come from Modrinth, for its loader and game version | ||
| 10 | 10 | - **Preview** picks the newest compatible version (a release when there is one) and resolves what it requires, recursively: "Adds Chunky 1.4.28; Adds ChunkyLib 1.0.2 (required by Chunky)". A project with no version for the server, a requirement with none, or two projects that say they are incompatible are refused with the reason. A bare slug already in `MODRINTH_PROJECTS` is pinned by the same change. |
| 11 | 11 | - **Install and restart** is one commit on the commit you previewed: the lockfile `<compose dir>/modrinth/<service>.lock.json` (each project's version id, file path, url and sha512, and whether it was asked for or is a dependency) and the compose env made from it: `MODRINTH_PROJECTS` lists `slug:versionId` for every project and `MODRINTH_DOWNLOAD_DEPENDENCIES=none`, so the image fetches exactly the locked set. A proxy also gets `MINECRAFT_VERSION`, which its Modrinth step needs. On a proxy whose servers sleep, `MODRINTH_PROJECTS` also holds AutoStopper (`PG4gqnzX:EclCtvWk`, see [](games.md)): it is sleep's, so a Modrinth change carries it over as it is and never lists it as the proxy's own, and Warm again takes only that entry. |
| 12 | 12 | - **Sets**: a named set installs in one preview and one commit. `set:survival` is the survival performance set for a Fabric server: Lithium, ScalableLux, Noisium and Chunky, each at its newest release for the server's Minecraft version, with what they require (Chunky needs Fabric API). It adds only what is missing, and a server on another loader is refused with the reason. The web Mods block shows it with a *Preview the set* button until it is installed; the terminal shows the same lines and `s` previews it; MCP `mods_install` takes `project: "set:survival"`. |
| 13 | - **Quality of life**: `set:quality` is graves (Universal Graves), Essential Commands, Styled Chat and Right Click Harvest for a Fabric server, installed like the survival set but optional by member: each is resolved alone, and one with no build for the server's Minecraft version (Right Click Harvest on 1.21.6) is left out with the reason ("Left out rightclickharvest: …") while the rest install; if none builds, it is refused. Essential Commands ships every command on; trimming it to /home, /spawn and /tpa is its config, which the owner sets, and the plan says so on a "Before players join" line, on the page and in the terminal. Each set shows a sentence on what it is for, and the web block offers *Preview the Quality of life set*, the terminal's key is `q`, MCP `mods_install` takes `project: "set:quality"`. | |
| 13 | - **Quality of life**: `set:quality` is graves (Universal Graves), Essential Commands, Styled Chat, Right Click Harvest and Sleep Warp (the night skips while players sleep) for a Fabric server, installed like the survival set but optional by member: each is resolved alone, and one with no build for the server's Minecraft version (Right Click Harvest on 1.21.6) is left out with the reason ("Left out rightclickharvest: …") while the rest install; if none builds, it is refused. Essential Commands ships every command on; trimming it to /home, /spawn and /tpa is its config, which the owner sets, and the plan says so on a "Before players join" line, on the page and in the terminal. Each set shows a sentence on what it is for, and the web block offers *Preview the Quality of life set*, the terminal's key is `q`, MCP `mods_install` takes `project: "set:quality"`. | |
| 14 | 14 | - **Updates** post the locked sha512s to Modrinth's `/v2/version_files/update` (releases for the loader and version) and show "2 updates" as from → to, one click each or all. |
| 15 | 15 | - **Remove** takes a project and what only it required; a dependency something else requires stays. |
| 16 | 16 |
src/games/mod_sets.ts +7 −6
| @@ -50,19 +50,19 @@ export const SURVIVAL: ModSet = Object.freeze({ | ||
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * Quality-of-life mods for a Fabric survival server (step 3 of #18059): graves, home/spawn/tpa |
| 53 | * commands, styled chat and right-click harvest. Optional: a mod that does not build for the | |
| 54 | * server's Minecraft version (rightclickharvest on 1.21.6) is skipped and named, not a refusal. | |
| 55 | * Essential Commands ships with every command on; its config is the owner's to trim to /home, | |
| 56 | * /spawn and /tpa. | |
| 53 | * commands, styled chat, right-click harvest and sleep (night-skip, #18151). Optional: a mod that | |
| 54 | * does not build for the server's Minecraft version (rightclickharvest on 1.21.6) is skipped and | |
| 55 | * named, not a refusal. Essential Commands ships with every command on; its config is the owner's | |
| 56 | * to trim to /home, /spawn and /tpa. | |
| 57 | 57 | */ |
| 58 | 58 | export const QUALITY: ModSet = Object.freeze({ |
| 59 | 59 | name: "quality", |
| 60 | 60 | title: "Quality of life", |
| 61 | 61 | key: "q", |
| 62 | about: "Graves, home and spawn commands, styled chat and right-click harvest for a Fabric survival server.", | |
| 62 | about: "Graves, home and spawn commands, styled chat, right-click harvest and a night-skip sleep mod for a Fabric survival server.", | |
| 63 | 63 | loader: "fabric", |
| 64 | 64 | optional: true, |
| 65 | slugs: Object.freeze(["universal-graves", "essential-commands", "styled-chat", "rightclickharvest"]), | |
| 65 | slugs: Object.freeze(["universal-graves", "essential-commands", "styled-chat", "rightclickharvest", "sleep-warp"]), | |
| 66 | 66 | cautions: Object.freeze({ |
| 67 | 67 | "essential-commands": "Essential Commands installs with every command on: before players join, trim its config to /home, /spawn and /tpa.", |
| 68 | 68 | }), |
| @@ -71,6 +71,7 @@ export const QUALITY: ModSet = Object.freeze({ | ||
| 71 | 71 | "Essential Commands: /home, /spawn and /tpa for players", |
| 72 | 72 | "Styled Chat: chat with colours and formatting", |
| 73 | 73 | "Right Click Harvest: right-click a ripe crop to harvest and replant it (skipped when it has no build for this version)", |
| 74 | "Sleep Warp: while players sleep the night runs fast, so a few in bed skip it (skipped when it has no build for this version)", | |
| 74 | 75 | ]), |
| 75 | 76 | }); |
| 76 | 77 |
src/http/mcp/tools/games.ts +1 −1
Diff not shown — a line 3,059 characters wide (limit 2,000). +1 −1
View filetest/game-mods.test.ts +26
| @@ -154,6 +154,7 @@ const PROJECTS = [ | ||
| 154 | 154 | { id: "ECid0001", slug: "essential-commands", title: "Essential Commands" }, |
| 155 | 155 | { id: "SCid0001", slug: "styled-chat", title: "Styled Chat" }, |
| 156 | 156 | { id: "RHid0001", slug: "rightclickharvest", title: "Right Click Harvest" }, |
| 157 | { id: "SWid0001", slug: "sleep-warp", title: "Sleep Warp" }, | |
| 157 | 158 | { id: "SLid0001", slug: "scalablelux", title: "ScalableLux" }, |
| 158 | 159 | { id: "NOid0001", slug: "noisium", title: "Noisium" }, |
| 159 | 160 | { id: "FPid0001", slug: "fabric-api", title: "Fabric API" }, |
| @@ -209,6 +210,7 @@ const VERSIONS: V[] = [ | ||
| 209 | 210 | { id: "ECv00001", project: "ECid0001", number: "0.5.0", date: "2025-02-02", games: ["1.21.4"], loaders: FABRIC, hash: "2b", deps: [{ project_id: "FPid0001", version_id: null, dependency_type: "required" }] }, |
| 210 | 211 | { id: "SCv00001", project: "SCid0001", number: "2.8.0", date: "2025-02-03", games: ["1.21.4"], loaders: FABRIC, hash: "2c" }, |
| 211 | 212 | // Built for a newer game version only. |
| 213 | { id: "SWv00001", project: "SWid0001", number: "1.2.0", date: "2025-02-05", games: ["1.21.4"], loaders: FABRIC, hash: "2e" }, | |
| 212 | 214 | { id: "RHv00001", project: "RHid0001", number: "4.5", date: "2025-02-04", games: ["1.21.8"], loaders: FABRIC, hash: "2d" }, |
| 213 | 215 | { id: "LIv00001", project: "LIid0001", number: "0.17.0", date: "2025-01-01", games: ["1.21.4"], loaders: FABRIC, hash: "1a" }, |
| 214 | 216 | { id: "SLv00001", project: "SLid0001", number: "0.1.5", date: "2025-01-02", games: ["1.21.4"], loaders: FABRIC, hash: "1b" }, |
| @@ -864,6 +866,30 @@ describe("the quality-of-life set (#18089)", () => { | ||
| 864 | 866 | if (!undone.ok) throw new Error(undone.error); |
| 865 | 867 | }); |
| 866 | 868 | |
| 869 | test("the set carries the sleep (night-skip) mod, optional and with a line saying why (#18151)", () => { | |
| 870 | expect(QUALITY.slugs).toContain("sleep-warp"); | |
| 871 | expect(QUALITY.optional).toBe(true); | |
| 872 | expect(QUALITY.why.some((l) => l.startsWith("Sleep Warp:"))).toBe(true); | |
| 873 | expect(QUALITY.why.length).toBe(QUALITY.slugs.length); | |
| 874 | }); | |
| 875 | ||
| 876 | test("a plan adds the sleep mod when it builds, and leaves only it out when it does not (#18151)", async () => { | |
| 877 | const m = await mods("smp"); | |
| 878 | const planned = await planInstall(app, m, "smp", "set:quality"); | |
| 879 | if (!planned.ok) throw new Error(planned.error); | |
| 880 | expect(planned.value.lock.map((l) => l.slug)).toContain("sleep-warp"); | |
| 881 | expect(planned.value.lines).toContain("Adds Sleep Warp 1.2.0"); | |
| 882 | // Right Click Harvest builds for 1.21.8 and Sleep Warp does not: it is named, the rest | |
| 883 | // installs. | |
| 884 | const later = { ...m, lock: [], target: { ...m.target, gameVersion: "1.21.8", label: "Fabric 1.21.8" } }; | |
| 885 | const left = await planInstall(app, later, "smp", "set:quality"); | |
| 886 | if (!left.ok) throw new Error(left.error); | |
| 887 | const slugs = left.value.lock.map((l) => l.slug); | |
| 888 | expect(slugs).toContain("rightclickharvest"); | |
| 889 | expect(slugs).not.toContain("sleep-warp"); | |
| 890 | expect(left.value.lines.some((l) => l.startsWith("Left out sleep-warp:"))).toBe(true); | |
| 891 | }); | |
| 892 | ||
| 867 | 893 | test("when no member builds for the server the set is refused, with each reason", async () => { |
| 868 | 894 | const m = await mods("smp"); |
| 869 | 895 | const old = { ...m, lock: [], target: { ...m.target, gameVersion: "1.19.2", label: "Fabric 1.19.2" } }; |
new above
offline
'Sleep Warp likewise' (no build on 1.21.6) is a claim nobody checked. Remove it or confirm it.