Skip to content

Instantly share code, notes, and snippets.

Discord: lare96 #6102

Cliven Mitchell lare96

Discord: lare96 #6102
  • Toronto, ON
Block or report user

Report or block lare96

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
private List<Region> getViewableRegions(Position position) {
RegionCoordinates coords = position.getRegionCoordinates(); // Current region's coordinates.
int localX = coords.getLocalX(position), localY = coords.getLocalY(position); // Player's (x,y) in the region.
boolean isEastViewable = localX + VIEWING_DISTANCE >= 63; // Is eastern region viewable?
boolean isWestViewable = localX - VIEWING_DISTANCE <= 0; // Is western region viewable?
boolean isNorthViewable = localY + VIEWING_DISTANCE >= 63; // Is northern region viewable?
boolean isSouthViewable = localY - VIEWING_DISTANCE <= 0; // Is southern region viewable?
List<Region> regions = new LinkedList<>(); // A list to store viewable regions.
package luna;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.concurrent.ThreadLocalRandom;
You can’t perform that action at this time.