Search in sources :

Example 1 with DecorativeObject

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

the class PohPlugin method onDecorativeObjectDespawned.

@Subscribe
public void onDecorativeObjectDespawned(DecorativeObjectDespawned event) {
    DecorativeObject decorativeObject = event.getDecorativeObject();
    pohObjects.remove(decorativeObject);
}
Also used : DecorativeObject(net.runelite.api.DecorativeObject) Subscribe(com.google.common.eventbus.Subscribe)

Example 2 with DecorativeObject

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

the class RunecraftPlugin method onDecorativeObjectDespawned.

@Subscribe
public void onDecorativeObjectDespawned(DecorativeObjectDespawned event) {
    DecorativeObject decorativeObject = event.getDecorativeObject();
    abyssObjects.remove(decorativeObject);
}
Also used : DecorativeObject(net.runelite.api.DecorativeObject) Subscribe(com.google.common.eventbus.Subscribe)

Example 3 with DecorativeObject

use of net.runelite.api.DecorativeObject 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);
    }
}
Also used : DecorativeObjectDespawned(net.runelite.api.events.DecorativeObjectDespawned) DecorativeObjectChanged(net.runelite.api.events.DecorativeObjectChanged) DecorativeObject(net.runelite.api.DecorativeObject) DecorativeObjectSpawned(net.runelite.api.events.DecorativeObjectSpawned) Inject(net.runelite.api.mixins.Inject) FieldHook(net.runelite.api.mixins.FieldHook)

Aggregations

DecorativeObject (net.runelite.api.DecorativeObject)3 Subscribe (com.google.common.eventbus.Subscribe)2 DecorativeObjectChanged (net.runelite.api.events.DecorativeObjectChanged)1 DecorativeObjectDespawned (net.runelite.api.events.DecorativeObjectDespawned)1 DecorativeObjectSpawned (net.runelite.api.events.DecorativeObjectSpawned)1 FieldHook (net.runelite.api.mixins.FieldHook)1 Inject (net.runelite.api.mixins.Inject)1