Package net.runelite.api
Interface PlayerComposition
-
public interface PlayerCompositionRepresents the template of a player.
-
-
Field Summary
Fields Modifier and Type Field Description static intITEM_OFFSETstatic intKIT_OFFSET
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description ColorTextureOverridecreateColorTextureOverride(KitType kit, int itemId)Create aColorTextureOverridefor a kit slot.int[]getColors()Get the body part colors for this player composition.ColorTextureOverridegetColorTextureOverride(KitType kit)Get theColorTextureOverridefor a kit slot.ColorTextureOverride[]getColorTextureOverrides()Get the overrides for this player composition, indexed by kit id.intgetEquipmentId(KitType type)Gets the equipment ID of a particular slot.int[]getEquipmentIds()Gets an array of IDs related to equipment slots.intgetGender()Get the player genderintgetKitId(KitType type)Gets the kit ID of a particular slot.intgetTransformedNpcId()Get the ID of the NPC that the player is currently transformed into.booleanisFemale()Deprecated.use getGendervoidremoveColorTextureOverride(KitType kit)Remove theColorTextureOverridefor a kit slot.voidsetHash()Update the cached hash value for player equipment.voidsetTransformedNpcId(int id)Set the ID of the NPC that the player should transform into.
-
-
-
Field Detail
-
KIT_OFFSET
static final int KIT_OFFSET
- See Also:
- Constant Field Values
-
ITEM_OFFSET
static final int ITEM_OFFSET
- See Also:
- Constant Field Values
-
-
Method Detail
-
isFemale
@Deprecated boolean isFemale()
Deprecated.use getGenderChecks if the player is female.- Returns:
- true if the player is female
-
getGender
int getGender()
Get the player gender- Returns:
- 0 for male, 1 for female
-
getColors
int[] getColors()
Get the body part colors for this player composition.- Returns:
- an array of the colors, always size 5
-
getEquipmentIds
int[] getEquipmentIds()
Gets an array of IDs related to equipment slots.IDs between
KIT_OFFSETandITEM_OFFSETare kits, offset byKIT_OFFSET. IDs greater than or equal toITEM_OFFSETare items, offset byITEM_OFFSET.- Returns:
- the equipment IDs
-
getEquipmentId
int getEquipmentId(KitType type)
Gets the equipment ID of a particular slot.- Parameters:
type- equipment slot- Returns:
- the equipment ID
-
getKitId
int getKitId(KitType type)
Gets the kit ID of a particular slot.- Parameters:
type- equipment slot- Returns:
- the kit ID
-
setHash
void setHash()
Update the cached hash value for player equipment. Call this whenever the player's equipment changes or overrides change.
-
getTransformedNpcId
int getTransformedNpcId()
Get the ID of the NPC that the player is currently transformed into. Used natively for cutscenes.- Returns:
- the id of the npc that the player is rendering as
- See Also:
setTransformedNpcId(int)
-
setTransformedNpcId
@VisibleForDevtools void setTransformedNpcId(int id)
Set the ID of the NPC that the player should transform into. Used natively for cutscenes.- Parameters:
id- the id of the npc that the player should render as- See Also:
getTransformedNpcId()
-
getColorTextureOverrides
@Nullable ColorTextureOverride[] getColorTextureOverrides()
Get the overrides for this player composition, indexed by kit id. The overrides replace the target color/textures for the item instead of using the target colors/textures from the item composition. Only works if the kittype is an item.- Returns:
-
getColorTextureOverride
@Nullable ColorTextureOverride getColorTextureOverride(KitType kit)
Get theColorTextureOverridefor a kit slot.
-
createColorTextureOverride
ColorTextureOverride createColorTextureOverride(KitType kit, int itemId)
Create aColorTextureOverridefor a kit slot. The ColorTextureOverride is initialized with the overrides from the provided item.
-
removeColorTextureOverride
void removeColorTextureOverride(KitType kit)
Remove theColorTextureOverridefor a kit slot.
-
-