Class FileTree

java.lang.Object
mindustry.core.FileTree
All Implemented Interfaces:
FileHandleResolver

public class FileTree extends Object implements FileHandleResolver
Handles files in a modded context.
  • Constructor Details

    • FileTree

      public FileTree()
  • Method Details

    • addFile

      public void addFile(String path, Fi f)
    • get

      public Fi get(String path)
      Gets an asset file.
    • get

      public Fi get(String path, boolean safe)
      Gets an asset file.
    • clear

      public void clear()
      Clears all mod files.
    • resolve

      public Fi resolve(String fileName)
      Specified by:
      resolve in interface FileHandleResolver
    • loadSound

      public Sound loadSound(String soundName)
      Loads a sound by name from the sounds/ folder. OGG and MP3 are supported; the extension is automatically added to the end of the file name. Results are cached; consecutive calls to this method with the same name will return the same sound instance.
    • loadMusic

      public Music loadMusic(String musicName)
      Loads a music file by name from the music/ folder. OGG and MP3 are supported; the extension is automatically added to the end of the file name. Results are cached; consecutive calls to this method with the same name will return the same music instance.