Add NPC Composition Changed Event (#820)
This commit is contained in:
@@ -24,12 +24,13 @@
|
||||
*/
|
||||
package net.runelite.mixins;
|
||||
|
||||
import java.awt.Polygon;
|
||||
import net.runelite.api.AnimationID;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.events.NpcCompositionChanged;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import java.awt.Polygon;
|
||||
import net.runelite.api.mixins.Copy;
|
||||
import net.runelite.api.mixins.FieldHook;
|
||||
import net.runelite.api.mixins.Inject;
|
||||
@@ -113,6 +114,16 @@ public abstract class RSNPCMixin implements RSNPC
|
||||
}
|
||||
}
|
||||
|
||||
@FieldHook("definition")
|
||||
@Inject
|
||||
public void afterCompositionChanged(int idx)
|
||||
{
|
||||
if (this.getDefinition() != null && this.getId() != -1)
|
||||
{
|
||||
client.getCallbacks().post(new NpcCompositionChanged(this));
|
||||
}
|
||||
}
|
||||
|
||||
@Copy("getModel")
|
||||
public abstract RSModel rs$getModel();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user