Merge pull request #5890 from Nightfirecat/colored-ground-markers
Add support for colored ground markers
This commit is contained in:
@@ -326,4 +326,36 @@ public class WorldPoint
|
||||
{
|
||||
return ((x >> 6) << 8) | (y >> 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the passed region ID and coordinates to a world coordinate
|
||||
*/
|
||||
public static WorldPoint fromRegion(int regionId, int regionX, int regionY, int plane)
|
||||
{
|
||||
return new WorldPoint(
|
||||
((regionId >>> 8) << 6) + regionX,
|
||||
((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