Class AssetUtils

java.lang.Object
org.geysermc.geyser.util.AssetUtils

public final class AssetUtils extends Object
Implementation note: try to design processes to fail softly if the client jar can't be downloaded, either if Mojang is down or internet access to Mojang is spotty.
  • Method Details

    • getAsset

      public static AssetUtils.Asset getAsset(String name)
    • isAssetKnown

      public static boolean isAssetKnown(String name)
    • addTask

      public static void addTask(boolean required, AssetUtils.ClientJarTask task)
      Add task to be ran after the client jar is downloaded or found to be cached.
      Parameters:
      required - if set to true, the client jar will always be downloaded, even if a pre-existing hash is matched. This means an asset or texture is missing.
    • generateAssetCache

      public static CompletableFuture<Void> generateAssetCache()
      Fetch the latest versions asset cache from Mojang so we can grab the locale files later
    • downloadAndRunClientJarTasks

      public static void downloadAndRunClientJarTasks()
    • saveFile

      public static void saveFile(Path location, InputStream fileStream) throws IOException
      Throws:
      IOException