api: mark getClickbox as nullable
This commit is contained in:
@@ -500,7 +500,7 @@ public class Perspective
|
|||||||
* @param point the coordinate of the tile
|
* @param point the coordinate of the tile
|
||||||
* @return the clickable area of the model
|
* @return the clickable area of the model
|
||||||
*/
|
*/
|
||||||
public static Area getClickbox(@Nonnull Client client, Model model, int orientation, @Nonnull LocalPoint point)
|
public static @Nullable Area getClickbox(@Nonnull Client client, Model model, int orientation, @Nonnull LocalPoint point)
|
||||||
{
|
{
|
||||||
if (model == null)
|
if (model == null)
|
||||||
{
|
{
|
||||||
@@ -518,7 +518,7 @@ public class Perspective
|
|||||||
Area clickBox = get2DGeometry(client, triangles, point);
|
Area clickBox = get2DGeometry(client, triangles, point);
|
||||||
Area visibleAABB = getAABB(client, vertices, point);
|
Area visibleAABB = getAABB(client, vertices, point);
|
||||||
|
|
||||||
if (visibleAABB == null || clickBox == null)
|
if (visibleAABB == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -540,7 +540,7 @@ public class Perspective
|
|||||||
&& (point.getY() < 0 || point.getY() >= client.getViewportHeight());
|
&& (point.getY() < 0 || point.getY() >= client.getViewportHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Area get2DGeometry(
|
private static @Nonnull Area get2DGeometry(
|
||||||
@Nonnull Client client,
|
@Nonnull Client client,
|
||||||
@Nonnull List<Triangle> triangles,
|
@Nonnull List<Triangle> triangles,
|
||||||
@Nonnull LocalPoint point
|
@Nonnull LocalPoint point
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ package net.runelite.api;
|
|||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Polygon;
|
import java.awt.Polygon;
|
||||||
import java.awt.geom.Area;
|
import java.awt.geom.Area;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import net.runelite.api.coords.LocalPoint;
|
import net.runelite.api.coords.LocalPoint;
|
||||||
import net.runelite.api.coords.WorldPoint;
|
import net.runelite.api.coords.WorldPoint;
|
||||||
|
|
||||||
@@ -130,5 +131,6 @@ public interface TileObject
|
|||||||
*
|
*
|
||||||
* @return the clickable area
|
* @return the clickable area
|
||||||
*/
|
*/
|
||||||
|
@Nullable
|
||||||
Area getClickbox();
|
Area getClickbox();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user