Class WorkspaceFolderManager

java.lang.Object
net.mcreator.workspace.WorkspaceFolderManager

public class WorkspaceFolderManager extends Object
  • Constructor Details

    • WorkspaceFolderManager

      public WorkspaceFolderManager(@Nonnull File workspaceFile, @Nonnull Workspace workspace)
  • Method Details

    • getSuggestedWorkspaceFoldersRoot

      public static File getSuggestedWorkspaceFoldersRoot()
    • getWorkspaceFolder

      public File getWorkspaceFolder()
    • isFileInWorkspace

      public boolean isFileInWorkspace(File file)
      Checks if the provided file is contained in the workspace folder.
      Parameters:
      file - The file to check.
      Returns:
      True if the provided file is inside the workspace folder.
    • isFileInWorkspace

      public boolean isFileInWorkspace(File file, boolean silent)
      Checks if the provided file is contained in the workspace folder.
      Parameters:
      file - The file to check.
      silent - Determines whether non-presence of input file in the workspace should be logged or not.
      Returns:
      True if the provided file is inside the workspace folder.
    • getPathInWorkspace

      public String getPathInWorkspace(File file)
      Attempts to locate the provided file inside workspace folder and return its path relative to this folder.
      Parameters:
      file - The input file.
      Returns:
      File path relative to workspace folder or its absolute path if not found in the workspace.
    • getTextureImageIcon

      public ImageIcon getTextureImageIcon(String textureIdentifier, TextureType section)

      This method gets an image depending on the desired type.

      Parameters:
      textureIdentifier -

      This is the name without the file extension of the texture file.

      section -

      This TextureType defines which path, defined by each generator, MCreator will search the texture file.

      Returns:

      The texture file as an ImageIcon.

    • getTextureFile

      public File getTextureFile(String textureIdentifier, TextureType section)

      This method gets a PNG texture file depending on the desired type.

      Parameters:
      textureIdentifier -

      This is the name without the file extension of the texture file.

      section -

      This TextureType defines which path, defined by each generator, MCreator will search the texture file.

      Returns:

      A PNG File

    • getStructureList

      public List<String> getStructureList()
    • getArmorTextureFilesForName

      public File[] getArmorTextureFilesForName(String armorTextureName)
    • getTexturesList

      public List<File> getTexturesList(TextureType section)
      Parameters:
      section -

      The TextureType we want to get the folder, defined by each generator.

      Returns:

      A list containing all texture files found in the TextureType provided.

    • removeStructure

      public void removeStructure(String name)
    • getTexturesFolder

      @Nullable public File getTexturesFolder(TextureType section)
      Parameters:
      section -

      The TextureType we want to get the folder, defined by each generator.

      Returns:

      The folder storing texture files of the given TextureType.

    • getStructuresDir

      @Nullable public File getStructuresDir()
    • getSoundsDir

      @Nullable public File getSoundsDir()
    • getClientRunDir

      @Nonnull public File getClientRunDir()
    • getServerRunDir

      @Nonnull public File getServerRunDir()
    • getModElementsDir

      public File getModElementsDir()
    • getModelsDir

      public File getModelsDir()
    • getWorkspaceCacheDir

      public File getWorkspaceCacheDir()
    • getModElementPicturesCacheDir

      public File getModElementPicturesCacheDir()
    • getWorkspaceBackupsCacheDir

      public File getWorkspaceBackupsCacheDir()