Interface RenderManager


public interface RenderManager
The RenderManager is used to schedule tile-renders and process them on a number of different threads.
  • Method Details

    • scheduleMapUpdateTask

      default boolean scheduleMapUpdateTask(BlueMapMap map)
      Schedules a task to update the given map.
      Parameters:
      map - the map to be updated
      Returns:
      true if a new task has been scheduled, false if not (usually because there is already an update-task for this map scheduled)
    • scheduleMapUpdateTask

      boolean scheduleMapUpdateTask(BlueMapMap map, boolean force)
      Schedules a task to update the given map.
      Parameters:
      map - the map to be updated
      force - it this is true, the task will forcefully re-render all tiles, even if there are no changes since the last map-update.
      Returns:
      true if a new task has been scheduled, false if not (usually because there is already an update-task for this map scheduled)
    • scheduleMapUpdateTask

      boolean scheduleMapUpdateTask(BlueMapMap map, Collection<Vector2i> regions, boolean force)
      Schedules a task to update the given map.
      Parameters:
      map - the map to be updated
      regions - The regions that should be updated ("region" refers to the coordinates of a minecraft region-file (32x32 chunks, 512x512 blocks))
      BlueMaps updating-system works based on region-files. For this reason you can always only update a whole region-file at once.
      force - it this is true, the task will forcefully re-render all tiles, even if there are no changes since the last map-update.
      Returns:
      true if a new task has been scheduled, false if not (usually because there is already an update-task for this map scheduled)
    • scheduleMapPurgeTask

      boolean scheduleMapPurgeTask(BlueMapMap map) throws IOException
      Schedules a task to purge the given map. An update-task will be scheduled right after the purge, to get the map up-to-date again.
      Parameters:
      map - the map to be purged
      Returns:
      true if a new task has been scheduled, false if not (usually because there is already an update-task for this map scheduled)
      Throws:
      IOException - if an IOException occurs while trying to create the task.
    • renderQueueSize

      int renderQueueSize()
      Getter for the current size of the render-queue.
      Returns:
      the current size of the render-queue
    • renderThreadCount

      int renderThreadCount()
      Getter for the current count of render threads.
      Returns:
      the count of render threads
    • isRunning

      boolean isRunning()
      Whether this RenderManager is currently running or stopped.
      Returns:
      true if this renderer is running
    • start

      void start()
      Starts the renderer if it is not already running. The renderer will be started with the configured number of render threads.
    • start

      void start(int threadCount)
      Starts the renderer if it is not already running. The renderer will be started with the given number of render threads.
      Parameters:
      threadCount - the number of render threads to use, must be greater than 0 and should be less than or equal to the number of available cpu-cores.
    • stop

      void stop()
      Stops the renderer if it currently is running.