worldpoint: Add static fromRegion method
This commit is contained in:
committed by
Tomas Slusny
parent
b6ab78b501
commit
1675a7e0a1
@@ -326,4 +326,15 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,12 +163,7 @@ public class GroundMarkerPlugin extends Plugin
|
||||
int regionY = point.getRegionY();
|
||||
int z = point.getZ();
|
||||
|
||||
// world point of the tile marker
|
||||
return new WorldPoint(
|
||||
((regionId >>> 8) << 6) + regionX,
|
||||
((regionId & 0xff) << 6) + regionY,
|
||||
z
|
||||
);
|
||||
return WorldPoint.fromRegion(regionId, regionX, regionY, z);
|
||||
})
|
||||
.flatMap(wp -> WorldPoint.toLocalInstance(client, wp).stream())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
Reference in New Issue
Block a user