api: fix bug with tile

This commit is contained in:
ThatGamerBlue
2021-03-24 21:51:18 +00:00
parent 24d211b7a5
commit fa6cdb897e
3 changed files with 37 additions and 3 deletions

View File

@@ -27,7 +27,7 @@ object ProjectVersions {
const val launcherVersion = "2.2.0"
const val rlVersion = "1.7.3"
const val openosrsVersion = "4.2.0"
const val openosrsVersion = "4.2.1"
const val rsversion = 194
const val cacheversion = 165

View File

@@ -29,7 +29,7 @@ import java.util.List;
/**
* Represents a tile in the game.
*/
public interface Tile extends TileObject
public interface Tile extends Locatable
{
/**
* Gets the decoration on the tile.
@@ -108,6 +108,13 @@ public interface Tile extends TileObject
*/
Point getSceneLocation();
/**
* Gets the plane that this tile is on.
*
* @return the plane
*/
int getPlane();
/**
* Get the plane this tile is rendered on, which is where the tile heights are from.
*

View File

@@ -24,14 +24,41 @@
*/
package net.runelite.api.queries;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import net.runelite.api.Client;
import net.runelite.api.Constants;
import net.runelite.api.LocatableQueryResults;
import net.runelite.api.Scene;
import net.runelite.api.Tile;
public class TileQuery extends TileObjectQuery<Tile, TileQuery>
@Deprecated(since = "4.2.1", forRemoval = true)
public class TileQuery extends LocatableQuery<Tile, TileQuery>
{
private List<Tile> getTiles(Client client)
{
List<Tile> tilesList = new ArrayList<>();
Scene scene = client.getScene();
Tile[][][] tiles = scene.getTiles();
int z = client.getPlane();
for (int x = 0; x < Constants.SCENE_SIZE; ++x)
{
for (int y = 0; y < Constants.SCENE_SIZE; ++y)
{
Tile tile = tiles[z][x][y];
if (tile == null)
{
continue;
}
tilesList.add(tile);
}
}
return tilesList;
}
@Deprecated(since = "4.2.1", forRemoval = true)
@Override
public LocatableQueryResults<Tile> result(Client client)
{