Package forestry.api.farming
Record Class Soil
java.lang.Object
java.lang.Record
forestry.api.farming.Soil
public record Soil(net.minecraft.world.item.ItemStack resource, net.minecraft.world.level.block.state.BlockState soilState)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionSoil(net.minecraft.world.item.ItemStack resource, net.minecraft.world.level.block.state.BlockState soilState) Creates an instance of aSoilrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.world.item.ItemStackresource()Returns the value of theresourcerecord component.net.minecraft.world.level.block.state.BlockStateReturns the value of thesoilStaterecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Soil
public Soil(net.minecraft.world.item.ItemStack resource, net.minecraft.world.level.block.state.BlockState soilState) Creates an instance of aSoilrecord class.- Parameters:
resource- the value for theresourcerecord componentsoilState- the value for thesoilStaterecord component
-
-
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). -
resource
public net.minecraft.world.item.ItemStack resource()Returns the value of theresourcerecord component.- Returns:
- the value of the
resourcerecord component
-
soilState
public net.minecraft.world.level.block.state.BlockState soilState()Returns the value of thesoilStaterecord component.- Returns:
- the value of the
soilStaterecord component
-