Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Checks if the player is in a given rectangle.
- *
- * @author Alekz
- *
- * @param lowX - The X coord of the south-westerly corner of the rectangle.
- * @param lowY - The Y coord of the south-westerly corner of the rectangle.
- * @param highX - The X coord of the north-easterly corner of the rectangle.
- * @param highY - The Y coord of the north-easterly corner of the rectangle.
- */
- public boolean playerInRect(int lowX, int lowY, int highX, int highY) {
- int X = getMyPlayer().getLocation().getX();
- int Y = getMyPlayer().getLocation().getY();
- if (X >= lowX && X <= highX && Y >= lowY && Y <= highY)
- return true;
- else
- return false;
- }
Add Comment
Please, Sign In to add comment