worldpoint: Add getRegionX() and getRegionY()
This commit is contained in:
@@ -337,4 +337,25 @@ public class WorldPoint
|
|||||||
((regionId & 0xff) << 6) + regionY,
|
((regionId & 0xff) << 6) + regionY,
|
||||||
plane);
|
plane);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the X-axis coordinate of the region coordinate
|
||||||
|
*/
|
||||||
|
public int getRegionX()
|
||||||
|
{
|
||||||
|
return getRegionOffset(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the Y-axis coordinate of the region coordinate
|
||||||
|
*/
|
||||||
|
public int getRegionY()
|
||||||
|
{
|
||||||
|
return getRegionOffset(y);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int getRegionOffset(final int position)
|
||||||
|
{
|
||||||
|
return position & 0x3f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ public class GroundMarkerPlugin extends Plugin
|
|||||||
WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, localPoint);
|
WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, localPoint);
|
||||||
|
|
||||||
int regionId = worldPoint.getRegionID();
|
int regionId = worldPoint.getRegionID();
|
||||||
GroundMarkerPoint point = new GroundMarkerPoint(regionId, worldPoint.getX() & 0x3f, worldPoint.getY() & 0x3f, client.getPlane());
|
GroundMarkerPoint point = new GroundMarkerPoint(regionId, worldPoint.getRegionX(), worldPoint.getRegionY(), client.getPlane());
|
||||||
log.debug("Updating point: {} - {}", point, worldPoint);
|
log.debug("Updating point: {} - {}", point, worldPoint);
|
||||||
|
|
||||||
List<GroundMarkerPoint> groundMarkerPoints = new ArrayList<>(getPoints(regionId));
|
List<GroundMarkerPoint> groundMarkerPoints = new ArrayList<>(getPoints(regionId));
|
||||||
|
|||||||
Reference in New Issue
Block a user