Record Class CircuitHolder

java.lang.Object
java.lang.Record
forestry.api.circuits.CircuitHolder
Record Components:
layoutId - The unique ID of the circuit layout. See ForestryCircuitLayouts for examples.
stack - The item that holds a circuit in this layout. Count is ignored. Usually, it is a type of Electron Tube.
circuit - The circuit this item holds when inserted into the circuit layout with the given layout ID.

public record CircuitHolder(String layoutId, net.minecraft.world.item.ItemStack stack, ICircuit circuit) extends Record
Replaces the old "CircuitRecipe" that isn't really a recipe. A circuit holder determines the ICircuit contained by an item when inserted into the layout with the given ID. See IForestryPlugin.registerCircuits(forestry.api.plugin.ICircuitRegistration) to register your circuit holders. See IForestryApi.getCircuitManager() to query data about circuits and circuit holders.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CircuitHolder(String layoutId, net.minecraft.world.item.ItemStack stack, ICircuit circuit)
    Creates an instance of a CircuitHolder record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the circuit record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the layoutId record component.
    net.minecraft.world.item.ItemStack
    Returns the value of the stack record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • CircuitHolder

      public CircuitHolder(String layoutId, net.minecraft.world.item.ItemStack stack, ICircuit circuit)
      Creates an instance of a CircuitHolder record class.
      Parameters:
      layoutId - the value for the layoutId record component
      stack - the value for the stack record component
      circuit - the value for the circuit record component
  • Method Details

    • 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.
    • layoutId

      public String layoutId()
      Returns the value of the layoutId record component.
      Returns:
      the value of the layoutId record component
    • stack

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

      public ICircuit circuit()
      Returns the value of the circuit record component.
      Returns:
      the value of the circuit record component