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
-
Constructor Summary
ConstructorDescriptionModElement
(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 TypeMethodDescriptionboolean
boolean
Warning: this method relies on getGeneratableElement that is not thread safe, so this method is also not thread safeWarning: 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()
int
hashCode()
boolean
void
loadDataFrom
(ModElement other) void
putMetadata
(String key, Object data) void
Call this method to reinit ME icon, mcItems cache or update associated workspacevoid
void
setCodeLock
(boolean codeLock) void
setCompiles
(boolean compiles) void
setParentFolder
(FolderElement parent) void
setRegistryName
(String registry_name) void
setWorkspace
(Workspace workspace) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.mcreator.generator.IGeneratorProvider
getGenerator, getGeneratorConfiguration, getGeneratorStats
Methods inherited from interface net.mcreator.workspace.IWorkspaceProvider
getFileManager, getFolderManager, getModElementManager, getWorkspaceFolder, getWorkspaceSettings
-
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:
getWorkspace
in interfaceIWorkspaceProvider
-
setWorkspace
-
getElementIcon
-
putMetadata
-
getMetadata
-
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.
-