From f757f15c29a5e8bc9bd2b46e13be3cd4ca09ce92 Mon Sep 17 00:00:00 2001 From: SRLJustin Date: Mon, 21 Mar 2022 10:17:38 +1100 Subject: [PATCH] Perspective: add in previous getClickBox function with Deprecated flag to prevent older plugins from crashing. --- .../java/net/runelite/api/Perspective.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/runelite-api/src/main/java/net/runelite/api/Perspective.java b/runelite-api/src/main/java/net/runelite/api/Perspective.java index e5b290254a..1035b5d511 100644 --- a/runelite-api/src/main/java/net/runelite/api/Perspective.java +++ b/runelite-api/src/main/java/net/runelite/api/Perspective.java @@ -670,6 +670,33 @@ public class Perspective return new Point(xOffset, yOffset); } + /** + * You don't want this. Use {@link //TileObject#getClickbox()} instead. + *

+ * Get the on-screen clickable area of {@code model} as though it's for the + * object on the tile at ({@code localX}, {@code localY}) and rotated to + * angle {@code orientation}. + * @param client the game client + * @param model the model to calculate a clickbox for + * @param orientation the orientation of the model (0-2048, where 0 is north) + * @param point the coordinate of the tile + * @return the clickable area of the model + */ + @Deprecated(since = "4.20.4", forRemoval = true) + public static Shape getClickbox(@Nonnull Client client, Model model, int orientation, LocalPoint point) + { + if (model == null) + { + return null; + } + + int x = point.getX(); + int y = point.getY(); + int z = getTileHeight(client, point, client.getPlane()); + + return getClickbox(client, model, orientation, x, y, z); + } + /** * You don't want this. Use {@link //TileObject#getClickbox()} instead. *