Class WorldEntity

java.lang.Object
dev.twilite.game.wrapper.WorldEntity
All Implemented Interfaces:
Interactable, InteractableUnit, Unit

public class WorldEntity extends Object implements InteractableUnit
Transmitted world entity backed by a child world.
  • Constructor Details

    • WorldEntity

      public WorldEntity(dev.twilite.game.internal.memory.RSWorldEntity memory, World parentWorld)
      Wraps a native world entity provider.
  • Method Details

    • id

      public int id()
      Returns the world entity id.
    • parentWorld

      public World parentWorld()
      Returns the parent world that owns this transmitted entity.
    • world

      public World world()
      Returns the child world associated with this entity.
      Specified by:
      world in interface Unit
    • coord

      public Coord coord()
      Description copied from interface: Unit
      Returns this unit's world coordinate.
      Specified by:
      coord in interface Unit
    • fine

      public Coord.Fine fine()
      Description copied from interface: Unit
      Returns this unit's fine coordinate, representing its model location.
      Specified by:
      fine in interface Unit
    • angle

      public int angle()
      Returns the current world entity coord angle.
    • waypointAngle

      public int waypointAngle()
      Returns the current waypoint angle, or the entity coord angle when no waypoint is active.
    • map

      public Coord.Map map()
      Description copied from interface: Unit
      Returns this unit's map coordinate relative to the loaded world area.
      Specified by:
      map in interface Unit
    • area

      public Rect area()
      Description copied from interface: Unit
      Returns the area this unit occupies.
      Specified by:
      area in interface Unit
    • areaFine

      public List<Coord.Fine> areaFine()
      Returns projected fine-coordinate corners for this entity's bounds.
    • projectCoord

      public Coord projectCoord(Coord.Fine fine)
      Projects a fine coordinate from this entity's child world to the root world.
    • projectCoord

      public Coord projectCoord(Coord.Fine fine, boolean definition)
      Projects a fine coordinate from this entity's child world to the root world.
    • projectCoord

      public Coord projectCoord(Coord.Fine fine, World childWorld)
      Projects a fine coordinate from the supplied child world to the root world.
    • projectFine

      public Coord.Fine projectFine(Coord.Fine fine)
      Projects a fine coordinate from this entity's child world to root-world fine coordinates.
    • projectFine

      public Coord.Fine projectFine(Coord.Fine fine, boolean waypoint)
      Projects a fine coordinate from this entity's child world to root-world fine coordinates.
    • projectFine

      public Coord.Fine projectFine(Coord.Fine fine, boolean waypoint, boolean definition)
      Projects a fine coordinate from this entity's child world to root-world fine coordinates.
    • projectFine

      public Coord.Fine projectFine(Coord.Fine fine, World childWorld)
      Projects a fine coordinate from the supplied child world to root-world fine coordinates.
    • unprojectFine

      public Coord.Fine unprojectFine(Coord.Fine fine)
      Unprojects a root-world fine coordinate to this entity's child-world fine coordinates.
    • unprojectFine

      public Coord.Fine unprojectFine(Coord.Fine fine, boolean waypoint)
      Unprojects a root-world fine coordinate to this entity's child-world fine coordinates.
    • unprojectFine

      public Coord.Fine unprojectFine(Coord.Fine fine, boolean waypoint, boolean definition)
      Unprojects a root-world fine coordinate to this entity's child-world fine coordinates.
    • options

      public List<MenuOption> options()
      Description copied from interface: Interactable
      Returns menu options associated with this interactable.
      Specified by:
      options in interface Interactable
    • target

      public boolean target()
      Description copied from interface: Interactable
      Performs the target action used when a selected component/item/spell targets this object. Returns true when the target action was performed.
      Specified by:
      target in interface Interactable
    • select

      public boolean select()
      Description copied from interface: Interactable
      Performs the use/select action for this object. Returns true when the "Use" action was performed.
      Specified by:
      select in interface Interactable