Package net.mcreator.workspace.elements
Class ModElement
java.lang.Object
net.mcreator.workspace.elements.ModElement
- All Implemented Interfaces:
Serializable,IGeneratorProvider,IElement,IWorkspaceProvider
public class ModElement
extends Object
implements Serializable, IWorkspaceProvider, IGeneratorProvider, IElement
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionModElement(Workspace workspace, String name, ModElementType<?> type) ModElement(Workspace workspace, ModElement mu, String duplicateName) Duplicates given mod element, but does not duplicate registry name, lock status, compiles status and ID map -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanWarning: this method relies on getGeneratableElement that is not thread safe, so this method is also not thread safestatic Comparator<ModElement> getComparator(Workspace workspace, List<?> originalOrder) Warning: this method uses ModElementManager and is thus not thread safeWarning: this method relies on getGeneratableElement that is not thread safe, so this method is also not thread safegetMetadata(String key) getName()getType()inthashCode()booleanvoidloadDataFrom(ModElement other) voidputMetadata(String key, Object data) voidCall this method to reinit ME icon, mcItems cache or update associated workspacevoidvoidsetAssociatedFiles(List<File> files) voidsetCodeLock(boolean codeLock) voidsetCompiles(boolean compiles) voidsetParentFolder(FolderElement parent) voidsetRegistryName(String registry_name) voidsetWorkspace(Workspace workspace) toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.mcreator.generator.IGeneratorProvider
getGenerator, getGeneratorConfiguration, getGeneratorStatsMethods inherited from interface net.mcreator.workspace.IWorkspaceProvider
getFileManager, getFolderManager, getModElementManager, getWorkspaceFolder, getWorkspaceSettings, getWorkspaceUserSettings
-
Constructor Details
-
ModElement
-
ModElement
Duplicates given mod element, but does not duplicate registry name, lock status, compiles status and ID map- Parameters:
mu- Mod element to be duplicatedduplicateName- Name of the duplicate
-
-
Method Details
-
getGeneratableElement
Warning: this method uses ModElementManager and is thus not thread safe- Returns:
- GeneratableElement or null if load failed
-
reinit
Call this method to reinit ME icon, mcItems cache or update associated workspace- Parameters:
workspace- Workspace this ME belongs to
-
reloadElementIcon
public void reloadElementIcon() -
getWorkspace
- Specified by:
getWorkspacein interfaceIWorkspaceProvider
-
setWorkspace
-
getElementIcon
-
putMetadata
-
getMetadata
-
getAssociatedFiles
-
setAssociatedFiles
-
toString
-
equals
-
hashCode
public int hashCode() -
doesCompile
public boolean doesCompile() -
setCompiles
public void setCompiles(boolean compiles) -
getName
-
getType
-
getTypeString
-
isCodeLocked
public boolean isCodeLocked() -
setCodeLock
public void setCodeLock(boolean codeLock) -
getMCItems
Warning: this method relies on getGeneratableElement that is not thread safe, so this method is also not thread safe -
getRegistryName
-
getRegistryNameUpper
-
setRegistryName
-
getFolderPath
-
setParentFolder
-
getBaseTypesProvided
Warning: this method relies on getGeneratableElement that is not thread safe, so this method is also not thread safe -
loadDataFrom
- Parameters:
other- The mod element to copy settings from.
-
getComparator
-