Merge pull request #3147 from SRLJustin/perspective

perspective: prevent outdated plugins from crashing
This commit is contained in:
Justin
2022-03-21 10:45:02 +11:00
committed by GitHub

View File

@@ -670,6 +670,33 @@ public class Perspective
return new Point(xOffset, yOffset);
}
/**
* You don't want this. Use {@link //TileObject#getClickbox()} instead.
* <p>
* 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.
* <p>