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
|
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();
|
Polygon getConvexHull();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ package net.runelite.mixins;
|
|||||||
|
|
||||||
import java.awt.Polygon;
|
import java.awt.Polygon;
|
||||||
import net.runelite.api.Model;
|
import net.runelite.api.Model;
|
||||||
|
import net.runelite.api.Point;
|
||||||
import net.runelite.api.Renderable;
|
import net.runelite.api.Renderable;
|
||||||
import net.runelite.api.mixins.Inject;
|
import net.runelite.api.mixins.Inject;
|
||||||
import net.runelite.api.mixins.Mixin;
|
import net.runelite.api.mixins.Mixin;
|
||||||
@@ -34,6 +35,20 @@ import net.runelite.rs.api.RSGameObject;
|
|||||||
@Mixin(RSGameObject.class)
|
@Mixin(RSGameObject.class)
|
||||||
public abstract class RSGameObjectMixin implements RSGameObject
|
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
|
@Inject
|
||||||
@Override
|
@Override
|
||||||
public Polygon getConvexHull()
|
public Polygon getConvexHull()
|
||||||
|
|||||||
Reference in New Issue
Block a user