4.4 KiB
wowmine stickers
NeoForge 1.21.1 / 21.1.250 mod. It keeps vanilla chat and adds a sticker picker
beside the Voice Messages microphone. Server and client are deployed; the
canonical updater publishes this mod in client release v21-stickers.
The server importer owns Telegram credentials and converts packs into cached PNG atlases. Clients receive only the catalog and content-addressed images through the existing Minecraft connection.
Shared catalog
catalog.json contains:
{
"version": 1,
"packs": [{
"id": "PackShortName",
"title": "Pack title",
"stickers": [{
"id": "lowercase SHA-256 of the PNG atlas, exactly 64 hex characters",
"emoji": "",
"frames": 1
}]
}]
}
Assets live in assets/<id>.png. Each frame is 128 by 128 pixels; an atlas has
min(8, frames) columns and enough rows for every frame. Animations run at
20 frames per second, with 1 to 60 frames. Static stickers have one frame.
Limits: 64 packs, 200 entries per pack, 2048 entries overall, a 512 KiB catalog
and 2 MiB per PNG. IDs are content hashes, never filesystem paths or URLs.
Duplicate PNGs inside one pack must be deduplicated by the importer.
UI contract
Primary action: choose and send one sticker. Priorities: existing vanilla chat and microphone remain usable; packs and sticker previews are easy to scan; loading and import errors have visible explanations.
Layout: an icon button beside the existing microphone opens an anchored picker. Only the sticker grid scrolls; pack selection remains visible. Escape dismisses the picker and returns to chat without clearing the input. No replacement chat, private messenger, reactions or new voice recorder.
Every ordinary player can paste a public https://t.me/addstickers/SET_NAME
link into a labelled picker field and press Add. OP is not required. The server
extracts the set name, queues a bounded import and reports progress or an error
to that player. It never fetches the supplied URL directly. Existing packs are
reused, imports are serialized, and per-player/global quotas protect the shared
cache. Successful imports refresh the shared catalog.
Verification must use a separate test client/world, never the user's live Prism instance or production chat.
Build and use
From this directory, using the repository's existing Gradle wrapper and Java 21:
sh ../wowmine-client-info/gradlew -p . check jar
The JAR is build/libs/wowmine-stickers-1.0.0.jar. Install the same JAR on
server and clients. Open vanilla chat, then click the sticker button beside
the microphone or press Alt+S. Click a loaded sticker to send it; arrows and
Enter provide keyboard selection. Tab moves between enabled controls.
Escape or the sticker button closes the picker; both input drafts survive.
Paste a public Telegram pack URL in the labelled field and press Add.
Imported packs are shared with all players.
Server deployment is declared in
nixos/system/neuro/minecraft/wowmine.nix. It installs the importer and passes
the bot token using systemd LoadCredential, from the SOPS-managed
minecraft/telegram-stickers-token secret in sus/neuro-minecraft.yaml.
Edit that file with SOPS; NixOS provisions the root-owned runtime secret with
mode 0400. Do not put the token in Nix expressions or manual persistent files.
The bot
needs access to public sticker sets; players do not need their own bot,
Telegram account or operator permission. See importer/README.md for limits
and the CLI protocol.
The isolated integration test imported generated WEBP/TGS/WEBM through a local Bot API fixture with a non-OP player, then sent static and animated stickers in vanilla chat. A real Telegram import of the 50-sticker Animals pack also passed from the deployed Minecraft service's namespace and user, using its actual systemd credential.
Neuro cannot reach the default api.telegram.org IPv4 address. Its Minecraft
unit uses a private, read-only hosts file pointing that hostname to the
reachable official Telegram endpoint 149.154.167.220. The original hostname
and TLS certificate verification remain enabled. The host's nscd cache is
hidden from this unit so it cannot bypass the private hosts entry; ordinary
NSS file/DNS lookups remain available. Global hosts, DNS and routes are unchanged.
The endpoint was checked for valid api.telegram.org TLS and Bot API behavior
before the full import test. Its address is maintained in the NixOS module.