Package net.mcreator.workspace
Class Workspace
java.lang.Object
net.mcreator.workspace.Workspace
- All Implemented Interfaces:
Closeable
,AutoCloseable
,IGeneratorProvider
,IWorkspaceProvider
-
Field Summary
Modifier and TypeFieldDescriptionprotected WorkspaceFileManager
protected FolderElement
protected Generator
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addLanguage
(String language, ConcurrentHashMap<String, String> data) void
addModElement
(ModElement element) void
addSoundElement
(SoundElement element) void
addTagElement
(TagElement element) void
addVariableElement
(VariableElement element) void
bindToNewWorkspaceFile
(File workspaceFile) boolean
void
close()
boolean
containsModElement
(String elementName) static Workspace
createWorkspace
(File workspaceFile, WorkspaceSettings workspaceSettings) boolean
long
getModElementByName
(String elementName) getVariableElementByName
(String elementName) int
hashCode()
boolean
void
loadStoredDataFrom
(Workspace other) void
void
static Workspace
readFromFS
(File workspaceFile, Window ui) static Workspace
readFromFSUnsafe
(File workspaceFile, GeneratorConfiguration generatorConfiguration) Unsafe version of readFromFS with supported generator type checks omitted.void
void
void
void
removeLocalizationLanguage
(String language) void
removeModElement
(ModElement element) void
removeSoundElement
(SoundElement element) void
removeTagElement
(TagElement element) void
removeVariableElement
(VariableElement element) void
void
void
setLocalization
(String key, String value) void
setMCreatorVersion
(long mcreatorVersion) void
setWorkspaceSettings
(WorkspaceSettings workspaceSettings) void
switchGenerator
(String generatorName) toString()
void
updateLanguage
(String language, ConcurrentHashMap<String, String> data) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.mcreator.generator.IGeneratorProvider
getGeneratorConfiguration, getGeneratorStats
Methods inherited from interface net.mcreator.workspace.IWorkspaceProvider
getWorkspaceFolder
-
Field Details
-
foldersRoot
-
fileManager
-
generator
-
-
Constructor Details
-
Workspace
-
-
Method Details
-
getWorkspaceSettings
- Specified by:
getWorkspaceSettings
in interfaceIWorkspaceProvider
-
setWorkspaceSettings
-
getModElements
- Returns:
- UNMODIFIABLE! collection of mod elements
-
getVariableElements
- Returns:
- UNMODIFIABLE! collection of variable elements
-
getSoundElements
- Returns:
- UNMODIFIABLE! collection of sound elements
-
getCreativeTabsOrder
-
getTagElements
-
getLanguageMap
-
getFoldersRoot
-
getWorkspaceInfo
-
containsModElement
-
getModElementByName
-
getVariableElementByName
-
resetModElementCompilesStatus
public void resetModElementCompilesStatus() -
addLanguage
-
updateLanguage
-
setLocalization
-
removeLocalizationEntryByKey
-
removeLocalizationLanguage
-
addModElement
-
addVariableElement
-
addTagElement
-
addSoundElement
-
removeModElement
-
removeVariableElement
-
removeTagElement
-
removeSoundElement
-
setMCreatorVersion
public void setMCreatorVersion(long mcreatorVersion) -
getMCreatorVersion
public long getMCreatorVersion() -
getFileManager
- Specified by:
getFileManager
in interfaceIWorkspaceProvider
-
getFolderManager
- Specified by:
getFolderManager
in interfaceIWorkspaceProvider
-
getGenerator
- Specified by:
getGenerator
in interfaceIGeneratorProvider
-
getModElementManager
- Specified by:
getModElementManager
in interfaceIWorkspaceProvider
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
equals
-
hashCode
public int hashCode() -
toString
-
markDirty
public void markDirty() -
reloadModElements
public void reloadModElements() -
reloadFolderStructure
public void reloadFolderStructure() -
switchGenerator
-
bindToNewWorkspaceFile
-
markFailingGradleDependencies
public void markFailingGradleDependencies() -
checkFailingGradleDependenciesAndClear
public boolean checkFailingGradleDependenciesAndClear() -
getWorkspace
- Specified by:
getWorkspace
in interfaceIWorkspaceProvider
-
readFromFS
public static Workspace readFromFS(File workspaceFile, @Nullable Window ui) throws UnsupportedGeneratorException, CorruptedWorkspaceFileException, FileNotFoundException, MissingGeneratorFeaturesException -
readFromFSUnsafe
public static Workspace readFromFSUnsafe(File workspaceFile, GeneratorConfiguration generatorConfiguration) throws MissingGeneratorFeaturesException Unsafe version of readFromFS with supported generator type checks omitted. Only intended to be used by tests. Instead of checking for supported generator, it will force the generator specified by generatorConfiguration.- Parameters:
workspaceFile
- File containing the output workspace definition.generatorConfiguration
- If same as workspace, nothing is done, otherwise regenerateRequired is set to true.- Returns:
- Workspace object for the given file
- Throws:
MissingGeneratorFeaturesException
-
createWorkspace
-
requireRegenerate
public void requireRegenerate() -
isRegenerateRequired
public boolean isRegenerateRequired() -
loadStoredDataFrom
- Parameters:
other
- The workspace to copy elements and settings from.
-