Interface WorldView
-
public interface WorldView
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Projectile
createProjectile(int id, int plane, int startX, int startY, int startZ, int startCycle, int endCycle, int slope, int startHeight, int endHeight, Actor target, int targetX, int targetY)
Create a projectile.int
getBaseX()
Returns the x-axis base coordinate.int
getBaseY()
Returns the y-axis base coordinate.CollisionData[]
getCollisionMaps()
Gets an array of tile collision data.Deque<GraphicsObject>
getGraphicsObjects()
Gets a list of all graphics objects currently drawn.int
getId()
Get the world view idint[][][]
getInstanceTemplateChunks()
Contains a 3D array of template chunks for instanced areas.int[]
getMapRegions()
Gets an array of map region IDs that are currently loaded.int
getPlane()
Gets the current plane the player is on.Deque<Projectile>
getProjectiles()
Gets a list of all projectiles currently spawned.Scene
getScene()
Gets the worldview's sceneTile
getSelectedSceneTile()
Gets the currently selected tile.int
getSizeX()
Get the size of the world view, x-axisint
getSizeY()
Get the size of the world view, y-axisint[][][]
getTileHeights()
Gets a 3D array containing the heights of tiles in the current scene.byte[][][]
getTileSettings()
Gets a 3D array containing the settings of tiles in the current scene.boolean
isInstance()
Check if this scene is an instanceboolean
isTopLevel()
Test if this worldview is the top level world view.IndexedObjectSet<? extends NPC>
npcs()
Gets all the Non Player Characters in this viewIndexedObjectSet<? extends Player>
players()
Gets all of the Players in this viewIndexedObjectSet<? extends WorldEntity>
worldEntities()
Gets all the WorldEntities in this view
-
-
-
Method Detail
-
getId
int getId()
Get the world view id- Returns:
- the id, or -1 if this is the top level worldview
-
isTopLevel
boolean isTopLevel()
Test if this worldview is the top level world view.- Returns:
-
getScene
Scene getScene()
Gets the worldview's scene
-
players
IndexedObjectSet<? extends Player> players()
Gets all of the Players in this view
-
npcs
IndexedObjectSet<? extends NPC> npcs()
Gets all the Non Player Characters in this view
-
worldEntities
IndexedObjectSet<? extends WorldEntity> worldEntities()
Gets all the WorldEntities in this view
-
getCollisionMaps
@Nullable CollisionData[] getCollisionMaps()
Gets an array of tile collision data.The index into the array is the plane/z-axis coordinate.
- Returns:
- the collision data
-
getPlane
int getPlane()
Gets the current plane the player is on.This value indicates the current map level above ground level, where ground level is 0. For example, going up a ladder in Lumbridge castle will put the player on plane 1.
Note: This value will never be below 0. Basements and caves below ground level use a tile offset and are still considered plane 0 by the game.
- Returns:
- the plane
-
getTileHeights
int[][][] getTileHeights()
Gets a 3D array containing the heights of tiles in the current scene.- Returns:
- the tile heights
-
getTileSettings
byte[][][] getTileSettings()
Gets a 3D array containing the settings of tiles in the current scene.- Returns:
- the tile settings
-
getSizeX
int getSizeX()
Get the size of the world view, x-axis- Returns:
-
getSizeY
int getSizeY()
Get the size of the world view, y-axis- Returns:
-
getBaseX
int getBaseX()
Returns the x-axis base coordinate.This value is the x-axis world coordinate of tile (0, 0) in the current scene (ie. the bottom-left most coordinates in the scene).
- Returns:
- the base x-axis coordinate
-
getBaseY
int getBaseY()
Returns the y-axis base coordinate.This value is the y-axis world coordinate of tile (0, 0) in the current scene (ie. the bottom-left most coordinates in the scene).
- Returns:
- the base y-axis coordinate
-
createProjectile
Projectile createProjectile(int id, int plane, int startX, int startY, int startZ, int startCycle, int endCycle, int slope, int startHeight, int endHeight, @Nullable Actor target, int targetX, int targetY)
Create a projectile.- Parameters:
id
- projectile/spotanim idplane
- plane the projectile is onstartX
- local x coordinate the projectile starts atstartY
- local y coordinate the projectile starts atstartZ
- local z coordinate the projectile starts at - includes tile heightstartCycle
- cycle the project startsendCycle
- cycle the projectile endsslope
-startHeight
- start height of projectile - excludes tile heightendHeight
- end height of projectile - excludes tile heighttarget
- optional actor targettargetX
- target x - if an actor target is supplied should be the target xtargetY
- target y - if an actor target is supplied should be the target y- Returns:
- the new projectile
-
getProjectiles
Deque<Projectile> getProjectiles()
Gets a list of all projectiles currently spawned.- Returns:
- all projectiles
-
getGraphicsObjects
Deque<GraphicsObject> getGraphicsObjects()
Gets a list of all graphics objects currently drawn.- Returns:
- all graphics objects
-
getSelectedSceneTile
@Nullable Tile getSelectedSceneTile()
Gets the currently selected tile. (ie. last right clicked tile)- Returns:
- the selected tile
-
isInstance
boolean isInstance()
Check if this scene is an instance- Returns:
- See Also:
getInstanceTemplateChunks()
-
getInstanceTemplateChunks
int[][][] getInstanceTemplateChunks()
Contains a 3D array of template chunks for instanced areas.The array returned is of format [z][x][y], where z is the plane, x and y the x-axis and y-axis coordinates of a tile divided by the size of a chunk.
The bits of the int value held by the coordinates are -1 if there is no data, structured in the following format:
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |rot| y chunk coord | x chunk coord |pln| | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Returns:
- the array of instance template chunks
- See Also:
Constants.CHUNK_SIZE
,InstanceTemplates
-
getMapRegions
int[] getMapRegions()
Gets an array of map region IDs that are currently loaded.- Returns:
- the map regions
-
-