use of net.runelite.api.Tile in project runelite by runelite.
the class RSRegionMixin method rl$addItemPile.
@Replace("addItemPile")
public void rl$addItemPile(int plane, int x, int y, int hash, Renderable var5, int var6, Renderable var7, Renderable var8) {
rs$addItemPile(plane, x, y, hash, var5, var6, var7, var8);
Tile tile = getTiles()[plane][x][y];
if (tile != null) {
RSItemLayer itemLayer = (RSItemLayer) tile.getItemLayer();
if (itemLayer != null) {
itemLayer.setPlane(plane);
}
}
}
use of net.runelite.api.Tile in project runelite by runelite.
the class RSRegionMixin method rl$groundObjectSpawned.
@Replace("groundObjectSpawned")
public void rl$groundObjectSpawned(int plane, int x, int y, int hash, Renderable var5, int var6, int var7) {
rs$groundObjectSpawned(plane, x, y, hash, var5, var6, var7);
Tile tile = getTiles()[plane][x][y];
if (tile != null) {
RSGroundObject groundObject = (RSGroundObject) tile.getGroundObject();
if (groundObject != null) {
groundObject.setPlane(plane);
}
}
}
use of net.runelite.api.Tile in project runelite by runelite.
the class RegionTileManager method forEachTile.
/**
* Iterates over each tile in current region if player is logged in
* @param consumer consumer accepting tile as parameter
*/
public void forEachTile(Consumer<Tile> consumer) {
final Client client = clientProvider.get();
if (client == null || client.getGameState() != GameState.LOGGED_IN) {
return;
}
final Region region = client.getRegion();
final Tile[][][] tiles = region.getTiles();
int z = client.getPlane();
for (int x = 0; x < REGION_SIZE; ++x) {
for (int y = 0; y < REGION_SIZE; ++y) {
Tile tile = tiles[z][x][y];
if (tile == null) {
continue;
}
consumer.accept(tile);
}
}
}
use of net.runelite.api.Tile in project runelite by runelite.
the class RaidsPlugin method buildRaid.
private Raid buildRaid() {
Point gridBase = findLobbyBase();
if (gridBase == null) {
return null;
}
Raid raid = new Raid();
Tile[][] tiles;
int position, x, y, offsetX;
int startX = -2;
for (int plane = 3; plane > 1; plane--) {
tiles = client.getRegion().getTiles()[plane];
if (tiles[gridBase.getX() + RaidRoom.ROOM_MAX_SIZE][gridBase.getY()] == null) {
position = 1;
} else {
position = 0;
}
for (int i = 1; i > -2; i--) {
y = gridBase.getY() + (i * RaidRoom.ROOM_MAX_SIZE);
for (int j = startX; j < 4; j++) {
x = gridBase.getX() + (j * RaidRoom.ROOM_MAX_SIZE);
offsetX = 0;
if (x > SCENE_SIZE && position > 1 && position < 4) {
position++;
}
if (x < 0) {
// add 1 because the tile at x=0 will always be null
offsetX = Math.abs(x) + 1;
}
if (x < SCENE_SIZE && y >= 0 && y < SCENE_SIZE) {
if (tiles[x + offsetX][y] == null) {
if (position == 4) {
position++;
break;
}
continue;
}
if (position == 0 && startX != j) {
startX = j;
}
Tile base = tiles[offsetX > 0 ? 1 : x][y];
RaidRoom room = determineRoom(base);
raid.setRoom(room, position + Math.abs((plane - 3) * 8));
position++;
}
}
}
}
return raid;
}
use of net.runelite.api.Tile in project runelite by runelite.
the class RSRegionMixin method rl$addBoundaryDecoration.
@Replace("addBoundaryDecoration")
public void rl$addBoundaryDecoration(int plane, int x, int y, int hash, Renderable var5, Renderable var6, int var7, int var8, int var9, int var10, int var11, int var12) {
rs$addBoundaryDecoration(plane, x, y, hash, var5, var6, var7, var8, var9, var10, var11, var12);
Tile tile = getTiles()[plane][x][y];
if (tile != null) {
RSDecorativeObject object = (RSDecorativeObject) tile.getDecorativeObject();
if (object != null) {
object.setPlane(plane);
}
}
}
Aggregations