Package forestry.api.circuits
Record Class CircuitHolder
java.lang.Object
java.lang.Record
forestry.api.circuits.CircuitHolder
- Record Components:
layoutId- The unique ID of the circuit layout. SeeForestryCircuitLayoutsfor 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
ConstructorsConstructorDescriptionCircuitHolder(String layoutId, net.minecraft.world.item.ItemStack stack, ICircuit circuit) Creates an instance of aCircuitHolderrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncircuit()Returns the value of thecircuitrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.layoutId()Returns the value of thelayoutIdrecord component.net.minecraft.world.item.ItemStackstack()Returns the value of thestackrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
layoutId
Returns the value of thelayoutIdrecord component.- Returns:
- the value of the
layoutIdrecord component
-
stack
public net.minecraft.world.item.ItemStack stack()Returns the value of thestackrecord component.- Returns:
- the value of the
stackrecord component
-
circuit
Returns the value of thecircuitrecord component.- Returns:
- the value of the
circuitrecord component
-