Merge pull request #1030 from ludovic111/feat/site-docs
🤖 Agent: merged after verify passed (docs and website only; the site build fails on broken links, anchors or images). The website gets a Docs section with 11 pages; /server redirects to /docs/hosting.
This commit is contained in:
+6
-2
@@ -27,9 +27,13 @@
|
||||
header @assets Cache-Control "public, max-age=31536000, immutable"
|
||||
@media path /media/* /fonts/* /og.png /favicon* /apple-touch-icon.png
|
||||
header @media Cache-Control "public, max-age=604800"
|
||||
# The server guide became a section of the documentation.
|
||||
redir /server /docs/hosting permanent
|
||||
redir /server.html /docs/hosting permanent
|
||||
rewrite /privacy /privacy.html
|
||||
rewrite /server /server.html
|
||||
@pages path / /index.html /404.html /privacy.html /server.html
|
||||
@doc path_regexp doc ^/docs/([a-z-]+)$
|
||||
rewrite @doc /docs/{re.doc.1}.html
|
||||
@pages path / /index.html /404.html /privacy.html /docs /docs/* /sitemap.xml
|
||||
header @pages Cache-Control "no-cache"
|
||||
@legal path /LEGAL.md /fonts/*.txt
|
||||
header @legal Content-Type "text/plain; charset=utf-8"
|
||||
|
||||
@@ -4,6 +4,7 @@ FROM node:22-alpine AS build
|
||||
WORKDIR /site
|
||||
COPY build.mjs ./
|
||||
COPY src ./src
|
||||
COPY docs ./docs
|
||||
COPY public ./public
|
||||
COPY LEGAL.md ./
|
||||
ARG GITHUB_TOKEN
|
||||
|
||||
+10
-1
@@ -64,10 +64,19 @@ shown as screenshots of the game, as the
|
||||
fan websites about the game, with the disclaimer they require. The site offers no game
|
||||
files: players need their own legally obtained copy of Minecraft: Java Edition.
|
||||
|
||||
### The launcher's Servers page
|
||||
|
||||
| Files in `public/media/docs/` | Source | What it shows |
|
||||
| --- | --- | --- |
|
||||
| `servers-create.webp`, `servers-dashboard.webp`, `servers-invite.webp`, `servers-backups.webp` | Screenshots of the Horizon launcher's Servers page (a debug build on Linux, with made-up addresses, names and `@example.com` emails), converted to WebP | The Create a server dialog, a running server, a Tailscale invitation, the Backups tab |
|
||||
|
||||
They show only Horizon's own interface (MIT) and a default player head.
|
||||
|
||||
## Text
|
||||
|
||||
The parity table is generated from Horizon's README, and the patch notes
|
||||
come from Horizon's GitHub releases: Horizon's own text, MIT.
|
||||
come from Horizon's GitHub releases: Horizon's own text, MIT. The documentation
|
||||
(`docs/*.md` in this folder, served under `/docs`) is Horizon's own text, MIT.
|
||||
|
||||
## Contributors
|
||||
|
||||
|
||||
+17
-4
@@ -2,7 +2,7 @@
|
||||
|
||||
Live at **https://playhorizon.dev**.
|
||||
|
||||
One static page in Horizon's design language (`docs/design-system.md`), with the tokens of
|
||||
A landing page and a documentation section in Horizon's design language (`docs/design-system.md`), with the tokens of
|
||||
`crates/horizon-theme` (generated into `src/tokens.css` by `cargo run -p xtask -- tokens`):
|
||||
Geist and Geist Mono, cool neutrals in a light and a dark appearance (the system's, or the
|
||||
toggle's) and one violet accent, numbered index lists with one-pixel rules, and short, eased
|
||||
@@ -14,18 +14,20 @@ no runtime dependencies.
|
||||
|
||||
```
|
||||
build.mjs renders dist/ (no dependencies)
|
||||
docs/*.md the documentation, one Markdown file per page: "# Title", a lede paragraph, then sections
|
||||
docs/nav.json the order of the pages and the groups of the left navigation
|
||||
serve.mjs a tiny static server for local checks
|
||||
src/index.html the page, with {{placeholders}} build.mjs fills
|
||||
src/404.html the not-found page
|
||||
src/privacy.html what the launcher can send when players allow it, retention, deletion (/privacy)
|
||||
src/server.html host a server (/server): docs/hosting.md rendered into the page
|
||||
src/docs.html the template of every documentation page (/docs/...), with its left navigation
|
||||
src/tokens.css the design tokens, generated from crates/horizon-theme (do not edit)
|
||||
src/style.css every style, on top of the tokens
|
||||
src/main.js download buttons, patch notes, links, contributors, nav and menu, tabs, lightbox, motion
|
||||
src/markdown.js a small Markdown renderer (escapes everything), shared by build and page
|
||||
src/releases.js the patch notes' markup, shared by build and page
|
||||
src/contributors.js the contributors' filtering and markup, shared by build and page
|
||||
public/ fonts, screenshots, icons, og.png, robots.txt, sitemap.xml: copied as is
|
||||
public/ fonts, screenshots, icons, og.png, robots.txt: copied as is (sitemap.xml is written by the build)
|
||||
scripts/assets.mjs rebuilds public/ from the repo (fonts to WOFF2, images to WebP)
|
||||
scripts/shots.mjs Playwright screenshots at every width, and og.png
|
||||
Dockerfile, Caddyfile, railway.json the Railway service
|
||||
@@ -36,7 +38,7 @@ shots/ (gitignored) full-page screenshots at 360–1920 px, a 1250×
|
||||
## What comes from where
|
||||
|
||||
- **Built in** (`build.mjs`): the parity table, its score, harness count and audit date,
|
||||
all from `README.md`; the server guide (`/server`) from `docs/hosting.md`; the Discord and Sponsor links from
|
||||
all from `README.md`; the documentation pages (`/docs`) from `website/docs/`; the Discord and Sponsor links from
|
||||
`launcher/links.json`; the latest releases and the contributors (`/repos/ludovic111/horizon/contributors`,
|
||||
bots left out, the owner first), when GitHub answers; without an answer the build still succeeds and
|
||||
the Contributors block and its menu entries stay hidden until the page loads them. Locally these come from
|
||||
@@ -48,6 +50,17 @@ shots/ (gitignored) full-page screenshots at 360–1920 px, a 1250×
|
||||
and `links.json` from `main`. Each
|
||||
falls back to what was built in, and the download button to the releases page.
|
||||
|
||||
## The documentation
|
||||
|
||||
`docs/<slug>.md` becomes `/docs/<slug>` (`index.md` is `/docs/`). Write for players first, then hosters,
|
||||
then contributors; plain words, short paragraphs; claim only what players can download today, and
|
||||
mark merged-but-unreleased things "next release". `{{HARNESSES}}` and `{{PERCENT}}` are filled from
|
||||
the README. A line holding only `` becomes a figure (the file must be in
|
||||
`public/media/`); links to other pages are `/docs/<slug>#heading`. The build checks every link
|
||||
between pages and every image, and fails with the list when one is broken. `/server`
|
||||
redirects to `/docs/hosting`. The developer docs in the repository's `docs/` stay as they are and are linked from
|
||||
the Contributing page.
|
||||
|
||||
## Run it locally
|
||||
|
||||
```sh
|
||||
|
||||
+95
-11
@@ -1,8 +1,9 @@
|
||||
// Builds the site into dist/: src/index.html with the README's parity table and
|
||||
// the community links and contributors baked in, plus public/ and fingerprinted CSS and JS. No dependencies.
|
||||
// the community links and contributors baked in, the documentation (docs/*.md, one page each, listed in
|
||||
// docs/nav.json), plus public/ and fingerprinted CSS and JS. No dependencies.
|
||||
//
|
||||
// Railway builds only website/, so the README and links.json come from the repo when they
|
||||
// are next to it (a local checkout) and from main on GitHub otherwise. The latest releases and
|
||||
// are next to it (a local checkout) and from main on GitHub otherwise. The documentation lives in website/. The latest releases and
|
||||
// the contributors are baked in when GitHub answers, so the page reads well before (or without) JavaScript.
|
||||
import { readFile, writeFile, mkdir, rm, cp } from "node:fs/promises";
|
||||
import { existsSync } from "node:fs";
|
||||
@@ -29,11 +30,6 @@ async function repoFile(path) {
|
||||
|
||||
// The README: required, a site with a stale or missing parity table is worse than no deploy.
|
||||
const [readme, readmeFrom] = await repoFile("README.md");
|
||||
// The server guide (/server) is docs/hosting.md from its first section on: the page has its own title and lede.
|
||||
const [hosting] = await repoFile("docs/hosting.md");
|
||||
const guideStart = hosting.search(/^## /m);
|
||||
if (guideStart < 0) throw new Error("docs/hosting.md: no '## ' section");
|
||||
|
||||
let links = { ...DEFAULT_LINKS };
|
||||
try {
|
||||
const parsed = JSON.parse((await repoFile("launcher/links.json"))[0]);
|
||||
@@ -203,10 +199,81 @@ const values = {
|
||||
CONTRIBUTORS_HIDDEN: contributors.length ? "" : " hidden",
|
||||
BAKED: JSON.stringify(baked).replace(/</g, "\\u003c"),
|
||||
YEAR: String(new Date().getUTCFullYear()),
|
||||
SERVER_GUIDE: markdown(hosting.slice(guideStart)),
|
||||
};
|
||||
|
||||
const pages = ["index.html", "404.html", "privacy.html", "server.html"];
|
||||
// --- The documentation ---------------------------------------------------------------------
|
||||
// website/docs/<slug>.md: "# Title", a one-paragraph lede, then the body. docs/nav.json orders them in groups.
|
||||
|
||||
const docsNav = JSON.parse(await readFile(join(site, "docs", "nav.json"), "utf8"));
|
||||
const docs = [];
|
||||
for (const { group, pages: slugs } of docsNav) {
|
||||
for (const slug of slugs) {
|
||||
const file = `${slug}.md`;
|
||||
const text = (await readFile(join(site, "docs", file), "utf8")).replace(/\r\n?/g, "\n");
|
||||
const m = text.match(/^# (.+)\n\n((?:[^\n]+\n)+)\n/);
|
||||
if (!m) throw new Error(`docs/${file}: needs "# Title", a blank line, a lede paragraph and a blank line`);
|
||||
docs.push({ slug, file, group, title: m[1].trim(), lede: m[2].trim().replace(/\n/g, " "), body: text.slice(m[0].length), path: slug === "index" ? "/docs/" : `/docs/${slug}` });
|
||||
}
|
||||
}
|
||||
const plain = (md) => md.replace(/`/g, "").replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/\*\*/g, "");
|
||||
const anchors = new Map(); // path -> ids, to check every link between the pages
|
||||
const problems = [];
|
||||
const renderedDocs = docs.map((d) => {
|
||||
const headings = [];
|
||||
const html = markdown(d.body.replaceAll("{{HARNESSES}}", harnesses).replaceAll("{{PERCENT}}", percent), { site: true, headings });
|
||||
anchors.set(d.path, new Set(headings.map((h) => h.id)));
|
||||
return { ...d, html, headings };
|
||||
});
|
||||
for (const d of renderedDocs) {
|
||||
for (const [, link] of d.html.matchAll(/<a href="((?:\/docs|#)[^"]*)"/g)) {
|
||||
const [path, id] = link.split("#");
|
||||
const to = path || d.path;
|
||||
const known = anchors.get(to);
|
||||
if (!known) problems.push(`${d.file}: ${link} is not a docs page`);
|
||||
else if (id && !known.has(id)) problems.push(`${d.file}: ${link} has no such heading`);
|
||||
}
|
||||
for (const [, src] of d.html.matchAll(/<img src="(\/media\/[^"]+)"/g)) {
|
||||
if (!existsSync(join(site, "public", src))) problems.push(`${d.file}: image ${src} is not in public/`);
|
||||
}
|
||||
}
|
||||
if (problems.length) throw new Error(`docs: ${problems.length} broken link(s)\n${problems.join("\n")}`);
|
||||
|
||||
const docNav = (current) =>
|
||||
docsNav
|
||||
.map(({ group, pages: slugs }) => {
|
||||
const items = slugs
|
||||
.map((slug) => {
|
||||
const d = docs.find((x) => x.slug === slug);
|
||||
return `<li><a href="${d.path}"${slug === current.slug ? ' aria-current="page"' : ""}>${escape(d.title)}</a></li>`;
|
||||
})
|
||||
.join("");
|
||||
return ` <p class="docs-nav-group">${escape(group)}</p>\n <ul>${items}</ul>`;
|
||||
})
|
||||
.join("\n");
|
||||
const pagerLink = (d, rel) => (d ? `<a class="docs-pager-${rel}" href="${d.path}"><span>${rel === "next" ? "Next" : "Previous"}</span>${escape(d.title)}</a>` : "");
|
||||
|
||||
await mkdir(join(dist, "docs"), { recursive: true });
|
||||
const docPageFiles = [];
|
||||
const docPages = renderedDocs.map((d, i) => {
|
||||
const toc = d.headings.filter((h) => h.level === 2);
|
||||
return {
|
||||
file: join("docs", d.slug + ".html"),
|
||||
values: {
|
||||
DOC_TITLE: escape(d.title),
|
||||
DOC_DESC: escape(plain(d.lede).slice(0, 220)),
|
||||
DOC_PATH: d.path,
|
||||
DOC_GROUP: escape(d.group),
|
||||
DOC_LEDE: inline(d.lede, true),
|
||||
DOC_NAV: docNav(d),
|
||||
DOC_TOC: toc.length >= 4 ? ` <nav class="docs-toc" aria-label="On this page"><p>On this page</p><ul>${toc.map((h) => `<li><a href="#${h.id}">${escape(h.text)}</a></li>`).join("")}</ul></nav>` : "",
|
||||
DOC_BODY: d.html,
|
||||
DOC_PAGER: pagerLink(renderedDocs[i - 1], "prev") + pagerLink(renderedDocs[i + 1], "next"),
|
||||
DOC_FILE: d.file,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
const pages = ["index.html", "404.html", "privacy.html"];
|
||||
for (const page of pages) {
|
||||
let html = await readFile(join(site, "src", page), "utf8");
|
||||
html = html.replace(/\{\{(\w+)\}\}/g, (all, key) => {
|
||||
@@ -216,15 +283,32 @@ for (const page of pages) {
|
||||
html = html.replace(/href="\/(favicon\.svg|favicon-32\.png|apple-touch-icon\.png)"/g, (all, icon) => `href="/${icon}?v=${iconVersions[icon]}"`);
|
||||
await writeFile(join(dist, page), html);
|
||||
}
|
||||
const docTemplate = await readFile(join(site, "src", "docs.html"), "utf8");
|
||||
for (const { file, values: own } of docPages) {
|
||||
let html = docTemplate.replace(/\{\{(\w+)\}\}/g, (all, key) => {
|
||||
const value = key in own ? own[key] : values[key];
|
||||
if (value === undefined) throw new Error(`docs.html: unknown placeholder ${all}`);
|
||||
return value;
|
||||
});
|
||||
html = html.replace(/href="\/(favicon\.svg|favicon-32\.png|apple-touch-icon\.png)"/g, (all, icon) => `href="/${icon}?v=${iconVersions[icon]}"`);
|
||||
await writeFile(join(dist, file), html);
|
||||
docPageFiles.push(file);
|
||||
}
|
||||
|
||||
// The pages' inline scripts (they mark the page as scripted and apply the saved theme before CSS
|
||||
// applies) and the inlined stylesheet: the Content-Security-Policy in the Caddyfile allows them by hash.
|
||||
const allHtml = (await Promise.all(pages.map((page) => readFile(join(dist, page), "utf8")))).join("\n");
|
||||
const allHtml = (await Promise.all([...pages, ...docPageFiles].map((page) => readFile(join(dist, page), "utf8")))).join("\n");
|
||||
const hashes = (re) => [...new Set([...allHtml.matchAll(re)].map((m) => `'sha256-${createHash("sha256").update(m[1]).digest("base64")}'`))].join(" ");
|
||||
await writeFile(join(dist, ".csp-script"), hashes(/<script>([\s\S]*?)<\/script>/g));
|
||||
await writeFile(join(dist, ".csp-style"), hashes(/<style>([\s\S]*?)<\/style>/g));
|
||||
|
||||
const urls = ["/", ...docs.map((d) => d.path), "/privacy"];
|
||||
await writeFile(
|
||||
join(dist, "sitemap.xml"),
|
||||
`<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n${urls.map((u) => ` <url><loc>https://playhorizon.dev${u}</loc></url>`).join("\n")}\n</urlset>\n`,
|
||||
);
|
||||
|
||||
console.log(
|
||||
`built dist/ from ${readmeFrom}: ${body.length} subsystems, ${percent}, ${harnesses} harnesses, ` +
|
||||
`${game.length} game releases baked${launcher ? `, launcher ${launcher.tag_name}` : ""}, ${contributors.length} contributors`,
|
||||
`${game.length} game releases baked${launcher ? `, launcher ${launcher.tag_name}` : ""}, ${contributors.length} contributors, ${docs.length} docs pages`,
|
||||
);
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
# Contribute
|
||||
|
||||
Horizon is open source and takes pull requests. The one rule that shapes everything: **it plays exactly like vanilla.** Wherever vanilla has a feature, vanilla is the specification.
|
||||
|
||||
Questions and ideas are welcome on [Discord](https://discord.gg/HcTeMZxe5E). Bugs and feature requests go in [GitHub issues](https://github.com/ludovic111/horizon/issues). If you want to take something on, say so in its issue so nobody else starts the same work.
|
||||
|
||||
## The repository
|
||||
|
||||
[github.com/ludovic111/horizon](https://github.com/ludovic111/horizon) holds the game, the launcher and this website, plus the tools, tests and docs that build, check and release them.
|
||||
|
||||
- `crates/` is the game, as Rust crates: the client, the server, the world and protocol code, the mod system, the shader pack reader, the design tokens and more.
|
||||
- `launcher/` is the launcher, a GPUI app with its own Cargo workspace.
|
||||
- `website/` is this site and its documentation, in `website/docs/`.
|
||||
- `tools/` holds the parity harness drivers, the parity runner, the release tools and the self-check.
|
||||
- `tests/` holds the Python tests, `benchmarks/` the published results and `packaging/` the installers.
|
||||
- `docs/` holds the developer documentation, [indexed here](https://github.com/ludovic111/horizon/blob/main/docs/README.md): the native client, the design system, world generation, the parity workflow, the release flow and more.
|
||||
|
||||
## Build it
|
||||
|
||||
You need Rust (stable), Python 3.10 or newer, JDK 25 and, on Linux, the ALSA and udev headers (`libasound2-dev libudev-dev`). Horizon never downloads the game: it prepares its resources from your own copy of Minecraft 26.3.
|
||||
|
||||
```sh
|
||||
git clone https://github.com/ludovic111/horizon.git
|
||||
cd horizon
|
||||
cargo run --release -p horizon-prepare -- --prepare --server-jar ~/Downloads/server.jar
|
||||
cargo run --release -p horizon-client
|
||||
```
|
||||
|
||||
Everything prepared lands in the git-ignored `.local/`. It is derived from the game: never commit it or share it. The launcher is its own workspace: `cd launcher && cargo run`. The website builds with `node build.mjs` in `website/`.
|
||||
|
||||
## Parity harnesses
|
||||
|
||||
A **harness** is a `tools/test_*_parity.py` script. It drives the same inputs through Horizon and through the vanilla client and server bytecode from your own copy of the game, and checks that the outputs are identical. There are {{HARNESSES}} in the audit.
|
||||
|
||||
- **Read the vanilla code before writing Horizon's.** `tools/rea_vanilla.py` queries the pinned game bytecode, for example `python3 tools/rea_vanilla.py method net.minecraft.world.level.block.DispenserBlock dispenseFrom`. Say in your pull request which vanilla classes and methods you followed.
|
||||
- **Gameplay changes come with a harness**, new or extended, so the next change cannot silently break them. Copy a nearby one.
|
||||
- `python3 tools/parity.py` runs the harnesses a change can affect. [The parity workflow](https://github.com/ludovic111/horizon/blob/main/docs/parity-workflow.md) explains the rest.
|
||||
- Horizon's own features (the launcher, the new menus) follow [the design system](https://github.com/ludovic111/horizon/blob/main/docs/design-system.md) and stay off by default wherever they would change the vanilla look.
|
||||
- Everything players run is Rust. Python and Java are fine for dev tools and harness drivers, never for player-facing code.
|
||||
|
||||
## How pull requests are checked
|
||||
|
||||
1. **Self-check first.** Run `python3 tools/pr_ready.py` and paste the block it prints into your pull request. It runs rustfmt, clippy with warnings denied, the tests of the crates you touched, the Python tests, the public-tree check and the harnesses your change can affect.
|
||||
2. **`verify`** runs on every pull request on GitHub's Linux runners: the same checks, without the vanilla harnesses. Docs-only changes finish in seconds.
|
||||
3. **`parity`** runs the affected harnesses on a maintainer's computer, which holds the game files. It never runs a fork's code on its own: a maintainer reads the change, then adds the `run-parity` label, which runs it once on your current commit.
|
||||
4. **Small pull requests.** One change each, under about 500 lines of code where you can. They get reviewed and merged the same day.
|
||||
5. **Labels.** `feature` when players get something new, `skip-release` when they see no change, nothing for a fix. We set them if you cannot.
|
||||
6. **"Allow edits by maintainers."** Tick it. When something small is left, we push the fix ourselves instead of sending you back.
|
||||
|
||||
Every merge to `main` that players can see is released automatically, so `main` always stays playable. See [the release flow](https://github.com/ludovic111/horizon/blob/main/docs/release-flow.md).
|
||||
|
||||
## What never goes in
|
||||
|
||||
Never commit game files, decompiled source or prepared resources. `tools/check_public_tree.py` rejects them, and `git config core.hooksPath .githooks` runs it before every commit. Tracked Java is allowed only under the project's own `dev/horizonlab` namespace.
|
||||
|
||||
[CONTRIBUTING.md](https://github.com/ludovic111/horizon/blob/main/CONTRIBUTING.md) is the short version of this page, and the [contributors](/#contributors) are listed on the home page.
|
||||
@@ -0,0 +1,71 @@
|
||||
# FAQ
|
||||
|
||||
Short answers, with a link when there is more to say.
|
||||
|
||||
## Do I need to buy Minecraft?
|
||||
|
||||
Yes. Horizon contains no Minecraft code, assets or data. It builds its game files from your own copy of Minecraft: Java Edition 26.3, on your computer. See [Install](/docs/install).
|
||||
|
||||
## Is Horizon official?
|
||||
|
||||
No. It is not an official Minecraft product, and it is not approved by or associated with Mojang or Microsoft. It is open source, under the MIT licence.
|
||||
|
||||
## Will my Forge, NeoForge or Fabric mods work?
|
||||
|
||||
No. Java mod jars do not run in Horizon. Horizon has its own mod system, and the launcher can carry over the data-and-assets part of some Java mods. See [Modpacks](/docs/modpacks) and [Mods and data packs](/docs/mods).
|
||||
|
||||
## Can I join public servers?
|
||||
|
||||
Not yet. Most public servers check that you own Minecraft, which needs a Microsoft account sign-in, and Horizon cannot do that yet. It can join servers in offline mode, such as your own or a friend's. See [Multiplayer](/docs/multiplayer).
|
||||
|
||||
## When will Microsoft sign-in work?
|
||||
|
||||
We cannot give a date. It needs an app registration with Microsoft and an approval from Mojang that the project does not have yet. Until then, this site only describes what works today.
|
||||
|
||||
## Can vanilla players join my Horizon world or server?
|
||||
|
||||
Yes. A vanilla 26.3 client can join a Horizon server and a Horizon LAN world. See [Multiplayer](/docs/multiplayer) and [Host a server](/docs/hosting).
|
||||
|
||||
## Can I use my existing worlds?
|
||||
|
||||
Yes. Worlds from Minecraft 1.8 to 26.2 are upgraded the way vanilla upgrades them, and saves use vanilla's format. Copy your world into the game folder's `saves` folder, and make a backup first, as you would before opening a world in any new version.
|
||||
|
||||
## Where are my worlds and settings?
|
||||
|
||||
In the game folder: `~/.local/share/horizon` on Linux, `~/Library/Application Support/horizon` on macOS and `%APPDATA%\horizon` on Windows. Updating the game never touches it.
|
||||
|
||||
## Does it change my normal Minecraft install?
|
||||
|
||||
No. Horizon only reads your Minecraft files when it prepares, and keeps what it needs in its own folder.
|
||||
|
||||
## Why does preparing need Java 25?
|
||||
|
||||
Preparation runs vanilla's own data generator on your copy of the game, to read data such as every item's default components, and that is Java. It is needed for the preparation only. The game and the server themselves run without Java.
|
||||
|
||||
## What does "100% vanilla parity" mean?
|
||||
|
||||
Every subsystem matches vanilla in every harness that compares it. It means 100% of what the harnesses compare, not proof that nothing else differs. See [What Horizon is](/docs/) and [the status table](/#parity).
|
||||
|
||||
## Which systems does it run on?
|
||||
|
||||
Linux x86-64, macOS on Apple Silicon and Windows x64. See [supported systems](/docs/#supported-systems).
|
||||
|
||||
## Are shader packs supported?
|
||||
|
||||
In part. Horizon runs the full-screen effects of Java shader packs, not their geometry and shadow passes yet. See [Settings](/docs/settings#shader-packs).
|
||||
|
||||
## Does Horizon collect data?
|
||||
|
||||
Only if you say yes, and each kind has its own switch. Everything is off by default. See [Privacy](/privacy).
|
||||
|
||||
## How often does it update?
|
||||
|
||||
Often. Every change players can see is released automatically after it is merged, so new versions can come out several times a day. The launcher installs them for you, or only stable ones if you leave **Beta builds** off. See [Install](/docs/install#updating).
|
||||
|
||||
## How do I report a bug?
|
||||
|
||||
See [Logs, crashes and bug reports](/docs/troubleshooting).
|
||||
|
||||
## How can I help?
|
||||
|
||||
See [Contribute](/docs/contributing). You can also [sponsor the project on GitHub](https://github.com/sponsors/ludovic111).
|
||||
@@ -0,0 +1,162 @@
|
||||
# Host a server
|
||||
|
||||
`horizon-server` runs a Minecraft: Java Edition 26.3 server with Horizon's own game as the engine. It is one native program: no Java, one settings file, a web panel and backups. Vanilla 26.3 clients and Horizon clients can join it.
|
||||
|
||||
There are two ways to run one. The launcher's **Servers** page does everything with buttons and no commands. The command line is for a VPS or a headless machine. Both run the same program and keep the same folder.
|
||||
|
||||
> **Next launcher release.** The Servers page is finished but not in a launcher release yet; the launcher updates itself when it comes out. Until then, the command line below works today, and so does starting a server from the launcher's Play page.
|
||||
|
||||
## Before you start
|
||||
|
||||
- **You need your own copy of Minecraft 26.3**, like for playing: the server reads its game files from the ones you prepared. See [Install](/docs/install#what-you-need).
|
||||
- **Horizon players cannot join servers that check accounts yet.** That needs a Microsoft sign-in, which Horizon does not have. So a server for Horizon players runs in offline mode, which means anyone who can reach it can join under any name. Keep it on your network or a VPN such as Tailscale, and use a whitelist ("Friends only" in the launcher). Vanilla players can join an offline server too.
|
||||
- **A server that checks accounts is fine for vanilla players.** It works as on a vanilla server, and Horizon players cannot join it yet.
|
||||
- Nothing of Mojang's is downloaded or shipped with the server.
|
||||
|
||||
## From the launcher: the Servers page
|
||||
|
||||
**Servers** is in the launcher's top navigation, between **Modpacks** and **Patch notes**. The **Play** page also has a **Host a server** button that leads there.
|
||||
|
||||
### Create a server
|
||||
|
||||
Choose **Create a server**. To use a server folder you already have, choose **Add a server folder…** instead. The dialog asks for:
|
||||
|
||||
- **Name**.
|
||||
- **World:** **New world** (with an optional seed) or **Copy one of my worlds**.
|
||||
- **Game mode:** **Survival**, **Creative** or **Adventure**.
|
||||
- **Difficulty:** **Peaceful**, **Easy**, **Normal** or **Hard**.
|
||||
- **Most players at once:** use **–** and **+**.
|
||||
- **Who can join:** **Friends only** or **Anyone with the address**. With Friends only, type your friends' names; the first one becomes an operator.
|
||||
- **Check Minecraft accounts**, off by default. Leave it off for Horizon players. Turn it on only if every player signs in with Microsoft.
|
||||
- **I agree to the Minecraft EULA**, with a **Read it** link. You must tick it.
|
||||
|
||||
Everything has a default, so ticking the EULA and choosing **Create** makes a friends-only survival world. You can change all of it later.
|
||||
|
||||

|
||||
|
||||
### Start it and watch it
|
||||
|
||||
Open the server with **Open** on its row. At the top, a line says whether it is Stopped, Starting, Running, Restarting, Stopping or Updating, with how long it has been up. Then:
|
||||
|
||||
- **Start** and **Stop**, and **Restart**.
|
||||
- **Open the web panel** and **Open the folder**.
|
||||
- Four tiles: **Players online**, **TPS** (20 is full speed), **MSPT** (how long a tick takes) and **RAM**.
|
||||
- Four tabs: **Overview**, **Players**, **Settings** and **Backups**.
|
||||
|
||||
The **Overview** tab has the server's console, with a command line: type a command and press Enter. If the game crashes, the launcher restarts it by itself and says so ("The game crashed N times and was restarted by itself").
|
||||
|
||||

|
||||
|
||||
### Let your friends join
|
||||
|
||||
The Overview tab shows **Address on this network** with a **Copy** button. Friends on the same Wi-Fi choose Multiplayer, **Add server** and paste it.
|
||||
|
||||
For friends elsewhere, the page offers **Friends over the internet** through [Tailscale](https://tailscale.com), which is free, needs nothing changed on your router and reaches only the people you invite. Depending on what it finds, it shows:
|
||||
|
||||
- **Install Tailscale** if it is not installed, **Open Tailscale** if it is not running, or **Sign in to Tailscale** if you are signed out. Each has **Check again**.
|
||||
- Once it runs, the server's Tailscale name with **Copy**. Friends type it in Multiplayer, once they have accepted your invitation.
|
||||
- **Invite a friend:** open Tailscale's admin console, or **Use an access token…** so the launcher can make the invitation itself. Type their email (optional), choose **Make an invitation** and send them the link. The list shows **Withdraw** for an invitation not accepted yet and **Stop sharing** for one that was.
|
||||
- **Limit them to Minecraft** changes your Tailscale access controls so invited friends reach the server and nothing else on your computer. **Remove the limit** undoes it.
|
||||
|
||||
Horizon never turns on Tailscale Funnel: the server is not put on the public internet. The other way is to forward TCP port 25565 on your router to the computer.
|
||||
|
||||

|
||||
|
||||
### Players
|
||||
|
||||
The **Players** tab lists who is **Online now**, with **Make operator** (or **Remove operator**), **Kick** and **Ban**. Under **Who may join**, the **Friends only** switch turns the whitelist on. Type a player's name and choose **Let in** to add them.
|
||||
|
||||
### Settings
|
||||
|
||||
The **Settings** tab has the message in the server list, game mode, difficulty, PvP, most players at once, view distance, simulation distance, port, **Check Minecraft accounts** and **Run in the background and at login**. Each says whether it applies at once or after a restart, and the page then offers **Restart now**. A value the server would refuse shows in red under its field.
|
||||
|
||||
When something is wrong the launcher says so in plain words. If it can fix it, there is a button: **Use port 25566** when the port is busy, **Prepare the game files** when they are missing.
|
||||
|
||||
### Backups and updates
|
||||
|
||||
The **Backups** tab has **Back up now**, and **Back up automatically** (every 6 hours, keeping the last 12; backups you make by hand are never deleted). **Restore** next to a backup asks you to confirm with **Replace the world**, and keeps the world it replaces.
|
||||
|
||||
Under **This server's Horizon**, **Check for updates** and **Update now** move the server to the newest release. The world is backed up first, and the server goes back to the old release by itself if the new one does not start.
|
||||
|
||||

|
||||
|
||||
## From the command line
|
||||
|
||||
This works today, on a VPS or any computer. Everything below is the same program the launcher runs.
|
||||
|
||||
### 1. Install
|
||||
|
||||
On Linux (x86-64) and macOS (Apple Silicon):
|
||||
|
||||
```sh
|
||||
curl -fsSL https://raw.githubusercontent.com/ludovic111/horizon/main/packaging/server/install.sh | sh
|
||||
```
|
||||
|
||||
On Windows (x64), in PowerShell:
|
||||
|
||||
```powershell
|
||||
irm https://raw.githubusercontent.com/ludovic111/horizon/main/packaging/server/install.ps1 | iex
|
||||
```
|
||||
|
||||
The script downloads the latest release from GitHub, checks it against the SHA-256 GitHub publishes, and never asks for sudo or administrator rights. It puts `horizon-server` and `horizon-prepare` in `~/.local/bin` (on Windows, in your PATH). Other systems, such as Linux on ARM, build from source.
|
||||
|
||||
### 2. Prepare the game files
|
||||
|
||||
You need Minecraft 26.3 played once, Java 25 (a JDK) and the 26.3 `server.jar`, which is the `downloads.server.url` in your launcher's `versions/26.3/26.3.json`. Then:
|
||||
|
||||
```sh
|
||||
horizon-prepare --prepare --server-jar /path/to/server.jar
|
||||
```
|
||||
|
||||
**On a machine with no Minecraft**, prepare on your own computer (with the launcher or `horizon-prepare`) and copy the prepared `26.3` folder to the server, into `~/.local/share/horizon/game-files/horizon-client/26.3`.
|
||||
|
||||
### 3. First run
|
||||
|
||||
```sh
|
||||
mkdir my-server && cd my-server
|
||||
horizon-server init
|
||||
horizon-server start
|
||||
horizon-server status
|
||||
```
|
||||
|
||||
`init` asks whether you accept the [Minecraft EULA](https://aka.ms/MinecraftEULA), the world's name and seed, the port, whether to use a whitelist and who to add, and whether to make the first player an operator. It writes `server.toml`. Every question has a flag, so it also runs from a script.
|
||||
|
||||
Players join at your computer's address and the port, 25565 by default. `horizon-server run` runs in the foreground with the console on your terminal instead.
|
||||
|
||||
### 4. The everyday commands
|
||||
|
||||
```text
|
||||
horizon-server run in the foreground, with the console
|
||||
horizon-server start | stop | restart in the background
|
||||
horizon-server status up or not, TPS, MSPT, players, RAM
|
||||
horizon-server cmd COMMAND... one console command, and its answer
|
||||
horizon-server logs [-f] [-n N] the log; -f follows it
|
||||
horizon-server op NAME | deop NAME
|
||||
horizon-server whitelist add|remove NAME
|
||||
horizon-server backup | backups | restore BACKUP
|
||||
horizon-server panel a one-time login link for the web panel
|
||||
horizon-server service install start it with the computer
|
||||
horizon-server update [--check] install the newest release and restart on it
|
||||
horizon-server rollback back to the release before
|
||||
```
|
||||
|
||||
Settings are in `server.toml`: the message of the day, port, most players, online mode, whitelist, view distance, game mode, difficulty, backups and the panel. Changes apply at the next restart. A vanilla server folder works as it is: run `horizon-server init` in it, and the world, `ops.json` and the whitelist keep vanilla's names and formats.
|
||||
|
||||
The server restarts the game by itself if it crashes. **Updates** never happen on their own: it tells you a new release is out, and `horizon-server update` backs up the world, switches, and goes back by itself if the new game does not start.
|
||||
|
||||
### The web panel
|
||||
|
||||
`horizon-server panel` prints a login link that works once, for ten minutes. The panel shows live TPS, MSPT, RAM and CPU for the last ten minutes, the players (with a kick button), the console, the backups, and Restart and Stop. It listens on this computer only. To reach it from elsewhere, put your Tailscale address in `[panel] bind`, or forward the port over SSH. Never put it on the open internet.
|
||||
|
||||
### What does not work yet
|
||||
|
||||
- Horizon players cannot join a server that checks accounts (see above).
|
||||
- No Docker image is published. You can build one from the repository.
|
||||
- Settings in `server.toml` apply at the next restart, not live.
|
||||
- `console` (attach to a server running in the background) and `ban` and `pardon` as their own commands are coming. In the meantime, `horizon-server cmd ban NAME` works.
|
||||
|
||||
The full reference, with every option, is [docs/hosting.md](https://github.com/ludovic111/horizon/blob/main/docs/hosting.md) in the repository, and [docs/server.md](https://github.com/ludovic111/horizon/blob/main/docs/server.md) explains the design.
|
||||
|
||||
## How fast is it
|
||||
|
||||
On the latest bot benchmark, with up to 50 players, Horizon used 3.8 to 4.8 times less memory than vanilla, Paper and Fabric with Lithium, started in about 8 seconds against 15 to 22, and used the least CPU from 10 players up. Its average tick was longer than Paper's at low player counts. See [Performance](/docs/performance#servers) for the numbers and what they mean.
|
||||
@@ -0,0 +1,33 @@
|
||||
# What Horizon is
|
||||
|
||||
Horizon is Minecraft: Java Edition 26.3 rewritten in Rust. You install it with a small launcher, and it runs on the game files from your own copy of Minecraft. It is free, open source and unofficial.
|
||||
|
||||
## In one minute
|
||||
|
||||
- **A new game program, not a mod.** Horizon is written from scratch in Rust. It reads the same worlds, plays by the same rules and generates the same terrain as the Java game.
|
||||
- **Checked against vanilla.** {{HARNESSES}} automated tests ("harnesses") feed the same inputs to Horizon and to the real game, then compare the results. Today every subsystem matches in every harness that compares it. That is {{PERCENT}} of what the harnesses compare, which is not proof that nothing else differs. The [status table](/#parity) lists what is covered.
|
||||
- **Light and fast.** It starts quickly, uses little memory and draws efficiently. See [Performance](/docs/performance) for what is measured and what is not.
|
||||
- **A few things vanilla doesn't have.** Its own menus (vanilla's are one setting away), graphics presets, distant terrain, controller support, optional extras such as zoom and a minimap, and a server you can run without Java.
|
||||
|
||||
## What Horizon is not
|
||||
|
||||
- **Not Minecraft itself.** Horizon contains no Minecraft code, assets or data, and it never downloads them. You need your own legally obtained copy of Minecraft: Java Edition 26.3. Horizon builds its game files from that copy, on your computer.
|
||||
- **Not a place where Java mods run.** Forge, NeoForge, Fabric and Quilt mod jars do **not** work in Horizon, and neither do Mixins. Horizon has its own mod system, and the launcher can port some Java mods' content. See [Mods and data packs](/docs/mods) and [Modpacks](/docs/modpacks).
|
||||
- **Not for other versions.** Horizon plays Java Edition 26.3. Worlds from older versions (1.8 to 26.2) are upgraded the way vanilla upgrades them.
|
||||
- **Not an official Minecraft product.** It is not approved by or associated with Mojang or Microsoft.
|
||||
- **Not able to sign in to a Microsoft account yet.** Until it can, Horizon cannot join servers that check accounts. See [Multiplayer](/docs/multiplayer).
|
||||
|
||||
## Supported systems
|
||||
|
||||
- **Linux, x86-64.** A graphics card with Vulkan drivers. Builds are made on Ubuntu 22.04, so use a distribution at least that recent.
|
||||
- **macOS, Apple Silicon.** Any M1 or newer, on macOS 11 or later.
|
||||
- **Windows, x64.** Vulkan or DirectX 12. Horizon picks DirectX 12 by itself when Vulkan does not work.
|
||||
|
||||
There is no build for Intel Macs, 32-bit systems, or ARM Linux and Windows. The server can be built from source on other systems.
|
||||
|
||||
## Where to go next
|
||||
|
||||
- **Playing:** [install and first launch](/docs/install), [settings worth knowing](/docs/settings), [multiplayer](/docs/multiplayer) and [what to do when something breaks](/docs/troubleshooting).
|
||||
- **Hosting:** [host a server](/docs/hosting), from the launcher or the command line.
|
||||
- **Going further:** [modpacks](/docs/modpacks), [mods and data packs](/docs/mods) and [performance](/docs/performance).
|
||||
- **Helping out:** [contribute](/docs/contributing) and the [FAQ](/docs/faq).
|
||||
@@ -0,0 +1,50 @@
|
||||
# Install and first launch
|
||||
|
||||
Download the launcher, let it install Horizon, then prepare the game from your own copy of Minecraft. It takes a few minutes, and you do the preparation once.
|
||||
|
||||
## What you need
|
||||
|
||||
- **Minecraft: Java Edition 26.3, played once.** Install it with the official Minecraft launcher (or Prism Launcher, MultiMC, the Modrinth App, ATLauncher or GDLauncher) and start 26.3 once, so it downloads its files. Horizon reads them from there and never copies them anywhere else.
|
||||
- **Java 25, a JDK.** For example [Eclipse Temurin 25](https://adoptium.net/temurin/releases/?version=25). Only the one-time preparation uses it. The game itself needs no Java.
|
||||
- **A computer on the [supported list](/docs/#supported-systems).** On Linux and Windows that means a graphics card with Vulkan (or DirectX 12 on Windows).
|
||||
|
||||
## Download the launcher
|
||||
|
||||
Get the newest launcher from the [Download button on the home page](/), which picks the right file for your system, or from [the launcher releases on GitHub](https://github.com/ludovic111/horizon/releases?q=launcher-v&expanded=true).
|
||||
|
||||
- **Linux:** download `horizon-launcher-linux-x86_64.tar.gz`, extract it and run `horizon-launcher`.
|
||||
- **macOS:** download `horizon-launcher-macos-arm64.dmg`, open it and drag Horizon onto Applications. The first time, macOS says it cannot check the app, because it is not signed with a paid Apple developer account. On macOS 14 and earlier, right-click Horizon, choose **Open**, then **Open** again. On macOS 15 and later, open it once, then go to **System Settings, Privacy & Security** and choose **Open Anyway**. After that it opens normally.
|
||||
- **Windows:** download `horizon-launcher-windows-x64.zip`, extract it and run `horizon-launcher.exe`.
|
||||
|
||||
Every release also carries `SHA256SUMS` and a signature, `SHA256SUMS.sig`, if you want to check your download. The launcher does not check that signature for you yet.
|
||||
|
||||
## First launch
|
||||
|
||||
1. Open the launcher. On the **Play** page, if it says "No version installed yet", choose **Choose a version**. On the **Versions** page, install the newest one. The launcher installs it in its own folder.
|
||||
2. Back on **Play**, the launcher says "Not prepared. Horizon needs the files of your own Minecraft 26.3." Choose **Prepare**. It finds your Minecraft folder by itself in the usual places. If it cannot, it lists where it looked, and **Choose…** next to the Minecraft folder lets you point it at yours.
|
||||
3. Wait a few minutes. When it says "Prepared for Minecraft 26.3", choose **Play**.
|
||||
|
||||
The game opens on Horizon's own title screen. Your worlds, options and logs live in the game folder, which is not inside a version's folder, so updating or removing a version never touches them:
|
||||
|
||||
- Linux: `~/.local/share/horizon`
|
||||
- macOS: `~/Library/Application Support/horizon`
|
||||
- Windows: `%APPDATA%\horizon`
|
||||
|
||||
> **No Microsoft sign-in yet.** The launcher's Settings page has an Accounts section, but signing in with a Microsoft account does not work for players today. It needs an app registration and an approval from Mojang that the project does not have yet. You do not need an account to play single player.
|
||||
|
||||
## Updating
|
||||
|
||||
- **Horizon.** The launcher looks for a new release when it starts and every four hours while it is open. With **Install new versions automatically** on (the default), it installs one and moves you to it if you were on the newest. New releases come out many times a day, and old versions stay installed until you remove them on the **Versions** page.
|
||||
- **The launcher.** It updates itself from its own releases, then shows **Restart** in its footer.
|
||||
|
||||
## Stable and beta builds
|
||||
|
||||
The launcher installs **stable** builds by default. In **Settings**, **Beta builds** installs new builds the moment they are released, before they have had time to settle. The **Versions** page shows each version's channel. Releases becoming stable by themselves, six hours after they come out, is coming; until then every release counts as stable.
|
||||
|
||||
## The Versions page
|
||||
|
||||
It lists Horizon's releases, newest first. You can install a version, remove it, or choose which one **Play** starts. Each release's notes are on the **Patch notes** page, and on [GitHub](https://github.com/ludovic111/horizon/releases).
|
||||
|
||||
## Something went wrong
|
||||
|
||||
See [Logs, crashes and bug reports](/docs/troubleshooting).
|
||||
@@ -0,0 +1,48 @@
|
||||
# Modpacks
|
||||
|
||||
Java mod jars do not run in Horizon. Instead, the launcher reads a modpack, tells you which of its mods Horizon can carry over, and brings over the ones it can. This page explains what that means today and where the limits are.
|
||||
|
||||
> **Early.** The Modpacks page works, but no large pack runs as a whole in Horizon yet. What carries over today is mods made of data and assets: blocks, items, recipes, loot tables, tags, models, textures and structures. Mods with Java code do not, yet.
|
||||
|
||||
## What the Modpacks page does
|
||||
|
||||
Open **Modpacks** in the launcher.
|
||||
|
||||
1. **Import a pack.** Choose **Import a pack file…** for a Modrinth `.mrpack` or a CurseForge zip, or **Import an instance folder…** for a Prism, MultiMC or CurseForge instance.
|
||||
2. **Read the coverage report.** For every mod in the pack it says **Ported**, **Partial**, **Not yet** or **Not needed**, with the reason. You can filter the list by status.
|
||||
3. **Port.** **Port N mods** gets the jars of the mods this computer can carry over today, and carries them over for the version you picked. It copies the jars from a folder you have, or downloads them from the pack's own links (or the same file from Modrinth's download network), and checks their hashes. Files that only CurseForge has need CurseForge's API key, so for those choose **Use jars from my instance…** and point it at your installed instance.
|
||||
4. **Play.** **Play with N mods** starts the game as the pack's own profile, with its own saves and options, and those mods on.
|
||||
|
||||
Nothing is uploaded or shared. The mod jars and what is made from them stay on your computer.
|
||||
|
||||
## What carries over, and what does not
|
||||
|
||||
**Carries over today:** content mods whose substance is data and assets. Blocks and items built on vanilla's shapes, recipes, loot tables, tags, models, textures and language files, and structures that are described in data, such as the structure mods that use jigsaw pools. Loot tables and structures from the mods you carry show up in your world.
|
||||
|
||||
**Not yet:**
|
||||
|
||||
- **Mods with Java code:** machines, magic, new mob behaviour, anything that needs the mod's own logic. Each of these must be ported by hand to Horizon's mod system (Rust compiled to WebAssembly), and checked against the original mod running in a Java test instance. That work is under way; none of it is something you can install yet.
|
||||
- **World generation written in code:** custom biomes, terrain shaping and structure types that are Java classes.
|
||||
- **Scripts** such as KubeJS, and recipe viewers and map mods that are built around Java.
|
||||
|
||||
**Not needed:** performance mods such as Sodium, Lithium or FerriteCore (Horizon is the replacement), and libraries whose job is to give mods a common API. The report says which is which.
|
||||
|
||||
So a pack is a list of mods, and today Horizon can bring over a part of that list. The coverage report is the honest answer for your pack.
|
||||
|
||||
## Example: All the Mods 10
|
||||
|
||||
All the Mods 10 has 495 jars. Horizon's report sorts them: about 290 add content, 80 are libraries, and the rest are integrations, interface mods, tools and performance mods. A few dozen of the content mods carry over today. The measured numbers are in [docs/modpacks.md](https://github.com/ludovic111/horizon/blob/main/docs/modpacks.md).
|
||||
|
||||
## From the command line
|
||||
|
||||
```text
|
||||
horizon-launcher modpack list
|
||||
horizon-launcher modpack import <pack>
|
||||
horizon-launcher modpack port <pack> [--from <dir>]
|
||||
horizon-launcher modpack play <pack>
|
||||
horizon-launcher modpack remove <pack>
|
||||
```
|
||||
|
||||
## Licences
|
||||
|
||||
Mods have their own licences, and Horizon respects them: it does not redistribute anyone's jars. The ports are made on your computer, from jars you downloaded, and stay there.
|
||||
@@ -0,0 +1,46 @@
|
||||
# Mods and data packs
|
||||
|
||||
Horizon has its own mod system, written for Horizon and not compatible with Java mods. Data packs work in part. This page says what you can do with each today.
|
||||
|
||||
## Mods
|
||||
|
||||
Horizon mods are written in Rust, compiled to WebAssembly and run in a sandbox. A mod can only do what it asks for and you allow, and a mod that crashes is switched off without taking the game down.
|
||||
|
||||
> **Early.** The mod system is new. There is no mod store yet, and a mod browser in the launcher is planned. Mods you find are files to put in a folder.
|
||||
|
||||
**Playing with mods**
|
||||
|
||||
1. Put the mod's `.hmod` file in the `horizon-mods` folder of the game folder (see [Install](/docs/install#first-launch) for where that is), or use the **Open Mod Folder** button on the Mods screen.
|
||||
2. Open **Options, Mods**. Each mod is listed with what it may do ("May see your position, health and the time, draw text on your screen…") and a switch. Mods start off. Turn on the ones you trust.
|
||||
3. A mod that failed to load shows why, in red, on its row.
|
||||
|
||||
**What a mod can do today**
|
||||
|
||||
- **Client mods** read the same things the F3 screen shows (your position, health, food, the time), draw text panels on the HUD, show chat lines only you see, and add chat commands. They work in single player and on any server, and a server cannot see them.
|
||||
- **Content mods** add blocks and items from data and assets: models, textures, recipes, loot tables and tags, with no code. They work in single player today. This is also what the launcher's [modpack](/docs/modpacks) carry-over produces.
|
||||
- **Server mods**, which run where the world is simulated, are planned.
|
||||
|
||||
**Making a mod**
|
||||
|
||||
```sh
|
||||
rustup target add wasm32-unknown-unknown
|
||||
cargo install --git https://github.com/ludovic111/horizon cargo-horizon-mod
|
||||
cargo horizon-mod new my-mod
|
||||
cd my-mod
|
||||
cargo horizon-mod run
|
||||
```
|
||||
|
||||
`run` builds the mod and starts the game with it. After an edit, `cargo horizon-mod build` rebuilds it and the running game reloads it. The full guide, with the API, the manifest and the roadmap, is [docs/mods.md](https://github.com/ludovic111/horizon/blob/main/docs/mods.md). What carries over from Java mods, and why jars cannot run, is in [the Java mod notes](https://github.com/ludovic111/horizon/blob/main/docs/research/java-mod-compat.md).
|
||||
|
||||
## Data packs
|
||||
|
||||
A world's data packs go in its `datapacks` folder, as folders or `.zip` files with a `pack.mcmeta`, as in vanilla.
|
||||
|
||||
**Works today (single player and open-to-LAN worlds):**
|
||||
|
||||
- **Functions** (`.mcfunction`, with macros and line continuation), **function tags** (such as `minecraft:load` and `minecraft:tick`), **predicates** and **item modifiers**.
|
||||
- The `/function`, `/datapack` and `/reload` commands, and the choice of which packs are on, kept with the world.
|
||||
|
||||
**Not applied from data packs yet:** custom recipes, loot tables, advancements and world generation. Horizon reads those from the vanilla data it prepared, and from content mods.
|
||||
|
||||
Vanilla's own data is always on, and it matches vanilla: every command runs as vanilla does, and recipes, loot and world generation are checked against the real game.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Multiplayer
|
||||
|
||||
You can play with friends from your own world, on your local network, or on a server. This page also says plainly what does not work yet: servers that check Minecraft accounts.
|
||||
|
||||
## Play with friends from your own world
|
||||
|
||||
This needs no server and no account.
|
||||
|
||||
1. In your world, open the pause menu and choose **Invite friends**. Horizon opens the world to your network and shows an **invite code**.
|
||||
2. Send the code to your friends.
|
||||
3. On their side, your friends choose **Join a friend** (on the game's Multiplayer page, or on the launcher's **Play** page), paste the code and choose **Join**.
|
||||
|
||||
There is no Horizon server in the middle. The code holds the host's addresses and a secret key, and the game between you is encrypted with it. A code works for as long as you keep sharing: closing the world or quitting ends it.
|
||||
|
||||
**Can your friends reach you?** The pause menu says what the game found:
|
||||
|
||||
- On the same network, or over a VPN such as Tailscale or ZeroTier, it just works.
|
||||
- Over the internet, it asks your router to open the port by itself (UPnP). If the router does not allow it, forward TCP port 25580 to your computer.
|
||||
- Some internet providers share one address between many homes (CGNAT), and no port can be opened. Use a VPN such as [Tailscale](https://tailscale.com) instead; the code already contains your VPN address.
|
||||
|
||||
Guests join with the name their game uses. There is no account check, so only share the code with people you trust.
|
||||
|
||||
## Open to LAN
|
||||
|
||||
As in vanilla, **Open to LAN** in the pause menu lets people on the same network join your world. They see it in their server list. A vanilla 26.3 client can join a Horizon LAN world, and Horizon can join a vanilla one. LAN worlds are in offline mode.
|
||||
|
||||
## Joining a server
|
||||
|
||||
The Multiplayer page works like vanilla's: **Add server** saves one, **Direct connect** takes an address, and your servers are listed with their message of the day and ping. Horizon joins vanilla 26.3 servers and Horizon's own.
|
||||
|
||||
**Online mode.** Most public servers run in online mode: they check that each player really owns Minecraft by asking Mojang. To pass that check, the game needs a Microsoft account sign-in, and Horizon cannot do that yet. It needs an app registration and an approval from Mojang that the project does not have. So today:
|
||||
|
||||
- **Horizon can join servers in offline mode only** (`online-mode=false`): your own, a friend's, or a server on your network or a VPN.
|
||||
- **It cannot join servers that check accounts.** That is most public servers, and Realms.
|
||||
- Skins served over https show the default skin unless they were already cached.
|
||||
|
||||
Anyone can join an offline server under any name, so run one only on your network or a VPN, or share it with people you trust. [Host a server](/docs/hosting) explains the details.
|
||||
|
||||
## Vanilla players on a Horizon server
|
||||
|
||||
A vanilla 26.3 client can join a Horizon server, and in online mode it signs in with its own account as on a vanilla server. Secure chat works for those players.
|
||||
@@ -0,0 +1,7 @@
|
||||
[
|
||||
{ "group": "Start here", "pages": ["index", "install"] },
|
||||
{ "group": "Playing", "pages": ["settings", "multiplayer", "troubleshooting"] },
|
||||
{ "group": "Hosting", "pages": ["hosting"] },
|
||||
{ "group": "Going further", "pages": ["modpacks", "mods", "performance"] },
|
||||
{ "group": "Project", "pages": ["contributing", "faq"] }
|
||||
]
|
||||
@@ -0,0 +1,50 @@
|
||||
# Performance
|
||||
|
||||
Horizon is built to run Minecraft with less work: less memory, no pauses from a Java runtime, and a renderer that keeps the graphics card busy. This page says what Horizon does differently, and what has been measured. Where nothing has been published yet, it says so.
|
||||
|
||||
## What Horizon does differently
|
||||
|
||||
- **Native code.** Horizon is Rust, compiled for your system. There is no Java virtual machine, so no garbage-collection pauses and no warm-up while the code gets compiled as you play.
|
||||
- **It ticks what vanilla ticks, and no more.** Mobs, minecarts and dropped items outside the simulation distance only check whether to despawn, as in vanilla. Before this was fixed, Horizon ticked seven times as many of them as vanilla at render distance 32.
|
||||
- **Work off the main thread.** Chunks are generated, lit and meshed on worker threads, and unloaded chunks are written to disk in the background.
|
||||
- **Fewer, bigger draw calls.** Terrain sections share one vertex arena and are drawn with one indirect multi-draw per pass. Mobs and block entities outside the view are skipped, and caves you cannot see into are culled.
|
||||
- **Distant terrain.** The optional [LOD distance](/docs/settings#distant-terrain-lod) draws terrain up to 1024 chunks away without simulating it.
|
||||
- **A server without Java.** `horizon-server` is one native program. See below.
|
||||
|
||||
## The client
|
||||
|
||||
The numbers below are Horizon before and after a round of performance work, on an RTX 4080, in a fresh creative world flown over a village, a forest, the ocean and a mountain (`tools/graphics_bench.py`). They compare Horizon with an earlier Horizon, not with vanilla.
|
||||
|
||||
- Render distance 8 over a village: **363 to 2,409 FPS**, and the slowest 1% of frames from 21.6 to 160.8 FPS.
|
||||
- Render distance 16 over a village: **8 to 1,041 FPS**. In a forest: 28 to 316 FPS.
|
||||
- Render distance 32 improved too (a village went from 4 to 48 FPS) but **still stutters in places**: the slow frames are game ticks while chunks load, not drawing.
|
||||
|
||||
The full tables, with the method and the Linux software-rendering run, are in [docs/graphics.md](https://github.com/ludovic111/horizon/blob/main/docs/graphics.md#results).
|
||||
|
||||
**Horizon against vanilla.** The benchmark exists: `tools/perf_bench.py` starts Horizon, vanilla 26.3 and vanilla with Sodium, Lithium, FerriteCore and ImmediatelyFast on the same machine, world, camera path and settings, and computes every number the same way. [docs/benchmark.md](https://github.com/ludovic111/horizon/blob/main/docs/benchmark.md) says how it keeps the comparison fair. **We have not published its results for the client yet**, so this site does not claim a number.
|
||||
|
||||
**Measure your own computer.** Horizon's half of that benchmark runs on its own:
|
||||
|
||||
```sh
|
||||
horizon-client --benchmark standard --render-distance 16
|
||||
```
|
||||
|
||||
It creates a world, flies the four scenes and writes a report to the `benchmarks` folder in the game folder. If you allow benchmark uploads in the launcher's data collection settings, you can share it. See [Privacy](/privacy).
|
||||
|
||||
## Servers
|
||||
|
||||
The latest bot benchmark compares `horizon-server` with vanilla 26.3, Paper and vanilla on Fabric with Lithium. It ran on a 4-thread laptop CPU (an i7-7500U), with 1 to 50 bots walking, exploring and standing around spawn, on another machine. All four servers did the same work. In short:
|
||||
|
||||
- **Memory:** 0.7 GB with one player and 1.1 GB with 50, against 3.4 to 4.5 GB for the Java servers (each with a 4 GB heap). That is 3.8 to 4.8 times less.
|
||||
- **Start:** ready in 8 to 9 seconds, against 15 for vanilla, 17 for Fabric and 19 to 22 for Paper.
|
||||
- **CPU:** from 10 players up, the least of the four.
|
||||
- **Average tick:** Paper's was shorter at every player count, and Fabric with Lithium's at 1 and 10 players. Horizon's was shorter than vanilla's, and than Fabric's from 25 players up.
|
||||
- **Slow ticks:** from 10 players up, Horizon's slowest ticks were the shortest of the four.
|
||||
- **50 players:** Horizon and Paper kept 20 TPS. Fabric with Lithium dropped to 17, and vanilla's watchdog stopped it.
|
||||
|
||||
For more than 50 active players, give it more cores. The full report is [benchmarks/server-four-way-2026-10-19](https://github.com/ludovic111/horizon/blob/main/benchmarks/server-four-way-2026-10-19/README.md).
|
||||
|
||||
## Where else to look
|
||||
|
||||
- [Benchmark report format](https://github.com/ludovic111/horizon/blob/main/docs/benchmark-report.md): what every benchmark writes.
|
||||
- `HORIZON_SPIKES=MS` prints what made every frame slower than that many milliseconds slow; it is described in [docs/graphics.md](https://github.com/ludovic111/horizon/blob/main/docs/graphics.md#benchmark).
|
||||
@@ -0,0 +1,72 @@
|
||||
# Settings worth knowing
|
||||
|
||||
Horizon plays like vanilla out of the box. This page covers the settings that are different or new: graphics, distant terrain, shader packs, resource packs, controllers and a few optional extras.
|
||||
|
||||
All of them are in the game's **Options** screen. Horizon's own menus group them in sections: Video, Audio, Controls, Accessibility, Language, Chat, Interface, Extras and Mods.
|
||||
|
||||
## Menu style
|
||||
|
||||
Horizon draws its own menus: the title screen, the world list, the options and the pause menu, over a live view of the world. If you prefer vanilla's screens, go to **Options, Interface, Menu style** and choose **Classic**. Classic has no way back inside the game, so to return to Horizon's menus use the launcher's **Settings** page, which has the same switch.
|
||||
|
||||

|
||||
|
||||
## Graphics: presets, Simple and Advanced
|
||||
|
||||
**Options, Video** has a **Simple / Advanced** switch at the top, and the game remembers your choice.
|
||||
|
||||
- **Simple** has a preset (Performance, Balanced, Quality, Ultra or Custom), render distance, LOD distance, field of view, maximum frame rate, VSync and GUI scale.
|
||||
- **Advanced** has every setting, in groups: Rendering, Quality, Display, Preferences, Performance and Overlay.
|
||||
|
||||
Every row has a one-line description and its cost in frame time: none, low, medium or high. Changes apply at once, except worker threads, which apply at the next start. A preset sets the quality settings together, and changing one of them turns the preset into **Custom**.
|
||||
|
||||
Two settings are worth knowing on laptops and handhelds. **Battery mode** (Performance group, off by default) caps the frame rate at 60 in a world and 30 in menus, and uses half the automatic worker threads. The **performance overlay** (Overlay group) shows the frame rate, frame times and a graph over the game.
|
||||
|
||||
Not available: anisotropic filtering, MSAA (FXAA is there instead) and exclusive fullscreen (fullscreen is borderless).
|
||||
|
||||
## Distant terrain (LOD)
|
||||
|
||||
**LOD Distance** draws far-away terrain as simplified columns, so you can see much farther than the render distance. It is **off by default**. Turn it on in the Video settings and choose 64, 128, 256, 512 or 1024 chunks.
|
||||
|
||||
- Keep the normal render distance modest next to it. For example 12 chunks with a LOD distance of 256. **Full Detail Distance** sets the nearby range.
|
||||
- LOD does not raise the simulation distance: far terrain is only drawn, not simulated.
|
||||
- Detail arrives gradually. A big radius does not mean everything is drawn right away.
|
||||
- Far terrain is made from the world's seed, so places you have not visited are drawn too, close to what they will be. Small features, fluid edges and lighting can differ from the real chunks.
|
||||
- Horizon caps far terrain on integrated graphics and holds it back on computers with four threads.
|
||||
|
||||
## Graphics API on Windows
|
||||
|
||||
Linux always uses Vulkan and macOS always uses Metal. On Windows there is a choice, in **Options, Video, Advanced, Performance, Graphics API**:
|
||||
|
||||
- **Auto** (the default) uses Vulkan, and DirectX 12 when Vulkan has no graphics card or driver that works.
|
||||
- **Vulkan** and **DirectX 12** force one of the two.
|
||||
|
||||
The change applies at the next start. If Vulkan gives you trouble, try DirectX 12.
|
||||
|
||||
## Shader packs
|
||||
|
||||
Shader packs are **experimental**. Put a pack's folder in the `shaderpacks` folder of the game folder (see [Install](/docs/install#first-launch) for where that is), then choose it in **Options, Video, Shader Packs**. With no pack selected the game draws exactly what vanilla draws. A pack that fails to load shows why in red and leaves the normal picture on.
|
||||
|
||||
Horizon can run the full-screen effects of Java shader packs (OptiFine and Iris packs: colour grading, bloom, sky and fog effects). It does not run their geometry and shadow passes yet, so packs do not look as they do in Iris. Horizon's own shader format, in WGSL with hot reload, is planned. The details are in the [shader pack notes](https://github.com/ludovic111/horizon/blob/main/docs/shader-packs.md).
|
||||
|
||||
## Resource packs
|
||||
|
||||
Java Edition resource packs work. Put the folder or `.zip` in the `resourcepacks` folder of the game folder and pick it on the **Resource Packs** screen, which is vanilla's screen. The game reloads every loader from the pack, as vanilla does.
|
||||
|
||||
[Resource packs: what works](https://github.com/ludovic111/horizon/blob/main/docs/resource-packs.md) lists everything a 26.3 resource pack can change and whether Horizon honours it.
|
||||
|
||||
## Controllers
|
||||
|
||||
Horizon plays with PlayStation (DualShock 4 and DualSense), Xbox (360, One and Series) and Nintendo Switch Pro controllers, and with the Steam Deck's built-in controls. Vanilla has no controller support at all, so this is Horizon's own. With no controller connected, nothing changes.
|
||||
|
||||
- Settings are in **Options, Controls, Controller**: on or off, vibration, look sensitivity, inverting the axes, deadzones, button glyphs and remapping.
|
||||
- Menus, the inventory and chat work with a controller, with an on-screen keyboard for text.
|
||||
- On a DualSense you can also set adaptive triggers and the lightbar.
|
||||
- On the Steam Deck, Steam's default layout works with no setup.
|
||||
|
||||
## Extras
|
||||
|
||||
**Options, Extras** holds small, optional conveniences. Every one is off by default, so a fresh install behaves like vanilla: fullbright, zoom, a minimap, an FPS counter, a keystroke display, auto-reconnect, Mouse Tweaks-style inventory controls and inventory sorting.
|
||||
|
||||
## Where your settings are stored
|
||||
|
||||
In the game folder, next to `options.txt`. That file keeps vanilla's own keys and values, so a vanilla client can share the folder. Horizon's own settings are in `horizon-graphics.txt`, `horizon-controller.txt` and a few more beside it.
|
||||
@@ -0,0 +1,55 @@
|
||||
# Logs, crashes and bug reports
|
||||
|
||||
When something breaks, Horizon writes down what happened. Send us that and the bug is much easier to fix. This page says where it is and how to report it.
|
||||
|
||||
## If the game crashes
|
||||
|
||||
The launcher notices. It shows what went wrong, in one line, with buttons:
|
||||
|
||||
- **Open report** opens the crash report.
|
||||
- **Copy report** copies it, so you can paste it where you report the bug.
|
||||
- **Open logs folder** opens the folder with the logs and crash reports.
|
||||
- **Report on Discord** takes you to our Discord server.
|
||||
|
||||
## Where the files are
|
||||
|
||||
Everything is in the game folder, which is the same for every version you install:
|
||||
|
||||
- Linux: `~/.local/share/horizon`
|
||||
- macOS: `~/Library/Application Support/horizon`
|
||||
- Windows: `%APPDATA%\horizon`
|
||||
|
||||
Inside it:
|
||||
|
||||
- `logs/latest.log` is the log of the current or last run. Older runs are kept as `logs/<date>-<number>.log.gz`.
|
||||
- `crash-reports/crash-<date>_<time>-client.txt` is written when the game crashes. It holds the error, where it happened, your computer, your graphics card, your render settings, your resource packs and the last 50 lines of the log.
|
||||
|
||||
The launcher's **Settings** page has a **Logs** row with an **Open** button. On the command line, `horizon-launcher logs --crash` prints the newest crash report and `horizon-launcher logs --lines 200` the end of the log.
|
||||
|
||||
## What to try first
|
||||
|
||||
- **The game does not start, or crashes straight away.** Update the launcher and Horizon, and your graphics drivers. On Windows, try **Graphics API: DirectX 12** (see [Settings](/docs/settings#graphics-api-on-windows)).
|
||||
- **"Not prepared" or "Minecraft 26.3 was not found".** Play 26.3 once in the official Minecraft launcher, or point the launcher at your Minecraft folder (**Choose…** next to Minecraft folder on the Play page), then choose **Prepare** again.
|
||||
- **Preparation says Java 25 is needed.** Install a Java 25 JDK, for example Eclipse Temurin 25.
|
||||
- **Slow or stuttering.** Lower the render distance, turn LOD off, or pick the **Performance** preset. The performance overlay (Video, Advanced, Overlay) shows what is slow.
|
||||
- **A resource or shader pack broke something.** Switch it off, or take it out of its folder.
|
||||
|
||||
## Reporting a bug
|
||||
|
||||
Good places, in this order:
|
||||
|
||||
1. **GitHub issues:** [github.com/ludovic111/horizon/issues](https://github.com/ludovic111/horizon/issues). Search first; someone may have reported it already.
|
||||
2. **Discord:** the bugs channel on [our Discord server](https://discord.gg/HcTeMZxe5E), if you would rather talk it through.
|
||||
|
||||
Include:
|
||||
|
||||
- what you did and what you expected;
|
||||
- your Horizon version (shown on the launcher's Play page) and the launcher's version;
|
||||
- your system and graphics card;
|
||||
- the crash report, or the end of `latest.log`, if there is one. Read it first: logs can hold your player name and server addresses, and lines of chat.
|
||||
|
||||
A Horizon bug is any place where it differs from vanilla 26.3, so "vanilla does X and Horizon does Y" is the best report there is.
|
||||
|
||||
## Data the launcher can send
|
||||
|
||||
The launcher can send performance statistics, crash reports, bug reports and benchmarks, but only the kinds you allow, and everything is off until you say yes. See [Privacy](/privacy) for what is sent, how long it is kept and how to delete it.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 35 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url><loc>https://playhorizon.dev/</loc></url>
|
||||
<url><loc>https://playhorizon.dev/server</loc></url>
|
||||
<url><loc>https://playhorizon.dev/privacy</loc></url>
|
||||
</urlset>
|
||||
+8
-2
@@ -6,13 +6,19 @@ import { join, extname, normalize } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const root = join(fileURLToPath(new URL(".", import.meta.url)), "dist");
|
||||
const types = { ".html": "text/html; charset=utf-8", ".css": "text/css", ".js": "text/javascript", ".webp": "image/webp", ".png": "image/png", ".svg": "image/svg+xml", ".woff2": "font/woff2", ".txt": "text/plain; charset=utf-8", ".md": "text/plain; charset=utf-8", ".json": "application/json" };
|
||||
const types = { ".html": "text/html; charset=utf-8", ".css": "text/css", ".js": "text/javascript", ".webp": "image/webp", ".png": "image/png", ".svg": "image/svg+xml", ".woff2": "font/woff2", ".txt": "text/plain; charset=utf-8", ".md": "text/plain; charset=utf-8", ".json": "application/json", ".xml": "application/xml" };
|
||||
const port = Number(process.env.PORT) || 4173;
|
||||
|
||||
createServer(async (req, res) => {
|
||||
let path = normalize(decodeURIComponent(new URL(req.url, "http://x").pathname)).replace(/^(\.\.[/\\])+/, "");
|
||||
if (path.endsWith("/")) path += "index.html";
|
||||
// /privacy is privacy.html, as the Caddyfile rewrites it.
|
||||
// The server guide is part of the docs now, as the Caddyfile redirects it.
|
||||
if (path === "/server" || path === "/server.html") {
|
||||
res.writeHead(301, { Location: "/docs/hosting" });
|
||||
return res.end();
|
||||
}
|
||||
if (path === "/docs") path = "/docs/index.html";
|
||||
// /privacy and /docs/<page> are .html files, as the Caddyfile rewrites them.
|
||||
if (!extname(path)) path += ".html";
|
||||
let file = join(root, path);
|
||||
let status = 200;
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{DOC_TITLE}} · Horizon docs</title>
|
||||
<meta name="description" content="{{DOC_DESC}}">
|
||||
<meta name="theme-color" content="#fafafc" media="(prefers-color-scheme: light)">
|
||||
<meta name="theme-color" content="#0d0e13" media="(prefers-color-scheme: dark)">
|
||||
<meta name="color-scheme" content="light dark">
|
||||
<link rel="canonical" href="https://playhorizon.dev{{DOC_PATH}}">
|
||||
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
|
||||
<link rel="icon" href="/favicon-32.png" sizes="32x32" type="image/png">
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
|
||||
<meta property="og:type" content="article">
|
||||
<meta property="og:site_name" content="Horizon">
|
||||
<meta property="og:title" content="{{DOC_TITLE}} · Horizon docs">
|
||||
<meta property="og:description" content="{{DOC_DESC}}">
|
||||
<meta property="og:url" content="https://playhorizon.dev{{DOC_PATH}}">
|
||||
<meta property="og:image" content="https://playhorizon.dev/og.png">
|
||||
<link rel="stylesheet" href="{{CSS}}">
|
||||
<script>try { const t = localStorage.getItem("theme"); if (t === "light" || t === "dark") document.documentElement.dataset.theme = t } catch {}</script>
|
||||
</head>
|
||||
<body class="docs-page">
|
||||
<a class="skip" href="#main">Skip to the content</a>
|
||||
<header class="docs-bar">
|
||||
<div class="docs-bar-inner">
|
||||
<a class="nav-mark" href="/" aria-label="Horizon, home"><svg class="mark" viewBox="0 0 16 16" aria-hidden="true"><path class="mark-stem" d="M4 3h2v4H4zM10 3h2v4h-2z"/><path class="mark-low" d="M4 8h2v4H4zM10 8h2v4h-2z"/><path class="mark-line" d="M1 7h14v1H1z"/></svg>Horizon</a>
|
||||
<a class="docs-bar-title" href="/docs/">Docs</a>
|
||||
<span class="docs-bar-end">
|
||||
<a class="docs-bar-link" href="https://github.com/ludovic111/horizon">GitHub</a>
|
||||
<a class="button primary small" href="/docs/install">Download</a>
|
||||
</span>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="docs">
|
||||
<details class="docs-nav-wrap" open>
|
||||
<summary>Docs menu</summary>
|
||||
<nav class="docs-nav" aria-label="Documentation">
|
||||
{{DOC_NAV}}
|
||||
</nav>
|
||||
</details>
|
||||
<script>if (matchMedia("(max-width: 900px)").matches) document.querySelector(".docs-nav-wrap").removeAttribute("open")</script>
|
||||
|
||||
<main id="main" class="docs-main">
|
||||
<p class="kicker"><span>{{DOC_GROUP}}</span></p>
|
||||
<h1 class="title">{{DOC_TITLE}}</h1>
|
||||
<p class="lede">{{DOC_LEDE}}</p>
|
||||
{{DOC_TOC}}
|
||||
<div class="prose docs-prose">
|
||||
{{DOC_BODY}}
|
||||
</div>
|
||||
<nav class="docs-pager" aria-label="Next and previous pages">
|
||||
{{DOC_PAGER}}
|
||||
</nav>
|
||||
<p class="docs-edit"><a href="https://github.com/ludovic111/horizon/blob/main/website/docs/{{DOC_FILE}}">Edit this page on GitHub</a> · Spotted something wrong? <a href="https://github.com/ludovic111/horizon/issues">Open an issue</a> or ask on <a href="{{DISCORD}}">Discord</a>.</p>
|
||||
<p class="disclaimer">Not an official Minecraft product. Not approved by or associated with Mojang or Microsoft.</p>
|
||||
</main>
|
||||
</div>
|
||||
<p class="footer-word" aria-hidden="true">horizon</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -45,7 +45,7 @@
|
||||
<a href="#patch-notes">Notes</a>
|
||||
<a href="#community">Community</a>
|
||||
<a href="#contributors" data-contributors{{CONTRIBUTORS_HIDDEN}}>Contributors</a>
|
||||
<a href="/server">Server</a>
|
||||
<a href="/docs/">Docs</a>
|
||||
</nav>
|
||||
<div class="nav-end">
|
||||
<button class="theme-toggle" type="button" aria-label="Switch between light and dark"><span data-theme-label>Dark</span></button>
|
||||
@@ -65,7 +65,7 @@
|
||||
<a href="#patch-notes">Patch notes</a>
|
||||
<a href="#community">Community</a>
|
||||
<a href="#contributors" data-contributors{{CONTRIBUTORS_HIDDEN}}>Contributors</a>
|
||||
<a href="/server">Host a server</a>
|
||||
<a href="/docs/">Documentation</a>
|
||||
</nav>
|
||||
<div class="menu-foot">
|
||||
<a class="button secondary large" href="https://github.com/ludovic111/horizon">GitHub</a>
|
||||
@@ -235,7 +235,7 @@
|
||||
</div>
|
||||
<div class="footer-bar">
|
||||
<span class="footer-mark">Made in the open, in Rust.</span>
|
||||
<nav class="footer-links" aria-label="Elsewhere"><a href="https://github.com/ludovic111/horizon">GitHub</a><a href="https://github.com/ludovic111/horizon/releases">Releases</a><a href="https://github.com/ludovic111/horizon/blob/main/LICENSE">Licence</a><a href="/server">Host a server</a><a href="/LEGAL.md">Assets</a><a href="/privacy">Privacy</a></nav>
|
||||
<nav class="footer-links" aria-label="Elsewhere"><a href="https://github.com/ludovic111/horizon">GitHub</a><a href="https://github.com/ludovic111/horizon/releases">Releases</a><a href="https://github.com/ludovic111/horizon/blob/main/LICENSE">Licence</a><a href="/docs/">Docs</a><a href="/docs/hosting">Host a server</a><a href="/LEGAL.md">Assets</a><a href="/privacy">Privacy</a></nav>
|
||||
</div>
|
||||
</div>
|
||||
<p class="footer-word" aria-hidden="true">horizon</p>
|
||||
|
||||
+38
-14
@@ -9,15 +9,17 @@ export function escape(text) {
|
||||
return text.replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[c]);
|
||||
}
|
||||
|
||||
function href(url) {
|
||||
function href(url, site) {
|
||||
url = url.trim();
|
||||
if (/^(https?:|mailto:)/i.test(url)) return url;
|
||||
if (url.startsWith("#")) return null; // README anchors have no target here
|
||||
// The docs pages (`site`) link each other and their own headings; the README's anchors have no target here.
|
||||
if (site && (/^\/(?!\/)/.test(url) || url.startsWith("#"))) return url;
|
||||
if (url.startsWith("#")) return null;
|
||||
if (/^[a-z]+:/i.test(url)) return null; // javascript: and the like
|
||||
return REPO_BLOB + url.replace(/^\.?\//, "");
|
||||
}
|
||||
|
||||
export function inline(text) {
|
||||
export function inline(text, site = false) {
|
||||
const codes = [];
|
||||
let out = text.replace(/`([^`]+)`/g, (_, code) => {
|
||||
codes.push(code);
|
||||
@@ -35,8 +37,8 @@ export function inline(text) {
|
||||
.replace(/<(https?:\/\/[^\s&]+)>/g, (_, u) => `<a href="${u}">${u}</a>`);
|
||||
out = out.replace(/\u0001(\d+)\u0001/g, (_, i) => {
|
||||
const [label, url] = links[i];
|
||||
const target = href(url);
|
||||
const body = inline(label);
|
||||
const target = href(url, site);
|
||||
const body = inline(label, site);
|
||||
return target ? `<a href="${escape(target)}">${body}</a>` : body;
|
||||
});
|
||||
return out.replace(/\u0000(\d+)\u0000/g, (_, i) => `<code>${escape(codes[i])}</code>`);
|
||||
@@ -45,7 +47,7 @@ export function inline(text) {
|
||||
const indentOf = (line) => line.match(/^ */)[0].length;
|
||||
const ITEM = /^(\s*)([-*+]|\d+[.)])\s+(.*)$/;
|
||||
|
||||
function list(lines, start) {
|
||||
function list(lines, start, site) {
|
||||
// Collects the items at this list's indentation; deeper lines belong to the item above.
|
||||
const base = indentOf(lines[start]);
|
||||
const ordered = /\d/.test(lines[start].match(ITEM)[2]);
|
||||
@@ -65,7 +67,7 @@ function list(lines, start) {
|
||||
if (m && indentOf(line) === base) {
|
||||
items.push({ text: [m[3]], children: [] });
|
||||
} else if (m && indentOf(line) > base) {
|
||||
const [html, end] = list(lines, i);
|
||||
const [html, end] = list(lines, i, site);
|
||||
items[items.length - 1].children.push(html);
|
||||
i = end;
|
||||
continue;
|
||||
@@ -77,12 +79,24 @@ function list(lines, start) {
|
||||
i++;
|
||||
}
|
||||
const tag = ordered ? "ol" : "ul";
|
||||
const body = items.map((it) => `<li>${inline(it.text.join(" "))}${it.children.join("")}</li>`).join("");
|
||||
const body = items.map((it) => `<li>${inline(it.text.join(" "), site)}${it.children.join("")}</li>`).join("");
|
||||
return [`<${tag}>${body}</${tag}>`, i];
|
||||
}
|
||||
|
||||
/** Renders Markdown; `shift` moves headings down (a `#` becomes `h{1 + shift}`). */
|
||||
export function markdown(source, { shift = 0 } = {}) {
|
||||
const slug = (text) =>
|
||||
text
|
||||
.toLowerCase()
|
||||
.replace(/`/g, "")
|
||||
.replace(/[^a-z0-9]+/g, "-")
|
||||
.replace(/^-|-$/g, "");
|
||||
|
||||
/**
|
||||
* Renders Markdown; `shift` moves headings down (a `#` becomes `h{1 + shift}`).
|
||||
* `site` is for the docs pages: links to the site's own pages and anchors stay as they are, `##` and `###`
|
||||
* headings get an id (and are pushed onto `headings`, for a table of contents), and a line holding only
|
||||
* `` becomes a figure.
|
||||
*/
|
||||
export function markdown(source, { shift = 0, site = false, headings = null } = {}) {
|
||||
const lines = source.replace(/\r\n?/g, "\n").split("\n");
|
||||
const out = [];
|
||||
let i = 0;
|
||||
@@ -95,7 +109,17 @@ export function markdown(source, { shift = 0 } = {}) {
|
||||
let m;
|
||||
if ((m = line.match(/^(#{1,6})\s+(.*?)\s*#*$/))) {
|
||||
const level = Math.min(6, m[1].length + shift);
|
||||
out.push(`<h${level}>${inline(m[2])}</h${level}>`);
|
||||
let id = "";
|
||||
if (site && (m[1].length === 2 || m[1].length === 3)) {
|
||||
const base = slug(m[2]);
|
||||
id = base;
|
||||
for (let n = 2; headings && headings.some((h) => h.id === id); n++) id = `${base}-${n}`;
|
||||
headings?.push({ level: m[1].length, text: m[2].replace(/`/g, ""), id });
|
||||
}
|
||||
out.push(`<h${level}${id ? ` id="${id}"` : ""}>${inline(m[2], site)}</h${level}>`);
|
||||
i++;
|
||||
} else if (site && (m = line.match(/^!\[([^\]]*)\]\((\/media\/[\w./-]+)\)\s*$/))) {
|
||||
out.push(`<figure><img src="${escape(m[2])}" alt="${escape(m[1])}" loading="lazy" decoding="async"><figcaption>${inline(m[1], true)}</figcaption></figure>`);
|
||||
i++;
|
||||
} else if ((m = line.match(/^\s*(```|~~~)/))) {
|
||||
const fence = m[1];
|
||||
@@ -108,13 +132,13 @@ export function markdown(source, { shift = 0 } = {}) {
|
||||
out.push("<hr>");
|
||||
i++;
|
||||
} else if (ITEM.test(line)) {
|
||||
const [html, end] = list(lines, i);
|
||||
const [html, end] = list(lines, i, site);
|
||||
out.push(html);
|
||||
i = end;
|
||||
} else if (line.startsWith(">")) {
|
||||
const quote = [];
|
||||
while (i < lines.length && lines[i].startsWith(">")) quote.push(lines[i++].replace(/^>\s?/, ""));
|
||||
out.push(`<blockquote>${markdown(quote.join("\n"), { shift })}</blockquote>`);
|
||||
out.push(`<blockquote>${markdown(quote.join("\n"), { shift, site })}</blockquote>`);
|
||||
} else {
|
||||
const para = [];
|
||||
while (
|
||||
@@ -125,7 +149,7 @@ export function markdown(source, { shift = 0 } = {}) {
|
||||
) {
|
||||
para.push(lines[i++].trim());
|
||||
}
|
||||
out.push(`<p>${inline(para.join(" "))}</p>`);
|
||||
out.push(`<p>${inline(para.join(" "), site)}</p>`);
|
||||
}
|
||||
}
|
||||
return out.join("\n");
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Host a server · Horizon</title>
|
||||
<meta name="description" content="Host a Minecraft Java Edition 26.3 server with horizon-server: one native program, one settings file, a command line, a web panel and backups. What works today and what doesn't yet.">
|
||||
<meta name="theme-color" content="#fafafc" media="(prefers-color-scheme: light)">
|
||||
<meta name="theme-color" content="#0d0e13" media="(prefers-color-scheme: dark)">
|
||||
<meta name="color-scheme" content="light dark">
|
||||
<link rel="canonical" href="https://playhorizon.dev/server">
|
||||
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
|
||||
<link rel="stylesheet" href="{{CSS}}">
|
||||
<script>try { const t = localStorage.getItem("theme"); if (t === "light" || t === "dark") document.documentElement.dataset.theme = t } catch {}</script>
|
||||
</head>
|
||||
<body class="privacy guide">
|
||||
<main id="main" class="section">
|
||||
<div class="container">
|
||||
<p class="kicker"><span>Server</span>Early version</p>
|
||||
<h1 class="display">Host a server.</h1>
|
||||
<p class="lede">horizon-server runs a Minecraft Java Edition 26.3 server with Horizon's own game as the engine: one native program, no Java, one settings file, a command line, a web panel and backups. Vanilla and Horizon clients can join. This page is <a href="https://github.com/ludovic111/horizon/blob/main/docs/hosting.md">docs/hosting.md</a>, built into the site.</p>
|
||||
<div class="prose">
|
||||
{{SERVER_GUIDE}}
|
||||
</div>
|
||||
<div class="hero-actions"><a class="button secondary" href="/">Back to Horizon</a></div>
|
||||
<p class="disclaimer">Not an official Minecraft product. Not approved by or associated with Mojang or Microsoft.</p>
|
||||
</div>
|
||||
</main>
|
||||
<p class="footer-word" aria-hidden="true">horizon</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -431,3 +431,71 @@ figcaption span { font-family: var(--mono); font-size: var(--text-micro); letter
|
||||
.privacy h1 { margin-bottom: 16px; }
|
||||
.privacy .prose { margin: 40px 0; }
|
||||
.privacy .disclaimer { margin-top: 32px; }
|
||||
|
||||
/* --- Documentation (/docs): a left navigation and one page at a time --------------------- */
|
||||
|
||||
.docs-bar {
|
||||
position: sticky; top: 0; z-index: 20; height: 56px;
|
||||
background: color-mix(in srgb, var(--page) 88%, transparent);
|
||||
-webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
|
||||
box-shadow: 0 1px 0 var(--rule);
|
||||
}
|
||||
.docs-bar-inner { display: flex; align-items: center; gap: 16px; height: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--g); }
|
||||
.docs-bar-title { padding-left: 16px; border-left: 1px solid var(--rule); color: var(--muted); font-size: var(--text-label); }
|
||||
.docs-bar-end { margin-left: auto; display: flex; align-items: center; gap: 16px; }
|
||||
.docs-bar-link { color: var(--muted); font-size: var(--text-label); }
|
||||
.docs-bar-link:hover { color: var(--ink); }
|
||||
.docs {
|
||||
display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: clamp(32px, 6vw, 96px);
|
||||
max-width: var(--max); margin: 0 auto; padding: 48px var(--g) 0; align-items: start;
|
||||
}
|
||||
.docs-nav-wrap { position: sticky; top: 80px; max-height: calc(100vh - 104px); overflow-y: auto; padding-bottom: 24px; }
|
||||
.docs-nav-wrap summary { display: none; }
|
||||
.docs-nav-group { margin: 28px 0 8px; font: var(--text-micro) / var(--text-micro-line) var(--mono); letter-spacing: var(--text-micro-tracking); text-transform: uppercase; color: var(--muted); }
|
||||
.docs-nav-group:first-child { margin-top: 0; }
|
||||
.docs-nav li a { display: block; padding: 6px 12px; margin-left: -12px; border-radius: var(--radius); color: var(--ink-soft); font-size: var(--text-ui); }
|
||||
.docs-nav li a:hover { background: var(--plate-soft); color: var(--ink); }
|
||||
.docs-nav li a[aria-current] { background: var(--plate-soft); color: var(--ink); font-weight: 500; }
|
||||
.docs-main { min-width: 0; padding-bottom: 48px; }
|
||||
.docs-main .title { margin-bottom: 16px; }
|
||||
.docs-main .lede { max-width: 64ch; font-size: var(--text-heading); line-height: 1.45; }
|
||||
.docs-toc { margin-top: 28px; max-width: 72ch; }
|
||||
.docs-toc p { font: var(--text-micro) / var(--text-micro-line) var(--mono); letter-spacing: var(--text-micro-tracking); text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
|
||||
.docs-toc ul { display: flex; flex-wrap: wrap; gap: 6px; }
|
||||
.docs-toc a { display: block; padding: 4px 12px; border-radius: var(--radius-pill); background: var(--plate-soft); color: var(--ink-soft); font-size: var(--text-label); }
|
||||
.docs-toc a:hover { background: var(--plate); color: var(--ink); }
|
||||
.docs-prose { max-width: 72ch; margin-top: 40px; font-size: var(--text-body); }
|
||||
.docs-prose > * + * { margin-top: 14px; }
|
||||
.docs-prose h2 { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--rule); font-size: clamp(24px, 2.4vw, 30px); line-height: 1.2; letter-spacing: var(--text-title-tracking); scroll-margin-top: 80px; }
|
||||
.docs-prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
|
||||
.docs-prose h3 { margin-top: 32px; scroll-margin-top: 80px; }
|
||||
.docs-prose ol { list-style: decimal; }
|
||||
.docs-prose pre { font: 0.86em/1.6 var(--mono); }
|
||||
.docs-prose blockquote { padding: 2px 0 2px 16px; border-left: 2px solid var(--accent); color: var(--ink-soft); }
|
||||
.docs-prose blockquote > * + * { margin-top: 8px; }
|
||||
.docs-prose figure { margin: 28px 0; }
|
||||
.docs-prose figure img { width: 100%; border-radius: var(--radius-plate); box-shadow: 0 0 0 1px var(--rule); }
|
||||
.docs-prose figcaption { margin-top: 10px; font-size: var(--text-caption); color: var(--muted); }
|
||||
.docs-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 72ch; margin-top: 56px; }
|
||||
.docs-pager a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius-plate); box-shadow: 0 0 0 1px var(--rule); color: var(--ink); font-weight: 500; }
|
||||
.docs-pager a:hover { background: var(--plate-soft); color: var(--ink); }
|
||||
.docs-pager a span { font: var(--text-micro) / var(--text-micro-line) var(--mono); letter-spacing: var(--text-micro-tracking); text-transform: uppercase; color: var(--muted); font-weight: 400; }
|
||||
.docs-pager-next { grid-column: 2; text-align: right; }
|
||||
.docs-edit { margin-top: 32px; font-size: var(--text-caption); color: var(--muted); }
|
||||
.docs-edit a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
|
||||
.docs-main .disclaimer { margin-top: 24px; }
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.docs { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 12px; }
|
||||
.docs-nav-wrap { position: static; max-height: none; overflow: visible; margin-bottom: 24px; border-bottom: 1px solid var(--rule); }
|
||||
.docs-nav-wrap summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 500; list-style: none; }
|
||||
.docs-nav-wrap summary::-webkit-details-marker { display: none; }
|
||||
.docs-nav-wrap summary::after { content: "+"; margin-left: auto; color: var(--muted); }
|
||||
.docs-nav-wrap[open] summary::after { content: "\2212"; }
|
||||
.docs-pager { grid-template-columns: minmax(0, 1fr); }
|
||||
.docs-pager-next { grid-column: 1; }
|
||||
.docs-bar-link { display: none; }
|
||||
}
|
||||
@media (pointer: coarse) {
|
||||
.docs-nav li a, .docs-toc a, .docs-bar-title, .docs-bar-link { display: flex; align-items: center; min-height: 44px; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user