Record Class SoupData

java.lang.Object
java.lang.Record
com.mrbysco.chowderexpress.entity.SoupData

public record SoupData(net.minecraft.world.item.ItemStackTemplate stack, int nutrition, float saturationModifier) extends Record
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<SoupData>
     
    static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, SoupData>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SoupData(net.minecraft.world.item.ItemStack stack, @Nullable net.minecraft.world.food.FoodProperties foodProperties)
     
    SoupData(net.minecraft.world.item.ItemStackTemplate stack, int nutrition, float saturationModifier)
    Creates an instance of a SoupData record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns a hash code value for this object.
    net.minecraft.resources.Identifier
     
    int
    Returns the value of the nutrition record component.
    float
    Returns the value of the saturationModifier record component.
    net.minecraft.world.item.ItemStackTemplate
    Returns the value of the stack record component.
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<SoupData> CODEC
    • STREAM_CODEC

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

    • SoupData

      public SoupData(net.minecraft.world.item.ItemStack stack, @Nullable @Nullable net.minecraft.world.food.FoodProperties foodProperties)
    • SoupData

      public SoupData(net.minecraft.world.item.ItemStackTemplate stack, int nutrition, float saturationModifier)
      Creates an instance of a SoupData record class.
      Parameters:
      stack - the value for the stack record component
      nutrition - the value for the nutrition record component
      saturationModifier - the value for the saturationModifier record component
  • Method Details

    • identifier

      public net.minecraft.resources.Identifier identifier()
    • equals

      public boolean equals(Object obj)
      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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      obj - the object with which to compare
      Returns:
      true if this object is the same as the obj argument; false otherwise.
    • hashCode

      public 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
    • toString

      public 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
    • stack

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

      public int nutrition()
      Returns the value of the nutrition record component.
      Returns:
      the value of the nutrition record component
    • saturationModifier

      public float saturationModifier()
      Returns the value of the saturationModifier record component.
      Returns:
      the value of the saturationModifier record component