Interface IAspect<V extends IValue,T extends IValueType<V>>

Type Parameters:
V - The value type.
T - The value type type.
All Known Subinterfaces:
IAspectRead<V,T>, IAspectWrite<V,T>
All Known Implementing Classes:
AspectBase, AspectReadBase, AspectWriteBase

public interface IAspect<V extends IValue,T extends IValueType<V>>
An element that can be used inside parts to access a specific aspect of something to read/write.
  • Method Details

    • getUniqueName

      net.minecraft.resources.ResourceLocation getUniqueName()
      Returns:
      The unique name for this aspecy, only used for internal storage.
    • getTranslationKey

      String getTranslationKey()
      Returns:
      The unique unlocalized name for this aspect.
    • loadTooltip

      void loadTooltip(List<net.minecraft.network.chat.Component> lines, boolean appendOptionalInfo)
      Add tooltip lines for this aspect when hovered in a gui.
      Parameters:
      lines - The list to add lines to.
      appendOptionalInfo - If shift-to-show info should be added.
    • getValueType

      T getValueType()
      Returns:
      The type of value this aspect can handle.
    • update

      <P extends IPartType<P, S>, S extends IPartState<P>> void update(INetwork network, IPartNetwork partNetwork, P partType, PartTarget target, S state)
      Called inside part types for updating a part on a block.
      Type Parameters:
      P - The part type type.
      S - The part state.
      Parameters:
      network - The network to update in.
      partNetwork - The part network to update in.
      partType - The part type.
      target - The position that is targeted by the given part.
      state - The current state of the given part.
    • hasProperties

      <P extends IPartType<P, S>, S extends IPartState<P>> boolean hasProperties()
      Type Parameters:
      P - The part type type
      S - The part state type
      Returns:
      If this aspect supports additional properties.
    • getProperties

      <P extends IPartType<P, S>, S extends IPartState<P>> IAspectProperties getProperties(P partType, PartTarget target, S state)
      Get the current properties of this aspect in the given part.
      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

      <P extends IPartType<P, S>, S extends IPartState<P>> void setProperties(P partType, PartTarget target, S state, IAspectProperties properties)
      Set the new properties of this aspect in the given part.
      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

      @Nullable IAspectProperties getDefaultProperties()
      Returns:
      The default properties for this aspect.
    • getPropertyTypes

      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.
      Returns:
      The types that are available for this aspect.
    • getPropertiesContainerProvider

      net.minecraft.world.MenuProvider getPropertiesContainerProvider(PartPos pos)
      This will only be called if this aspect has properties.
      Parameters:
      pos - The part position.
      Returns:
      The container type for the screen to configure the properties.