worldpoint: Add getRegionX() and getRegionY()
This commit is contained in:
committed by
Tomas Slusny
parent
1675a7e0a1
commit
39bbf2f259
@@ -337,4 +337,25 @@ public class WorldPoint
|
||||
((regionId & 0xff) << 6) + regionY,
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user