PrefabLoader

public class PrefabLoader

Class PrefabLoader. Provides prefabloader functionality for the Hytale server.

java.lang.Object > PrefabLoader

Field Summary

prefabPath

final Path prefabPath

Field prefabPath.

prefabDirectory

final String prefabDirectory

Field prefabDirectory.

directoryPath

final Path directoryPath

Field directoryPath.

fileName

final String fileName

Field fileName.

matcher

final Matcher matcher

Field matcher.

fileNameNoExtension

final String fileNameNoExtension

Field fileNameNoExtension.

filepath

final String filepath

Field filepath.

start

final int start

Field start.

length

final int length

Field length.

chars

final char[] chars

Field chars.

Method Detail

PrefabLoader

public public PrefabLoader (final Path rootFolder)

Method PrefabLoader.

Parameters:
final Path rootFolder

getRootFolder

public Path getRootFolder ()

Method getRootFolder.

resolvePrefabs

public void resolvePrefabs (@Nonnull final String prefabName, @Nonnull final Consumer pathConsumer)

Method resolvePrefabs.

Parameters:
@Nonnull final String prefabName
@Nonnull final Consumer pathConsumer

NoSuchFileException

public new NoSuchFileException (prefabPath.toString()

Method NoSuchFileException.

Parameters:
prefabPath.toString( prefabPath.toString(

resolvePrefabFolder

static void resolvePrefabFolder (@Nonnull final Path rootFolder, @Nonnull final String prefabName, @Nonnull final Consumer pathConsumer)

Method resolvePrefabFolder.

Parameters:
@Nonnull final Path rootFolder
@Nonnull final String prefabName
@Nonnull final Consumer pathConsumer

NotDirectoryException

public new NotDirectoryException (directoryPath.toString()

Method NotDirectoryException.

Parameters:
directoryPath.toString( directoryPath.toString(

visitFile

public FileVisitResult visitFile (@Nonnull final Path file, final BasicFileAttributes attrs)

Method visitFile.

Parameters:
@Nonnull final Path file
final BasicFileAttributes attrs

resolveRelativeJsonPath

static String resolveRelativeJsonPath (@Nonnull final String prefabName, @Nonnull final Path prefabPath, @Nonnull final Path rootPrefabDir)

Method resolveRelativeJsonPath.

Parameters:
@Nonnull final String prefabName
@Nonnull final Path prefabPath
@Nonnull final Path rootPrefabDir

IllegalArgumentException

public new IllegalArgumentException (String.format("Prefab key '%s' is longer than its filepath '%s'", prefabName, filepath)

Method IllegalArgumentException.

Parameters:
String.format("Prefab key '%s' is longer than its filepath '%s'"
prefabName prefabName
filepath filepath

getFilepathLengthNoExtension

static int getFilepathLengthNoExtension (@Nonnull final String filepath)

Method getFilepathLengthNoExtension.

Parameters:
@Nonnull final String filepath

if

public else if (filepath.endsWith(".prefab.json.lpf")

Method if.

Parameters:
filepath.endsWith(".prefab.json.lpf" filepath.endsWith(".prefab.json.lpf"