Remove ability to disable async chunks unless single core cpu

Too many people try to disable async chunks thinking its the cure
to some mysterious problem.

It is not possible to fully disable async chunks, and the portion
that this config controls is so minor in the grand scheme of things.

People are needlessly hurting their server following bad advice, so
just kill this config except for the people who might actually benefit from it.
This commit is contained in:
Aikar 2020-07-27 23:01:56 -04:00
parent dda6cbb298
commit 529c4f9f90

View file

@ -218,9 +218,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private static void asyncChunks() {
+ ConfigurationSection section;
+ if (version < 15) {
+ boolean enabled = config.getBoolean("settings.async-chunks", true);
+ section = config.createSection("settings.async-chunks");
+ section.set("enable", enabled);
+ section.set("threads", -1);
+ } else {
+ section = config.getConfigurationSection("settings.async-chunks");
@ -236,9 +234,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ section.set("load-threads", null);
+ }
+ section.set("generation", null);
+ section.set("enabled", null);
+ section.set("thread-per-world-generation", null);
+
+ asyncChunks = getBoolean("settings.async-chunks.enable", true);
+ int threads = getInt("settings.async-chunks.threads", -1);
+ int cpus = Runtime.getRuntime().availableProcessors();
+ if (threads <= 0) {
@ -246,6 +244,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ if (cpus == 1 && !Boolean.getBoolean("Paper.allowAsyncChunksSingleCore")) {
+ asyncChunks = false;
+ } else {
+ asyncChunks = true;
+ }
+
+ // Let Shared Host set some limits