Package net.mcreator.generator.mapping
Class MappableElement
java.lang.Object
net.mcreator.generator.mapping.MappableElement
- All Implemented Interfaces:
IWorkspaceDependent
- Direct Known Subclasses:
AchievementEntry
,Animation
,AttributeEntry
,BiomeEntry
,ConfiguredFeatureEntry
,DamageTypeEntry
,EffectEntry
,Enchantment
,EntityEntry
,Fluid
,Material
,MItemBlock
,NonMappableElement
,Particle
,ProfessionEntry
,ProjectileEntry
,Sound
,StepSound
,TabEntry
,UniquelyMappedElement
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMappableElement
(NameMapper mapper) MappableElement
(NameMapper mapper, String value) -
Method Summary
Modifier and TypeMethodDescriptionboolean
getMappedValue
(int mappingTable) int
hashCode()
boolean
isEmpty()
boolean
boolean
void
setManaged
(boolean managed) Call this to mark the current mappable element as managed - meaning it was not generated by a direct user input.void
setWorkspace
(Workspace workspace) toString()
static boolean
validateReference
(String value, Workspace workspace)
-
Field Details
-
mapper
-
-
Constructor Details
-
MappableElement
-
MappableElement
-
-
Method Details
-
toString
-
isEmpty
public boolean isEmpty() -
getMappedValue
-
getMappedValue
-
getUnmappedValue
-
isValidReference
public boolean isValidReference()- Returns:
- true if the value exists in the workspace. Always returns true for vanilla elements, even if they are not supported in the selected Minecraft version. Returns false if the element is empty.
-
validateReference
- Returns:
- true if the value exists in the workspace. Always returns true for vanilla elements, even if they are not supported in the selected Minecraft version.
-
getDataListEntry
-
getDataListEntryType
-
setManaged
public void setManaged(boolean managed) Call this to mark the current mappable element as managed - meaning it was not generated by a direct user input. Can be used to filter out elements that were not generated by the user in UI components, for example.- Parameters:
managed
- true if the element is managed
-
isManaged
public boolean isManaged()- Returns:
- true if the element was marked as managed
- See Also:
-
setWorkspace
- Specified by:
setWorkspace
in interfaceIWorkspaceDependent
-
getWorkspace
- Specified by:
getWorkspace
in interfaceIWorkspaceDependent
-
hashCode
public int hashCode() -
equals
-