Class AspectBase<V extends IValue,T extends IValueType<V>>

java.lang.Object
org.cyclops.integrateddynamics.part.aspect.AspectBase<V,T>
All Implemented Interfaces:
IAspect<V,T>
Direct Known Subclasses:
AspectReadBase, AspectWriteBase

public abstract class AspectBase<V extends IValue,T extends IValueType<V>> extends Object implements IAspect<V,T>
Base class for aspects.
  • Constructor Details

    • AspectBase

      public AspectBase(org.cyclops.cyclopscore.init.ModBase mod, IAspectProperties defaultProperties)
  • Method Details

    • getUniqueName

      public net.minecraft.resources.ResourceLocation getUniqueName()
      Specified by:
      getUniqueName in interface IAspect<V extends IValue,T extends IValueType<V>>
      Returns:
      The unique name for this aspecy, only used for internal storage.
    • getTranslationKey

      public String getTranslationKey()
      Specified by:
      getTranslationKey in interface IAspect<V extends IValue,T extends IValueType<V>>
      Returns:
      The unique unlocalized name for this aspect.
    • getUnlocalizedPrefix

      protected String getUnlocalizedPrefix()
    • getUnlocalizedType

      protected abstract String getUnlocalizedType()
    • loadTooltip

      public void loadTooltip(List<net.minecraft.network.chat.Component> lines, boolean appendOptionalInfo)
      Description copied from interface: IAspect
      Add tooltip lines for this aspect when hovered in a gui.
      Specified by:
      loadTooltip in interface IAspect<V extends IValue,T extends IValueType<V>>
      Parameters:
      lines - The list to add lines to.
      appendOptionalInfo - If shift-to-show info should be added.
    • hasProperties

      public <P extends IPartType<P, S>, S extends IPartState<P>> boolean hasProperties()
      Specified by:
      hasProperties in interface IAspect<V extends IValue,T extends IValueType<V>>
      Type Parameters:
      P - The part type type
      S - The part state type
      Returns:
      If this aspect supports additional properties.
    • getProperties

      public <P extends IPartType<P, S>, S extends IPartState<P>> IAspectProperties getProperties(P partType, PartTarget target, S state)
      Description copied from interface: IAspect
      Get the current properties of this aspect in the given part.
      Specified by:
      getProperties in interface IAspect<V extends IValue,T extends IValueType<V>>
      Type Parameters:
      P - The part type type.
      S - The part state.
      Parameters:
      partType - The part type.
      target - The position that is targeted by the given part.
      state - The current state of the given part.
      Returns:
      The current properties.
    • setProperties

      public <P extends IPartType<P, S>, S extends IPartState<P>> void setProperties(P partType, PartTarget target, S state, IAspectProperties properties)
      Description copied from interface: IAspect
      Set the new properties of this aspect in the given part.
      Specified by:
      setProperties in interface IAspect<V extends IValue,T extends IValueType<V>>
      Type Parameters:
      P - The part type type.
      S - The part state.
      Parameters:
      partType - The part type.
      target - The position that is targeted by the given part.
      state - The current state of the given part.
      properties - The new properties.
    • getDefaultProperties

      public final IAspectProperties getDefaultProperties()
      Specified by:
      getDefaultProperties in interface IAspect<V extends IValue,T extends IValueType<V>>
      Returns:
      The default properties for this aspect.
    • getPropertyTypes

      public Collection<IAspectPropertyTypeInstance> getPropertyTypes()
      Description copied from interface: IAspect
      These are the properties that are supported for this aspect. It is possible that some deprecated properties are available inside the retrieved properties, so use this to iterate over the values.
      Specified by:
      getPropertyTypes in interface IAspect<V extends IValue,T extends IValueType<V>>
      Returns:
      The types that are available for this aspect.
    • getPropertiesContainerProvider

      public net.minecraft.world.MenuProvider getPropertiesContainerProvider(PartPos pos)
      Description copied from interface: IAspect
      This will only be called if this aspect has properties.
      Specified by:
      getPropertiesContainerProvider in interface IAspect<V extends IValue,T extends IValueType<V>>
      Parameters:
      pos - The part position.
      Returns:
      The container type for the screen to configure the properties.
    • createDefaultProperties

      @Deprecated protected IAspectProperties createDefaultProperties()
      Deprecated.
      Creates the default properties for this aspect, only called once.
      Returns:
      The default properties.
    • getMod

      protected org.cyclops.cyclopscore.init.ModBase getMod()
    • getModId

      protected String getModId()