Class Map
- java.lang.Object
-
- net.eternalclient.api.wrappers.map.Map
-
public class Map extends java.lang.Object
Represents a map in the game. Provides various methods to access and manipulate map data.
-
-
Constructor Summary
Constructors Constructor Description Map()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RSSpritePixels
createDot(java.awt.Color color)
Creates a dot sprite with the specified color.static Positionable
getBase()
Returns the base tile of the map coordinates.static Positionable
getBase(int plane)
Returns the base tile for a given plane.static int
getBaseX()
Returns the base X coordinate of the current map area.static int
getBaseY()
Returns the base Y coordinate of the current map.static int[][]
getCollisionFlags()
Retrieves the collision flags for the current plane of the map.static int[][]
getCollisionFlags(int plane)
Retrieves the collision flags for a specific plane in the game map.static int
getPlane()
Returns the current plane level of the player's location in the map.protected static int
getPlaneFromInstance(int sceneX, int sceneY, int plane)
static java.awt.Polygon
getPolygon(Positionable tile)
Returns a Polygon object representing the visual representation of a specific tile on the in-game map.static java.awt.Polygon
getPolygonArea(Positionable centerTile, int size)
Retrieves the polygon area of a specified size centered around a given tile.static byte[][][]
getTileSettings()
Returns the tile settings for the map.protected static int
getWorldXFromInstance(int sceneX, int sceneY, int plane, int defaultWorldX)
protected static int
getWorldYFromInstance(int sceneX, int sceneY, int plane, int defaultWorldY)
static boolean
isInInstance()
Checks if the client is currently in an instanced region.protected static int
rotateChunkX(int x, int y, int rotation)
protected static int
rotateChunkY(int x, int y, int rotation)
-
-
-
Method Detail
-
createDot
public static RSSpritePixels createDot(java.awt.Color color)
Creates a dot sprite with the specified color. If the sprite already exists, it is returned directly.- Parameters:
color
- the color of the dot- Returns:
- the dot sprite
-
getBaseX
public static int getBaseX()
Returns the base X coordinate of the current map area.- Returns:
- the base X coordinate
-
getBaseY
public static int getBaseY()
Returns the base Y coordinate of the current map.- Returns:
- the base Y coordinate of the current map.
-
getPlane
public static int getPlane()
Returns the current plane level of the player's location in the map.- Returns:
- the plane level as an integer value
-
getCollisionFlags
public static int[][] getCollisionFlags()
Retrieves the collision flags for the current plane of the map.- Returns:
- a 2D array representing the collision flags for the current plane.
-
getCollisionFlags
public static int[][] getCollisionFlags(int plane)
Retrieves the collision flags for a specific plane in the game map.- Parameters:
plane
- the plane for which to retrieve the collision flags- Returns:
- a 2D array of collision flags for the specified plane, or an empty 2D array if no collision flags are available
-
getTileSettings
public static byte[][][] getTileSettings()
Returns the tile settings for the map.- Returns:
- a three-dimensional byte array representing the tile settings
-
getBase
public static Positionable getBase()
Returns the base tile of the map coordinates.- Returns:
- the base tile of the map coordinates
-
getBase
public static Positionable getBase(int plane)
Returns the base tile for a given plane.- Parameters:
plane
- the desired plane- Returns:
- the base tile with the specified plane
-
getPolygon
public static java.awt.Polygon getPolygon(Positionable tile)
Returns a Polygon object representing the visual representation of a specific tile on the in-game map.- Parameters:
tile
- the tile for which the Polygon object is to be obtained- Returns:
- a Polygon object representing the visual representation of the given tile
-
getPolygonArea
public static java.awt.Polygon getPolygonArea(Positionable centerTile, int size)
Retrieves the polygon area of a specified size centered around a given tile.- Parameters:
centerTile
- the center tile of the areasize
- the size of the area- Returns:
- a Polygon representing the area on the game canvas
-
isInInstance
public static boolean isInInstance()
Checks if the client is currently in an instanced region.- Returns:
true
if the client is in an instanced region,false
otherwise.
-
getWorldXFromInstance
protected static int getWorldXFromInstance(int sceneX, int sceneY, int plane, int defaultWorldX)
-
getWorldYFromInstance
protected static int getWorldYFromInstance(int sceneX, int sceneY, int plane, int defaultWorldY)
-
getPlaneFromInstance
protected static int getPlaneFromInstance(int sceneX, int sceneY, int plane)
-
rotateChunkX
protected static int rotateChunkX(int x, int y, int rotation)
-
rotateChunkY
protected static int rotateChunkY(int x, int y, int rotation)
-
-