api: mark getClickbox as nullable

This commit is contained in:
Adam
2018-12-26 15:44:52 -05:00
parent 7ccf52b3b4
commit 626be60c55
2 changed files with 5 additions and 3 deletions

View File

@@ -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

View File

@@ -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();
} }