Search in sources :

Example 1 with WallObjectDespawned

use of net.runelite.api.events.WallObjectDespawned 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);
    }
}
Also used : WallObject(net.runelite.api.WallObject) WallObjectDespawned(net.runelite.api.events.WallObjectDespawned) WallObjectChanged(net.runelite.api.events.WallObjectChanged) WallObjectSpawned(net.runelite.api.events.WallObjectSpawned) Inject(net.runelite.api.mixins.Inject) FieldHook(net.runelite.api.mixins.FieldHook)

Aggregations

WallObject (net.runelite.api.WallObject)1 WallObjectChanged (net.runelite.api.events.WallObjectChanged)1 WallObjectDespawned (net.runelite.api.events.WallObjectDespawned)1 WallObjectSpawned (net.runelite.api.events.WallObjectSpawned)1 FieldHook (net.runelite.api.mixins.FieldHook)1 Inject (net.runelite.api.mixins.Inject)1