screenshot: use playerdeath events (#1245)

* add PlayerDeath event

* use LocalPlayerDeath and PlayerDeath events
This commit is contained in:
Harry
2019-08-03 12:43:42 +01:00
committed by Kyleeld
parent 445b1fb2a5
commit f26154c4bc
3 changed files with 59 additions and 65 deletions

View File

@@ -38,6 +38,7 @@ import net.runelite.api.coords.WorldPoint;
import net.runelite.api.events.AnimationChanged;
import net.runelite.api.events.HitsplatApplied;
import net.runelite.api.events.LocalPlayerDeath;
import net.runelite.api.events.PlayerDeath;
import net.runelite.api.events.SpotAnimationChanged;
import net.runelite.api.events.InteractingChanged;
import net.runelite.api.events.OverheadTextChanged;
@@ -254,6 +255,11 @@ public abstract class RSActorMixin implements RSActor
LocalPlayerDeath event = LocalPlayerDeath.INSTANCE;
client.getCallbacks().post(LocalPlayerDeath.class, event);
}
else if (this != client.getLocalPlayer() && this instanceof Player)
{
final PlayerDeath event = new PlayerDeath((Player) this);
client.getCallbacks().post(PlayerDeath.class, event);
}
else if (this instanceof RSNPC)
{
((RSNPC) this).setDead(true);