worldpoint: Add static fromRegion method

This commit is contained in:
Jordan Atwood
2019-03-02 12:23:15 +01:00
committed by Tomas Slusny
parent b6ab78b501
commit 1675a7e0a1
2 changed files with 12 additions and 6 deletions
@@ -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());