mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Fix cache image task from last commit and make it work with reloading
This commit is contained in:
parent
36afd3f2ec
commit
7853e8c93f
2 changed files with 6 additions and 7 deletions
|
@ -154,7 +154,6 @@ public class GeyserImpl implements GeyserApi {
|
|||
ItemTranslator.init();
|
||||
MessageTranslator.init();
|
||||
MinecraftLocale.init();
|
||||
SkinProvider.init();
|
||||
|
||||
start();
|
||||
|
||||
|
@ -197,6 +196,8 @@ public class GeyserImpl implements GeyserApi {
|
|||
|
||||
ScoreboardUpdater.init();
|
||||
|
||||
SkinProvider.registerCacheImageTask(this);
|
||||
|
||||
ResourcePack.loadPacks();
|
||||
|
||||
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);
|
||||
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);
|
||||
}
|
||||
|
||||
public static void registerCacheImageTask(GeyserImpl geyser) {
|
||||
// Schedule Daily Image Expiry if we are caching them
|
||||
if (GeyserImpl.getInstance().getConfig().getCacheImages() > 0) {
|
||||
GeyserImpl.getInstance().getScheduledThread().scheduleAtFixedRate(() -> {
|
||||
if (geyser.getConfig().getCacheImages() > 0) {
|
||||
geyser.getScheduledThread().scheduleAtFixedRate(() -> {
|
||||
File cacheFolder = GeyserImpl.getInstance().getBootstrap().getConfigFolder().resolve("cache").resolve("images").toFile();
|
||||
if (!cacheFolder.exists()) {
|
||||
return;
|
||||
|
@ -819,8 +821,4 @@ public class SkinProvider {
|
|||
};
|
||||
}
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
// no-op
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue