use of net.runelite.api.mixins.FieldHook in project runelite by runelite.
the class RSTileMixin method decorativeObjectChanged.
@FieldHook("decorativeObject")
@Inject
public void decorativeObjectChanged(int idx) {
DecorativeObject previous = previousDecorativeObject;
DecorativeObject current = getDecorativeObject();
previousDecorativeObject = current;
if (current == null && previous != null) {
DecorativeObjectDespawned decorativeObjectDespawned = new DecorativeObjectDespawned();
decorativeObjectDespawned.setTile(this);
decorativeObjectDespawned.setDecorativeObject(previous);
eventBus.post(decorativeObjectDespawned);
} else if (current != null && previous == null) {
DecorativeObjectSpawned decorativeObjectSpawned = new DecorativeObjectSpawned();
decorativeObjectSpawned.setTile(this);
decorativeObjectSpawned.setDecorativeObject(current);
eventBus.post(decorativeObjectSpawned);
} else if (current != null && previous != null) {
DecorativeObjectChanged decorativeObjectChanged = new DecorativeObjectChanged();
decorativeObjectChanged.setTile(this);
decorativeObjectChanged.setPrevious(previous);
decorativeObjectChanged.setDecorativeObject(current);
eventBus.post(decorativeObjectChanged);
}
}
use of net.runelite.api.mixins.FieldHook in project runelite by runelite.
the class RSTileMixin method wallObjectChanged.
@FieldHook("wallObject")
@Inject
public void wallObjectChanged(int idx) {
WallObject previous = previousWallObject;
WallObject current = getWallObject();
previousWallObject = current;
if (current == null && previous != null) {
WallObjectDespawned wallObjectDespawned = new WallObjectDespawned();
wallObjectDespawned.setTile(this);
wallObjectDespawned.setWallObject(previous);
eventBus.post(wallObjectDespawned);
} else if (current != null && previous == null) {
WallObjectSpawned wallObjectSpawned = new WallObjectSpawned();
wallObjectSpawned.setTile(this);
wallObjectSpawned.setWallObject(current);
eventBus.post(wallObjectSpawned);
} else if (current != null && previous != null) {
WallObjectChanged wallObjectChanged = new WallObjectChanged();
wallObjectChanged.setTile(this);
wallObjectChanged.setPrevious(previous);
wallObjectChanged.setWallObject(current);
eventBus.post(wallObjectChanged);
}
}
use of net.runelite.api.mixins.FieldHook in project runelite by runelite.
the class RSTileMixin method itemLayerChanged.
@FieldHook("itemLayer")
@Inject
public void itemLayerChanged(int idx) {
ItemLayerChanged itemLayerChanged = new ItemLayerChanged(this);
eventBus.post(itemLayerChanged);
}
use of net.runelite.api.mixins.FieldHook in project runelite by runelite.
the class MenuEntryEventMixin method onMenuOptionsChanged.
@FieldHook("menuOptionCount")
@Inject
public static void onMenuOptionsChanged(int idx) {
int newCount = client.getMenuOptionCount();
if (newCount == oldMenuEntryCount + 1) {
MenuEntryAdded event = new MenuEntryAdded(client.getMenuOptions()[newCount - 1], client.getMenuTargets()[newCount - 1], client.getMenuTypes()[newCount - 1], client.getMenuIdentifiers()[newCount - 1], client.getMenuActionParams0()[newCount - 1], client.getMenuActionParams1()[newCount - 1]);
eventBus.post(event);
}
oldMenuEntryCount = newCount;
}
use of net.runelite.api.mixins.FieldHook in project runelite by runelite.
the class RSNpcCompositionMixin method actionsHook.
@FieldHook("actions")
@Inject
public void actionsHook(int idx) {
NpcActionChanged npcActionChanged = new NpcActionChanged();
npcActionChanged.setNpcComposition(this);
npcActionChanged.setIdx(idx);
eventBus.post(npcActionChanged);
}
Aggregations