Search in sources :

Example 1 with WallObject

use of net.runelite.api.WallObject in project runelite by runelite.

the class BarrowsPlugin method onWallObjectChanged.

@Subscribe
public void onWallObjectChanged(WallObjectChanged event) {
    WallObject previous = event.getPrevious();
    WallObject wallObject = event.getWallObject();
    walls.remove(previous);
    if (BARROWS_WALLS.contains(wallObject.getId())) {
        walls.add(wallObject);
    }
}
Also used : WallObject(net.runelite.api.WallObject) Subscribe(com.google.common.eventbus.Subscribe)

Example 2 with WallObject

use of net.runelite.api.WallObject in project runelite by runelite.

the class MotherlodePlugin method onWallObjectDespawned.

@Subscribe
public void onWallObjectDespawned(WallObjectDespawned event) {
    WallObject wallObject = event.getWallObject();
    veins.remove(wallObject);
}
Also used : WallObject(net.runelite.api.WallObject) Subscribe(com.google.common.eventbus.Subscribe)

Example 3 with WallObject

use of net.runelite.api.WallObject 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)

Example 4 with WallObject

use of net.runelite.api.WallObject in project runelite by runelite.

the class BarrowsPlugin method onWallObjectDespawned.

@Subscribe
public void onWallObjectDespawned(WallObjectDespawned event) {
    WallObject wallObject = event.getWallObject();
    walls.remove(wallObject);
}
Also used : WallObject(net.runelite.api.WallObject) Subscribe(com.google.common.eventbus.Subscribe)

Example 5 with WallObject

use of net.runelite.api.WallObject in project runelite by runelite.

the class MotherlodePlugin method onWallObjectChanged.

@Subscribe
public void onWallObjectChanged(WallObjectChanged event) {
    WallObject previous = event.getPrevious();
    WallObject wallObject = event.getWallObject();
    veins.remove(previous);
    if (MINE_SPOTS.contains(wallObject.getId())) {
        veins.add(wallObject);
    }
}
Also used : WallObject(net.runelite.api.WallObject) Subscribe(com.google.common.eventbus.Subscribe)

Aggregations

WallObject (net.runelite.api.WallObject)5 Subscribe (com.google.common.eventbus.Subscribe)4 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