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

    Fields
    Modifier and Type
    Field
    Description
    static 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

    Constructors
    Constructor
    Description
    ChangeItemDecayProduct(net.minecraft.world.item.ItemStack stack)
    Creates an instance of a ChangeItemDecayProduct record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    equals(Object other)
    Indicates whether some other object is "equal to" this one.
    net.minecraft.world.item.ItemStack
    get(net.minecraft.world.item.ItemStack stack)
     
     
    final int
    Returns a hash code value for this object.
    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
  • Field Details

    • CODEC

      public static final com.mojang.serialization.MapCodec<ChangeItemDecayProduct> 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 a ChangeItemDecayProduct record class.
      Parameters:
      stack - the value for the stack record component
  • Method Details

    • get

      public net.minecraft.world.item.ItemStack get(net.minecraft.world.item.ItemStack stack)
      Specified by:
      get in interface IDecayProduct
    • getType

      public DecayProductType getType()
      Specified by:
      getType in interface IDecayProduct
    • equals

      public final boolean equals(Object other)
      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:
      other - the object with which to compare
      Returns:
      true if this object is the same as the other argument; false otherwise.
    • 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
    • stack

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