Remove actor death event, use despawn event instead
This commit is contained in:
@@ -56,7 +56,6 @@ import net.runelite.api.RenderOverview;
|
||||
import net.runelite.api.TextureProvider;
|
||||
import net.runelite.api.WorldMapManager;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.events.ActorDeath;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.FocusChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
@@ -456,12 +455,6 @@ public class Hooks
|
||||
|
||||
public static void onSetCombatInfo(Actor actor, int combatInfoId, int gameCycle, int var3, int var4, int healthRatio, int health)
|
||||
{
|
||||
if (healthRatio == 0)
|
||||
{
|
||||
ActorDeath death = new ActorDeath();
|
||||
death.setActor(actor);
|
||||
eventBus.post(death);
|
||||
}
|
||||
}
|
||||
|
||||
public static void postItemComposition(ItemComposition itemComposition)
|
||||
|
||||
@@ -37,9 +37,9 @@ import net.runelite.api.NPC;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.api.VarPlayer;
|
||||
import net.runelite.api.events.ActorDeath;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
@@ -162,11 +162,11 @@ public class SpecialCounterPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onActorDeath(ActorDeath death)
|
||||
public void onNpcDespawn(NpcDespawned npcDespawned)
|
||||
{
|
||||
Actor actor = death.getActor();
|
||||
NPC actor = npcDespawned.getNpc();
|
||||
|
||||
if (actor instanceof NPC && ((NPC) actor).getId() == interactedNpcId)
|
||||
if (actor.getHealthRatio() == 0 && actor.getId() == interactedNpcId)
|
||||
{
|
||||
removeCounters();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user