diff --git a/core/src/main/java/org/geysermc/geyser/registry/loader/ResourcePackLoader.java b/core/src/main/java/org/geysermc/geyser/registry/loader/ResourcePackLoader.java index 32900d9c7..8a2f5abdf 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/loader/ResourcePackLoader.java +++ b/core/src/main/java/org/geysermc/geyser/registry/loader/ResourcePackLoader.java @@ -100,34 +100,8 @@ public class ResourcePackLoader implements RegistryLoader cdnPacks = GeyserImpl.getInstance().getConfig().getResourcePackUrls(); - for (String url: cdnPacks) { - int packHash = url.hashCode(); - Path cachedPath = cachedCdnPacksDirectory.resolve(packHash + ".zip"); - WebUtils.downloadFile(url, cachedPath.toString()); - - ResourcePack cdnpack = readPack(cachedPath); - UUID uuid = cdnpack.manifest().header().uuid(); - - RESOURCE_PACK_CDN_ENTRIES.add(new ResourcePackCDNEntry(url, uuid)); - - try { - Files.delete(cachedPath); - } catch (IOException e) { - GeyserImpl.getInstance().getLogger().error("Could not delete cached pack", e); - } - } + // Load CDN entries + loadCdnEntries(); GeyserLoadResourcePacksEvent event = new GeyserLoadResourcePacksEvent(resourcePacks); GeyserImpl.getInstance().eventBus().fire(event); @@ -200,4 +174,36 @@ public class ResourcePackLoader implements RegistryLoader cdnPacks = GeyserImpl.getInstance().getConfig().getResourcePackUrls(); + for (String url: cdnPacks) { + int packHash = url.hashCode(); + Path cachedPath = cachedCdnPacksDirectory.resolve(packHash + ".zip"); + WebUtils.downloadFile(url, cachedPath.toString()); + + ResourcePack cdnpack = readPack(cachedPath); + UUID uuid = cdnpack.manifest().header().uuid(); + + RESOURCE_PACK_CDN_ENTRIES.add(new ResourcePackCDNEntry(url, uuid)); + + try { + Files.delete(cachedPath); + } catch (IOException e) { + GeyserImpl.getInstance().getLogger().error("Could not delete cached pack", e); + } + } + } }