Record Class PatternContainerGroup

java.lang.Object
java.lang.Record
appeng.api.implementations.blockentities.PatternContainerGroup
Record Components:
icon - The icon to display when referring to the grouped containers. This stack will NEVER be modified. It will be used to show an icon, as well as compared to group similar containers. It may be ItemStack.EMPTY
name - The name to use to refer to the group.
tooltip - Additional tooltip lines to describe the group (i.e. installed upgrades).

public record PatternContainerGroup(@Nullable AEItemKey icon, net.minecraft.network.chat.Component name, List<net.minecraft.network.chat.Component> tooltip) extends Record
Provides both a key for grouping pattern providers, and displaying the group in the pattern access terminal.

The group can be the crafting container itself, for example if it is given a custom name by the player. It might default to the crafting machine it is adjacent otherwise.

  • Constructor Summary

    Constructors
    Constructor
    Description
    PatternContainerGroup(@Nullable AEItemKey icon, net.minecraft.network.chat.Component name, List<net.minecraft.network.chat.Component> tooltip)
    Creates an instance of a PatternContainerGroup record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    static @Nullable PatternContainerGroup
    fromMachine(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side)
     
    final int
    Returns a hash code value for this object.
    @Nullable AEItemKey
    Returns the value of the icon record component.
    net.minecraft.network.chat.Component
    Returns the value of the name record component.
     
    readFromPacket(net.minecraft.network.RegistryFriendlyByteBuf buffer)
     
    List<net.minecraft.network.chat.Component>
    Returns the value of the tooltip record component.
    final String
    Returns a string representation of this record class.
    void
    writeToPacket(net.minecraft.network.RegistryFriendlyByteBuf buffer)
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PatternContainerGroup

      public PatternContainerGroup(@Nullable @Nullable AEItemKey icon, net.minecraft.network.chat.Component name, List<net.minecraft.network.chat.Component> tooltip)
      Creates an instance of a PatternContainerGroup record class.
      Parameters:
      icon - the value for the icon record component
      name - the value for the name record component
      tooltip - the value for the tooltip record component
  • Method Details

    • nothing

      public static PatternContainerGroup nothing()
    • writeToPacket

      public void writeToPacket(net.minecraft.network.RegistryFriendlyByteBuf buffer)
    • readFromPacket

      public static PatternContainerGroup readFromPacket(net.minecraft.network.RegistryFriendlyByteBuf buffer)
    • fromMachine

      @Nullable public static @Nullable PatternContainerGroup fromMachine(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • icon

      @Nullable public @Nullable AEItemKey icon()
      Returns the value of the icon record component.
      Returns:
      the value of the icon record component
    • name

      public net.minecraft.network.chat.Component name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • tooltip

      public List<net.minecraft.network.chat.Component> tooltip()
      Returns the value of the tooltip record component.
      Returns:
      the value of the tooltip record component