Record Class ChangeItemDecayProduct
java.lang.Object
java.lang.Record
com.petrolpark.core.item.decay.product.ChangeItemDecayProduct
- All Implemented Interfaces:
IDecayProduct
public record ChangeItemDecayProduct(net.minecraft.world.item.ItemStack stack)
extends Record
implements IDecayProduct
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<ChangeItemDecayProduct> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, ChangeItemDecayProduct> Fields inherited from interface com.petrolpark.core.item.decay.product.IDecayProduct
TYPED_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionChangeItemDecayProduct(net.minecraft.world.item.ItemStack stack) Creates an instance of aChangeItemDecayProductrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.net.minecraft.world.item.ItemStackget(net.minecraft.world.item.ItemStack stack) getType()final inthashCode()Returns a hash code value for this object.net.minecraft.world.item.ItemStackstack()Returns the value of thestackrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,ChangeItemDecayProduct> STREAM_CODEC
-
-
Constructor Details
-
ChangeItemDecayProduct
public ChangeItemDecayProduct(net.minecraft.world.item.ItemStack stack) Creates an instance of aChangeItemDecayProductrecord class.- Parameters:
stack- the value for thestackrecord component
-
-
Method Details
-
get
public net.minecraft.world.item.ItemStack get(net.minecraft.world.item.ItemStack stack) - Specified by:
getin interfaceIDecayProduct
-
getType
- Specified by:
getTypein interfaceIDecayProduct
-
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). -
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. -
stack
public net.minecraft.world.item.ItemStack stack()Returns the value of thestackrecord component.- Returns:
- the value of the
stackrecord component
-