Record Class ContaminateDecayProduct

java.lang.Object
java.lang.Record
com.petrolpark.core.item.decay.product.ContaminateDecayProduct
All Implemented Interfaces:
IDecayProduct

public record ContaminateDecayProduct(net.minecraft.core.Holder<Contaminant> contaminantHolder, ContaminationLootItemFunction.Action action) extends Record implements IDecayProduct
  • Field Details

    • CODEC

      public static final com.mojang.serialization.MapCodec<ContaminateDecayProduct> CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,ContaminateDecayProduct> STREAM_CODEC
  • Constructor Details

    • ContaminateDecayProduct

      public ContaminateDecayProduct(net.minecraft.core.Holder<Contaminant> contaminantHolder, ContaminationLootItemFunction.Action action)
      Creates an instance of a ContaminateDecayProduct record class.
      Parameters:
      contaminantHolder - the value for the contaminantHolder record component
      action - the value for the action 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
    • contaminantHolder

      public net.minecraft.core.Holder<Contaminant> contaminantHolder()
      Returns the value of the contaminantHolder record component.
      Returns:
      the value of the contaminantHolder record component
    • action

      Returns the value of the action record component.
      Returns:
      the value of the action record component