Merge pull request #3236 from sainttx/api-documentation
runelite-api: Add missing documentation
This commit is contained in:
@@ -32,37 +32,112 @@ import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.coords.WorldArea;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
|
||||
/**
|
||||
* Represents a RuneScape actor/entity.
|
||||
*/
|
||||
public interface Actor extends Renderable
|
||||
{
|
||||
/**
|
||||
* Gets the combat level of the actor.
|
||||
*
|
||||
* @return the combat level
|
||||
*/
|
||||
int getCombatLevel();
|
||||
|
||||
/**
|
||||
* Gets the name of the actor.
|
||||
*
|
||||
* @return the name
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Gets the actor being interacted with.
|
||||
* <p>
|
||||
* Examples of interaction include:
|
||||
* <ul>
|
||||
* <li>A monster focusing an Actor to attack</li>
|
||||
* <li>Targetting a player to trade</li>
|
||||
* <li>Following a player</li>
|
||||
* </ul>
|
||||
*
|
||||
* @return the actor, null if no interaction is occurring
|
||||
*/
|
||||
Actor getInteracting();
|
||||
|
||||
/**
|
||||
* Gets the health ratio of the actor.
|
||||
* <p>
|
||||
* The ratio is the number of green bars in the overhead
|
||||
* HP display.
|
||||
*
|
||||
* @return the health ratio
|
||||
*/
|
||||
int getHealthRatio();
|
||||
|
||||
/**
|
||||
* Gets the health of the actor.
|
||||
*
|
||||
* @return the health
|
||||
*/
|
||||
int getHealth();
|
||||
|
||||
/**
|
||||
* Retrieve the server location of the actor. Note that this is typically
|
||||
* a couple steps ahead of where the client renders the actor.
|
||||
* @return Returns the server location of the actor.
|
||||
* Gets the server-side location of the actor.
|
||||
* <p>
|
||||
* This value is typically ahead of where the client renders and may
|
||||
* be affected by things such as animations.
|
||||
*
|
||||
* @return the server location
|
||||
*/
|
||||
WorldPoint getWorldLocation();
|
||||
|
||||
/**
|
||||
* Gets the client-side location of the actor.
|
||||
*
|
||||
* @return the client location
|
||||
*/
|
||||
LocalPoint getLocalLocation();
|
||||
|
||||
/**
|
||||
* Gets the orientation of the actor.
|
||||
*
|
||||
* @return the orientation
|
||||
* @see net.runelite.api.coords.Angle
|
||||
*/
|
||||
int getOrientation();
|
||||
|
||||
/**
|
||||
* Gets the current animation the actor is performing.
|
||||
*
|
||||
* @return the animation ID
|
||||
* @see AnimationID
|
||||
*/
|
||||
int getAnimation();
|
||||
|
||||
/**
|
||||
* Sets an animation for the actor to perform.
|
||||
*
|
||||
* @param animation the animation ID
|
||||
* @see AnimationID
|
||||
*/
|
||||
@VisibleForDevtools
|
||||
void setAnimation(int animation);
|
||||
|
||||
/**
|
||||
* Sets the frame of the animation the actor is performing.
|
||||
*
|
||||
* @param actionFrame the animation frame
|
||||
*/
|
||||
@VisibleForDevtools
|
||||
void setActionFrame(int actionFrame);
|
||||
|
||||
/**
|
||||
* Gets the graphic that is currently on the player.
|
||||
*
|
||||
* @return the graphic of the actor
|
||||
* @see GraphicID
|
||||
*/
|
||||
int getGraphic();
|
||||
|
||||
@VisibleForDevtools
|
||||
@@ -71,24 +146,84 @@ public interface Actor extends Renderable
|
||||
@VisibleForDevtools
|
||||
void setSpotAnimFrame(int spotAnimFrame);
|
||||
|
||||
/**
|
||||
* Gets the height of the actors model.
|
||||
*
|
||||
* @return the height
|
||||
*/
|
||||
int getModelHeight();
|
||||
|
||||
/**
|
||||
* Gets the canvas area of the current tile the actor is standing on.
|
||||
*
|
||||
* @return the current tile canvas area
|
||||
*/
|
||||
Polygon getCanvasTilePoly();
|
||||
|
||||
/**
|
||||
* Gets the point at which text should be drawn, relative to the
|
||||
* current location with the given z-axis offset.
|
||||
*
|
||||
* @param graphics engine graphics
|
||||
* @param text the text to draw
|
||||
* @param zOffset the z-axis offset
|
||||
* @return the text drawing location
|
||||
*/
|
||||
Point getCanvasTextLocation(Graphics2D graphics, String text, int zOffset);
|
||||
|
||||
/**
|
||||
* Gets the point at which an image should be drawn, relative to the
|
||||
* current location with the given z-axis offset.
|
||||
*
|
||||
* @param graphics engine graphics
|
||||
* @param image the image to draw
|
||||
* @param zOffset the z-axis offset
|
||||
* @return the image drawing location
|
||||
*/
|
||||
Point getCanvasImageLocation(Graphics2D graphics, BufferedImage image, int zOffset);
|
||||
|
||||
|
||||
/**
|
||||
* Gets the point at which a sprite should be drawn, relative to the
|
||||
* current location with the given z-axis offset.
|
||||
*
|
||||
* @param graphics engine graphics
|
||||
* @param sprite the sprite to draw
|
||||
* @param zOffset the z-axis offset
|
||||
* @return the sprite drawing location
|
||||
*/
|
||||
Point getCanvasSpriteLocation(Graphics2D graphics, SpritePixels sprite, int zOffset);
|
||||
|
||||
/**
|
||||
* Gets a point on the canvas of where this actors mini-map indicator
|
||||
* should appear.
|
||||
*
|
||||
* @return mini-map location on canvas
|
||||
*/
|
||||
Point getMinimapLocation();
|
||||
|
||||
/**
|
||||
* Returns the logical height of the actor's model. This is roughly where the health bar is drawn.
|
||||
* Gets the logical height of the actors model.
|
||||
* <p>
|
||||
* This z-axis offset is roughly where the health bar of the actor
|
||||
* is drawn.
|
||||
*
|
||||
* @return the logical height
|
||||
*/
|
||||
int getLogicalHeight();
|
||||
|
||||
/**
|
||||
* Gets the convex hull of the actors model.
|
||||
*
|
||||
* @return the convex hull
|
||||
* @see net.runelite.api.model.Jarvis
|
||||
*/
|
||||
Polygon getConvexHull();
|
||||
|
||||
/**
|
||||
* Gets the world area that the actor occupies.
|
||||
*
|
||||
* @return the world area
|
||||
*/
|
||||
WorldArea getWorldArea();
|
||||
}
|
||||
|
||||
@@ -24,8 +24,12 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
// Note: This class is not complete: these animations were manually gathered
|
||||
// through getAnimation(). Please add animations as you happen to use them.
|
||||
/**
|
||||
* Utility class used for mapping animation IDs.
|
||||
* <p>
|
||||
* Note: This class is not complete and may not contain a specific animation
|
||||
* required.
|
||||
*/
|
||||
public final class AnimationID
|
||||
{
|
||||
public static final int IDLE = -1;
|
||||
|
||||
@@ -24,7 +24,16 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents an area in the world.
|
||||
*/
|
||||
public interface Area
|
||||
{
|
||||
SpritePixels getMapIcon(boolean var1);
|
||||
/**
|
||||
* Gets the sprite icon to display on the world map.
|
||||
*
|
||||
* @param unused unused value
|
||||
* @return the sprite icon to display on the world map
|
||||
*/
|
||||
SpritePixels getMapIcon(boolean unused);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents an engine graphic buffer.
|
||||
*/
|
||||
public interface BufferProvider
|
||||
{
|
||||
}
|
||||
|
||||
@@ -26,15 +26,22 @@
|
||||
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents the buffer containing all messages in the chatbox.
|
||||
*/
|
||||
public interface ChatLineBuffer
|
||||
{
|
||||
/**
|
||||
* @return the MessageNode arrays which contain the messages in the chatbox
|
||||
* Gets an array of message nodes currently in the chatbox.
|
||||
*
|
||||
* @return messages in the chatbox
|
||||
*/
|
||||
MessageNode[] getLines();
|
||||
|
||||
/**
|
||||
* @return the length of the MessageNode array getLines()
|
||||
* Gets the length of the {@link #getLines()} array.
|
||||
*
|
||||
* @return the length
|
||||
*/
|
||||
int getLength();
|
||||
}
|
||||
@@ -24,30 +24,102 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Enumeration of message types that can be received in the chat.
|
||||
*/
|
||||
public enum ChatMessageType
|
||||
{
|
||||
/**
|
||||
* A message received from the server.
|
||||
*/
|
||||
SERVER(0),
|
||||
/**
|
||||
* A message in the public chat.
|
||||
*/
|
||||
PUBLIC(2),
|
||||
/**
|
||||
* A private message from another player.
|
||||
*/
|
||||
PRIVATE_MESSAGE_RECEIVED(3),
|
||||
/**
|
||||
* A trade request received.
|
||||
*/
|
||||
TRADE_RECEIVED(4),
|
||||
/**
|
||||
* A message received when a friend logs in or out.
|
||||
*/
|
||||
PRIVATE_MESSAGE_INFO(5),
|
||||
/**
|
||||
* A private message sent to another player.
|
||||
*/
|
||||
PRIVATE_MESSAGE_SENT(6),
|
||||
/**
|
||||
* A private message received from a moderator.
|
||||
*/
|
||||
PRIVATE_MESSAGE_RECEIVED_MOD(7),
|
||||
/**
|
||||
* A message received in clan chat.
|
||||
*/
|
||||
CLANCHAT(9),
|
||||
/**
|
||||
* A message received with information about the current clan chat.
|
||||
*/
|
||||
CLANCHAT_INFO(11),
|
||||
/**
|
||||
* A trade request being sent.
|
||||
*/
|
||||
TRADE_SENT(12),
|
||||
/**
|
||||
* An abuse report submitted.
|
||||
*/
|
||||
ABUSE_REPORT(26),
|
||||
/**
|
||||
* Examine item description.
|
||||
*/
|
||||
EXAMINE_ITEM(27),
|
||||
/**
|
||||
* Examine NPC description.
|
||||
*/
|
||||
EXAMINE_NPC(28),
|
||||
/**
|
||||
* Examine object description.
|
||||
*/
|
||||
EXAMINE_OBJECT(29),
|
||||
/**
|
||||
* Adding player to friend list.
|
||||
*/
|
||||
FRIENDS_LIST_ADD(30),
|
||||
/**
|
||||
* Adding player to ignore list.
|
||||
*/
|
||||
IGNORE_LIST_ADD(31),
|
||||
/**
|
||||
* An autochat message from a player.
|
||||
*/
|
||||
AUTOCHAT(90),
|
||||
/**
|
||||
* A game message (ie. when a setting is changed).
|
||||
*/
|
||||
GAME(99),
|
||||
/**
|
||||
* A message received when somebody sends a trade offer.
|
||||
*/
|
||||
TRADE(101),
|
||||
/**
|
||||
* A message received when somebody sends a duel offer.
|
||||
*/
|
||||
DUEL(103),
|
||||
/**
|
||||
* A message that was filtered.
|
||||
*/
|
||||
FILTERED(105),
|
||||
/**
|
||||
* A message about an action.
|
||||
*/
|
||||
ACTION(109),
|
||||
/**
|
||||
* An unknown message type.
|
||||
*/
|
||||
UNKNOWN(-1);
|
||||
|
||||
private final int type;
|
||||
@@ -57,6 +129,13 @@ public enum ChatMessageType
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method that maps the type value to its respective
|
||||
* {@link ChatMessageType} value.
|
||||
*
|
||||
* @param type the raw type
|
||||
* @return appropriate message type, or {@link #UNKNOWN}
|
||||
*/
|
||||
public static ChatMessageType of(int type)
|
||||
{
|
||||
for (ChatMessageType ct : ChatMessageType.values())
|
||||
@@ -69,6 +148,11 @@ public enum ChatMessageType
|
||||
return UNKNOWN;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the raw type value of the message type.
|
||||
*
|
||||
* @return the raw type
|
||||
*/
|
||||
public int getType()
|
||||
{
|
||||
return type;
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents a player in the chat.
|
||||
*/
|
||||
public interface ChatPlayer extends Nameable
|
||||
{
|
||||
}
|
||||
|
||||
@@ -24,11 +24,29 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents a clan member.
|
||||
*/
|
||||
public interface ClanMember
|
||||
{
|
||||
/**
|
||||
* Gets the username of the member.
|
||||
*
|
||||
* @return the username
|
||||
*/
|
||||
String getUsername();
|
||||
|
||||
/**
|
||||
* Gets the world the member is in.
|
||||
*
|
||||
* @return the world
|
||||
*/
|
||||
int getWorld();
|
||||
|
||||
/**
|
||||
* Gets the rank of the clan member.
|
||||
*
|
||||
* @return the rank
|
||||
*/
|
||||
ClanMemberRank getRank();
|
||||
}
|
||||
|
||||
@@ -29,18 +29,48 @@ import java.util.Map;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* An enumeration of ranks of clan members.
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum ClanMemberRank
|
||||
{
|
||||
/**
|
||||
* Not in a clan.
|
||||
*/
|
||||
UNRANKED(-1),
|
||||
/**
|
||||
* Friend rank.
|
||||
*/
|
||||
FRIEND(0),
|
||||
/**
|
||||
* Recruit rank.
|
||||
*/
|
||||
RECRUIT(1),
|
||||
/**
|
||||
* Corporal rank.
|
||||
*/
|
||||
CORPORAL(2),
|
||||
/**
|
||||
* Sergeant rank.
|
||||
*/
|
||||
SERGEANT(3),
|
||||
/**
|
||||
* Lieutenant rank.
|
||||
*/
|
||||
LIEUTENANT(4),
|
||||
/**
|
||||
* Captain rank.
|
||||
*/
|
||||
CAPTAIN(5),
|
||||
/**
|
||||
* General rank.
|
||||
*/
|
||||
GENERAL(6),
|
||||
/**
|
||||
* Channel owner rank.
|
||||
*/
|
||||
OWNER(7);
|
||||
|
||||
private static final Map<Integer, ClanMemberRank> RANKS = new HashMap<>();
|
||||
@@ -53,10 +83,20 @@ public enum ClanMemberRank
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method that maps the rank value to its respective
|
||||
* {@link ClanMemberRank} value.
|
||||
*
|
||||
* @param rank the rank value
|
||||
* @return rank type
|
||||
*/
|
||||
public static ClanMemberRank valueOf(int rank)
|
||||
{
|
||||
return RANKS.get(rank);
|
||||
}
|
||||
|
||||
/**
|
||||
* The value of the clan rank.
|
||||
*/
|
||||
private final int value;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -24,7 +24,23 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents tile collision data for a world region.
|
||||
*/
|
||||
public interface CollisionData
|
||||
{
|
||||
/**
|
||||
* Gets a 2D array of tile collision flags.
|
||||
* <p>
|
||||
* The array covers all tiles in a region (104x104), and the index into
|
||||
* the array is of format [x][y] where x and y are the tiles region
|
||||
* coordinates, respectively.
|
||||
* <p>
|
||||
* Collision flags are checked using the bitwise and (&) operator. Flag
|
||||
* values can be obtained and used with the {@link CollisionDataFlag} class.
|
||||
*
|
||||
* @return all collision flags for the tiles in the region
|
||||
* @see Constants#REGION_SIZE
|
||||
*/
|
||||
int[][] getFlags();
|
||||
}
|
||||
@@ -24,8 +24,14 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* A utility class containing collision data flags for tiles.
|
||||
*/
|
||||
public final class CollisionDataFlag
|
||||
{
|
||||
/**
|
||||
* Directional movement blocking flags.
|
||||
*/
|
||||
public static final int BLOCK_MOVEMENT_NORTH_WEST = 0x1;
|
||||
public static final int BLOCK_MOVEMENT_NORTH = 0x2;
|
||||
public static final int BLOCK_MOVEMENT_NORTH_EAST = 0x4;
|
||||
@@ -35,6 +41,9 @@ public final class CollisionDataFlag
|
||||
public static final int BLOCK_MOVEMENT_SOUTH_WEST = 0x40;
|
||||
public static final int BLOCK_MOVEMENT_WEST = 0x80;
|
||||
|
||||
/**
|
||||
* Movement blocking type flags.
|
||||
*/
|
||||
public static final int BLOCK_MOVEMENT_OBJECT = 0x100;
|
||||
public static final int BLOCK_MOVEMENT_FLOOR_DECORATION = 0x40000;
|
||||
public static final int BLOCK_MOVEMENT_FLOOR = 0x200000; // Eg. water
|
||||
@@ -43,6 +52,9 @@ public final class CollisionDataFlag
|
||||
BLOCK_MOVEMENT_FLOOR_DECORATION |
|
||||
BLOCK_MOVEMENT_FLOOR;
|
||||
|
||||
/**
|
||||
* Directional line of sight blocking flags.
|
||||
*/
|
||||
public static final int BLOCK_LINE_OF_SIGHT_NORTH = BLOCK_MOVEMENT_NORTH << 9; // 0x400
|
||||
public static final int BLOCK_LINE_OF_SIGHT_EAST = BLOCK_MOVEMENT_EAST << 9; // 0x1000
|
||||
public static final int BLOCK_LINE_OF_SIGHT_SOUTH = BLOCK_MOVEMENT_SOUTH << 9; // 0x4000
|
||||
|
||||
@@ -27,14 +27,44 @@ package net.runelite.api;
|
||||
|
||||
import java.awt.Dimension;
|
||||
|
||||
/**
|
||||
* A utility class containing constant values.
|
||||
*/
|
||||
public class Constants
|
||||
{
|
||||
/**
|
||||
* The original width of the game when running in fixed mode.
|
||||
*/
|
||||
public static final int GAME_FIXED_WIDTH = 765;
|
||||
/**
|
||||
* The original height of the game when running in fixed mode.
|
||||
*/
|
||||
public static final int GAME_FIXED_HEIGHT = 503;
|
||||
/**
|
||||
* Dimension representation of the width and height of the game in fixed mode.
|
||||
*/
|
||||
public static final Dimension GAME_FIXED_SIZE = new Dimension(GAME_FIXED_WIDTH, GAME_FIXED_HEIGHT);
|
||||
/**
|
||||
* The aspect ratio of the game when running in fixed mode.
|
||||
*/
|
||||
public static final double GAME_FIXED_ASPECT_RATIO = (double) GAME_FIXED_WIDTH / (double) GAME_FIXED_HEIGHT;
|
||||
/**
|
||||
* The default camera zoom value.
|
||||
*/
|
||||
public static final int CLIENT_DEFAULT_ZOOM = 512;
|
||||
/**
|
||||
* The width and length of a chunk (8x8 tiles).
|
||||
*/
|
||||
public static final int CHUNK_SIZE = 8;
|
||||
/**
|
||||
* The width and length of a region (13 chunks x 8 tiles).
|
||||
*/
|
||||
public static final int REGION_SIZE = 104;
|
||||
/**
|
||||
* The max allowed plane by the game.
|
||||
* <p>
|
||||
* This value is exclusive. The plane is set by 2 bits which restricts
|
||||
* the plane value to 0-3.
|
||||
*/
|
||||
public static final int MAX_Z = 4;
|
||||
}
|
||||
|
||||
@@ -27,11 +27,15 @@ package net.runelite.api;
|
||||
import java.awt.Polygon;
|
||||
|
||||
/**
|
||||
* Decorative object, such as objects on walls
|
||||
*
|
||||
* @author Adam
|
||||
* Represents a decorative object, such as an object on a wall.
|
||||
*/
|
||||
public interface DecorativeObject extends TileObject
|
||||
{
|
||||
/**
|
||||
* Gets the convex hull of the objects model.
|
||||
*
|
||||
* @return the convex hull
|
||||
* @see net.runelite.api.model.Jarvis
|
||||
*/
|
||||
Polygon getConvexHull();
|
||||
}
|
||||
|
||||
@@ -24,6 +24,16 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* An enumeration of equipment slots in the inventory {@link ItemContainer}.
|
||||
* <p>
|
||||
* These values are intended for use with the local players equipment
|
||||
* {@link ItemContainer} corresponding. For obtaining information about equipment
|
||||
* in the {@link PlayerComposition}, use {@link net.runelite.api.kit.KitType}.
|
||||
*
|
||||
* @see Client#getItemContainer(InventoryID)
|
||||
* @see InventoryID#EQUIPMENT
|
||||
*/
|
||||
public enum EquipmentInventorySlot
|
||||
{
|
||||
HEAD(0),
|
||||
@@ -44,6 +54,12 @@ public enum EquipmentInventorySlot
|
||||
this.slotIdx = slotIdx;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the index into the item array obtained from
|
||||
* {@link ItemContainer#getItems()}.
|
||||
*
|
||||
* @return the raw index
|
||||
*/
|
||||
public int getSlotIdx()
|
||||
{
|
||||
return slotIdx;
|
||||
|
||||
@@ -27,15 +27,22 @@ package net.runelite.api;
|
||||
import static java.lang.Math.floor;
|
||||
import static java.lang.Math.max;
|
||||
|
||||
/**
|
||||
* A utility class used for calculating experience related values.
|
||||
* <p>
|
||||
* Skill levels calculated and handled by this class are within (inclusive)
|
||||
* the range 1-126 rather than 1-99 to account for virtual levels obtained
|
||||
* when reaching the 200M experience limit.
|
||||
*/
|
||||
public class Experience
|
||||
{
|
||||
/**
|
||||
* Maximum virtual skill level at 200m xp
|
||||
* The maximum virtual skill level for any skill (200M experience).
|
||||
*/
|
||||
public static final int MAX_VIRT_LEVEL = 126;
|
||||
|
||||
/**
|
||||
* Total xp requirements of each skill level
|
||||
* The total experience required for each skill level.
|
||||
*/
|
||||
private static final int[] XP_FOR_LEVEL = new int[MAX_VIRT_LEVEL];
|
||||
|
||||
@@ -53,10 +60,12 @@ public class Experience
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the total quantity of xp required to hit a skill level.
|
||||
* Gets the total experience required to obtain the passed skill
|
||||
* level.
|
||||
*
|
||||
* @param level Level between 1 and 126 (inclusive).
|
||||
* @return Positive quantity of xp.
|
||||
* @param level the skill level
|
||||
* @return the required experience for the level
|
||||
* @throws IllegalArgumentException if skill level is invalid
|
||||
*/
|
||||
public static int getXpForLevel(int level)
|
||||
{
|
||||
@@ -70,10 +79,10 @@ public class Experience
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the skill level reached with a total quantity of xp.
|
||||
* Gets the skill level for the passed total experience.
|
||||
*
|
||||
* @param xp Positive quantity of xp.
|
||||
* @return Level between 1 and 126 (inclusive).
|
||||
* @param xp the passed experience (non-negative)
|
||||
* @return the skill level
|
||||
*/
|
||||
public static int getLevelForXp(int xp)
|
||||
{
|
||||
@@ -108,9 +117,19 @@ public class Experience
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates a high-precision combat level without integer rounding.
|
||||
* Calculates a non-virtual high-precision combat level without integer
|
||||
* rounding.
|
||||
* <p>
|
||||
* Combat levels range between 1.15 and ~126.1.
|
||||
*
|
||||
* @return Combat level between 1.15 and ~126.1 (assuming non-virtual levels).
|
||||
* @param attackLevel the attack level
|
||||
* @param strengthLevel the strength level
|
||||
* @param defenceLevel the defence level
|
||||
* @param hitpointsLevel the hitpoints level
|
||||
* @param magicLevel the magic level
|
||||
* @param rangeLevel the range level
|
||||
* @param prayerLevel the prayer level
|
||||
* @return the non-virtual combat level
|
||||
*/
|
||||
public static double getCombatLevelPrecise(int attackLevel, int strengthLevel,
|
||||
int defenceLevel, int hitpointsLevel, int magicLevel,
|
||||
@@ -128,7 +147,14 @@ public class Experience
|
||||
/**
|
||||
* Calculates a regular combat level.
|
||||
*
|
||||
* @return Combat level between 1 and 126 (assuming non-virtual levels).
|
||||
* @param attackLevel the attack level
|
||||
* @param strengthLevel the strength level
|
||||
* @param defenceLevel the defence level
|
||||
* @param hitpointsLevel the hitpoints level
|
||||
* @param magicLevel the magic level
|
||||
* @param rangeLevel the range level
|
||||
* @param prayerLevel the prayer level
|
||||
* @return the combat level, rounded down
|
||||
*/
|
||||
public static int getCombatLevel(int attackLevel, int strengthLevel,
|
||||
int defenceLevel, int hitpointsLevel, int magicLevel,
|
||||
|
||||
@@ -24,9 +24,22 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents a player in the friends list.
|
||||
*/
|
||||
public interface Friend extends ChatPlayer
|
||||
{
|
||||
/**
|
||||
* The name of the player.
|
||||
*
|
||||
* @return the name
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* The previous name the player had.
|
||||
*
|
||||
* @return the previous name
|
||||
*/
|
||||
String getPrevName();
|
||||
}
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents the friend and ignore list manager.
|
||||
*/
|
||||
public interface FriendManager
|
||||
{
|
||||
}
|
||||
|
||||
@@ -26,11 +26,29 @@ package net.runelite.api;
|
||||
|
||||
import java.awt.Canvas;
|
||||
|
||||
/**
|
||||
* Represents the client game engine.
|
||||
*/
|
||||
public interface GameEngine
|
||||
{
|
||||
/**
|
||||
* Gets the canvas that contains everything.
|
||||
*
|
||||
* @return the game canvas
|
||||
*/
|
||||
Canvas getCanvas();
|
||||
|
||||
/**
|
||||
* Gets the client main thread.
|
||||
*
|
||||
* @return the main thread
|
||||
*/
|
||||
Thread getClientThread();
|
||||
|
||||
/**
|
||||
* Checks whether this code is executing on the client main thread.
|
||||
*
|
||||
* @return true if on the main thread, false otherwise
|
||||
*/
|
||||
boolean isClientThread();
|
||||
}
|
||||
|
||||
@@ -28,27 +28,43 @@ import java.awt.Polygon;
|
||||
import net.runelite.api.coords.Angle;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Adam
|
||||
* Represents a game object.
|
||||
* <p>
|
||||
* Most object in the RuneScape world are considered as game objects. Things
|
||||
* such as trees, anvils, boxes, etc are all game objects.
|
||||
*/
|
||||
public interface GameObject extends TileObject
|
||||
{
|
||||
|
||||
/**
|
||||
* Returns the min x,y for this game object
|
||||
* Gets the minimum x and y region coordinate pair for this game object.
|
||||
*
|
||||
* @return
|
||||
* @return the minimum region coordinate
|
||||
*/
|
||||
Point getRegionMinLocation();
|
||||
|
||||
/**
|
||||
* Returns the max x,y for this game object. This is different from
|
||||
* {@link #getRegionMinLocation()} for objects larger than 1 tile.
|
||||
* Gets the maximum x and y region coordinate pair for this game object.
|
||||
* <p>
|
||||
* This value differs from {@link #getRegionMinLocation()} when the size
|
||||
* of the object is more than 1 tile.
|
||||
*
|
||||
* @return
|
||||
* @return the minimum region coordinate
|
||||
*/
|
||||
Point getRegionMaxLocation();
|
||||
|
||||
/**
|
||||
* Gets the convex hull of the actors model.
|
||||
*
|
||||
* @return the convex hull
|
||||
* @see net.runelite.api.model.Jarvis
|
||||
*/
|
||||
Polygon getConvexHull();
|
||||
|
||||
/**
|
||||
* Gets the orientation of the object.
|
||||
*
|
||||
* @return the orientation
|
||||
*/
|
||||
Angle getOrientation();
|
||||
}
|
||||
|
||||
@@ -24,17 +24,47 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* An enumeration of game states the client is in.
|
||||
*/
|
||||
public enum GameState
|
||||
{
|
||||
/**
|
||||
* Unknown game state.
|
||||
*/
|
||||
UNKNOWN(-1),
|
||||
/**
|
||||
* The client is starting.
|
||||
*/
|
||||
STARTING(0),
|
||||
/**
|
||||
* The client is at the login screen.
|
||||
*/
|
||||
LOGIN_SCREEN(10),
|
||||
/**
|
||||
* There is a player logging in.
|
||||
*/
|
||||
LOGGING_IN(20),
|
||||
/**
|
||||
* The game is being loaded.
|
||||
*/
|
||||
LOADING(25),
|
||||
/**
|
||||
* The user has successfully logged in.
|
||||
*/
|
||||
LOGGED_IN(30),
|
||||
/**
|
||||
* Connection to the server was lost.
|
||||
*/
|
||||
CONNECTION_LOST(40),
|
||||
/**
|
||||
* A world hop is taking place.
|
||||
*/
|
||||
HOPPING(45);
|
||||
|
||||
/**
|
||||
* The raw state value.
|
||||
*/
|
||||
private final int state;
|
||||
|
||||
GameState(int state)
|
||||
@@ -42,6 +72,13 @@ public enum GameState
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method that maps the rank value to its respective
|
||||
* {@link GameState} value.
|
||||
*
|
||||
* @param state the raw state value
|
||||
* @return the gamestate
|
||||
*/
|
||||
public static GameState of(int state)
|
||||
{
|
||||
for (GameState gs : GameState.values())
|
||||
|
||||
@@ -24,17 +24,51 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents an offer in a grand exchange slot.
|
||||
*/
|
||||
public interface GrandExchangeOffer
|
||||
{
|
||||
/**
|
||||
* Gets the quantity of bought or sold items.
|
||||
*
|
||||
* @return the quantity bought or sold
|
||||
*/
|
||||
int getQuantitySold();
|
||||
|
||||
/**
|
||||
* Gets the ID of the item being bought or sold.
|
||||
*
|
||||
* @return item ID
|
||||
* @see ItemID
|
||||
*/
|
||||
int getItemId();
|
||||
|
||||
/**
|
||||
* Gets the total quantity being bought or sold.
|
||||
*
|
||||
* @return the total quantity
|
||||
*/
|
||||
int getTotalQuantity();
|
||||
|
||||
/**
|
||||
* Gets the offer or sell price per item.
|
||||
*
|
||||
* @return the offer price
|
||||
*/
|
||||
int getPrice();
|
||||
|
||||
/**
|
||||
* Gets the total amount of money spent so far.
|
||||
*
|
||||
* @return the amount spent
|
||||
*/
|
||||
int getSpent();
|
||||
|
||||
/**
|
||||
* Gets the current state of the offer.
|
||||
*
|
||||
* @return the offers state
|
||||
*/
|
||||
GrandExchangeOfferState getState();
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Describes the state of a Grand Exchange offer
|
||||
* Describes the state of a Grand Exchange offer.
|
||||
*/
|
||||
public enum GrandExchangeOfferState
|
||||
{
|
||||
@@ -35,11 +35,11 @@ public enum GrandExchangeOfferState
|
||||
*/
|
||||
EMPTY,
|
||||
/**
|
||||
* A cancelled buy offer
|
||||
* A cancelled buy offer.
|
||||
*/
|
||||
CANCELLED_BUY,
|
||||
/**
|
||||
* A cancelled sell offer
|
||||
* A cancelled sell offer.
|
||||
*/
|
||||
CANCELLED_SELL,
|
||||
/**
|
||||
|
||||
@@ -26,15 +26,33 @@ package net.runelite.api;
|
||||
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
|
||||
/**
|
||||
* Represents a graphics object.
|
||||
*/
|
||||
public interface GraphicsObject extends Renderable
|
||||
{
|
||||
/**
|
||||
* The graphics object ID.
|
||||
*
|
||||
* @return the ID
|
||||
*/
|
||||
int getId();
|
||||
|
||||
/**
|
||||
* The location of the object.
|
||||
*
|
||||
* @return the location
|
||||
*/
|
||||
LocalPoint getLocation();
|
||||
|
||||
int getStartCycle();
|
||||
|
||||
int getLevel();
|
||||
|
||||
/**
|
||||
* Gets the height of the graphic.
|
||||
*
|
||||
* @return the height
|
||||
*/
|
||||
int getHeight();
|
||||
}
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents an object on the ground of a tile.
|
||||
*/
|
||||
public interface GroundObject extends TileObject
|
||||
{
|
||||
}
|
||||
|
||||
@@ -26,9 +26,24 @@ package net.runelite.api;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* A data structure that uses a hash function to compute an index into an
|
||||
* array of buckets from which node objects can be quickly obtained.
|
||||
*/
|
||||
public interface HashTable
|
||||
{
|
||||
/**
|
||||
* Gets a node by its hash value.
|
||||
*
|
||||
* @param value the node value
|
||||
* @return the associated node
|
||||
*/
|
||||
Node get(long value);
|
||||
|
||||
/**
|
||||
* Gets a collection of all nodes stored in this table.
|
||||
*
|
||||
* @return the nodes stored
|
||||
*/
|
||||
Collection<Node> getNodes();
|
||||
}
|
||||
|
||||
@@ -24,13 +24,37 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* An enumeration of prayer icons above the head.
|
||||
*/
|
||||
public enum HeadIcon
|
||||
{
|
||||
/**
|
||||
* Protect from melee.
|
||||
*/
|
||||
MELEE,
|
||||
/**
|
||||
* Protect from ranged.
|
||||
*/
|
||||
RANGED,
|
||||
/**
|
||||
* Protect from magic.
|
||||
*/
|
||||
MAGIC,
|
||||
/**
|
||||
* Retribution prayer.
|
||||
*/
|
||||
RETRIBUTION,
|
||||
/**
|
||||
* Smite prayer.
|
||||
*/
|
||||
SMITE,
|
||||
/**
|
||||
* Redemption prayer.
|
||||
*/
|
||||
REDEMPTION,
|
||||
RANGE_MAGE; //used by Kalphite Queen
|
||||
/**
|
||||
* Protect from range and mage (ie. used by Kalphite Queen).
|
||||
*/
|
||||
RANGE_MAGE
|
||||
}
|
||||
|
||||
@@ -27,14 +27,32 @@ package net.runelite.api;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* An enumeration of hint arrow types.
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
public enum HintArrowType
|
||||
{
|
||||
/**
|
||||
* No hint arrow present.
|
||||
*/
|
||||
NONE(0),
|
||||
/**
|
||||
* Hint arrow is pointing to a player.
|
||||
*/
|
||||
PLAYER(10),
|
||||
/**
|
||||
* Hint arrow is pointing to an NPC.
|
||||
*/
|
||||
NPC(1),
|
||||
/**
|
||||
* Hint arrow is pointing at a position in the world.
|
||||
*/
|
||||
WORLD_POSITION(2);
|
||||
|
||||
/**
|
||||
* The raw type value.
|
||||
*/
|
||||
@Getter
|
||||
private final int value;
|
||||
}
|
||||
|
||||
@@ -26,17 +26,48 @@ package net.runelite.api;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* A hitsplat that has been applied to an {@link Actor}.
|
||||
*/
|
||||
public class Hitsplat
|
||||
{
|
||||
/**
|
||||
* An enumeration of hitsplat types.
|
||||
*/
|
||||
public enum HitsplatType
|
||||
{
|
||||
BLOCK, // Blue
|
||||
DAMAGE, // Red
|
||||
POISON, // Green
|
||||
VENOM, // Darkgreen
|
||||
DISEASE, // Yellow
|
||||
HEAL; // Purple
|
||||
/**
|
||||
* Blocking damage (blue).
|
||||
*/
|
||||
BLOCK,
|
||||
/**
|
||||
* Taking damage (red).
|
||||
*/
|
||||
DAMAGE,
|
||||
/**
|
||||
* Damage from poison (green).
|
||||
*/
|
||||
POISON,
|
||||
/**
|
||||
* Damage from venom (dark green).
|
||||
*/
|
||||
VENOM,
|
||||
/**
|
||||
* Damage from disease (yellow).
|
||||
*/
|
||||
DISEASE,
|
||||
/**
|
||||
* Healing (purple).
|
||||
*/
|
||||
HEAL;
|
||||
|
||||
/**
|
||||
* Utility method that maps the type value to its respective
|
||||
* {@link Hitsplat} value.
|
||||
*
|
||||
* @param type the type value
|
||||
* @return hitsplat type
|
||||
*/
|
||||
public static HitsplatType fromInteger(int type)
|
||||
{
|
||||
switch (type)
|
||||
@@ -52,12 +83,21 @@ public class Hitsplat
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of hitsplat.
|
||||
*/
|
||||
@Getter
|
||||
private HitsplatType hitsplatType;
|
||||
|
||||
/**
|
||||
* The value displayed by the hitsplat.
|
||||
*/
|
||||
@Getter
|
||||
private int amount;
|
||||
|
||||
/**
|
||||
* When the hitsplat will disappear.
|
||||
*/
|
||||
@Getter
|
||||
private int disappearsOnGameCycle;
|
||||
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents an indexed database, typically used for sprites.
|
||||
*/
|
||||
public interface IndexDataBase
|
||||
{
|
||||
}
|
||||
|
||||
@@ -24,37 +24,120 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents an indexed sprite.
|
||||
*/
|
||||
public interface IndexedSprite
|
||||
{
|
||||
/**
|
||||
* Gets the pixels contained by the sprite.
|
||||
*
|
||||
* @return the sprite pixels
|
||||
*/
|
||||
byte[] getPixels();
|
||||
|
||||
/**
|
||||
* Sets the pixels contained by the sprite.
|
||||
*
|
||||
* @param pixels the new sprite pixels
|
||||
*/
|
||||
void setPixels(byte[] pixels);
|
||||
|
||||
/**
|
||||
* Gets the color palette for the sprites pixels.
|
||||
*
|
||||
* @return the color palette
|
||||
*/
|
||||
int[] getPalette();
|
||||
|
||||
/**
|
||||
* Sets the color palette for the sprites pixels.
|
||||
*
|
||||
* @param palette the new color palette
|
||||
*/
|
||||
void setPalette(int[] palette);
|
||||
|
||||
/**
|
||||
* Gets the offset of the sprite along the x-axis.
|
||||
*
|
||||
* @return the x-axis offset
|
||||
*/
|
||||
int getOffsetX();
|
||||
|
||||
/**
|
||||
* Sets the offset of the sprite along the x-axis.
|
||||
*
|
||||
* @param offsetX new x-axis offset
|
||||
*/
|
||||
void setOffsetX(int offsetX);
|
||||
|
||||
/**
|
||||
* Gets the offset of the sprite along the y-axis.
|
||||
*
|
||||
* @return the y-axis offset
|
||||
*/
|
||||
int getOffsetY();
|
||||
|
||||
/**
|
||||
* Sets the offset of the sprite along the y-axis.
|
||||
*
|
||||
* @param offsetY new y-axis offset
|
||||
*/
|
||||
void setOffsetY(int offsetY);
|
||||
|
||||
/**
|
||||
* Gets the width of the sprite.
|
||||
*
|
||||
* @return the width
|
||||
*/
|
||||
int getWidth();
|
||||
|
||||
/**
|
||||
* Sets the width of the sprite.
|
||||
*
|
||||
* @param width the new width
|
||||
*/
|
||||
void setWidth(int width);
|
||||
|
||||
/**
|
||||
* Gets the original width of the sprite.
|
||||
*
|
||||
* @return the width
|
||||
*/
|
||||
int getOriginalWidth();
|
||||
|
||||
/**
|
||||
* Sets the original width of the sprite.
|
||||
*
|
||||
* @param originalWidth the width
|
||||
*/
|
||||
void setOriginalWidth(int originalWidth);
|
||||
|
||||
/**
|
||||
* Gets the height of the sprite.
|
||||
*
|
||||
* @return the height
|
||||
*/
|
||||
int getHeight();
|
||||
|
||||
/**
|
||||
* Sets the height of the sprite.
|
||||
*
|
||||
* @param height the height
|
||||
*/
|
||||
void setHeight(int height);
|
||||
|
||||
/**
|
||||
* Gets the original height of the sprite.
|
||||
*
|
||||
* @return the height
|
||||
*/
|
||||
int getOriginalHeight();
|
||||
|
||||
/**
|
||||
* Sets the original height of the sprite.
|
||||
*
|
||||
* @param originalHeight the height
|
||||
*/
|
||||
void setOriginalHeight(int originalHeight);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,9 @@ package net.runelite.api;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* An enumeration of possible instance templates and the area they occupy.
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
public enum InstanceTemplates
|
||||
{
|
||||
@@ -50,21 +53,42 @@ public enum InstanceTemplates
|
||||
RAIDS_VESPULA(3264, 5280, 2, 96, 32),
|
||||
RAIDS_CRABS(3264, 5344, 2, 96, 32);
|
||||
|
||||
/**
|
||||
* The base x-axis coordinate of the instance area.
|
||||
*/
|
||||
@Getter
|
||||
private final int baseX;
|
||||
|
||||
/**
|
||||
* The base y-axis coordinate of the instance area.
|
||||
*/
|
||||
@Getter
|
||||
private final int baseY;
|
||||
|
||||
/**
|
||||
* The plane the instance is on.
|
||||
*/
|
||||
@Getter
|
||||
private final int plane;
|
||||
|
||||
/**
|
||||
* The width of the instance area.
|
||||
*/
|
||||
@Getter
|
||||
private final int width;
|
||||
|
||||
/**
|
||||
* The height of the instance area.
|
||||
*/
|
||||
@Getter
|
||||
private final int height;
|
||||
|
||||
/**
|
||||
* Matches chunk data of an instance to the instance it belongs.
|
||||
*
|
||||
* @param chunkData the chunk data
|
||||
* @return the instance the chunk is in
|
||||
*/
|
||||
public static InstanceTemplates findMatch(int chunkData)
|
||||
{
|
||||
int rotation = chunkData >> 1 & 0x3; //unused, but shows us the rotation of the chunk
|
||||
|
||||
@@ -24,9 +24,22 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents an integer typically in a {@link HashTable}.
|
||||
*/
|
||||
public interface IntegerNode extends Node
|
||||
{
|
||||
/**
|
||||
* Gets the value of the node.
|
||||
*
|
||||
* @return the int value
|
||||
*/
|
||||
int getValue();
|
||||
|
||||
/**
|
||||
* Sets the value of the node.
|
||||
*
|
||||
* @param value the new int value
|
||||
*/
|
||||
void setValue(int value);
|
||||
}
|
||||
@@ -24,12 +24,30 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* An enumeration of possible inventory types.
|
||||
*/
|
||||
public enum InventoryID
|
||||
{
|
||||
/**
|
||||
* Standard player inventory.
|
||||
*/
|
||||
INVENTORY(93),
|
||||
/**
|
||||
* Equipment inventory.
|
||||
*/
|
||||
EQUIPMENT(94),
|
||||
/**
|
||||
* Bank inventory.
|
||||
*/
|
||||
BANK(95),
|
||||
/**
|
||||
* A puzzle box inventory.
|
||||
*/
|
||||
PUZZLE_BOX(140),
|
||||
/**
|
||||
* Barrows reward chest inventory.
|
||||
*/
|
||||
BARROWS_REWARD(141);
|
||||
|
||||
private final int id;
|
||||
@@ -39,6 +57,11 @@ public enum InventoryID
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the raw inventory type ID.
|
||||
*
|
||||
* @return inventory type
|
||||
*/
|
||||
public int getId()
|
||||
{
|
||||
return id;
|
||||
|
||||
@@ -24,9 +24,23 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents an item inside an {@link ItemContainer}.
|
||||
*/
|
||||
public interface Item extends Renderable
|
||||
{
|
||||
/**
|
||||
* Gets the items ID.
|
||||
*
|
||||
* @return the ID of the item
|
||||
* @see ItemID
|
||||
*/
|
||||
int getId();
|
||||
|
||||
/**
|
||||
* Gets the items quantity.
|
||||
*
|
||||
* @return the items quantity
|
||||
*/
|
||||
int getQuantity();
|
||||
}
|
||||
|
||||
@@ -24,96 +24,111 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents the template of a specific item type.
|
||||
*/
|
||||
public interface ItemComposition
|
||||
{
|
||||
/**
|
||||
* Returns the item's name as a string.
|
||||
* Gets the items name.
|
||||
*
|
||||
* @return the name of the item
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Returns the item's ID. A list of item IDs can be found in
|
||||
* ItemID.
|
||||
* Gets the items ID.
|
||||
*
|
||||
* @return the item's ID as an integer
|
||||
* @return the items ID
|
||||
* @see ItemID
|
||||
*/
|
||||
int getId();
|
||||
|
||||
/**
|
||||
* Returns a result that depends on whether the item is in noted form or
|
||||
* not.
|
||||
* Gets a value specifying whether the item is noted.
|
||||
*
|
||||
* @return 799 if noted, -1 if unnoted
|
||||
* @return 799 if noted, -1 otherwise
|
||||
*/
|
||||
int getNote();
|
||||
|
||||
/**
|
||||
* Returns the item ID of the noted/unnoted counterpart. For example, if
|
||||
* you call this on an unnoted monkfish(ID 7946), this method will
|
||||
* return the ID of a noted monkfish(ID 7947), and vice versa.
|
||||
* Gets the item ID of the noted or unnoted variant of this item.
|
||||
* <p>
|
||||
* Calling this method on a noted item will result in the ID of itself
|
||||
* in unnoted form, and on an unnoted item its noted variant.
|
||||
*
|
||||
* @return the ID that is linked to this item in noted/unnoted form.
|
||||
* @return the noted or unnoted variant of this item
|
||||
*/
|
||||
int getLinkedNoteId();
|
||||
|
||||
/**
|
||||
* Returns the item ID of the normal/placeholder counterpart. For example, if
|
||||
* you call this on a monkfish(ID 7946), this method will
|
||||
* return the ID of a placeholder monkfish(ID 17065), and vice versa.
|
||||
* Gets the item ID of the normal or placeholder variant of this item.
|
||||
* <p>
|
||||
* Calling this method on a normal item will result in the ID of itself
|
||||
* in placeholder form, and on a placeholder item its normal variant.
|
||||
*
|
||||
* @return the ID that is linked to this item in normal/placeholder form.
|
||||
* @return the normal or placeholder variant of this item
|
||||
*/
|
||||
int getPlaceholderId();
|
||||
|
||||
/**
|
||||
* Returns a result that depends on whether the item is in placeholder form or
|
||||
* not.
|
||||
* Gets a value specifying whether the item is a placeholder.
|
||||
*
|
||||
* @return 14401 if placeholder, -1 if normal
|
||||
* @return 14401 if placeholder, -1 otherwise
|
||||
*/
|
||||
int getPlaceholderTemplateId();
|
||||
|
||||
/**
|
||||
* Returns the store price of the item. Even if the item cannot be found
|
||||
* in a store, all items have a store price from which the High and Low
|
||||
* Alchemy values are calculated. Multiply the price by 0.6 to get the
|
||||
* High Alchemy value, or 0.4 to get the Low Alchemy value.
|
||||
* Gets the store price of the item.
|
||||
* <p>
|
||||
* Although not all items can be found in a store, they have a store price
|
||||
* which can be used to calculate high and low alchemy values. Multiplying
|
||||
* the price by {@code 0.6} and {@code 0.4} gives these high and low
|
||||
* alchemy values, respectively.
|
||||
*
|
||||
* @return the general store value of the item
|
||||
*/
|
||||
int getPrice();
|
||||
|
||||
/**
|
||||
* Returns whether or not the item is members-only.
|
||||
* Checks whether the item is members only.
|
||||
*
|
||||
* @return true if members-only, false otherwise.
|
||||
* @return true if members only, false otherwise.
|
||||
*/
|
||||
boolean isMembers();
|
||||
|
||||
/**
|
||||
* Returns whether or not the item stacks in the players' inventories
|
||||
* Checks whether the item is able to stack in a players inventory.
|
||||
*
|
||||
* @return true if stackable, false otherwise
|
||||
*/
|
||||
boolean isStackable();
|
||||
|
||||
/**
|
||||
* Returns the menu actions the item has in a players' inventory
|
||||
* Gets an array of possible right-click menu actions the item
|
||||
* has in a player inventory.
|
||||
*
|
||||
* @return the inventory menu actions
|
||||
*/
|
||||
String[] getInventoryActions();
|
||||
|
||||
/**
|
||||
* Returns the menu action index of the shift-click action
|
||||
* Gets the menu action index of the shift-click action.
|
||||
*
|
||||
* @return menu index of the shift-click action
|
||||
* @return the index of the shift-click action
|
||||
*/
|
||||
int getShiftClickActionIndex();
|
||||
|
||||
/**
|
||||
* Sets the menu action index of the shift-click action.
|
||||
*
|
||||
* @param shiftclickActionIndex the new index of the shift-click action
|
||||
*/
|
||||
void setShiftClickActionIndex(int shiftclickActionIndex);
|
||||
|
||||
/**
|
||||
* Resets the menu action index of the shift-click action to its
|
||||
* default value.
|
||||
*/
|
||||
void resetShiftClickActionIndex();
|
||||
}
|
||||
|
||||
@@ -24,11 +24,15 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents an inventory that contains items.
|
||||
*/
|
||||
public interface ItemContainer extends Node
|
||||
{
|
||||
/**
|
||||
* Get the items from the container
|
||||
* @return items
|
||||
* Gets an array of all items in the container.
|
||||
*
|
||||
* @return the items held
|
||||
*/
|
||||
Item[] getItems();
|
||||
}
|
||||
|
||||
@@ -24,13 +24,36 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents a pile of items held by a tile.
|
||||
*/
|
||||
public interface ItemLayer extends TileObject
|
||||
{
|
||||
/**
|
||||
* Gets the height of the layer.
|
||||
*
|
||||
* @return the height
|
||||
*/
|
||||
int getHeight();
|
||||
|
||||
/**
|
||||
* Gets the item at the bottom of the pile.
|
||||
*
|
||||
* @return the bottom item
|
||||
*/
|
||||
Renderable getBottom();
|
||||
|
||||
/**
|
||||
* Gets the item at the middle of the pile.
|
||||
*
|
||||
* @return the middle item
|
||||
*/
|
||||
Renderable getMiddle();
|
||||
|
||||
/**
|
||||
* Gets the item at the top of the pile.
|
||||
*
|
||||
* @return the top item
|
||||
*/
|
||||
Renderable getTop();
|
||||
}
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Detects when the window is focused or unfocused.
|
||||
*/
|
||||
public interface KeyFocusListener
|
||||
{
|
||||
}
|
||||
|
||||
@@ -26,7 +26,15 @@ package net.runelite.api;
|
||||
|
||||
import java.awt.Image;
|
||||
|
||||
/**
|
||||
* Represents the clients primary image buffer.
|
||||
*/
|
||||
public interface MainBufferProvider
|
||||
{
|
||||
/**
|
||||
* Gets the image currently loaded in the buffer.
|
||||
*
|
||||
* @return the loaded image
|
||||
*/
|
||||
Image getImage();
|
||||
}
|
||||
|
||||
@@ -27,6 +27,9 @@ package net.runelite.api;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* An enumeration of right-click menu actions.
|
||||
*/
|
||||
public enum MenuAction
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -26,14 +26,38 @@ package net.runelite.api;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* A menu entry in a right-click menu.
|
||||
*/
|
||||
@Data
|
||||
public class MenuEntry
|
||||
{
|
||||
/**
|
||||
* The option text added to the menu (ie. "Walk here", "Use").
|
||||
*/
|
||||
private String option;
|
||||
/**
|
||||
* The target of the action (ie. Item or Actor name).
|
||||
* <p>
|
||||
* If the option does not apply to any target, this field
|
||||
* will be set to empty string.
|
||||
*/
|
||||
private String target;
|
||||
/**
|
||||
* An identifier value for the target of the action.
|
||||
*/
|
||||
private int identifier;
|
||||
/**
|
||||
* The action the entry will trigger.
|
||||
*/
|
||||
private int type;
|
||||
/**
|
||||
* An additional parameter for the action.
|
||||
*/
|
||||
private int param0;
|
||||
/**
|
||||
* A second additional parameter for the action.
|
||||
*/
|
||||
private int param1;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,23 +24,75 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents a message in the chatbox.
|
||||
*/
|
||||
public interface MessageNode
|
||||
{
|
||||
/**
|
||||
* Gets the type of message.
|
||||
*
|
||||
* @return the message type
|
||||
*/
|
||||
ChatMessageType getType();
|
||||
|
||||
/**
|
||||
* Gets the name of the player that sent the message.
|
||||
*
|
||||
* @return the player name
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Sets the name of the player that sent the message.
|
||||
*
|
||||
* @param name the new player name
|
||||
*/
|
||||
void setName(String name);
|
||||
|
||||
/**
|
||||
* Gets the sender of the message (ie. clan name).
|
||||
*
|
||||
* @return the message sender
|
||||
*/
|
||||
String getSender();
|
||||
|
||||
/**
|
||||
* Sets the sender of the message.
|
||||
*
|
||||
* @param sender the new message sender
|
||||
*/
|
||||
void setSender(String sender);
|
||||
|
||||
/**
|
||||
* Gets the message contents.
|
||||
*
|
||||
* @return the message contents
|
||||
*/
|
||||
String getValue();
|
||||
|
||||
/**
|
||||
* Sets the message contents.
|
||||
*
|
||||
* @param value the new message contents
|
||||
*/
|
||||
void setValue(String value);
|
||||
|
||||
/**
|
||||
* Gets the overriden message format.
|
||||
*
|
||||
* @return the message format
|
||||
*/
|
||||
String getRuneLiteFormatMessage();
|
||||
|
||||
/**
|
||||
* Sets the overriden message format.
|
||||
* <p>
|
||||
* If this value is not null, the message contents as returned by
|
||||
* {@link #getValue()} will be replaced with the format set here
|
||||
* when a message is processed.
|
||||
*
|
||||
* @param runeLiteFormatMessage the new message format
|
||||
*/
|
||||
void setRuneLiteFormatMessage(String runeLiteFormatMessage);
|
||||
}
|
||||
|
||||
@@ -28,9 +28,22 @@ import java.util.List;
|
||||
import net.runelite.api.model.Triangle;
|
||||
import net.runelite.api.model.Vertex;
|
||||
|
||||
/**
|
||||
* Represents the model of an object.
|
||||
*/
|
||||
public interface Model extends Renderable
|
||||
{
|
||||
/**
|
||||
* Gets a list of all vertices of the model.
|
||||
*
|
||||
* @return the vertices
|
||||
*/
|
||||
List<Vertex> getVertices();
|
||||
|
||||
/**
|
||||
* Gets a list of all triangles of the model.
|
||||
*
|
||||
* @return the triangle
|
||||
*/
|
||||
List<Triangle> getTriangles();
|
||||
}
|
||||
|
||||
@@ -24,8 +24,17 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents a non-player character in the game.
|
||||
*/
|
||||
public interface NPC extends Actor
|
||||
{
|
||||
/**
|
||||
* Gets the ID of the NPC.
|
||||
*
|
||||
* @return the ID of the NPC
|
||||
* @see NpcID
|
||||
*/
|
||||
int getId();
|
||||
|
||||
@Override
|
||||
@@ -34,14 +43,26 @@ public interface NPC extends Actor
|
||||
@Override
|
||||
int getCombatLevel();
|
||||
|
||||
/**
|
||||
* Gets the index position of this NPC in the clients cached
|
||||
* NPC array.
|
||||
*
|
||||
* @return the NPC index
|
||||
* @see Client#getCachedNPCs()
|
||||
*/
|
||||
int getIndex();
|
||||
|
||||
/**
|
||||
* Gets the composition of this NPC.
|
||||
*
|
||||
* @return the composition
|
||||
*/
|
||||
NPCComposition getComposition();
|
||||
|
||||
/**
|
||||
* Get the composition for this NPC and transform it if required
|
||||
*
|
||||
* @return
|
||||
* @return the transformed NPC
|
||||
*/
|
||||
NPCComposition getTransformedComposition();
|
||||
}
|
||||
|
||||
@@ -24,29 +24,94 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents the template of a specific NPC type.
|
||||
*/
|
||||
public interface NPCComposition
|
||||
{
|
||||
/**
|
||||
* Gets the name of the NPC.
|
||||
*
|
||||
* @return the name
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Gets the model IDs that compose this NPC.
|
||||
*
|
||||
* @return the NPCs model IDs
|
||||
*/
|
||||
int[] getModels();
|
||||
|
||||
/**
|
||||
* Gets an array of possible right-click menu actions that can be
|
||||
* performed on the NPC.
|
||||
*
|
||||
* @return the menu actions
|
||||
*/
|
||||
String[] getActions();
|
||||
|
||||
/**
|
||||
* Gets whether the NPC can be clicked.
|
||||
*
|
||||
* @return true if the NPC can be clicked, false otherwise
|
||||
*/
|
||||
boolean isClickable();
|
||||
|
||||
/**
|
||||
* Gets whether the NPC is visible on the mini-map.
|
||||
*
|
||||
* @return the mini-map visible state
|
||||
*/
|
||||
boolean isMinimapVisable();
|
||||
|
||||
/**
|
||||
* Gets whether the NPC is visible.
|
||||
*
|
||||
* @return the visible state
|
||||
*/
|
||||
boolean isVisable();
|
||||
|
||||
/**
|
||||
* Gets the ID of the NPC.
|
||||
*
|
||||
* @return the ID of the NPC
|
||||
* @see NpcID
|
||||
*/
|
||||
int getId();
|
||||
|
||||
/**
|
||||
* Gets the combat level of the NPC.
|
||||
*
|
||||
* @return the combat level, -1 if none
|
||||
*/
|
||||
int getCombatLevel();
|
||||
|
||||
/**
|
||||
* Gets the configuration data for the NPC.
|
||||
*
|
||||
* @return the configuration data
|
||||
*/
|
||||
int[] getConfigs();
|
||||
|
||||
|
||||
/**
|
||||
* Transforms this NPC into a new state, which may have a different ID.
|
||||
*
|
||||
* @return the transformed composition
|
||||
*/
|
||||
NPCComposition transform();
|
||||
|
||||
/**
|
||||
* Gets the size of the NPC.
|
||||
*
|
||||
* @return the NPCs size
|
||||
*/
|
||||
int getSize();
|
||||
|
||||
/**
|
||||
* Gets the displayed overhead icon of the NPC.
|
||||
*
|
||||
* @return the overhead icon
|
||||
*/
|
||||
HeadIcon getOverheadIcon();
|
||||
}
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents a chat entity that has a name.
|
||||
*/
|
||||
public interface Nameable extends Comparable
|
||||
{
|
||||
}
|
||||
|
||||
@@ -24,11 +24,29 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents a doubly linked node.
|
||||
*/
|
||||
public interface Node
|
||||
{
|
||||
/**
|
||||
* Gets the next node.
|
||||
*
|
||||
* @return the next node
|
||||
*/
|
||||
Node getNext();
|
||||
|
||||
/**
|
||||
* Gets the previous node.
|
||||
*
|
||||
* @return the previous node
|
||||
*/
|
||||
Node getPrevious();
|
||||
|
||||
/**
|
||||
* Gets the hash value of the node.
|
||||
*
|
||||
* @return the hash value
|
||||
*/
|
||||
long getHash();
|
||||
}
|
||||
|
||||
@@ -24,17 +24,52 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents the template of a specific object.
|
||||
*/
|
||||
public interface ObjectComposition
|
||||
{
|
||||
/**
|
||||
* Gets the name of the object.
|
||||
*
|
||||
* @return the object name
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Gets an array of possible right-click menu actions that can be
|
||||
* performed on the object.
|
||||
*
|
||||
* @return the menu actions
|
||||
*/
|
||||
String[] getActions();
|
||||
|
||||
/**
|
||||
* Gets the map scene ID for the object.
|
||||
*
|
||||
* @return the scene ID
|
||||
*/
|
||||
int getMapSceneId();
|
||||
|
||||
/**
|
||||
* Gets the map icon ID for the object.
|
||||
*
|
||||
* @return the map icon ID
|
||||
*/
|
||||
int getMapIconId();
|
||||
|
||||
/**
|
||||
* Gets IDs for objects that are considered fakes of this object,
|
||||
* such as barrows walls.
|
||||
*
|
||||
* @return the impostor IDs
|
||||
*/
|
||||
int[] getImpostorIds();
|
||||
|
||||
/**
|
||||
* Gets the impostor composition for this object.
|
||||
*
|
||||
* @return the impostor
|
||||
*/
|
||||
ObjectComposition getImpostor();
|
||||
}
|
||||
|
||||
@@ -24,7 +24,13 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Utility class containing ASM opcodes used by the RuneLite client.
|
||||
*/
|
||||
public class Opcodes
|
||||
{
|
||||
/**
|
||||
* RuneLite execution opcode used to inject scripts.
|
||||
*/
|
||||
public static final int RUNELITE_EXECUTE = 6599;
|
||||
}
|
||||
|
||||
@@ -40,6 +40,10 @@ import net.runelite.api.model.Jarvis;
|
||||
import net.runelite.api.model.Triangle;
|
||||
import net.runelite.api.model.Vertex;
|
||||
|
||||
/**
|
||||
* A utility class containing methods to help with conversion between
|
||||
* in-game features to canvas areas.
|
||||
*/
|
||||
public class Perspective
|
||||
{
|
||||
private static final double UNIT = Math.PI / 1024d; // How much of the circle each unit of SINE/COSINE is
|
||||
@@ -65,7 +69,7 @@ public class Perspective
|
||||
* Translates two-dimensional ground coordinates within the 3D world to
|
||||
* their corresponding coordinates on the game screen.
|
||||
*
|
||||
* @param client
|
||||
* @param client the game client
|
||||
* @param x ground coordinate on the x axis
|
||||
* @param y ground coordinate on the y axis
|
||||
* @param plane ground plane on the z axis
|
||||
@@ -81,7 +85,7 @@ public class Perspective
|
||||
* Translates two-dimensional ground coordinates within the 3D world to
|
||||
* their corresponding coordinates on the game screen.
|
||||
*
|
||||
* @param client
|
||||
* @param client the game client
|
||||
* @param x ground coordinate on the x axis
|
||||
* @param y ground coordinate on the y axis
|
||||
* @param plane ground plane on the z axis
|
||||
@@ -97,12 +101,14 @@ public class Perspective
|
||||
/**
|
||||
* Translates two-dimensional ground coordinates within the 3D world to
|
||||
* their corresponding coordinates on the game screen. Calculating heights
|
||||
* based on the coordinates of the tile provided, rather than the world coordinates
|
||||
* based on the coordinates of the tile provided, rather than the world
|
||||
* coordinates.
|
||||
* <p>
|
||||
* Using the position of each vertex, rather than the location of the
|
||||
* object, to determine the height of each vertex causes the mesh to be
|
||||
* vertically warped, based on the terrain below.
|
||||
*
|
||||
* Using the position of each vertex, rather than the location of the object, to determine the
|
||||
* height of each vertex causes the mesh to be vertically warped, based on the terrain below
|
||||
*
|
||||
* @param client
|
||||
* @param client the game client
|
||||
* @param x ground coordinate on the x axis
|
||||
* @param y ground coordinate on the y axis
|
||||
* @param plane ground plane on the z axis
|
||||
@@ -119,12 +125,14 @@ public class Perspective
|
||||
/**
|
||||
* Translates two-dimensional ground coordinates within the 3D world to
|
||||
* their corresponding coordinates on the game screen. Calculating heights
|
||||
* based on the coordinates of the tile provided, rather than the world coordinates
|
||||
* based on the coordinates of the tile provided, rather than the world
|
||||
* coordinates.
|
||||
* <p>
|
||||
* Using the position of each vertex, rather than the location of the
|
||||
* object, to determine the height of each vertex causes the mesh to be
|
||||
* vertically warped, based on the terrain below.
|
||||
*
|
||||
* Using the position of each vertex, rather than the location of the object, to determine the
|
||||
* height of each vertex causes the mesh to be vertically warped, based on the terrain below
|
||||
*
|
||||
* @param client
|
||||
* @param client the game client
|
||||
* @param x ground coordinate on the x axis
|
||||
* @param y ground coordinate on the y axis
|
||||
* @param plane ground plane on the z axis
|
||||
@@ -174,7 +182,7 @@ public class Perspective
|
||||
* Translates two-dimensional ground coordinates within the 3D world to
|
||||
* their corresponding coordinates on the Minimap.
|
||||
*
|
||||
* @param client
|
||||
* @param client the game client
|
||||
* @param x ground coordinate on the x axis
|
||||
* @param y ground coordinate on the y axis
|
||||
* @return a {@link Point} on screen corresponding to the position in
|
||||
@@ -189,7 +197,7 @@ public class Perspective
|
||||
* Translates two-dimensional ground coordinates within the 3D world to
|
||||
* their corresponding coordinates on the Minimap.
|
||||
*
|
||||
* @param client
|
||||
* @param client the game client
|
||||
* @param x ground coordinate on the x axis
|
||||
* @param y ground coordinate on the y axis
|
||||
* @param distance max distance from local player to minimap point
|
||||
@@ -228,7 +236,7 @@ public class Perspective
|
||||
/**
|
||||
* Calculates the above ground height of a tile point.
|
||||
*
|
||||
* @param client
|
||||
* @param client the game client
|
||||
* @param localX the ground coordinate on the x axis
|
||||
* @param localY the ground coordinate on the y axis
|
||||
* @param plane the client plane/ground level
|
||||
@@ -262,7 +270,7 @@ public class Perspective
|
||||
/**
|
||||
* Calculates a tile polygon from offset worldToScreen() points.
|
||||
*
|
||||
* @param client
|
||||
* @param client the game client
|
||||
* @param localLocation local location of the tile
|
||||
* @return a {@link Polygon} on screen corresponding to the given
|
||||
* localLocation.
|
||||
@@ -275,10 +283,9 @@ public class Perspective
|
||||
/**
|
||||
* Returns a polygon representing an area.
|
||||
*
|
||||
* @param client
|
||||
* @param localLocation Center location of the AoE
|
||||
* @param size size of the area. Ex. Lizardman Shaman AoE is a 3x3, so
|
||||
* size = 3
|
||||
* @param client the game client
|
||||
* @param localLocation the center location of the AoE
|
||||
* @param size the size of the area (ie. 3x3 AoE evaluates to size 3)
|
||||
* @return a polygon representing the tiles in the area
|
||||
*/
|
||||
public static Polygon getCanvasTileAreaPoly(@Nonnull Client client, @Nonnull LocalPoint localLocation, int size)
|
||||
@@ -322,8 +329,8 @@ public class Perspective
|
||||
/**
|
||||
* Calculates text position and centers depending on string length.
|
||||
*
|
||||
* @param client
|
||||
* @param graphics
|
||||
* @param client the game client
|
||||
* @param graphics the game graphics
|
||||
* @param localLocation local location of the tile
|
||||
* @param text string for width measurement
|
||||
* @param zOffset offset from ground plane
|
||||
@@ -357,8 +364,8 @@ public class Perspective
|
||||
/**
|
||||
* Calculates image position and centers depending on image size.
|
||||
*
|
||||
* @param client
|
||||
* @param graphics
|
||||
* @param client the game client
|
||||
* @param graphics the game graphics
|
||||
* @param localLocation local location of the tile
|
||||
* @param image image for size measurement
|
||||
* @param zOffset offset from ground plane
|
||||
@@ -390,7 +397,7 @@ public class Perspective
|
||||
/**
|
||||
* Calculates image position and centers depending on image size.
|
||||
*
|
||||
* @param client
|
||||
* @param client the game client
|
||||
* @param localLocation local location of the tile
|
||||
* @param image image for size measurement
|
||||
* @return a {@link Point} on screen corresponding to the given
|
||||
@@ -399,8 +406,7 @@ public class Perspective
|
||||
public static Point getMiniMapImageLocation(
|
||||
@Nonnull Client client,
|
||||
@Nonnull LocalPoint localLocation,
|
||||
@Nonnull BufferedImage image
|
||||
)
|
||||
@Nonnull BufferedImage image)
|
||||
{
|
||||
Point p = Perspective.worldToMiniMap(client, localLocation.getX(), localLocation.getY());
|
||||
|
||||
@@ -418,21 +424,19 @@ public class Perspective
|
||||
/**
|
||||
* Calculates sprite position and centers depending on sprite size.
|
||||
*
|
||||
* @param client
|
||||
* @param graphics
|
||||
* @param client the game client
|
||||
* @param graphics the game graphics
|
||||
* @param localLocation local location of the tile
|
||||
* @param sprite SpritePixel for size measurement
|
||||
* @param zOffset offset from ground plane
|
||||
* @return a {@link Point} on screen corresponding to the given
|
||||
* localLocation.
|
||||
* @return a {@link Point} on screen corresponding to the given localLocation.
|
||||
*/
|
||||
public static Point getCanvasSpriteLocation(
|
||||
@Nonnull Client client,
|
||||
@Nonnull Graphics2D graphics,
|
||||
@Nonnull LocalPoint localLocation,
|
||||
@Nonnull SpritePixels sprite,
|
||||
int zOffset
|
||||
)
|
||||
int zOffset)
|
||||
{
|
||||
int plane = client.getPlane();
|
||||
|
||||
@@ -450,17 +454,18 @@ public class Perspective
|
||||
}
|
||||
|
||||
/**
|
||||
* You don't want this. Use {@link TileObject#getClickbox()} instead
|
||||
* You don't want this. Use {@link TileObject#getClickbox()} instead.
|
||||
* <p>
|
||||
* Get the on-screen clickable area of {@code model} as though it's for the
|
||||
* object on the tile at ({@code tileX}, {@code tileY}) and rotated to
|
||||
* angle {@code orientation}.
|
||||
*
|
||||
* Get the on-screen clickable area of {@code model} as though it's for the object on the tile at
|
||||
* ({@code tileX}, {@code tileY}) and rotated to angle {@code orientation}
|
||||
*
|
||||
* @param client
|
||||
* @param client the game client
|
||||
* @param model the model to calculate a clickbox for
|
||||
* @param orientation the orientation of the model (0-2048, where 0 is north)
|
||||
* @param tileX the X coordinate of the tile that the object using the model is on
|
||||
* @param tileY the Y coordinate of the tile that the object using the model is on
|
||||
* @return the clickable area of {@code model}, rotated to angle {@code orientation}, at the height of tile ({@code tileX}, {@code tileY})
|
||||
* @param tileX the x-axis coordinate of the tile
|
||||
* @param tileY the y-axis coordinate of the tile
|
||||
* @return the clickable area of the model
|
||||
*/
|
||||
public static Area getClickbox(@Nonnull Client client, Model model, int orientation, int tileX, int tileY)
|
||||
{
|
||||
@@ -683,8 +688,8 @@ public class Perspective
|
||||
/**
|
||||
* Calculates text position and centers on minimap depending on string length.
|
||||
*
|
||||
* @param client
|
||||
* @param graphics
|
||||
* @param client the game client
|
||||
* @param graphics the game graphics
|
||||
* @param localLocation local location of the tile
|
||||
* @param text string for width measurement
|
||||
* @return a {@link Point} on screen corresponding to the given
|
||||
@@ -694,8 +699,7 @@ public class Perspective
|
||||
@Nonnull Client client,
|
||||
@Nonnull Graphics2D graphics,
|
||||
@Nonnull LocalPoint localLocation,
|
||||
@Nonnull String text
|
||||
)
|
||||
@Nonnull String text)
|
||||
{
|
||||
Point p = Perspective.worldToMiniMap(client, localLocation.getX(), localLocation.getY());
|
||||
|
||||
|
||||
@@ -26,20 +26,54 @@ package net.runelite.api;
|
||||
|
||||
import java.awt.Polygon;
|
||||
|
||||
/**
|
||||
* Represents a player entity in the game.
|
||||
*/
|
||||
public interface Player extends Actor
|
||||
{
|
||||
@Override
|
||||
int getCombatLevel();
|
||||
|
||||
/**
|
||||
* Gets the composition of this player.
|
||||
*
|
||||
* @return the composition
|
||||
*/
|
||||
PlayerComposition getPlayerComposition();
|
||||
|
||||
/**
|
||||
* Gets the polygons that make up the players model.
|
||||
*
|
||||
* @return the model polygons
|
||||
*/
|
||||
Polygon[] getPolygons();
|
||||
|
||||
/**
|
||||
* Gets the current team cape team number the player is on.
|
||||
*
|
||||
* @return team number, or 0 if not on any team
|
||||
*/
|
||||
int getTeam();
|
||||
|
||||
/**
|
||||
* Checks whether this player is a member of the same clan as
|
||||
* the local player.
|
||||
*
|
||||
* @return true if the player is a clan member, false otherwise
|
||||
*/
|
||||
boolean isClanMember();
|
||||
|
||||
/**
|
||||
* Checks whether this player is a friend of the local player.
|
||||
*
|
||||
* @return true if the player is a friend, false otherwise
|
||||
*/
|
||||
boolean isFriend();
|
||||
|
||||
/**
|
||||
* Gets the displayed overhead icon of the player.
|
||||
*
|
||||
* @return the overhead icon
|
||||
*/
|
||||
HeadIcon getOverheadIcon();
|
||||
}
|
||||
|
||||
@@ -26,18 +26,35 @@ package net.runelite.api;
|
||||
|
||||
import net.runelite.api.kit.KitType;
|
||||
|
||||
/**
|
||||
* Represents the template of a player.
|
||||
*/
|
||||
public interface PlayerComposition
|
||||
{
|
||||
/**
|
||||
* Get equipment ids. If id is ≥ 256 && < 512 then
|
||||
* subtract 256 and the id is a kit definition. If the id is ≥ 512
|
||||
* then subtract 512 and the id is an item id.
|
||||
* Gets an array of IDs related to equipment slots.
|
||||
* <p>
|
||||
* If the ID for a specific slot is between 256 and 512, subtracting
|
||||
* 256 will result in the kit ID. Values above 512 indicate an item
|
||||
* and can be converted to the item ID by subtracting 512.
|
||||
*
|
||||
* @return
|
||||
* @return the equipment IDs
|
||||
*/
|
||||
int[] getEquipmentIds();
|
||||
|
||||
/**
|
||||
* Gets the equipment ID of a particular slot.
|
||||
*
|
||||
* @param type equipment slot
|
||||
* @return the equipment ID
|
||||
*/
|
||||
int getEquipmentId(KitType type);
|
||||
|
||||
/**
|
||||
* Gets the kit ID of a particular slot.
|
||||
*
|
||||
* @param type equipment slot
|
||||
* @return the kit ID
|
||||
*/
|
||||
int getKitId(KitType type);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* A two-dimensional coordinate on the canvas.
|
||||
*/
|
||||
public class Point
|
||||
{
|
||||
private final int x;
|
||||
@@ -41,21 +44,31 @@ public class Point
|
||||
return "Point{" + "x=" + x + ", y=" + y + '}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the x-axis coordinate of the point.
|
||||
*
|
||||
* @return the x-axis coordinate
|
||||
*/
|
||||
public int getX()
|
||||
{
|
||||
return x;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the y-axis coordinate of the point.
|
||||
*
|
||||
* @return the y-axis coordinate
|
||||
*/
|
||||
public int getY()
|
||||
{
|
||||
return y;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the distance from this point to another point
|
||||
* Gets the distance between this point and another.
|
||||
*
|
||||
* @param other
|
||||
* @return
|
||||
* @param other other point
|
||||
* @return the distance
|
||||
*/
|
||||
public int distanceTo(Point other)
|
||||
{
|
||||
|
||||
@@ -24,45 +24,140 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* An enumeration of different prayer spells.
|
||||
*/
|
||||
public enum Prayer
|
||||
{
|
||||
/**
|
||||
* Thick Skin (Level 1, Defence).
|
||||
*/
|
||||
THICK_SKIN(Varbits.PRAYER_THICK_SKIN),
|
||||
/**
|
||||
* Burst of Strength (Level 4, Strength).
|
||||
*/
|
||||
BURST_OF_STRENGTH(Varbits.PRAYER_BURST_OF_STRENGTH),
|
||||
/**
|
||||
* Clarity of Thought (Level 7, Attack).
|
||||
*/
|
||||
CLARITY_OF_THOUGHT(Varbits.PRAYER_CLARITY_OF_THOUGHT),
|
||||
/**
|
||||
* Sharp Eye (Level 8, Ranging).
|
||||
*/
|
||||
SHARP_EYE(Varbits.PRAYER_SHARP_EYE),
|
||||
/**
|
||||
* Mystic Will (Level 9, Magic).
|
||||
*/
|
||||
MYSTIC_WILL(Varbits.PRAYER_MYSTIC_WILL),
|
||||
/**
|
||||
* Rock Skin (Level 10, Defence).
|
||||
*/
|
||||
ROCK_SKIN(Varbits.PRAYER_ROCK_SKIN),
|
||||
/**
|
||||
* Superhuman Strength (Level 13, Strength).
|
||||
*/
|
||||
SUPERHUMAN_STRENGTH(Varbits.PRAYER_SUPERHUMAN_STRENGTH),
|
||||
/**
|
||||
* Improved Reflexes (Level 16, Attack).
|
||||
*/
|
||||
IMPROVED_REFLEXES(Varbits.PRAYER_IMPROVED_REFLEXES),
|
||||
/**
|
||||
* Rapid Restore (Level 19, Stats).
|
||||
*/
|
||||
RAPID_RESTORE(Varbits.PRAYER_RAPID_RESTORE),
|
||||
/**
|
||||
* Rapid Heal (Level 22, Hitpoints).
|
||||
*/
|
||||
RAPID_HEAL(Varbits.PRAYER_RAPID_HEAL),
|
||||
/**
|
||||
* Protect Item (Level 25).
|
||||
*/
|
||||
PROTECT_ITEM(Varbits.PRAYER_PROTECT_ITEM),
|
||||
/**
|
||||
* Hawk Eye (Level 26, Ranging).
|
||||
*/
|
||||
HAWK_EYE(Varbits.PRAYER_HAWK_EYE),
|
||||
/**
|
||||
* Mystic Lore (Level 27, Magic).
|
||||
*/
|
||||
MYSTIC_LORE(Varbits.PRAYER_MYSTIC_LORE),
|
||||
/**
|
||||
* Steel Skin (Level 28, Defence).
|
||||
*/
|
||||
STEEL_SKIN(Varbits.PRAYER_STEEL_SKIN),
|
||||
/**
|
||||
* Ultimate Strength (Level 31, Strength).
|
||||
*/
|
||||
ULTIMATE_STRENGTH(Varbits.PRAYER_ULTIMATE_STRENGTH),
|
||||
/**
|
||||
* Incredible Reflexes (Level 34, Attack).
|
||||
*/
|
||||
INCREDIBLE_REFLEXES(Varbits.PRAYER_INCREDIBLE_REFLEXES),
|
||||
/**
|
||||
* Protect from Magic (Level 37).
|
||||
*/
|
||||
PROTECT_FROM_MAGIC(Varbits.PRAYER_PROTECT_FROM_MAGIC),
|
||||
/**
|
||||
* Protect from Missiles (Level 40).
|
||||
*/
|
||||
PROTECT_FROM_MISSILES(Varbits.PRAYER_PROTECT_FROM_MISSILES),
|
||||
/**
|
||||
* Protect from Melee (Level 43).
|
||||
*/
|
||||
PROTECT_FROM_MELEE(Varbits.PRAYER_PROTECT_FROM_MELEE),
|
||||
/**
|
||||
* Eagle Eye (Level 44, Ranging).
|
||||
*/
|
||||
EAGLE_EYE(Varbits.PRAYER_EAGLE_EYE),
|
||||
/**
|
||||
* Mystic Might (Level 45, Magic).
|
||||
*/
|
||||
MYSTIC_MIGHT(Varbits.PRAYER_MYSTIC_MIGHT),
|
||||
/**
|
||||
* Retribution (Level 46).
|
||||
*/
|
||||
RETRIBUTION(Varbits.PRAYER_RETRIBUTION),
|
||||
/**
|
||||
* Redemption (Level 49).
|
||||
*/
|
||||
REDEMPTION(Varbits.PRAYER_REDEMPTION),
|
||||
/**
|
||||
* Smite (Level 52).
|
||||
*/
|
||||
SMITE(Varbits.PRAYER_SMITE),
|
||||
CHIVALRY(Varbits.PRAYER_CHIVALRY),
|
||||
PIETY(Varbits.PRAYER_PIETY),
|
||||
/**
|
||||
* Preserve (Level 55).
|
||||
*/
|
||||
PRESERVE(Varbits.PRAYER_PRESERVE),
|
||||
/**
|
||||
* Chivalry (Level 60, Defence/Strength/Attack).
|
||||
*/
|
||||
CHIVALRY(Varbits.PRAYER_CHIVALRY),
|
||||
/**
|
||||
* Piety (Level 70, Defence/Strength/Attack).
|
||||
*/
|
||||
PIETY(Varbits.PRAYER_PIETY),
|
||||
/**
|
||||
* Rigour (Level 74, Ranging/Damage/Defence).
|
||||
*/
|
||||
RIGOUR(Varbits.PRAYER_RIGOUR),
|
||||
/**
|
||||
* Augury (Level 77, Magic/Magic Def./Defence).
|
||||
*/
|
||||
AUGURY(Varbits.PRAYER_AUGURY);
|
||||
|
||||
|
||||
private final Varbits varbit;
|
||||
|
||||
private Prayer(Varbits varbit)
|
||||
Prayer(Varbits varbit)
|
||||
{
|
||||
this.varbit = varbit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the varbit that stores whether the prayer is active or not.
|
||||
*
|
||||
* @return the prayer active varbit
|
||||
*/
|
||||
public Varbits getVarbit()
|
||||
{
|
||||
return varbit;
|
||||
|
||||
@@ -24,9 +24,22 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Stores the clients persisting preferences.
|
||||
*/
|
||||
public interface Preferences
|
||||
{
|
||||
/**
|
||||
* Gets the remembered login username.
|
||||
*
|
||||
* @return the remembered username
|
||||
*/
|
||||
String getRememberedUsername();
|
||||
|
||||
/**
|
||||
* Sets the remembered login username.
|
||||
*
|
||||
* @param username the new remembered username
|
||||
*/
|
||||
void setRememberedUsername(String username);
|
||||
}
|
||||
|
||||
@@ -24,43 +24,146 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents a projectile entity (ie. cannonball, arrow).
|
||||
*/
|
||||
public interface Projectile extends Renderable
|
||||
{
|
||||
/**
|
||||
* Gets the ID of the projectile.
|
||||
*
|
||||
* @return the projectile ID
|
||||
* @see ProjectileID
|
||||
*/
|
||||
int getId();
|
||||
|
||||
/**
|
||||
* Gets the actor that is targeted by this projectile.
|
||||
*
|
||||
* @return the target actor, or null if this projectile is an AoE attack
|
||||
*/
|
||||
Actor getInteracting();
|
||||
|
||||
/**
|
||||
* Gets the original x-axis coordinate that this projectile started from.
|
||||
*
|
||||
* @return the original coordinate
|
||||
*/
|
||||
int getX1();
|
||||
|
||||
/**
|
||||
* Gets the original y-axis coordinate that this projectile started from.
|
||||
*
|
||||
* @return the original coordinate
|
||||
*/
|
||||
int getY1();
|
||||
|
||||
/**
|
||||
* Gets the plane that the projectile is on.
|
||||
*
|
||||
* @return the plane
|
||||
*/
|
||||
int getFloor();
|
||||
|
||||
/**
|
||||
* Gets the height of the projectile.
|
||||
*
|
||||
* @return the height
|
||||
*/
|
||||
int getHeight();
|
||||
|
||||
/**
|
||||
* Gets the ending height of the projectile.
|
||||
*
|
||||
* @return the ending height
|
||||
*/
|
||||
int getEndHeight();
|
||||
|
||||
/**
|
||||
* Gets the game cycle that the projectile begun movement at.
|
||||
*
|
||||
* @return the start game cycle
|
||||
*/
|
||||
int getStartMovementCycle();
|
||||
|
||||
/**
|
||||
* Gets the game cycle that the projectile will reach its target at.
|
||||
*
|
||||
* @return the end game cycle
|
||||
*/
|
||||
int getEndCycle();
|
||||
|
||||
/**
|
||||
* Gets the remaining game cycles until the projectile reaches its
|
||||
* target and despawns.
|
||||
*
|
||||
* @return the remaining game cycles
|
||||
*/
|
||||
int getRemainingCycles();
|
||||
|
||||
/**
|
||||
* Gets the slope of the projectile.
|
||||
* <p>
|
||||
* This value indicates how much arc the projectile can have. Projectiles
|
||||
* with larger slopes have a more noticeable arc when thrown.
|
||||
*
|
||||
* @return the slope of the projectile
|
||||
*/
|
||||
int getSlope();
|
||||
|
||||
/**
|
||||
* Gets the starting height of the projectile.
|
||||
*
|
||||
* @return the starting height
|
||||
*/
|
||||
int getStartHeight();
|
||||
|
||||
/**
|
||||
* Gets the current x-axis coordinate of the projectile.
|
||||
*
|
||||
* @return the x-axis coordinate
|
||||
*/
|
||||
double getX();
|
||||
|
||||
/**
|
||||
* Gets the current y-axis coordinate of the projectile.
|
||||
*
|
||||
* @return the y-axis coordinate
|
||||
*/
|
||||
double getY();
|
||||
|
||||
/**
|
||||
* Gets the current z-axis coordinate of the projectile.
|
||||
*
|
||||
* @return the z-axis coordinate
|
||||
*/
|
||||
double getZ();
|
||||
|
||||
/**
|
||||
* Gets the scalar quantity (speed) at which the projectile is travelling.
|
||||
*
|
||||
* @return the scalar quantity
|
||||
*/
|
||||
double getScalar();
|
||||
|
||||
/**
|
||||
* Gets the x-axis velocity of the projectile.
|
||||
*
|
||||
* @return the x-axis velocity
|
||||
*/
|
||||
double getVelocityX();
|
||||
|
||||
/**
|
||||
* Gets the y-axis velocity of the projectile.
|
||||
*
|
||||
* @return the y-axis velocity
|
||||
*/
|
||||
double getVelocityY();
|
||||
|
||||
/**
|
||||
* Gets the z-axis velocity of the projectile.
|
||||
*
|
||||
* @return the z-axis velocity
|
||||
*/
|
||||
double getVelocityZ();
|
||||
}
|
||||
|
||||
@@ -24,6 +24,11 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Utility class used for mapping projectile IDs.
|
||||
* <p>
|
||||
* Note: This class is not complete and may be missing mapped IDs.
|
||||
*/
|
||||
public class ProjectileID
|
||||
{
|
||||
public static final int CANNONBALL = 53;
|
||||
|
||||
@@ -26,6 +26,12 @@ package net.runelite.api;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/**
|
||||
* A query to search the game for objects that match.
|
||||
*
|
||||
* @param <EntityType> the returned object type
|
||||
* @param <QueryType> the query type
|
||||
*/
|
||||
public abstract class Query<EntityType, QueryType>
|
||||
{
|
||||
protected Predicate<EntityType> predicate = x -> true;
|
||||
@@ -34,8 +40,22 @@ public abstract class Query<EntityType, QueryType>
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes the query and filters through possible objects, returning only
|
||||
* those who evaluate true using {@link #predicate}.
|
||||
*
|
||||
* @param client the game client
|
||||
* @return the matching objects
|
||||
*/
|
||||
public abstract EntityType[] result(Client client);
|
||||
|
||||
/**
|
||||
* Constructs and returns a predicate that will evaluate {@link #predicate}
|
||||
* and the passed value.
|
||||
*
|
||||
* @param other the passed predicate
|
||||
* @return the combined predicate
|
||||
*/
|
||||
protected Predicate<EntityType> and(Predicate<EntityType> other)
|
||||
{
|
||||
if (predicate == null)
|
||||
|
||||
@@ -24,7 +24,17 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents a region of chunks.
|
||||
* <p>
|
||||
* A region is an area that contains 8x8 chunks on the map.
|
||||
*/
|
||||
public interface Region
|
||||
{
|
||||
/**
|
||||
* Gets the tiles in this region.
|
||||
*
|
||||
* @return the regions tile
|
||||
*/
|
||||
Tile[][][] getTiles();
|
||||
}
|
||||
|
||||
@@ -26,17 +26,50 @@ package net.runelite.api;
|
||||
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
|
||||
/**
|
||||
* Represents an overview of the currently rendered world map.
|
||||
*/
|
||||
public interface RenderOverview
|
||||
{
|
||||
/**
|
||||
* Gets the current position of the local player on the world map.
|
||||
*
|
||||
* @return the world map position
|
||||
*/
|
||||
Point getWorldMapPosition();
|
||||
|
||||
/**
|
||||
* Gets the current zoom level of the world map.
|
||||
*
|
||||
* @return the world map zoon
|
||||
*/
|
||||
float getWorldMapZoom();
|
||||
|
||||
/**
|
||||
* Sets the target position of the world map.
|
||||
*
|
||||
* @param worldPoint the new target position
|
||||
*/
|
||||
void setWorldMapPositionTarget(WorldPoint worldPoint);
|
||||
|
||||
/**
|
||||
* Gets the world map manager.
|
||||
*
|
||||
* @return the world map manager
|
||||
*/
|
||||
WorldMapManager getWorldMapManager();
|
||||
|
||||
/**
|
||||
* Initializes the world map with the provided data.
|
||||
*
|
||||
* @param var1 the new map data
|
||||
*/
|
||||
void initializeWorldMap(WorldMapData var1);
|
||||
|
||||
/**
|
||||
* The data represented by the render.
|
||||
*
|
||||
* @return the map data
|
||||
*/
|
||||
WorldMapData getWorldMapData();
|
||||
}
|
||||
|
||||
@@ -24,7 +24,15 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents an object that can be rendered.
|
||||
*/
|
||||
public interface Renderable extends Node
|
||||
{
|
||||
/**
|
||||
* Gets the model of the object.
|
||||
*
|
||||
* @return the model
|
||||
*/
|
||||
Model getModel();
|
||||
}
|
||||
|
||||
@@ -24,13 +24,36 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents the model of a tile in the current scene.
|
||||
*/
|
||||
public interface SceneTileModel
|
||||
{
|
||||
/**
|
||||
* Gets the underlay color of the tile.
|
||||
*
|
||||
* @return the underlay color
|
||||
*/
|
||||
int getModelUnderlay();
|
||||
|
||||
/**
|
||||
* Gets the overlay color of the tile.
|
||||
*
|
||||
* @return the overlay color
|
||||
*/
|
||||
int getModelOverlay();
|
||||
|
||||
/**
|
||||
* Gets the shape mask type.
|
||||
*
|
||||
* @return the shape mask
|
||||
*/
|
||||
int getShape();
|
||||
|
||||
/**
|
||||
* Gets the rotation of the tile.
|
||||
*
|
||||
* @return the rotation
|
||||
*/
|
||||
int getRotation();
|
||||
}
|
||||
|
||||
@@ -24,7 +24,15 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents the paint of a tile in the current scene.
|
||||
*/
|
||||
public interface SceneTilePaint
|
||||
{
|
||||
/**
|
||||
* Gets the RGB value of the paint.
|
||||
*
|
||||
* @return the paint RGB
|
||||
*/
|
||||
int getRBG();
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* An enumeration of skills that a player can level.
|
||||
*/
|
||||
public enum Skill
|
||||
{
|
||||
ATTACK("Attack"),
|
||||
@@ -50,6 +53,9 @@ public enum Skill
|
||||
RUNECRAFT("Runecraft"),
|
||||
HUNTER("Hunter"),
|
||||
CONSTRUCTION("Construction"),
|
||||
/**
|
||||
* The level of all skills added together.
|
||||
*/
|
||||
OVERALL("Overall");
|
||||
|
||||
private final String name;
|
||||
@@ -59,6 +65,11 @@ public enum Skill
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the name of the skill.
|
||||
*
|
||||
* @return the skill name
|
||||
*/
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Utility class used for mapping sound effect IDs.
|
||||
*/
|
||||
public final class SoundEffectID
|
||||
{
|
||||
public final static int UI_BOOP = 2266;
|
||||
@@ -51,7 +54,7 @@ public final class SoundEffectID
|
||||
public final static int SMITH_ANVIL_TONK = 3791;
|
||||
|
||||
/**
|
||||
* Used for random event NPCs spawning, and the imp teleport
|
||||
* Used for random event NPCs spawning, and the imp teleport.
|
||||
*/
|
||||
public final static int NPC_TELEPORT_WOOSH = 1930;
|
||||
|
||||
|
||||
@@ -26,29 +26,54 @@ package net.runelite.api;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
/**
|
||||
* Represents data about the pixels of a sprite image.
|
||||
*/
|
||||
public interface SpritePixels
|
||||
{
|
||||
int DEFAULT_SHADOW_COLOR = 3153952;
|
||||
|
||||
/**
|
||||
* Draws the pixels at the given coordinates on the canvas.
|
||||
*
|
||||
* @param x the x-axis coordinate
|
||||
* @param y the y-axis coordinate
|
||||
*/
|
||||
void drawAt(int x, int y);
|
||||
|
||||
/**
|
||||
* Gets the width of the sprite image in pixels.
|
||||
*
|
||||
* @return the width
|
||||
*/
|
||||
int getWidth();
|
||||
|
||||
/**
|
||||
* Gets the height of the sprite image in pixels.
|
||||
*
|
||||
* @return the height
|
||||
*/
|
||||
int getHeight();
|
||||
|
||||
/**
|
||||
* Gets an array of all pixels data in the sprite.
|
||||
*
|
||||
* @return the pixel data
|
||||
*/
|
||||
int[] getPixels();
|
||||
|
||||
/**
|
||||
* Covert the SpritePixels to a BufferedImage
|
||||
* Converts the sprite into a BufferedImage.
|
||||
*
|
||||
* @return
|
||||
* @return the resulting BufferedImage
|
||||
*/
|
||||
BufferedImage toBufferedImage();
|
||||
|
||||
|
||||
/**
|
||||
* Writes the contents of the SpritePixels to the BufferedImage.
|
||||
* Width and Height must match
|
||||
* Writes the contents of the sprite to the given BufferedImage.
|
||||
*
|
||||
* @param img the passsed buffered image
|
||||
* @throws IllegalArgumentException if the width or height do not match
|
||||
*/
|
||||
void toBufferedImage(BufferedImage img);
|
||||
void toBufferedImage(BufferedImage img) throws IllegalArgumentException;
|
||||
}
|
||||
|
||||
@@ -28,41 +28,101 @@ import java.util.List;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
|
||||
/**
|
||||
* Represents a tile in the game.
|
||||
*/
|
||||
public interface Tile
|
||||
{
|
||||
/**
|
||||
* Get the decorative object for this tile.
|
||||
* Gets the decoration on the tile.
|
||||
*
|
||||
* @return
|
||||
* @return the tile decoration
|
||||
*/
|
||||
DecorativeObject getDecorativeObject();
|
||||
|
||||
/**
|
||||
* Gets all game objects on the tile.
|
||||
*
|
||||
* @return the game objects
|
||||
*/
|
||||
GameObject[] getGameObjects();
|
||||
|
||||
/**
|
||||
* Gets the items held on this tile.
|
||||
*
|
||||
* @return the item
|
||||
*/
|
||||
ItemLayer getItemLayer();
|
||||
|
||||
/**
|
||||
* Gets the object on the ground layer of the tile.
|
||||
*
|
||||
* @return the ground object
|
||||
*/
|
||||
GroundObject getGroundObject();
|
||||
|
||||
/**
|
||||
* Gets the wall of the tile.
|
||||
*
|
||||
* @return the wall object
|
||||
*/
|
||||
WallObject getWallObject();
|
||||
|
||||
/**
|
||||
* Gets the scene paint of the tile.
|
||||
*
|
||||
* @return the paint
|
||||
*/
|
||||
SceneTilePaint getSceneTilePaint();
|
||||
|
||||
/**
|
||||
* Gets the model of the tile in the scene.
|
||||
*
|
||||
* @return the tile model
|
||||
*/
|
||||
SceneTileModel getSceneTileModel();
|
||||
|
||||
/**
|
||||
* Gets the location coordinate of the tile in the world.
|
||||
*
|
||||
* @return the world location
|
||||
*/
|
||||
WorldPoint getWorldLocation();
|
||||
|
||||
/**
|
||||
* Gets the location coordinate of the tile relative to the current
|
||||
* region start point.
|
||||
*
|
||||
* @return the region location
|
||||
*/
|
||||
Point getRegionLocation();
|
||||
|
||||
/**
|
||||
* Gets the local coordinate of the tile.
|
||||
*
|
||||
* @return the local location
|
||||
*/
|
||||
LocalPoint getLocalLocation();
|
||||
|
||||
/**
|
||||
* Gets the plane that this tile is on.
|
||||
*
|
||||
* @return the plane
|
||||
*/
|
||||
int getPlane();
|
||||
|
||||
/**
|
||||
* Computes and returns whether this tile has line of sight to another.
|
||||
*
|
||||
* @param other the other tile
|
||||
* @return true if there is no sight obstruction, false otherwise
|
||||
*/
|
||||
boolean hasLineOfSightTo(Tile other);
|
||||
|
||||
/**
|
||||
* Get all the ground items for this tile
|
||||
*
|
||||
* @return
|
||||
* @return the ground items
|
||||
*/
|
||||
List<Item> getGroundItems();
|
||||
}
|
||||
|
||||
@@ -30,36 +30,105 @@ import java.awt.geom.Area;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
|
||||
/**
|
||||
* Represents an object that a tile holds.
|
||||
*/
|
||||
public interface TileObject
|
||||
{
|
||||
/**
|
||||
* Gets the hashed value of this object.
|
||||
*
|
||||
* @return the object hash
|
||||
*/
|
||||
long getHash();
|
||||
|
||||
/**
|
||||
* Gets the x-axis coordinate of the object in local context.
|
||||
*
|
||||
* @return the x-axis coordinate
|
||||
*/
|
||||
int getX();
|
||||
|
||||
/**
|
||||
* Gets the y-axis coordinate of the object in local context.
|
||||
*
|
||||
* @return the y-axis coordinate
|
||||
*/
|
||||
int getY();
|
||||
|
||||
/**
|
||||
* Gets the plane of the tile that the object is on.
|
||||
*
|
||||
* @return the tile plane
|
||||
*/
|
||||
int getPlane();
|
||||
|
||||
/**
|
||||
* Gets the ID of the object.
|
||||
*
|
||||
* @return the object ID
|
||||
*/
|
||||
int getId();
|
||||
|
||||
/**
|
||||
* Gets the location coordinate of the object in the world.
|
||||
*
|
||||
* @return the world location
|
||||
*/
|
||||
WorldPoint getWorldLocation();
|
||||
|
||||
/**
|
||||
* Gets the local location of the object.
|
||||
*
|
||||
* @return the local location
|
||||
*/
|
||||
LocalPoint getLocalLocation();
|
||||
|
||||
/**
|
||||
* Gets the upper-left canvas point where this object is drawn.
|
||||
*
|
||||
* @return the canvas location
|
||||
*/
|
||||
Point getCanvasLocation();
|
||||
|
||||
/**
|
||||
* Gets the upper-left canvas point where this object is drawn,
|
||||
* offset by the passed value.
|
||||
*
|
||||
* @param zOffset the z-axis offset
|
||||
* @return the canvas location
|
||||
*/
|
||||
Point getCanvasLocation(int zOffset);
|
||||
|
||||
/**
|
||||
* Gets the polygon of the objects model as drawn on the canvas.
|
||||
*
|
||||
* @return the canvas polygon
|
||||
*/
|
||||
Polygon getCanvasTilePoly();
|
||||
|
||||
/**
|
||||
* Gets the text position on the canvas.
|
||||
*
|
||||
* @param graphics the client graphics
|
||||
* @param text the text to draw
|
||||
* @param zOffset the offset from ground plane
|
||||
* @return the canvas point to draw the text at
|
||||
*/
|
||||
Point getCanvasTextLocation(Graphics2D graphics, String text, int zOffset);
|
||||
|
||||
/**
|
||||
* Gets a point on the canvas of where this objects mini-map indicator
|
||||
* should appear.
|
||||
*
|
||||
* @return mini-map location on canvas
|
||||
*/
|
||||
Point getMinimapLocation();
|
||||
|
||||
/**
|
||||
* Get the on-screen clickable area of {@code object}
|
||||
* Get the on-screen clickable area of the object.
|
||||
*
|
||||
* @return the clickable area of {@code object}
|
||||
* @return the clickable area
|
||||
*/
|
||||
Area getClickbox();
|
||||
}
|
||||
|
||||
@@ -27,6 +27,9 @@ package net.runelite.api;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* An enumeration of integer local variables.
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum VarClientInt
|
||||
|
||||
@@ -27,6 +27,9 @@ package net.runelite.api;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* An enumeration of string local variables.
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum VarClientStr
|
||||
|
||||
@@ -27,6 +27,9 @@ package net.runelite.api;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* An enumeration of local player variables.
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum VarPlayer
|
||||
@@ -41,7 +44,7 @@ public enum VarPlayer
|
||||
IN_RAID_PARTY(1427),
|
||||
|
||||
/**
|
||||
* Experience tracker goal start
|
||||
* Experience tracker goal start.
|
||||
*/
|
||||
ATTACK_GOAL_START(1229),
|
||||
STRENGTH_GOAL_START(1230),
|
||||
@@ -68,7 +71,7 @@ public enum VarPlayer
|
||||
HUNTER_GOAL_START(1251),
|
||||
|
||||
/**
|
||||
* Experience tracker goal end
|
||||
* Experience tracker goal end.
|
||||
*/
|
||||
ATTACK_GOAL_END(1253),
|
||||
STRENGTH_GOAL_END(1254),
|
||||
|
||||
@@ -27,6 +27,9 @@ package net.runelite.api;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* An enumeration of local client variables.
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum Varbits
|
||||
@@ -347,7 +350,7 @@ public enum Varbits
|
||||
ACCOUNT_TYPE(1777);
|
||||
|
||||
/**
|
||||
* varbit id
|
||||
* The raw varbit ID.
|
||||
*/
|
||||
private final int id;
|
||||
}
|
||||
|
||||
@@ -25,15 +25,28 @@
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* A wall object, which is a boundary you can't walk through.
|
||||
*
|
||||
* @author Adam
|
||||
* Represents the wall of a tile, which is an un-passable boundary.
|
||||
*/
|
||||
public interface WallObject extends TileObject
|
||||
{
|
||||
/**
|
||||
* Gets the first orientation of the wall.
|
||||
*
|
||||
* @return the first orientation, 0-2048 where 0 is north
|
||||
*/
|
||||
int getOrientationA();
|
||||
|
||||
/**
|
||||
* Gets the second orientation value of the wall.
|
||||
*
|
||||
* @return the second orientation, 0-2048 where 0 is north
|
||||
*/
|
||||
int getOrientationB();
|
||||
|
||||
/**
|
||||
* Gets the boundary configuration of the wall.
|
||||
*
|
||||
* @return the boundary configuration
|
||||
*/
|
||||
int getConfig();
|
||||
}
|
||||
|
||||
@@ -24,7 +24,16 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents a widget as an iterable node.
|
||||
*/
|
||||
public interface WidgetNode extends Node
|
||||
{
|
||||
/**
|
||||
* The ID of the widget.
|
||||
*
|
||||
* @return the ID of the widget
|
||||
* @see net.runelite.api.widgets.Widget
|
||||
*/
|
||||
int getId();
|
||||
}
|
||||
|
||||
@@ -24,18 +24,17 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
/**
|
||||
* Holds data of RuneScape world.
|
||||
* Holds data of a RuneScape world.
|
||||
*/
|
||||
public interface World
|
||||
{
|
||||
/**
|
||||
* Gets world types.
|
||||
* Gets all applicable world types for this world.
|
||||
*
|
||||
* @return the types
|
||||
* @return the world types
|
||||
*/
|
||||
EnumSet<WorldType> getTypes();
|
||||
|
||||
@@ -47,84 +46,86 @@ public interface World
|
||||
void setTypes(EnumSet<WorldType> types);
|
||||
|
||||
/**
|
||||
* Gets player count.
|
||||
* Gets the current number of players logged in the world.
|
||||
*
|
||||
* @return the player count
|
||||
*/
|
||||
int getPlayerCount();
|
||||
|
||||
/**
|
||||
* Sets player count.
|
||||
* Sets the player count of the world.
|
||||
*
|
||||
* @param playerCount the player count
|
||||
* @param playerCount the new player count
|
||||
*/
|
||||
void setPlayerCount(int playerCount);
|
||||
|
||||
/**
|
||||
* Gets location.
|
||||
* Gets the world location value.
|
||||
*
|
||||
* @return the location
|
||||
* @return the world location
|
||||
*/
|
||||
int getLocation();
|
||||
|
||||
/**
|
||||
* Sets location.
|
||||
* Sets the world location value.
|
||||
*
|
||||
* @param location the location
|
||||
*/
|
||||
void setLocation(int location);
|
||||
|
||||
/**
|
||||
* Gets index.
|
||||
* Gets the worlds index.
|
||||
*
|
||||
* @return the index
|
||||
*/
|
||||
int getIndex();
|
||||
|
||||
/**
|
||||
* Sets index.
|
||||
* Sets the worlds index.
|
||||
*
|
||||
* @param index the index
|
||||
*/
|
||||
void setIndex(int index);
|
||||
|
||||
/**
|
||||
* Gets id.
|
||||
* Gets the world number.
|
||||
*
|
||||
* @return the id
|
||||
* @return the world number
|
||||
*/
|
||||
int getId();
|
||||
|
||||
/**
|
||||
* Sets id.
|
||||
* Sets the world number.
|
||||
*
|
||||
* @param id the id
|
||||
* @param id the world number
|
||||
*/
|
||||
void setId(int id);
|
||||
|
||||
/**
|
||||
* Gets activity.
|
||||
* Gets the world activity description.
|
||||
* <p>
|
||||
* For example, world 2 would return "Trade - Members".
|
||||
*
|
||||
* @return the activity
|
||||
* @return the world activity
|
||||
*/
|
||||
String getActivity();
|
||||
|
||||
/**
|
||||
* Sets activity.
|
||||
* Sets the world activity description.
|
||||
*
|
||||
* @param activity the activity
|
||||
*/
|
||||
void setActivity(String activity);
|
||||
|
||||
/**
|
||||
* Gets address.
|
||||
* Gets the address of the world.
|
||||
*
|
||||
* @return the address
|
||||
* @return the world address
|
||||
*/
|
||||
String getAddress();
|
||||
|
||||
/**
|
||||
* Sets address.
|
||||
* Sets the address of the world.
|
||||
*
|
||||
* @param address the address
|
||||
*/
|
||||
|
||||
@@ -24,7 +24,18 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Represents data on the world map.
|
||||
*/
|
||||
public interface WorldMapData
|
||||
{
|
||||
/**
|
||||
* Checks whether the passed coordinates are on the surface of the
|
||||
* world map.
|
||||
*
|
||||
* @param x x-axis coordinate
|
||||
* @param y y-axis coordinate
|
||||
* @return true if the coordinate is on the surface, false otherwise
|
||||
*/
|
||||
boolean surfaceContainsPosition(int x, int y);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,15 @@
|
||||
*/
|
||||
package net.runelite.api;
|
||||
|
||||
/**
|
||||
* Manages the world map.
|
||||
*/
|
||||
public interface WorldMapManager
|
||||
{
|
||||
/**
|
||||
* Checks whether the world map is currently loaded.
|
||||
*
|
||||
* @return true if the map is loaded, false otherwise
|
||||
*/
|
||||
boolean isLoaded();
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ package net.runelite.api;
|
||||
import java.util.EnumSet;
|
||||
|
||||
/**
|
||||
* Enum representing world type.
|
||||
* An enumeration of possible world types.
|
||||
*/
|
||||
public enum WorldType
|
||||
{
|
||||
@@ -96,7 +96,7 @@ public enum WorldType
|
||||
* Create mask from enum set of world types.
|
||||
*
|
||||
* @param types the types
|
||||
* @return the int
|
||||
* @return the int containing all mask
|
||||
*/
|
||||
public static int toMask(final EnumSet<WorldType> types)
|
||||
{
|
||||
|
||||
@@ -30,18 +30,34 @@ import static net.runelite.api.coords.Direction.NORTH;
|
||||
import static net.runelite.api.coords.Direction.SOUTH;
|
||||
import static net.runelite.api.coords.Direction.WEST;
|
||||
|
||||
/**
|
||||
* Represents an in-game orientation that uses fixed point arithmetic.
|
||||
* <p>
|
||||
* Angles are represented as an int value ranging from 0-2047, where the
|
||||
* following is true:
|
||||
* <ul>
|
||||
* <li>0 is true South</li>
|
||||
* <li>512 is true West</li>
|
||||
* <li>1024 is true North</li>
|
||||
* <li>1536 is true East</li>
|
||||
* </ul>
|
||||
*/
|
||||
@Value
|
||||
public class Angle
|
||||
{
|
||||
/**
|
||||
* angle, 0-2047.
|
||||
* 0 is south, west is 512, south is 1024, east is 1536s
|
||||
* The raw angle value.
|
||||
*/
|
||||
private final int angle;
|
||||
|
||||
/**
|
||||
* Get the nearest N/S/E/W direction for this angle
|
||||
* @return
|
||||
* Converts the angle value to the nearest cardinal direction.
|
||||
* <p>
|
||||
* Each cardinal direction contains 512 angles, ranging between
|
||||
* -256 and +256 of it's true value. Negative values and values
|
||||
* above 2047 are wrapped accordingly.
|
||||
*
|
||||
* @return Nearest cardinal direction to the angle
|
||||
*/
|
||||
public Direction getNearestDirection()
|
||||
{
|
||||
|
||||
@@ -24,10 +24,28 @@
|
||||
*/
|
||||
package net.runelite.api.coords;
|
||||
|
||||
/**
|
||||
* Represents the four main cardinal points.
|
||||
*/
|
||||
public enum Direction
|
||||
{
|
||||
/**
|
||||
* Angles ranging from 768 - 1279.
|
||||
*/
|
||||
NORTH,
|
||||
|
||||
/**
|
||||
* Angles ranging from 1792 - 2047 and 0 - 255.
|
||||
*/
|
||||
SOUTH,
|
||||
|
||||
/**
|
||||
* Angles ranging from 1280 - 1791.
|
||||
*/
|
||||
EAST,
|
||||
WEST;
|
||||
|
||||
/**
|
||||
* Angles ranging from 256 - 767.
|
||||
*/
|
||||
WEST
|
||||
}
|
||||
|
||||
@@ -31,18 +31,27 @@ import net.runelite.api.Client;
|
||||
import net.runelite.api.Perspective;
|
||||
|
||||
/**
|
||||
* A LocolPoint is a Two-Dimensional point in the local coordinate space. Because the local coordinate space moves,
|
||||
* it is not safe to keep a LocalPoint after a loading zone. The unit is 1/128th of a Tile
|
||||
* A two-dimensional point in the local coordinate space.
|
||||
* <p>
|
||||
* Local points are immutable, however since the local coordinate space moves,
|
||||
* it is not safe to keep a LocalPoint after a loading zone.
|
||||
* <p>
|
||||
* The unit of a LocalPoint is 1/128th of a tile.
|
||||
*/
|
||||
@Value
|
||||
public class LocalPoint
|
||||
{
|
||||
/**
|
||||
* X and Y axis coordinates.
|
||||
*/
|
||||
private final int x, y;
|
||||
|
||||
/**
|
||||
* Returns a LocalPoint of the center of the passed tile
|
||||
* Gets the local coordinate at the center of the passed tile.
|
||||
*
|
||||
* @return LocalPoint if in scene, otherwise null
|
||||
* @param client the client
|
||||
* @param world the passed tile
|
||||
* @return coordinate if the tile is in the current scene, otherwise null
|
||||
*/
|
||||
@Nullable
|
||||
public static LocalPoint fromWorld(Client client, WorldPoint world)
|
||||
@@ -55,9 +64,12 @@ public class LocalPoint
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a LocalPoint of the center of the passed tile
|
||||
* Gets the local coordinate at the center of the passed tile.
|
||||
*
|
||||
* @return LocalPoint if in scene, otherwise null
|
||||
* @param client the client
|
||||
* @param x x-axis coordinate of the tile
|
||||
* @param y y-axis coordinate of the tile
|
||||
* @return coordinate if the tile is in the current scene, otherwise null
|
||||
*/
|
||||
public static LocalPoint fromWorld(Client client, int x, int y)
|
||||
{
|
||||
@@ -73,10 +85,10 @@ public class LocalPoint
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the distance from this point to another point
|
||||
* Gets the distance between this point and another.
|
||||
*
|
||||
* @param other
|
||||
* @return
|
||||
* @param other other point
|
||||
* @return the distance
|
||||
*/
|
||||
public int distanceTo(LocalPoint other)
|
||||
{
|
||||
@@ -84,7 +96,17 @@ public class LocalPoint
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a LocalPoint of the center of the passed tile
|
||||
* Gets the coordinate at the center of the passed tile.
|
||||
* <p>
|
||||
* The coordinate returned by this method is the true tile location,
|
||||
* in LocalPoint units, relative to tile (0, 0).
|
||||
* <p>
|
||||
* e.g. If the local player is standing on tile 3170, the method returns
|
||||
* 405823, or 3170 * 128 + 64.
|
||||
*
|
||||
* @param x x-axis coordinate of the tile
|
||||
* @param y y-axis coordinate of the tile
|
||||
* @return true coordinate of the tile
|
||||
*/
|
||||
public static LocalPoint fromRegion(int x, int y)
|
||||
{
|
||||
@@ -95,16 +117,19 @@ public class LocalPoint
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the X coordinate in Scene space (tiles)
|
||||
* Gets the x-axis coordinate in scene space (tiles).
|
||||
*
|
||||
* @return x-axis coordinate
|
||||
*/
|
||||
public int getRegionX()
|
||||
{
|
||||
return x >>> Perspective.LOCAL_COORD_BITS;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the Y coordinate in Scene space (tiles)
|
||||
* Gets the y-axis coordinate in scene space (tiles).
|
||||
*
|
||||
* @return y-axis coordinate
|
||||
*/
|
||||
public int getRegionY()
|
||||
{
|
||||
|
||||
@@ -33,34 +33,37 @@ import net.runelite.api.Constants;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.Tile;
|
||||
|
||||
/**
|
||||
* Represents an area on the world.
|
||||
*/
|
||||
public class WorldArea
|
||||
{
|
||||
/**
|
||||
* The western most point of the area
|
||||
* The western most point of the area.
|
||||
*/
|
||||
@Getter
|
||||
private int x;
|
||||
|
||||
/**
|
||||
* The southern most point of the area
|
||||
* The southern most point of the area.
|
||||
*/
|
||||
@Getter
|
||||
private int y;
|
||||
|
||||
/**
|
||||
* The width of the area
|
||||
* The width of the area.
|
||||
*/
|
||||
@Getter
|
||||
private int width;
|
||||
|
||||
/**
|
||||
* The height of the area
|
||||
* The height of the area.
|
||||
*/
|
||||
@Getter
|
||||
private int height;
|
||||
|
||||
/**
|
||||
* The plane the area is on
|
||||
* The plane the area is on.
|
||||
*/
|
||||
@Getter
|
||||
private int plane;
|
||||
@@ -84,9 +87,10 @@ public class WorldArea
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the shortest distance to another WorldArea for both x and y axis
|
||||
* @param other The WorldArea to get the distance to
|
||||
* @return Returns a Point with the shortest distance
|
||||
* Computes the shortest distance to another area.
|
||||
*
|
||||
* @param other the passed area
|
||||
* @return the distance along both x and y axis
|
||||
*/
|
||||
private Point getAxisDistances(WorldArea other)
|
||||
{
|
||||
@@ -96,10 +100,10 @@ public class WorldArea
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the shortest distance to another WorldArea
|
||||
* Computes the shortest distance to another area.
|
||||
*
|
||||
* @param other The other area
|
||||
* @return Returns the distance
|
||||
* @param other the passed area
|
||||
* @return the distance, or {@link Integer#MAX_VALUE} if the planes differ
|
||||
*/
|
||||
public int distanceTo(WorldArea other)
|
||||
{
|
||||
@@ -113,10 +117,10 @@ public class WorldArea
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the shortest distance to another WorldPoint
|
||||
* Computes the shortest distance to a world coordinate.
|
||||
*
|
||||
* @param other The other worldpoint
|
||||
* @return Returns the distance
|
||||
* @param other the passed coordinate
|
||||
* @return the distance, or {@link Integer#MAX_VALUE} if the planes differ
|
||||
*/
|
||||
public int distanceTo(WorldPoint other)
|
||||
{
|
||||
@@ -124,10 +128,14 @@ public class WorldArea
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if this WorldArea is within melee distance of another WorldArea
|
||||
* Checks whether this area is within melee distance of another.
|
||||
* <p>
|
||||
* Melee distance is exactly 1 tile, so this method computes and returns
|
||||
* whether the shortest distance to the passed area is directly
|
||||
* on the outside of this areas edge.
|
||||
*
|
||||
* @param other The other world area to compare with
|
||||
* @return Returns true if it is in melee distance
|
||||
* @param other the other area
|
||||
* @return true if in melee distance, false otherwise
|
||||
*/
|
||||
public boolean isInMeleeDistance(WorldArea other)
|
||||
{
|
||||
@@ -141,10 +149,11 @@ public class WorldArea
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if this WorldArea is within melee distance of another WorldPoint
|
||||
* Checks whether a coordinate is within melee distance of this area.
|
||||
*
|
||||
* @param other The world pint to compare with
|
||||
* @return Returns true if it is in melee distance
|
||||
* @param other the coordinate
|
||||
* @return true if in melee distance, false otherwise
|
||||
* @see #isInMeleeDistance(WorldArea)
|
||||
*/
|
||||
public boolean isInMeleeDistance(WorldPoint other)
|
||||
{
|
||||
@@ -152,10 +161,10 @@ public class WorldArea
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if a WorldArea intersects with another WorldArea
|
||||
* Checks whether this area intersects with another.
|
||||
*
|
||||
* @param other The other WorldArea to compare with
|
||||
* @return Returns true if the areas intersect
|
||||
* @param other the other area
|
||||
* @return true if the areas intersect, false otherwise
|
||||
*/
|
||||
public boolean intersectsWith(WorldArea other)
|
||||
{
|
||||
@@ -169,16 +178,18 @@ public class WorldArea
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the area can travel in one of the 8 directions
|
||||
* Determines if the area can travel in one of the 9 directions
|
||||
* by using the standard collision detection algorithm.
|
||||
* <p>
|
||||
* Note that this method does not consider other actors as
|
||||
* a collision, but most non-boss NPCs do check for collision
|
||||
* with some actors.
|
||||
* with some actors. For actor collision checking, use the
|
||||
* {@link #canTravelInDirection(Client, int, int, Predicate)} method.
|
||||
*
|
||||
* @param client The client to test in
|
||||
* @param dx The x direction to test against
|
||||
* @param dy The y direction to test against
|
||||
* @return Returns true if it's possible to travel in specified direction
|
||||
* @param client the client to test in
|
||||
* @param dx the x-axis direction to travel (-1, 0, or 1)
|
||||
* @param dy the y-axis direction to travel (-1, 0, or 1)
|
||||
* @return true if the area can travel in the specified direction
|
||||
*/
|
||||
public boolean canTravelInDirection(Client client, int dx, int dy)
|
||||
{
|
||||
@@ -186,18 +197,23 @@ public class WorldArea
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the area can travel in one of the 8 directions
|
||||
* Determines if the area can travel in one of the 9 directions
|
||||
* by using the standard collision detection algorithm.
|
||||
* Note that this method does not consider other actors as
|
||||
* a collision, but most non-boss NPCs do check for collision
|
||||
* with some actors.
|
||||
* <p>
|
||||
* The passed x and y axis directions indicate the direction to
|
||||
* travel in.
|
||||
* <p>
|
||||
* Note that this method does not normally consider other actors
|
||||
* as a collision, but most non-boss NPCs do check for collision
|
||||
* with some actors. However, using the {@code extraCondition} param
|
||||
* it is possible to implement this check manually.
|
||||
*
|
||||
* @param client The client to test in
|
||||
* @param dx The x direction to test against
|
||||
* @param dy The y direction to test against
|
||||
* @param extraCondition Additional check for if movement is allowed through specific
|
||||
* tiles, which may be used if movement should be disabled through other actors
|
||||
* @return Returns true if it's possible to travel in specified direction
|
||||
* @param client the client to test in
|
||||
* @param dx the x-axis direction to travel (-1, 0, or 1)
|
||||
* @param dy the y-axis direction to travel (-1, 0, or 1)
|
||||
* @param extraCondition an additional condition to perform when checking valid tiles,
|
||||
* such as performing a check for un-passable actors
|
||||
* @return true if the area can travel in the specified direction
|
||||
*/
|
||||
public boolean canTravelInDirection(Client client, int dx, int dy,
|
||||
Predicate<? super WorldPoint> extraCondition)
|
||||
@@ -375,10 +391,10 @@ public class WorldArea
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the Point within this WorldArea which is the closest to another WorldArea
|
||||
* Gets the point within this area that is closest to another.
|
||||
*
|
||||
* @param other The other WorldArea to compare to
|
||||
* @return Returns the closest Point
|
||||
* @param other the other area
|
||||
* @return the closest point to the passed area
|
||||
*/
|
||||
private Point getComparisonPoint(WorldArea other)
|
||||
{
|
||||
@@ -411,14 +427,13 @@ public class WorldArea
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the next area that will be occupied if this area
|
||||
* attempts to move toward it by using the normal NPC travelling
|
||||
* pattern.
|
||||
* Calculates the next area that will be occupied if this area attempts
|
||||
* to move toward it by using the normal NPC travelling pattern.
|
||||
*
|
||||
* @param client The client to calculate with
|
||||
* @param target The target area
|
||||
* @param stopAtMeleeDistance Determine if it should stop at melee distance to the target
|
||||
* @return Returns the next occupied area
|
||||
* @param client the client to calculate with
|
||||
* @param target the target area
|
||||
* @param stopAtMeleeDistance whether to stop at melee distance to the target
|
||||
* @return the next occupied area
|
||||
*/
|
||||
public WorldArea calculateNextTravellingPoint(Client client, WorldArea target,
|
||||
boolean stopAtMeleeDistance)
|
||||
@@ -427,16 +442,15 @@ public class WorldArea
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the next area that will be occupied if this area
|
||||
* attempts to move toward it by using the normal NPC travelling
|
||||
* pattern.
|
||||
* Calculates the next area that will be occupied if this area attempts
|
||||
* to move toward it by using the normal NPC travelling pattern.
|
||||
*
|
||||
* @param client The client to calculate with
|
||||
* @param target The target area
|
||||
* @param stopAtMeleeDistance Determine if it should stop at melee distance to the target
|
||||
* @param extraCondition Additional check for if movement is allowed through specific
|
||||
* tiles, which may be used if movement should be disabled through other actors
|
||||
* @return Returns the next occupied area
|
||||
* @param client the client to calculate with
|
||||
* @param target the target area
|
||||
* @param stopAtMeleeDistance whether to stop at melee distance to the target
|
||||
* @param extraCondition an additional condition to perform when checking valid tiles,
|
||||
* such as performing a check for un-passable actors
|
||||
* @return the next occupied area
|
||||
*/
|
||||
public WorldArea calculateNextTravellingPoint(Client client, WorldArea target,
|
||||
boolean stopAtMeleeDistance, Predicate<? super WorldPoint> extraCondition)
|
||||
@@ -514,6 +528,7 @@ public class WorldArea
|
||||
|
||||
/**
|
||||
* Determine if this WorldArea has line of sight to another WorldArea.
|
||||
* <p>
|
||||
* Note that the reverse isn't necessarily true, meaning this can return true
|
||||
* while the other WorldArea does not have line of sight to this WorldArea.
|
||||
*
|
||||
@@ -606,6 +621,7 @@ public class WorldArea
|
||||
|
||||
/**
|
||||
* Determine if this WorldArea has line of sight to another WorldArea.
|
||||
* <p>
|
||||
* Note that the reverse isn't necessarily true, meaning this can return true
|
||||
* while the other WorldArea does not have line of sight to this WorldArea.
|
||||
*
|
||||
@@ -619,7 +635,7 @@ public class WorldArea
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the southwestern most point of this WorldArea
|
||||
* Retrieves the southwestern most point of this WorldArea.
|
||||
*
|
||||
* @return Returns the southwestern most WorldPoint in the area
|
||||
*/
|
||||
|
||||
@@ -31,32 +31,36 @@ import net.runelite.api.Perspective;
|
||||
import net.runelite.api.Point;
|
||||
|
||||
/**
|
||||
* WorldPoint is a Three-Dimensional point representing the location of a Tile
|
||||
* A three-dimensional point representing the coordinate of a Tile.
|
||||
* <p>
|
||||
* WorldPoints are immutable. Methods that modify the properties create a new
|
||||
* instance.
|
||||
*/
|
||||
@Value
|
||||
public class WorldPoint
|
||||
{
|
||||
/**
|
||||
* The X coordinate of the Point.
|
||||
* Units are in tiles
|
||||
* X-axis coordinate.
|
||||
*/
|
||||
private final int x;
|
||||
|
||||
/**
|
||||
* The Y coordinate of the Point.
|
||||
* Units are in tiles
|
||||
* Y-axis coordinate.
|
||||
*/
|
||||
private final int y;
|
||||
|
||||
/**
|
||||
* The plane coordinate of the Point.
|
||||
* The plane level of the Tile, also referred as z-axis coordinate.
|
||||
*
|
||||
* @see Client#getPlane()
|
||||
*/
|
||||
private final int plane;
|
||||
|
||||
/**
|
||||
* Returns a WorldPoint offset on x from this point
|
||||
* @param dx offset
|
||||
* @return
|
||||
* Offsets the x-axis coordinate by the passed value.
|
||||
*
|
||||
* @param dx the offset
|
||||
* @return new instance
|
||||
*/
|
||||
public WorldPoint dx(int dx)
|
||||
{
|
||||
@@ -64,9 +68,10 @@ public class WorldPoint
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a WorldPoint offset on y from this point
|
||||
* @param dy offset
|
||||
* @return
|
||||
* Offsets the y-axis coordinate by the passed value.
|
||||
*
|
||||
* @param dy the offset
|
||||
* @return new instance
|
||||
*/
|
||||
public WorldPoint dy(int dy)
|
||||
{
|
||||
@@ -74,15 +79,24 @@ public class WorldPoint
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a WorldPoint offset on z from this point
|
||||
* @param dz offset
|
||||
* @return
|
||||
* Offsets the plane by the passed value.
|
||||
*
|
||||
* @param dz the offset
|
||||
* @return new instance
|
||||
*/
|
||||
public WorldPoint dz(int dz)
|
||||
{
|
||||
return new WorldPoint(x, y, plane + dz);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether a tile is located in the current scene.
|
||||
*
|
||||
* @param client the client
|
||||
* @param x the tiles x coordinate
|
||||
* @param y the tiles y coordinate
|
||||
* @return true if the tile is in the scene, false otherwise
|
||||
*/
|
||||
public static boolean isInScene(Client client, int x, int y)
|
||||
{
|
||||
int baseX = client.getBaseX();
|
||||
@@ -94,13 +108,23 @@ public class WorldPoint
|
||||
return x >= baseX && x < maxX && y >= baseY && y < maxY;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether this tile is located in the current scene.
|
||||
*
|
||||
* @param client the client
|
||||
* @return true if this tile is in the scene, false otherwise
|
||||
*/
|
||||
public boolean isInScene(Client client)
|
||||
{
|
||||
return client.getPlane() == plane && isInScene(client, x, y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a WorldPoint containing the passed LocalPoint
|
||||
* Gets the coordinate of the tile that contains the passed local point.
|
||||
*
|
||||
* @param client the client
|
||||
* @param local the local coordinate
|
||||
* @return the tile coordinate containing the local point
|
||||
*/
|
||||
public static WorldPoint fromLocal(Client client, LocalPoint local)
|
||||
{
|
||||
@@ -108,7 +132,13 @@ public class WorldPoint
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a WorldPoint containing the passed local coordinates
|
||||
* Gets the coordinate of the tile that contains the passed local point.
|
||||
*
|
||||
* @param client the client
|
||||
* @param x the local x-axis coordinate
|
||||
* @param y the local x-axis coordinate
|
||||
* @param plane the plane
|
||||
* @return the tile coordinate containing the local point
|
||||
*/
|
||||
public static WorldPoint fromLocal(Client client, int x, int y, int plane)
|
||||
{
|
||||
@@ -120,10 +150,10 @@ public class WorldPoint
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the shortest distance from this point to a WorldArea
|
||||
* Gets the shortest distance from this point to a WorldArea.
|
||||
*
|
||||
* @param other The WorldArea to find the distance to
|
||||
* @return Returns the shortest distance
|
||||
* @param other the world area
|
||||
* @return the shortest distance
|
||||
*/
|
||||
public int distanceTo(WorldArea other)
|
||||
{
|
||||
@@ -131,11 +161,14 @@ public class WorldPoint
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the distance from this point to another point. Returns Integer.MAX_VALUE if other is on
|
||||
* a different plane.
|
||||
* Gets the distance between this point and another.
|
||||
* <p>
|
||||
* If the other point is not on the same plane, this method will return
|
||||
* {@link Integer#MAX_VALUE}. If ignoring the plane is wanted, use the
|
||||
* {@link #distanceTo2D(WorldPoint)} method.
|
||||
*
|
||||
* @param other
|
||||
* @return
|
||||
* @param other other point
|
||||
* @return the distance
|
||||
*/
|
||||
public int distanceTo(WorldPoint other)
|
||||
{
|
||||
@@ -147,12 +180,14 @@ public class WorldPoint
|
||||
return distanceTo2D(other);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Find the distance from this point to another point.
|
||||
* <p>
|
||||
* This method disregards the plane value of the two tiles and returns
|
||||
* the simple distance between the X-Z coordinate pairs.
|
||||
*
|
||||
* @param other
|
||||
* @return
|
||||
* @param other other point
|
||||
* @return the distance
|
||||
*/
|
||||
public int distanceTo2D(WorldPoint other)
|
||||
{
|
||||
@@ -160,7 +195,13 @@ public class WorldPoint
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a WorldPoint from the passed region coords
|
||||
* Gets the coordinate of the tile that contains the passed local point.
|
||||
*
|
||||
* @param client the client
|
||||
* @param x the local x-axis coordinate
|
||||
* @param y the local x-axis coordinate
|
||||
* @param plane the plane
|
||||
* @return the tile coordinate containing the local point
|
||||
*/
|
||||
public static WorldPoint fromRegion(Client client, int x, int y, int plane)
|
||||
{
|
||||
@@ -177,6 +218,11 @@ public class WorldPoint
|
||||
return new Point(x, y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ID of the region containing this tile.
|
||||
*
|
||||
* @return the region ID
|
||||
*/
|
||||
public int getRegionID()
|
||||
{
|
||||
return ((x >> 6) << 8) | (y >> 6);
|
||||
|
||||
@@ -27,8 +27,14 @@ package net.runelite.api.events;
|
||||
import lombok.Data;
|
||||
import net.runelite.api.Actor;
|
||||
|
||||
/**
|
||||
* An event where the {@link Actor} has died.
|
||||
*/
|
||||
@Data
|
||||
public class ActorDeath
|
||||
{
|
||||
/**
|
||||
* The player or NPC who died.
|
||||
*/
|
||||
private Actor actor;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,31 @@ package net.runelite.api.events;
|
||||
|
||||
import net.runelite.api.Actor;
|
||||
|
||||
/**
|
||||
* Represents the base event where an {@link Actor} has despawned.
|
||||
* <p>
|
||||
* To hook into a more focused actor type, see the {@link PlayerDespawned}
|
||||
* or {@link NpcDespawned} events.
|
||||
* <p>
|
||||
* Examples of when this event may trigger include:
|
||||
* <ul>
|
||||
* <li>An actor moving out of render distance</li>
|
||||
* <li>An actor despawning after death</li>
|
||||
* <li>Moving out of or away from a region with Actor entities in it</li>
|
||||
* </ul>
|
||||
* <p>
|
||||
* During a world change, the event is only called for Players,
|
||||
* ie. {@link PlayerDespawned} will trigger but {@link NpcDespawned}
|
||||
* will not.
|
||||
* <p>
|
||||
* The client logging out does not trigger this event.
|
||||
*/
|
||||
public interface ActorDespawned
|
||||
{
|
||||
/**
|
||||
* Gets the despawned player or NPC.
|
||||
*
|
||||
* @return despawned entity
|
||||
*/
|
||||
Actor getActor();
|
||||
}
|
||||
|
||||
@@ -26,7 +26,25 @@ package net.runelite.api.events;
|
||||
|
||||
import net.runelite.api.Actor;
|
||||
|
||||
/**
|
||||
* Represents the base event where an {@link Actor} has spawned.
|
||||
* <p>
|
||||
* To hook into a more focused actor type, see the {@link PlayerSpawned}
|
||||
* or {@link NpcSpawned} events.
|
||||
* <p>
|
||||
* Examples of when this event may trigger include:
|
||||
* <ul>
|
||||
* <li>Entering a new region or area with actors inside</li>
|
||||
* <li>A player logging in nearby</li>
|
||||
* <li>An actor moving into render distance</li>
|
||||
* </ul>
|
||||
*/
|
||||
public interface ActorSpawned
|
||||
{
|
||||
/**
|
||||
* Gets the spawned player or NPC.
|
||||
*
|
||||
* @return spawned entity
|
||||
*/
|
||||
Actor getActor();
|
||||
}
|
||||
|
||||
@@ -27,8 +27,24 @@ package net.runelite.api.events;
|
||||
import lombok.Data;
|
||||
import net.runelite.api.Actor;
|
||||
|
||||
/**
|
||||
* An event where the {@link Actor} has changed animations.
|
||||
* <p>
|
||||
* In order to get the new animation ID, use {@link Actor#getAnimation()}.
|
||||
* <p>
|
||||
* Examples of when this event may trigger include:
|
||||
* <ul>
|
||||
* <li>A player starts or stops gathering a resource (ie. woodcut, fishing)</li>
|
||||
* <li>A player starts or stops dancing</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see net.runelite.api.AnimationID
|
||||
*/
|
||||
@Data
|
||||
public class AnimationChanged
|
||||
{
|
||||
/**
|
||||
* The actor that has entered a new animation.
|
||||
*/
|
||||
private Actor actor;
|
||||
}
|
||||
|
||||
@@ -27,8 +27,25 @@ package net.runelite.api.events;
|
||||
import lombok.Data;
|
||||
import net.runelite.api.Skill;
|
||||
|
||||
/**
|
||||
* An event where a players skill level has been temporarily modified.
|
||||
* <p>
|
||||
* Examples of when this event may trigger include:
|
||||
* <ul>
|
||||
* <li>Prayer points draining or being restored at an altar or restoration pool</li>
|
||||
* <li>Positive and negative effects gained from potions (ie. Saradomin brew)</li>
|
||||
* <li>Earning skill points towards a skill</li>
|
||||
* <li>Levelling up a skill</li>
|
||||
* </ul>
|
||||
* <p>
|
||||
* Use {@link net.runelite.api.Client#getBoostedSkillLevel(Skill)} in order to
|
||||
* retrieve the newly boosted skill level.
|
||||
*/
|
||||
@Data
|
||||
public class BoostedLevelChanged
|
||||
{
|
||||
/**
|
||||
* The skill that has had its level modified.
|
||||
*/
|
||||
private Skill skill;
|
||||
}
|
||||
|
||||
@@ -28,12 +28,35 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import net.runelite.api.ChatMessageType;
|
||||
|
||||
/**
|
||||
* An event where a new chat message is received.
|
||||
* <p>
|
||||
* See {@link ChatMessageType} for different message types that can be
|
||||
* received.
|
||||
* <p>
|
||||
* Note: This event will not trigger for NPC dialogues.
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class ChatMessage
|
||||
{
|
||||
/**
|
||||
* The type of message received.
|
||||
*/
|
||||
private ChatMessageType type;
|
||||
/**
|
||||
* The name of the player that sent the message.
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* The contents of the message.
|
||||
*/
|
||||
private String message;
|
||||
/**
|
||||
* The sender of the message.
|
||||
* <p>
|
||||
* This field is only used for clan messages and refers to the
|
||||
* current name of the clan chat the client is in.
|
||||
*/
|
||||
private String sender;
|
||||
}
|
||||
|
||||
@@ -26,8 +26,14 @@ package net.runelite.api.events;
|
||||
|
||||
import lombok.Value;
|
||||
|
||||
/**
|
||||
* An event where the client has joined or left a clan chat.
|
||||
*/
|
||||
@Value
|
||||
public class ClanChanged
|
||||
{
|
||||
/**
|
||||
* Whether or not the client is now in a clan chat.
|
||||
*/
|
||||
private boolean joined;
|
||||
}
|
||||
|
||||
@@ -26,9 +26,30 @@ package net.runelite.api.events;
|
||||
|
||||
import lombok.Value;
|
||||
|
||||
/**
|
||||
* An event where a command has been used in the chat.
|
||||
* <p>
|
||||
* Commands are triggered by using the "::" prefix before a chat message. The
|
||||
* structure of a command is "::[name] [args..]" where "[name]" is the name
|
||||
* of the command that is set in the command field, and args are (optional)
|
||||
* words entered that are separated by spaces.
|
||||
* <p>
|
||||
* Typing in "::" with no additional characters will treat the message as normal
|
||||
* and pass it along to the public chat.
|
||||
* <p>
|
||||
* Note that having a space as the first character after the command trigger will
|
||||
* set the command field to an empty string. For example, the message ":: hello world!"
|
||||
* will set command to "" and arguments to ["hello", "world!"].
|
||||
*/
|
||||
@Value
|
||||
public class CommandExecuted
|
||||
{
|
||||
/**
|
||||
* The name of the command entered.
|
||||
*/
|
||||
private String command;
|
||||
/**
|
||||
* The command arguments that have been entered.
|
||||
*/
|
||||
private String[] arguments;
|
||||
}
|
||||
|
||||
@@ -26,11 +26,29 @@ package net.runelite.api.events;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* An event where a configuration entry has been modified.
|
||||
*/
|
||||
@Data
|
||||
public class ConfigChanged
|
||||
{
|
||||
/**
|
||||
* The parent group for the key.
|
||||
* <p>
|
||||
* Typically set to the name of a plugin to prevent potential collisions
|
||||
* between other key values that may have the same name.
|
||||
*/
|
||||
private String group;
|
||||
/**
|
||||
* The configuration key that has been modified.
|
||||
*/
|
||||
private String key;
|
||||
/**
|
||||
* The previous value of the entry.
|
||||
*/
|
||||
private String oldValue;
|
||||
/**
|
||||
* The new value of the entry, null if the entry has been unset.
|
||||
*/
|
||||
private String newValue;
|
||||
}
|
||||
|
||||
@@ -28,10 +28,23 @@ import lombok.Data;
|
||||
import net.runelite.api.DecorativeObject;
|
||||
import net.runelite.api.Tile;
|
||||
|
||||
/**
|
||||
* An event where the {@link DecorativeObject} attached to a {@link Tile}
|
||||
* has been modified.
|
||||
*/
|
||||
@Data
|
||||
public class DecorativeObjectChanged
|
||||
{
|
||||
/**
|
||||
* The affected tile.
|
||||
*/
|
||||
private Tile tile;
|
||||
/**
|
||||
* The decorative object that has been replaced.
|
||||
*/
|
||||
private DecorativeObject previous;
|
||||
/**
|
||||
* The new decoration for the tile.
|
||||
*/
|
||||
private DecorativeObject decorativeObject;
|
||||
}
|
||||
|
||||
@@ -28,9 +28,19 @@ import lombok.Data;
|
||||
import net.runelite.api.DecorativeObject;
|
||||
import net.runelite.api.Tile;
|
||||
|
||||
/**
|
||||
* An event where the {@link DecorativeObject} attached to a {@link Tile}
|
||||
* is removed.
|
||||
*/
|
||||
@Data
|
||||
public class DecorativeObjectDespawned
|
||||
{
|
||||
/**
|
||||
* The affected tile.
|
||||
*/
|
||||
private Tile tile;
|
||||
/**
|
||||
* The removed decorative object.
|
||||
*/
|
||||
private DecorativeObject decorativeObject;
|
||||
}
|
||||
|
||||
@@ -28,9 +28,18 @@ import lombok.Data;
|
||||
import net.runelite.api.DecorativeObject;
|
||||
import net.runelite.api.Tile;
|
||||
|
||||
/**
|
||||
* An event where a {@link DecorativeObject} is attached to a {@link Tile}.
|
||||
*/
|
||||
@Data
|
||||
public class DecorativeObjectSpawned
|
||||
{
|
||||
/**
|
||||
* The affected tile.
|
||||
*/
|
||||
private Tile tile;
|
||||
/**
|
||||
* The newly spawned decorative object.
|
||||
*/
|
||||
private DecorativeObject decorativeObject;
|
||||
}
|
||||
|
||||
@@ -26,8 +26,15 @@ package net.runelite.api.events;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Called every game cycle the client is dragging a widget on
|
||||
* the cursor.
|
||||
*/
|
||||
@Data
|
||||
public class DraggingWidgetChanged
|
||||
{
|
||||
/**
|
||||
* Whether a widget is currently being dragged.
|
||||
*/
|
||||
private boolean draggingWidget;
|
||||
}
|
||||
|
||||
@@ -28,11 +28,14 @@ package net.runelite.api.events;
|
||||
import lombok.Data;
|
||||
import net.runelite.api.Skill;
|
||||
|
||||
/**
|
||||
* An event where the experience level of a {@link Skill} has been modified.
|
||||
*/
|
||||
@Data
|
||||
public class ExperienceChanged
|
||||
{
|
||||
/**
|
||||
* The {@link Skill} that had its experience changed.
|
||||
* The modified skill.
|
||||
*/
|
||||
private Skill skill;
|
||||
}
|
||||
|
||||
@@ -26,8 +26,21 @@ package net.runelite.api.events;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* An event where the focus state of the client changes.
|
||||
* <p>
|
||||
* Examples of when this event may trigger include:
|
||||
* <ul>
|
||||
* <li>Alt-tabbing to a different window</li>
|
||||
* <li>Clicking outside the client window</li>
|
||||
* <li>Clicking the client window from a different focused window</li>
|
||||
* </ul>
|
||||
*/
|
||||
@Data
|
||||
public class FocusChanged
|
||||
{
|
||||
/**
|
||||
* The new focus state.
|
||||
*/
|
||||
private boolean focused;
|
||||
}
|
||||
|
||||
@@ -28,10 +28,22 @@ import lombok.Data;
|
||||
import net.runelite.api.GameObject;
|
||||
import net.runelite.api.Tile;
|
||||
|
||||
/**
|
||||
* An event where a {@link GameObject} on a {@link Tile} has been replaced.
|
||||
*/
|
||||
@Data
|
||||
public class GameObjectChanged
|
||||
{
|
||||
/**
|
||||
* The affected tile.
|
||||
*/
|
||||
private Tile tile;
|
||||
/**
|
||||
* The game object that has been replaced.
|
||||
*/
|
||||
private GameObject previous;
|
||||
/**
|
||||
* The new game object on the tile.
|
||||
*/
|
||||
private GameObject gameObject;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user