Class PrefabBufferUtil

java.lang.Object
com.hypixel.hytale.server.core.prefab.selection.buffer.PrefabBufferUtil

public class PrefabBufferUtil extends Object
  • Field Details

  • Constructor Details

    • PrefabBufferUtil

      public PrefabBufferUtil()
  • Method Details

    • getCached

      @Nonnull public static IPrefabBuffer getCached(@Nonnull Path path)
      Gets a PrefabBuffer accessor from the cache, loading from disk if necessary.
      Parameters:
      path - The path of the prefab to load.
      Returns:
      The PrefabBuffer accessor.
    • removeCached

      public static void removeCached(@Nonnull Path path)
      Remove the cache entry for the given prefab path.
      Parameters:
      path -
    • loadBuffer

      @Nonnull public static PrefabBuffer loadBuffer(@Nonnull Path path)
      Loads a PrefabBuffer from disk bypassing PrefabBufferUtil's cache.
      Parameters:
      path - The path of the prefab to load.
      Returns:
      The loaded PrefabBuffer.
    • writeToFileAsync

      @Nonnull public static CompletableFuture<Void> writeToFileAsync(@Nonnull PrefabBuffer prefab, @Nonnull Path path)
    • readFromFile

      public static PrefabBuffer readFromFile(@Nonnull Path path)
    • readFromFileAsync

      @Nonnull public static CompletableFuture<PrefabBuffer> readFromFileAsync(@Nonnull Path path)
    • loadFromLPF

      @Nonnull public static PrefabBuffer loadFromLPF(@Nonnull Path path, @Nonnull Path realPath)
    • loadFromJson

      @Nonnull public static PrefabBuffer loadFromJson(@Nullable AssetPack pack, Path path, @Nonnull Path cachedLpfPath, @Nonnull Path jsonPath) throws IOException
      Throws:
      IOException