Class MappableElement

java.lang.Object
net.mcreator.generator.mapping.MappableElement
All Implemented Interfaces:
IWorkspaceDependent
Direct Known Subclasses:
AchievementEntry, AIPathNodeType, Animation, AttributeEntry, BiomeEntry, ConfiguredFeatureEntry, DamageTypeEntry, EffectEntry, EnchantmentEntry, EntityEntry, EquipmentSlotEntry, FluidEntry, GameEventEntry, GenerationStep, GrowapableSpawnType, KeyButton, MapColor, MItemBlock, MobSpawnType, NonMappableElement, NoteBlockInstrument, ParticleEntry, ProfessionEntry, ProjectileEntry, ScreenEntry, Sound, StepSound, StructureEntry, TabEntry, UniquelyMappedElement

public abstract class MappableElement extends Object implements IWorkspaceDependent
  • Field Details

    • mapper

      protected final transient NameMapper mapper
  • Constructor Details

    • MappableElement

      public MappableElement(NameMapper mapper)
    • MappableElement

      public MappableElement(NameMapper mapper, String value)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isEmpty

      public boolean isEmpty()
    • getMappedValue

      public String getMappedValue()
    • getMappedValue

      public String getMappedValue(int mappingTable)
    • getUnmappedValue

      public String getUnmappedValue()
    • getNameMapper

      public NameMapper getNameMapper()
    • getMappingSource

      public String getMappingSource()
    • 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

      public static boolean validateReference(@Nonnull String value, @Nonnull Workspace workspace)
      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

      public Optional<DataListEntry> getDataListEntry()
    • getDataListEntryType

      public String getDataListEntryType()
    • setAssociatedTagEntry

      public void setAssociatedTagEntry(@Nullable TagElement.Entry associatedTagEntry)
      Sets the associated tag entry for this element. Used in tag UI
      Parameters:
      associatedTagEntry - the tag entry to be associated with this element, or null if no tag entry is being set
    • getAssociatedTagEntry

      @Nullable public TagElement.Entry getAssociatedTagEntry()
    • isManaged

      public boolean isManaged()
      Determines if the current element is managed within a tag.
      Returns:
      true if the associated tag entry exists and is flagged as managed; false otherwise.
    • setWorkspace

      public void setWorkspace(@Nullable Workspace workspace)
      Specified by:
      setWorkspace in interface IWorkspaceDependent
    • getWorkspace

      @Nullable public Workspace getWorkspace()
      Specified by:
      getWorkspace in interface IWorkspaceDependent
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object element)
      Overrides:
      equals in class Object