@@ -10,13 +10,13 @@ out due to a sync load, as the worldgen threads will be
10
10
stalling on profile lookups.
11
11
12
12
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
13
- index 5f9e3d37c3ba79d26806374d73f87328cebb562d..206c6ce227ba19620185ac835af28d67caa76c40 100644
13
+ index d7e22ddf89619b58516ccef1d75a4c33df61b73c..33ec7786cdf8c32e905d192fc8364418e47404d5 100644
14
14
--- a/src/main/java/net/minecraft/Util.java
15
15
+++ b/src/main/java/net/minecraft/Util.java
16
16
@@ -80,6 +80,22 @@ public class Util {
17
17
private static final AtomicInteger WORKER_COUNT = new AtomicInteger(1);
18
- private static final ExecutorService BOOTSTRAP_EXECUTOR = makeExecutor("Bootstrap", -2); // Paper - add -2 priority
19
- private static final ExecutorService BACKGROUND_EXECUTOR = makeExecutor("Main", -1); // Paper - add -1 priority
18
+ private static final ExecutorService BOOTSTRAP_EXECUTOR = makeExecutor("Bootstrap");
19
+ private static final ExecutorService BACKGROUND_EXECUTOR = makeExecutor("Main");
20
20
+ // Paper start - don't submit BLOCKING PROFILE LOOKUPS to the world gen thread
21
21
+ public static final ExecutorService PROFILE_EXECUTOR = Executors.newFixedThreadPool(2, new java.util.concurrent.ThreadFactory() {
22
22
+
@@ -37,10 +37,10 @@ index 5f9e3d37c3ba79d26806374d73f87328cebb562d..206c6ce227ba19620185ac835af28d67
37
37
public static LongSupplier timeSource = System::nanoTime;
38
38
public static final Ticker TICKER = new Ticker() {
39
39
diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java
40
- index 8d86645ef264287d01203afd7bba516e78be5743..4dff88bdf14675718572e4b3720c0250ce6e730e 100644
40
+ index c7edbd12361cfd3dcf1359917d579fae4c3cc8a7..6c8a1d9c7696fa55dae6ba5e4ea50a0ffc7ea543 100644
41
41
--- a/src/main/java/net/minecraft/server/players/GameProfileCache.java
42
42
+++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java
43
- @@ -207 ,7 +207 ,7 @@ public class GameProfileCache {
43
+ @@ -181 ,7 +181 ,7 @@ public class GameProfileCache {
44
44
} else {
45
45
this.requests.put(username, CompletableFuture.supplyAsync(() -> {
46
46
return this.get(username);
@@ -62,3 +62,16 @@ index 0c7e29b589ab106013d979a20edc415b4b32a677..c5d5d90d10b30f30d1262367b3d75df4
62
62
Util.ifElse(profile, (profilex) -> {
63
63
Property property = Iterables.getFirst(profilex.getProperties().get("textures"), (Property)null);
64
64
if (property == null) {
65
+ diff --git a/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java b/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java
66
+ index 2d49bd6f3f017d43dfaa23cedf35040b64bcdcf8..9edc5e73819e0b55372f77c5e292eece74d837c7 100644
67
+ --- a/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java
68
+ +++ b/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java
69
+ @@ -121,7 +121,7 @@ public final class CraftPlayerProfile implements PlayerProfile {
70
+
71
+ @Override
72
+ public CompletableFuture<PlayerProfile> update() {
73
+ - return CompletableFuture.supplyAsync(this::getUpdatedProfile, Util.backgroundExecutor());
74
+ + return CompletableFuture.supplyAsync(this::getUpdatedProfile, Util.PROFILE_EXECUTOR); // Paper - not a good idea to use BLOCKING OPERATIONS on the worldgen executor
75
+ }
76
+
77
+ private CraftPlayerProfile getUpdatedProfile() {
0 commit comments