use of net.runelite.api.events.GroundObjectDespawned in project runelite by runelite.
the class RSTileMixin method groundObjectChanged.
@FieldHook("groundObject")
@Inject
public void groundObjectChanged(int idx) {
GroundObject previous = previousGroundObject;
GroundObject current = getGroundObject();
previousGroundObject = current;
if (current == null && previous != null) {
GroundObjectDespawned groundObjectDespawned = new GroundObjectDespawned();
groundObjectDespawned.setTile(this);
groundObjectDespawned.setGroundObject(previous);
eventBus.post(groundObjectDespawned);
} else if (current != null && previous == null) {
GroundObjectSpawned groundObjectSpawned = new GroundObjectSpawned();
groundObjectSpawned.setTile(this);
groundObjectSpawned.setGroundObject(current);
eventBus.post(groundObjectSpawned);
} else if (current != null && previous != null) {
GroundObjectChanged groundObjectChanged = new GroundObjectChanged();
groundObjectChanged.setTile(this);
groundObjectChanged.setPrevious(previous);
groundObjectChanged.setGroundObject(current);
eventBus.post(groundObjectChanged);
}
}
Aggregations