Modules1 min read
Resource packs
Prefetch your pack before the join and hear back how it went.
pack:1Tier A · DecorateGood for
- Big resource packs that do not slow down joins
- Knowing who declined your pack
Big resource packs make joins slow. With a pack hint, Teho downloads your pack in the background before the server asks for it. When vanilla's pack request arrives, the pack is already in Teho's 250 MB cache and applies straight away.
Hint your pack
The easiest way is config:
resource-pack:
url: "https://cdn.skyline.gg/skyline-v12.zip"
sha1: "0123456789abcdef0123456789abcdef01234567"
required: falseFrom code, send the hint as soon as the player is ready, and keep sending the pack the vanilla way as usual:
teho.pack().hint("skyline-v12",
"https://cdn.skyline.gg/skyline-v12.zip",
"0123456789abcdef0123456789abcdef01234567",
48_000_000L,
true,
"Skyline needs its texture pack");The arguments are an id, the URL, the pack's SHA-1, its size in bytes, whether it is required, and the prompt text.
Hear back
pack().lastState() and TehoListener.onPackStatus(player, sha1, state) report how it went:
PackApi.State | Meaning |
|---|---|
CACHED | The pack was already in the cache. |
DOWNLOADED | Teho fetched it ahead of the join. |
FAILED | The download failed or the hash did not match. |
DECLINED | The player declined the pack. |