Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-09-08 20:43:04 +02:00
Fix cache image task from last commit and make it work with reloading
Dieser Commit ist enthalten in:
Ursprung
36afd3f2ec
Commit
7853e8c93f
@ -154,7 +154,6 @@ public class GeyserImpl implements GeyserApi {
|
|||||||
ItemTranslator.init();
|
ItemTranslator.init();
|
||||||
MessageTranslator.init();
|
MessageTranslator.init();
|
||||||
MinecraftLocale.init();
|
MinecraftLocale.init();
|
||||||
SkinProvider.init();
|
|
||||||
|
|
||||||
start();
|
start();
|
||||||
|
|
||||||
@ -197,6 +196,8 @@ public class GeyserImpl implements GeyserApi {
|
|||||||
|
|
||||||
ScoreboardUpdater.init();
|
ScoreboardUpdater.init();
|
||||||
|
|
||||||
|
SkinProvider.registerCacheImageTask(this);
|
||||||
|
|
||||||
ResourcePack.loadPacks();
|
ResourcePack.loadPacks();
|
||||||
|
|
||||||
if (platformType != PlatformType.STANDALONE && config.getRemote().getAddress().equals("auto")) {
|
if (platformType != PlatformType.STANDALONE && config.getRemote().getAddress().equals("auto")) {
|
||||||
|
@ -115,10 +115,12 @@ public class SkinProvider {
|
|||||||
WEARING_CUSTOM_SKULL = new SkinGeometry("{\"geometry\" :{\"default\" :\"geometry.humanoid.wearingCustomSkull\"}}", wearingCustomSkull, false);
|
WEARING_CUSTOM_SKULL = new SkinGeometry("{\"geometry\" :{\"default\" :\"geometry.humanoid.wearingCustomSkull\"}}", wearingCustomSkull, false);
|
||||||
String wearingCustomSkullSlim = new String(FileUtils.readAllBytes("bedrock/skin/geometry.humanoid.wearingCustomSkullSlim.json"), StandardCharsets.UTF_8);
|
String wearingCustomSkullSlim = new String(FileUtils.readAllBytes("bedrock/skin/geometry.humanoid.wearingCustomSkullSlim.json"), StandardCharsets.UTF_8);
|
||||||
WEARING_CUSTOM_SKULL_SLIM = new SkinGeometry("{\"geometry\" :{\"default\" :\"geometry.humanoid.wearingCustomSkullSlim\"}}", wearingCustomSkullSlim, false);
|
WEARING_CUSTOM_SKULL_SLIM = new SkinGeometry("{\"geometry\" :{\"default\" :\"geometry.humanoid.wearingCustomSkullSlim\"}}", wearingCustomSkullSlim, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerCacheImageTask(GeyserImpl geyser) {
|
||||||
// Schedule Daily Image Expiry if we are caching them
|
// Schedule Daily Image Expiry if we are caching them
|
||||||
if (GeyserImpl.getInstance().getConfig().getCacheImages() > 0) {
|
if (geyser.getConfig().getCacheImages() > 0) {
|
||||||
GeyserImpl.getInstance().getScheduledThread().scheduleAtFixedRate(() -> {
|
geyser.getScheduledThread().scheduleAtFixedRate(() -> {
|
||||||
File cacheFolder = GeyserImpl.getInstance().getBootstrap().getConfigFolder().resolve("cache").resolve("images").toFile();
|
File cacheFolder = GeyserImpl.getInstance().getBootstrap().getConfigFolder().resolve("cache").resolve("images").toFile();
|
||||||
if (!cacheFolder.exists()) {
|
if (!cacheFolder.exists()) {
|
||||||
return;
|
return;
|
||||||
@ -819,8 +821,4 @@ public class SkinProvider {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void init() {
|
|
||||||
// no-op
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren