Record Class PartConfigEntry

java.lang.Object
java.lang.Record
org.cyclops.integrateddynamics.core.part.PartConfigEntry
Record Components:
id - The identifier of this entry, which is stable across reloads, as it is what a disabled entry is remembered by.
group - What this entry belongs to, such as the aspect that a property belongs to.
label - The name of this entry.
value - What is stored for it, which is empty when the name says it all.
icon - The item to show in the slot of this entry, which is empty when it has no slot.
aspect - The unique name of the aspect that this entry stands for, which is shown as an item next to its name, and empty for an entry that is not an aspect itself.
color - The colour that this entry is shown in, which is the display colour of the value type it belongs to, and empty for entries that belong to no value type.
section - The configuration section that this entry belongs to.

public record PartConfigEntry(String id, net.minecraft.network.chat.Component group, net.minecraft.network.chat.Component label, net.minecraft.network.chat.Component value, net.minecraft.world.item.ItemStack icon, Optional<net.minecraft.resources.Identifier> aspect, OptionalInt color, PartConfigSection section) extends Record
One thing inside a PartConfigSnapshot that the player can switch off before pasting.
  • Field Details

  • Constructor Details

    • PartConfigEntry

      public PartConfigEntry(String id, net.minecraft.network.chat.Component group, net.minecraft.network.chat.Component label, net.minecraft.network.chat.Component value, PartConfigSection section)
      An entry that is shown without an item next to it, and in no colour of its own.
    • PartConfigEntry

      public PartConfigEntry(String id, net.minecraft.network.chat.Component group, net.minecraft.network.chat.Component label, net.minecraft.network.chat.Component value, net.minecraft.world.item.ItemStack icon, Optional<net.minecraft.resources.Identifier> aspect, OptionalInt color, PartConfigSection section)
      Creates an instance of a PartConfigEntry record class.
      Parameters:
      id - the value for the id record component
      group - the value for the group record component
      label - the value for the label record component
      value - the value for the value record component
      icon - the value for the icon record component
      aspect - the value for the aspect record component
      color - the value for the color record component
      section - the value for the section record component
  • Method Details

    • idPartSetting

      public static String idPartSetting(String setting)
      Parameters:
      setting - The name of a general part setting.
      Returns:
      The identifier of that setting.
    • idAspectProperty

      public static String idAspectProperty(net.minecraft.resources.Identifier aspect, String property)
      Parameters:
      aspect - The unique name of an aspect.
      property - The name of one of its properties.
      Returns:
      The identifier of that property.
    • idVariableCard

      public static String idVariableCard(String inventoryName, int slot)
      Parameters:
      inventoryName - The name of a variable inventory inside a part.
      slot - A slot in that inventory.
      Returns:
      The identifier of the variable in that slot.
    • idExtra

      public static String idExtra(PartConfigSection section, String key)
      Part types must build the identifiers of their own entries with this, so that they can not collide with the entries of another part type or of another section.
      Parameters:
      section - The section that the entry belongs to.
      key - A name for the entry that is unique within the part type.
      Returns:
      The identifier of that entry.
    • 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.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • group

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

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

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

      public net.minecraft.world.item.ItemStack icon()
      Returns the value of the icon record component.
      Returns:
      the value of the icon record component
    • aspect

      public Optional<net.minecraft.resources.Identifier> aspect()
      Returns the value of the aspect record component.
      Returns:
      the value of the aspect record component
    • color

      public OptionalInt color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component
    • section

      public PartConfigSection section()
      Returns the value of the section record component.
      Returns:
      the value of the section record component