Repository navigation
Jade Compatibility
Jade is a popular WAILA-style overlay for blocks and entities. Its overlay sits at the top of the screen by default, where the OnTime timer can also live (bossbar, top_center, top_left, top_right presets).
Without intervention, the two overlap. OnTime detects Jade automatically at runtime and gently displaces Jade's overlay downward when they would collide, then restores Jade's user-configured position when the timer is gone.
OnTime never compiles against Jade — the integration is fully reflective, looked up class-by-class on first use:
-
JadeOverlayManager.isInstalled()checks forsnownee.jade.api.config.IWailaConfigon the classpath. -
tryInit()walks the config object and resolves accessors forposY,posX,anchorX,anchorYplus the optional rendered-rect field. Each method lookup is wrapped in a guard that catchesThrowable, so a missing or renamed Jade class can never crash the host. - On every client tick,
JadeClientHook.updateFromTimer()computes the timer's bounding box. If it overlaps Jade's, OnTime calls Jade'ssetOverlayPosYto move it just below the timer. - When the timer is hidden, finished, or moved to a non-top preset, OnTime restores Jade's previously read
posY.
| Loader / MC | Jade major | Layout |
|---|---|---|
| Forge 1.20.1 | 11.x |
OverlayRenderer without a rect field |
| Fabric / NeoForge 1.21.1 | 15.x |
OverlayRenderer.rect (TooltipRect.rect, Rect2i) |
| Fabric / NeoForge 1.21.6+ | 19.x |
OverlayRenderer.animation (TooltipAnimation.rect, Rect2f) |
The reflective lookup tries both layouts and uses whichever is present. If neither exists (newer Jade with a renamed field), OnTime falls back to estimating Jade's bounding box from anchorX, anchorY, posX, posY and a default size of 100×22 px — coarse but safe.
The first attempts at Jade integration suffered from two recurring issues:
-
Feedback loop. Reading Jade's currently-rendered rect to decide where to push it caused OnTime to chase its own displacement. Fix: prefer the
expectedRect(settled position) field when available; estimate from posY/posX/anchor instead of measuring the live rect. -
NeoForge 1.21.1 re-asserting config. Some Jade versions on NeoForge re-write
posYfrom their config every tick, fighting OnTime's displacement. Fix: while displacing, OnTime ignores Jade's current value entirely and unconditionally enforces its target.
Together these keep the displacement stable — no jitter, no oscillation.
When OnTime stops displacing, it only restores the user's posY if Jade's current value still matches the value OnTime last wrote. If you edited Jade's config mid-displacement, your value already wins and OnTime won't overwrite it.
On client disconnect, JadeOverlayManager.resetOnDisconnect() does a hard reset: restores any active displacement, re-reads Jade's actual posY (which may now be the "edited mid-game" value), and clears all internal state.
Displacement is only active when all of the following are true:
- Jade is installed and
tryInit()succeeded. - The timer is currently visible (
shouldDisplay()). - The timer's preset is one of
BOSSBAR,TOP_CENTER,TOP_LEFT,TOP_RIGHT. - The timer's bounding box would actually overlap Jade's at the user's preferred posY.
For non-top presets (bottom_*, center, actionbar, custom), Jade is never touched.
When you connect to a world with Jade present, OnTime logs once at INFO level:
[OnTime/Jade] Initialized (userPosY=..., rectAccess=true|false)
rectAccess=true means OnTime found Jade's rendered rect and can use the precise overlap check; false means it fell back to the estimated bounding box. Both modes work; true is just slightly tighter when Jade's content has unusual dimensions.
If Jade is updated to a future version OnTime hasn't seen, you may see a [OnTime/Jade] Init deferred: ... debug line. The integration falls back gracefully — Jade still works, but no displacement happens.
There is no toggle. To opt out of displacement, set the timer's position to a non-top preset (bottom_center, center, etc.). The overlay will draw freely without touching Jade.
If you want OnTime to never look at Jade at all, the only way is to remove Jade from the modpack — the integration is unconditional when Jade is on the classpath, but harmless when it isn't.