Package de.bluecolored.bluemap.api
Interface RenderManager
public interface RenderManager
The
RenderManager
is used to schedule tile-renders and process them on a number of different threads.-
Method Summary
Modifier and TypeMethodDescriptionboolean
Whether thisRenderManager
is currently running or stopped.int
Getter for the current size of the render-queue.int
Getter for the current count of render threads.boolean
Schedules a task to purge the given map.default boolean
Schedules a task to update the given map.boolean
scheduleMapUpdateTask
(BlueMapMap map, boolean force) Schedules a task to update the given map.boolean
scheduleMapUpdateTask
(BlueMapMap map, Collection<Vector2i> regions, boolean force) Schedules a task to update the given map.void
start()
Starts the renderer if it is not already running.void
start
(int threadCount) Starts the renderer if it is not already running.void
stop()
Stops the renderer if it currently is running.
-
Method Details
-
scheduleMapUpdateTask
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
Schedules a task to update the given map.- Parameters:
map
- the map to be updatedforce
- 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
Schedules a task to update the given map.- Parameters:
map
- the map to be updatedregions
- 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
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 thisRenderManager
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.
-