This replaces uses of `Duration#minusMillis()` and `TemporalUnit`
referencing units of time defined in RSTimeUnits with their definitions.
The Timers plugin constructors are changed to accept implementations of
the `TemporalUnit` interface as they do not require any
`ChronoUnit`-specific APIs. Furthermore, the timer lengths updated use
the game tick lengths described in the OSRS wiki, which generally
closely correspond to the previous length definitions we used.
Location clue scrolls added a hint arrow when the player was nearby one
of the clue's locations. It did not, however clear that arrow if the
locations were changed and the previously-set hint arrow location was no
longer marked. This commit updates this behavior to clear the active
hint arrow each game tick before re-adding any location hint arrows.
(and if no NPC hint arrows are set)
Fixesrunelite/runelite#10370
Creating and destroying buffers each frame is unnecessary and inefficient as it doesn't give the driver the chance to observe the buffer's usage and optimize its access.
Co-authored-by: Adam <Adam@sigterm.info>
This commit allows the poison timer to be much more accurate as it
receives periodic updates from the server, and covers edge cases where
poison may be delayed or cured from sources besides potion clicks.
(banked potion drinks, HP orb "Cure" menu option, etc.)
This commit removes the `initialDelay` field from GameTimer as the field
was used only to chain antivenom timers into their follow-up antipoison
timers.
Fixesrunelite/runelite#1471Fixesrunelite/runelite#10724
Co-authored-by: Lucas <lws.ned1260@gmail.com>
Co-authored-by: Adam <Adam@sigterm.info>
Since dragged items are not moved until after the drag is complete, the
item still gets queued to be drawn, even if dragged outside of the
parent layer.
The current way of invoking it on the executor would let the client have
a start and a stop for a plugin sitting in the executor's queue, making
it toggle endlessly. This only was because we were using invokeAndWait
in startPlugin, which can't be invoked on the EDT because it would
deadlock with itself.