Add WorldPoint::getRegionID
This commit is contained in:
@@ -165,4 +165,9 @@ public class WorldPoint
|
|||||||
{
|
{
|
||||||
return new Point(x, y);
|
return new Point(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getRegionID()
|
||||||
|
{
|
||||||
|
return ((x >> 6) << 8) | (y >> 6);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,9 +62,7 @@ public class LocationOverlay extends Overlay
|
|||||||
WorldPoint localWorld = client.getLocalPlayer().getWorldLocation();
|
WorldPoint localWorld = client.getLocalPlayer().getWorldLocation();
|
||||||
LocalPoint localPoint = client.getLocalPlayer().getLocalLocation();
|
LocalPoint localPoint = client.getLocalPlayer().getLocalLocation();
|
||||||
|
|
||||||
int regionX = localWorld.getX() >> 6;
|
int regionID = localWorld.getRegionID();
|
||||||
int regionY = localWorld.getY() >> 6;
|
|
||||||
int regionID = regionX << 8 | regionY;
|
|
||||||
|
|
||||||
if (client.isInInstancedRegion())
|
if (client.isInInstancedRegion())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -342,9 +342,7 @@ public class GroundMarkerPlugin extends Plugin
|
|||||||
worldPoint = WorldPoint.fromLocal(client, localPoint);
|
worldPoint = WorldPoint.fromLocal(client, localPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
int regionX = worldPoint.getX() >> 6;
|
int regionId = worldPoint.getRegionID();
|
||||||
int regionY = worldPoint.getY() >> 6;
|
|
||||||
int regionId = regionX << 8 | regionY;
|
|
||||||
GroundMarkerPoint point = new GroundMarkerPoint(regionId, worldPoint.getX() & 0x3f, worldPoint.getY() & 0x3f, client.getPlane());
|
GroundMarkerPoint point = new GroundMarkerPoint(regionId, worldPoint.getX() & 0x3f, worldPoint.getY() & 0x3f, client.getPlane());
|
||||||
log.debug("Updating point: {} - {}", point, worldPoint);
|
log.debug("Updating point: {} - {}", point, worldPoint);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user