mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-09-27 06:42:42 +02:00
Fix config formatting and render-thread-calculation
This commit is contained in:
parent
e555d558b7
commit
492573c866
@ -26,6 +26,13 @@ public int getRenderThreadCount() {
|
||||
return renderThreadCount;
|
||||
}
|
||||
|
||||
public int resolveRenderThreadCount() {
|
||||
if (renderThreadCount > 0)
|
||||
return renderThreadCount;
|
||||
|
||||
return Runtime.getRuntime().availableProcessors() + renderThreadCount;
|
||||
}
|
||||
|
||||
public boolean isMetrics() {
|
||||
return metrics;
|
||||
}
|
||||
|
@ -416,7 +416,7 @@ public boolean checkPausedByPlayerCount() {
|
||||
return true;
|
||||
} else {
|
||||
if (!renderManager.isRunning() && getPluginState().isRenderThreadsEnabled())
|
||||
renderManager.start(coreConfig.getRenderThreadCount());
|
||||
renderManager.start(coreConfig.resolveRenderThreadCount());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -590,7 +590,7 @@ public int startCommand(CommandContext<S> context) {
|
||||
new Thread(() -> {
|
||||
plugin.getPluginState().setRenderThreadsEnabled(true);
|
||||
|
||||
plugin.getRenderManager().start(plugin.getConfigs().getCoreConfig().getRenderThreadCount());
|
||||
plugin.getRenderManager().start(plugin.getConfigs().getCoreConfig().resolveRenderThreadCount());
|
||||
source.sendMessage(Text.of(TextColor.GREEN, "Render-Threads started!"));
|
||||
|
||||
plugin.save();
|
||||
|
@ -10,7 +10,7 @@ storage-type: SQL
|
||||
|
||||
# The JDBC-Connection URL that is used to connect to the database.
|
||||
# The format for this url is: jdbc:[driver]://[host]:[port]/[database]
|
||||
dbUrl: "jdbc:mysql://localhost:3306/bluemap"
|
||||
db-url: "jdbc:mysql://localhost:3306/bluemap"
|
||||
|
||||
# The user that is used to connect to the database
|
||||
user: "root"
|
||||
|
@ -107,7 +107,7 @@ public void renderMaps(BlueMapService blueMap, boolean watch, boolean forceRende
|
||||
Logger.global.logInfo("Start updating " + maps.size() + " maps (" + totalRegions + " regions, ~" + totalRegions * 1024L + " chunks)...");
|
||||
|
||||
// start rendering
|
||||
renderManager.start(blueMap.getConfigs().getCoreConfig().getRenderThreadCount());
|
||||
renderManager.start(blueMap.getConfigs().getCoreConfig().resolveRenderThreadCount());
|
||||
|
||||
Timer timer = new Timer("BlueMap-CLI-Timer", true);
|
||||
TimerTask updateInfoTask = new TimerTask() {
|
||||
|
Loading…
Reference in New Issue
Block a user