Interface WorldView


  • public interface WorldView
    • 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
      • 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 id
        plane - plane the projectile is on
        startX - local x coordinate the projectile starts at
        startY - local y coordinate the projectile starts at
        startZ - local z coordinate the projectile starts at - includes tile height
        startCycle - cycle the project starts
        endCycle - cycle the projectile ends
        slope -
        startHeight - start height of projectile - excludes tile height
        endHeight - end height of projectile - excludes tile height
        target - optional actor target
        targetX - target x - if an actor target is supplied should be the target x
        targetY - 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
      • 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