Instances

Working with in-game instances.

Let's look at how to convert between a Coordinate in the "real" world to it's mapped position within the current instance, using Coordinate.instance() and Coordinate.uninstance().

//South-west portal in pest control in the "real" world
Coordinate portal = new Coordinate(2645, 2572, 0);

//This gives us the position of the portal coordinate in our current instance
Coordinate instancedPortal = Coordinate.instance(portal);

//This converts that position back to the "real world"
Coordinate uninstancedPortal = Coordinate.uninstance(instancedPortal);

assert uninstancedPortal.equals(portal);

Last updated