Record Class FlagDecayProduct

java.lang.Object
java.lang.Record
petrolpark.mc.library.core.world.item.decay.product.FlagDecayProduct
All Implemented Interfaces:
IDecayProduct

public record FlagDecayProduct(net.minecraft.core.Holder<Flag> flagHolder, FlagLootItemFunction.Action action) extends Record implements IDecayProduct
  • Field Details

    • CODEC

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

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

    • FlagDecayProduct

      public FlagDecayProduct(net.minecraft.core.Holder<Flag> flagHolder, FlagLootItemFunction.Action action)
      Creates an instance of a FlagDecayProduct record class.
      Parameters:
      flagHolder - the value for the flagHolder 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
    • flagHolder

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

      public FlagLootItemFunction.Action action()
      Returns the value of the action record component.
      Returns:
      the value of the action record component