Interface Ids


public interface Ids
Translates OSRS ids to the ids this server uses, and back. Available as ctx.ids.

Private servers renumber content: Elorin plays OSRS animation 426 as 19426, and Impact sends OSRS graphic 3244 as 7473. Write a plugin against OSRS ids and translate at the boundary instead of keeping one constant table per server:


 // what does this server call OSRS animation 426?
 OptionalInt bow = ctx.ids.animation(426);
 // which OSRS graphic is the one this actor just played? (prefer this direction for comparisons)
 boolean telegraph = ctx.ids.osrsGraphic(spotAnimId).orElse(-1) == 3244;
 

Every method returns an empty OptionalInt when it cannot translate: the server's rule is not documented with evidence, the id is outside the range the rule covers, or (forward only) several server ids stand for the same OSRS id, so no single answer is safe to compare with ==. Empty never means "the id does not exist"; it means "cannot say". A translation is a namespace rule, not proof that the server defines that id.

Animations here are actor (player and NPC) sequences. Object animations can use another namespace. Which servers translate which ids is in the SDK docs, Compatibility.

  • Method Summary

    Modifier and Type
    Method
    Description
    animation(int osrsId)
    This server's actor animation (sequence) id for OSRS animation osrsId.
    graphic(int osrsId)
    This server's spot graphic / graphics object / projectile id for OSRS graphic osrsId.
    osrsAnimation(int serverId)
    The OSRS animation id for this server's animation serverId.
    osrsGraphic(int serverId)
    The OSRS graphic id for this server's graphic serverId.
    osrsVarbit(int serverId)
    The OSRS varbit id for this server's varbit serverId.
    The server whose ids these are.
    varbit(int osrsId)
    This server's varbit id for OSRS varbit osrsId.
  • Method Details

    • server

      ServerId server()
      The server whose ids these are.
    • animation

      OptionalInt animation(int osrsId)
      This server's actor animation (sequence) id for OSRS animation osrsId.
    • graphic

      OptionalInt graphic(int osrsId)
      This server's spot graphic / graphics object / projectile id for OSRS graphic osrsId.
    • varbit

      OptionalInt varbit(int osrsId)
      This server's varbit id for OSRS varbit osrsId.
    • osrsAnimation

      OptionalInt osrsAnimation(int serverId)
      The OSRS animation id for this server's animation serverId.
    • osrsGraphic

      OptionalInt osrsGraphic(int serverId)
      The OSRS graphic id for this server's graphic serverId.
    • osrsVarbit

      OptionalInt osrsVarbit(int serverId)
      The OSRS varbit id for this server's varbit serverId.