api: fix bug with tile
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user