diff --git a/core/src/main/java/net/pl3x/map/core/configuration/Config.java b/core/src/main/java/net/pl3x/map/core/configuration/Config.java index a0c4a2cae..88ee80025 100644 --- a/core/src/main/java/net/pl3x/map/core/configuration/Config.java +++ b/core/src/main/java/net/pl3x/map/core/configuration/Config.java @@ -118,6 +118,12 @@ How many scroll pixels (as reported by L.DomEvent.getWheelDelta) mean for security reasons. But you do you, boo boo.""") public static boolean HTTPD_FOLLOW_SYMLINKS = false; + @Key("settings.performance.live-update-threads") + @Comment(""" + The number of process-threads to use for real-time marker updates on the map. + Value of -1 will use 50% of the available cpu-threads. (recommended)""") + public static int LIVE_UPDATE_THREADS = -1; + @Key("settings.performance.render-threads") @Comment(""" The number of process-threads to use for loading and scanning chunks. diff --git a/core/src/main/java/net/pl3x/map/core/renderer/task/UpdateLiveData.java b/core/src/main/java/net/pl3x/map/core/renderer/task/UpdateLiveData.java index e03b11bc4..794fcc22c 100644 --- a/core/src/main/java/net/pl3x/map/core/renderer/task/UpdateLiveData.java +++ b/core/src/main/java/net/pl3x/map/core/renderer/task/UpdateLiveData.java @@ -45,8 +45,8 @@ public class UpdateLiveData extends AbstractDataTask { .build(); private Map> liveUpdateFutures; - public UpdateLiveData(@NotNull World world) { - super(1, true, world, "Pl3xMap-LiveData", 2); + public UpdateLiveData(@NotNull World world, int threads) { + super(1, true, world, "Pl3xMap-LiveData", threads); this.liveUpdateFutures = new HashMap<>(); } diff --git a/core/src/main/java/net/pl3x/map/core/world/World.java b/core/src/main/java/net/pl3x/map/core/world/World.java index aa1cfc4f0..7fc4e7145 100644 --- a/core/src/main/java/net/pl3x/map/core/world/World.java +++ b/core/src/main/java/net/pl3x/map/core/world/World.java @@ -43,6 +43,7 @@ import javax.imageio.ImageIO; import net.pl3x.map.core.Keyed; import net.pl3x.map.core.Pl3xMap; +import net.pl3x.map.core.configuration.Config; import net.pl3x.map.core.configuration.PlayersLayerConfig; import net.pl3x.map.core.configuration.SpawnLayerConfig; import net.pl3x.map.core.configuration.WorldBorderLayerConfig; @@ -128,7 +129,7 @@ public World(@NotNull String name, long seed, @NotNull Point spawn, @NotNull Typ this.regionModifiedState = new RegionModifiedState(this); //this.regionFileWatcher = new RegionFileWatcher(this); this.markerTask = new UpdateMarkerData(this); - this.liveDataTask = new UpdateLiveData(this); + this.liveDataTask = new UpdateLiveData(this, Config.LIVE_UPDATE_THREADS); } protected void init() {