Repository navigation
RedCraftChat 0.2.6-SNAPSHOT
·
5 commits
to master
since this release
Translate action bars, both wire forms The action bar arrives two different ways and they are different packets: the dedicated SET_ACTION_BAR_TEXT that Adventure's sendActionBar produces, and system chat with the overlay flag, which is how CMI writes its. The chat interceptor only ever saw the second, which is why the elytra speed bar came out translated while the museum's "Use /musehub to quit" loop and the parkour HUD never did. ActionBarTranslator handles both, and is deliberately not built on the chat buffer. Cancelling and holding is what multi-line menus need and exactly what a surface repainting twenty times a second cannot afford, so this follows the hologram pattern instead: rewrite in place on the netty thread when the cache has the answer, pass the original through and warm the cache when it does not. The first repeat after a miss is translated; nothing is held or reordered, and no corrective resend, which would reset the fade timer and double-flash text that corrects itself one repeat later anyway. Counters are what make the cache work. NumericTemplate collapses every frame of a timer onto one template, the template is what gets translated and cached, and each frame injects its own numbers into the cached translation. A twenty-hertz HUD costs one provider call ever, and a frame is never shown carrying a placeholder: the store path refuses translations that lost one, and the rewrite path refuses output that still contains one, which covers a provider inventing an extra. A per-player churn guard counts cache misses, not text changes, so a cyclic animation stops costing once the cache has seen a full cycle where a change counter would trip forever. Only new provider spending goes quiet; cache hits keep rewriting. Overlay system chat moves out of the interceptor's buffer behind the same flag, which also stops it paying the grouping delay and a scheduler hop per frame. translate-action-bars off restores the old behaviour exactly. Clients before 1.19.1 are documented as unsupported for this and for system chat: they receive the legacy chat packet nothing listens for, and thirty days of logs show no real player below 1.21.5.