Class PrefabLoader

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

public class PrefabLoader extends Object
  • Constructor Details

    • PrefabLoader

      public PrefabLoader(Path rootFolder)
  • Method Details

    • getRootFolder

      public Path getRootFolder()
    • resolvePrefabs

      public void resolvePrefabs(@Nonnull String prefabName, @Nonnull Consumer<Path> pathConsumer) throws IOException
      Throws:
      IOException
    • resolvePrefabs

      public static void resolvePrefabs(@Nonnull Path rootFolder, @Nonnull String prefabName, @Nonnull Consumer<Path> pathConsumer) throws IOException
      Throws:
      IOException
    • resolvePrefabFolder

      public static void resolvePrefabFolder(@Nonnull Path rootFolder, @Nonnull String prefabName, @Nonnull Consumer<Path> pathConsumer) throws IOException
      Throws:
      IOException
    • resolveRelativeJsonPath

      @Nonnull public static String resolveRelativeJsonPath(@Nonnull String prefabName, @Nonnull Path prefabPath, @Nonnull Path rootPrefabDir)
      Returns a json filepath for a prefab's real file path relativized against the provided root directory and prefab name.
      Parameters:
      prefabName - The prefab name representing the prefab, or the directory containing the prefab, at the prefabPath.
      prefabPath - The path of the prefab file.
      rootPrefabDir - The root directory containing all prefab files.
      Returns:
      The json filepath representing the prefab found at the given prefabPath.