Class OSRSNpc
- java.lang.Object
-
- com.runemate.game.api.hybrid.entities.Entity
-
- com.runemate.game.api.osrs.entities.OSRSCacheModelEntity
-
- com.runemate.game.api.osrs.entities.OSRSEntity
-
- com.runemate.game.api.osrs.entities.OSRSNpc
-
- All Implemented Interfaces:
Actor
,Animable
,Identifiable
,Interactable
,Locatable
,Modeled
,Onymous
,Renderable
,Rotatable
,LocatableEntity
,Npc
,Validatable
public final class OSRSNpc extends OSRSEntity implements Npc
-
-
Constructor Summary
Constructors Constructor Description OSRSNpc(long uid)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAnimationFrame()
Gets the current frame of the actors animationint
getAnimationId()
Gets the entities current animation idArea.Rectangular
getArea(Coordinate regionBase)
Gets the area using the region base as the coordinate to offset from.NpcDefinition
getDefinition()
A definition containing a vast collection of data regarding this npcs creation on the world-graph@Nullable java.lang.String
getDialogue()
Gets the dialogue above an actors head@Nullable CombatGauge
getHealthGauge()
The health gauge displayed during combatint
getHighPrecisionOrientation()
For internal usage only.Coordinate.HighPrecision
getHighPrecisionPosition(Coordinate regionBase)
Gets the high precision position using the region base as the coordinate to offset from.@NonNull java.util.List<Hitsplat>
getHitsplats()
int
getId()
int
getLevel()
Gets the npcs current levelModel
getModel()
Gets the polygon-based model of the entityjava.lang.String
getName()
int
getOrientationAsAngle()
Gets the current orientation as an angle.@NonNull java.util.List<OverheadIcon>
getOverheadIcons()
Gets a list of the overhead icons currently above the npc.@NonNull java.util.List<Coordinate>
getPath()
@Nullable Coordinate
getPosition(Coordinate regionBase)
Gets the position using the region base as the coordinate to offset from.Coordinate
getServerPosition()
Gets the position of the actor according to the server.@NonNull java.util.List<java.lang.Integer>
getSpotAnimationIds()
Gets a list of the spot animation ids of the entity.int
getStanceFrame()
Gets the current frame of the actors stance animationint
getStanceId()
Gets the current stance animation id@Nullable Actor
getTarget()
Gets the Actor that this Actor is targeting (talking, attacking, trading, pickpocketing, etc)boolean
isFacing(Locatable locatable)
Checks if this rotatable entity is facing a locatable objectboolean
isMoving()
Gets whether or not the actor is moving across the world graphboolean
isValid()
Verifies whether this entity is valid and still exists, typically on the world-graphjava.lang.String
toString()
-
Methods inherited from class com.runemate.game.api.osrs.entities.OSRSEntity
contains, getInteractionPoint, getVisibility, isHovered, isVisible, render, render
-
Methods inherited from class com.runemate.game.api.osrs.entities.OSRSCacheModelEntity
click, interact
-
Methods inherited from class com.runemate.game.api.hybrid.entities.Entity
equals, hasDynamicBounds, hashCode, releaseUidOnGarbageCollection, setBackupModel, setBackupModel, setBackupModel, setForcedModel, setForcedModel, setForcedModel
-
Methods inherited from interface com.runemate.game.api.hybrid.entities.Actor
getAnimationFrame, getDialogue, getHealthGauge, getHitsplats, getPath, getServerPosition, getSpotAnimationIds, getStanceFrame, getStanceId, getTarget, isMoving
-
Methods inherited from interface com.runemate.game.api.hybrid.entities.details.Animable
getAnimationId
-
Methods inherited from interface com.runemate.game.api.hybrid.entities.details.Interactable
click, contains, getInteractionPoint, getInteractionPoint, getVisibility, hasDynamicBounds, hover, interact, interact, interact, interact, interact, interact, isHovered, isVisible
-
Methods inherited from interface com.runemate.game.api.hybrid.entities.details.Locatable
distanceTo, distanceTo, getLocalPosition
-
Methods inherited from interface com.runemate.game.api.hybrid.entities.LocatableEntity
getArea, getHighPrecisionPosition, getPosition, getPosition
-
Methods inherited from interface com.runemate.game.api.hybrid.entities.details.Modeled
setBackupModel, setBackupModel, setBackupModel, setForcedModel, setForcedModel, setForcedModel
-
Methods inherited from interface com.runemate.game.api.hybrid.entities.Npc
getActiveDefinition
-
Methods inherited from interface com.runemate.game.api.hybrid.entities.details.Renderable
render, render
-
Methods inherited from interface com.runemate.game.api.hybrid.entities.details.Rotatable
getHighPrecisionOrientation, getOrientationAsAngle, isFacing
-
-
-
-
Method Detail
-
getId
public int getId()
- Specified by:
getId
in interfaceIdentifiable
-
getLevel
public int getLevel()
Description copied from interface:Npc
Gets the npcs current level
-
getDefinition
@Nullable public NpcDefinition getDefinition()
Description copied from interface:Npc
A definition containing a vast collection of data regarding this npcs creation on the world-graph- Specified by:
getDefinition
in interfaceNpc
- Returns:
- The definition, otherwise null
-
getOverheadIcons
@NonNull public @NonNull java.util.List<OverheadIcon> getOverheadIcons()
Description copied from interface:Actor
Gets a list of the overhead icons currently above the npc.- Specified by:
getOverheadIcons
in interfaceActor
-
getModel
public Model getModel()
Description copied from interface:Modeled
Gets the polygon-based model of the entity- Specified by:
getModel
in interfaceModeled
- Overrides:
getModel
in classOSRSEntity
- Returns:
- the entities model, otherwise the backup if set, if neither are available null
-
getArea
public Area.Rectangular getArea(Coordinate regionBase)
Description copied from interface:LocatableEntity
Gets the area using the region base as the coordinate to offset from. For optimization.- Specified by:
getArea
in interfaceLocatableEntity
- Overrides:
getArea
in classOSRSEntity
- Parameters:
regionBase
- The Coordinate base of the loaded region
-
getHighPrecisionPosition
public Coordinate.HighPrecision getHighPrecisionPosition(Coordinate regionBase)
Description copied from interface:LocatableEntity
Gets the high precision position using the region base as the coordinate to offset from. For optimization.- Specified by:
getHighPrecisionPosition
in interfaceLocatableEntity
- Parameters:
regionBase
- The Coordinate base of the loaded region
-
isValid
public boolean isValid()
Description copied from interface:Validatable
Verifies whether this entity is valid and still exists, typically on the world-graph- Specified by:
isValid
in interfaceValidatable
- Overrides:
isValid
in classEntity
- Returns:
- true if it's still available, otherwise false
-
getAnimationId
public final int getAnimationId()
Description copied from interface:Animable
Gets the entities current animation id- Specified by:
getAnimationId
in interfaceAnimable
- Returns:
- the current animation id, or if unavailable -1
-
getAnimationFrame
public final int getAnimationFrame()
Description copied from interface:Actor
Gets the current frame of the actors animation- Specified by:
getAnimationFrame
in interfaceActor
- Returns:
- the current frame, otherwise -1
-
getStanceId
public int getStanceId()
Description copied from interface:Actor
Gets the current stance animation id- Specified by:
getStanceId
in interfaceActor
- Returns:
- the current stance animation id, otherwise -1
-
getStanceFrame
public final int getStanceFrame()
Description copied from interface:Actor
Gets the current frame of the actors stance animation- Specified by:
getStanceFrame
in interfaceActor
- Returns:
- the current frame, otherwise -1
-
getHighPrecisionOrientation
public final int getHighPrecisionOrientation()
Description copied from interface:Rotatable
For internal usage only. Subject to removal without notice.- Specified by:
getHighPrecisionOrientation
in interfaceRotatable
-
getOrientationAsAngle
public final int getOrientationAsAngle()
Description copied from interface:Rotatable
Gets the current orientation as an angle.- Specified by:
getOrientationAsAngle
in interfaceRotatable
-
isFacing
public boolean isFacing(Locatable locatable)
Description copied from interface:Rotatable
Checks if this rotatable entity is facing a locatable object
-
isMoving
public final boolean isMoving()
Description copied from interface:Actor
Gets whether or not the actor is moving across the world graph
-
getHealthGauge
@Nullable public final @Nullable CombatGauge getHealthGauge()
The health gauge displayed during combat- Specified by:
getHealthGauge
in interfaceActor
- Returns:
- The health gauge if visible, else null
-
getDialogue
@Nullable public final @Nullable java.lang.String getDialogue()
Description copied from interface:Actor
Gets the dialogue above an actors head- Specified by:
getDialogue
in interfaceActor
- Returns:
- The actors current dialogue, otherwise null
-
getTarget
@Nullable public final @Nullable Actor getTarget()
Description copied from interface:Actor
Gets the Actor that this Actor is targeting (talking, attacking, trading, pickpocketing, etc)
-
getSpotAnimationIds
@NonNull public @NonNull java.util.List<java.lang.Integer> getSpotAnimationIds()
Description copied from interface:Actor
Gets a list of the spot animation ids of the entity. A spot animation is a model that is animated simultaneously with the actor's model.- Specified by:
getSpotAnimationIds
in interfaceActor
-
getPosition
@Nullable public final @Nullable Coordinate getPosition(Coordinate regionBase)
Description copied from interface:LocatableEntity
Gets the position using the region base as the coordinate to offset from. For optimization.- Specified by:
getPosition
in interfaceLocatableEntity
- Parameters:
regionBase
- The Coordinate base of the loaded region
-
getHitsplats
@NonNull public @NonNull java.util.List<Hitsplat> getHitsplats()
- Specified by:
getHitsplats
in interfaceActor
-
getServerPosition
public Coordinate getServerPosition()
Description copied from interface:Actor
Gets the position of the actor according to the server.This value is typically ahead of where the client renders.
- Specified by:
getServerPosition
in interfaceActor
-
getPath
@NonNull public @NonNull java.util.List<Coordinate> getPath()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classOSRSEntity
-
-