runelite-api: add getRegionMin/MaxLocation for GameObject
This commit is contained in:
@@ -32,5 +32,20 @@ import java.awt.Polygon;
|
||||
*/
|
||||
public interface GameObject extends TileObject
|
||||
{
|
||||
/**
|
||||
* Returns the min x,y for this game object
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Point getRegionMinLocation();
|
||||
|
||||
/**
|
||||
* Returns the max x,y for this game object. This is different from
|
||||
* {@link #getRegionMinLocation()} for objects larger than 1 tile.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Point getRegionMaxLocation();
|
||||
|
||||
Polygon getConvexHull();
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ package net.runelite.mixins;
|
||||
|
||||
import java.awt.Polygon;
|
||||
import net.runelite.api.Model;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.Renderable;
|
||||
import net.runelite.api.mixins.Inject;
|
||||
import net.runelite.api.mixins.Mixin;
|
||||
@@ -34,6 +35,20 @@ import net.runelite.rs.api.RSGameObject;
|
||||
@Mixin(RSGameObject.class)
|
||||
public abstract class RSGameObjectMixin implements RSGameObject
|
||||
{
|
||||
@Inject
|
||||
@Override
|
||||
public Point getRegionMinLocation()
|
||||
{
|
||||
return new Point(getRelativeX(), getRelativeY());
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public Point getRegionMaxLocation()
|
||||
{
|
||||
return new Point(getOffsetX(), getOffsetY());
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public Polygon getConvexHull()
|
||||
|
||||
Reference in New Issue
Block a user