3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-20 06:50:09 +01:00

Ensure executor service isn't null by accessing it via the getter (#4328)

Dieser Commit ist enthalten in:
chris 2023-12-06 22:22:21 +01:00 committet von GitHub
Ursprung 94a1cbeb83
Commit 9d6dd58fd8
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
2 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -134,7 +134,7 @@ public class FakeHeadProvider {
session.getPlayerWithCustomHeads().add(entity.getUuid());
String texturesProperty = entity.getTexturesProperty();
SkinProvider.EXECUTOR_SERVICE.execute(() -> {
SkinProvider.getExecutorService().execute(() -> {
try {
SkinProvider.SkinData mergedSkinData = MERGED_SKINS_LOADING_CACHE.get(new FakeHeadEntry(texturesProperty, fakeHeadSkinUrl, entity));
SkinManager.sendSkinPacket(session, entity, mergedSkinData);

Datei anzeigen

@ -58,7 +58,7 @@ import java.util.function.Predicate;
public class SkinProvider {
private static final boolean ALLOW_THIRD_PARTY_CAPES = GeyserImpl.getInstance().getConfig().isAllowThirdPartyCapes();
static ExecutorService EXECUTOR_SERVICE;
private static ExecutorService EXECUTOR_SERVICE;
static final Skin EMPTY_SKIN;
static final Cape EMPTY_CAPE = new Cape("", "no-cape", ByteArrays.EMPTY_ARRAY, -1, true);
@ -133,7 +133,7 @@ public class SkinProvider {
WEARING_CUSTOM_SKULL_SLIM = new SkinGeometry("{\"geometry\" :{\"default\" :\"geometry.humanoid.wearingCustomSkullSlim\"}}", wearingCustomSkullSlim, false);
}
private static ExecutorService getExecutorService() {
public static ExecutorService getExecutorService() {
if (EXECUTOR_SERVICE == null) {
EXECUTOR_SERVICE = Executors.newFixedThreadPool(ALLOW_THIRD_PARTY_CAPES ? 21 : 14);
}