use of net.runelite.api.events.DecorativeObjectChanged 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);
}
}
Aggregations