Add 'runelite-api/' from commit '934060b327413003846e150fd3296421c3ca8a19'

git-subtree-dir: runelite-api
git-subtree-mainline: 3db8786720370327a5c51682c551e2fbb6a497a7
git-subtree-split: 934060b327
This commit is contained in:
Adam
2016-04-25 18:54:52 -04:00
57 changed files with 14135 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
package net.runelite.api;
public abstract class Actor extends Renderable
{
private Client client;
private net.runelite.rs.api.Actor actor;
public Actor(Client client, net.runelite.rs.api.Actor actor)
{
super(actor);
this.client = client;
this.actor = actor;
}
public abstract String getName();
public Actor getInteracting()
{
int i = actor.getInteracting();
if (i == -1)
{
return null;
}
// logic taken from runeloader.
if (i < 32767)
{
return client.getNpcs()[i];
}
// XXX is this correct for i = 32767 ?
i = i - 32767 - 1;
return client.getPlayers()[i];
}
public int getHealth()
{
return actor.getHealth();
}
public int getMaxHealth()
{
return actor.getMaxHealth();
}
}