Record Class ItemCookingProperties

java.lang.Object
java.lang.Record
net.raphimc.viabedrock.protocol.model.ItemCookingProperties

public record ItemCookingProperties(boolean food, String blockIdentifier, boolean replacementBlockItem) extends Record
Item traits used by Bedrock's cooking recipe categories, independently of Java item types.
  • Field Details

  • Constructor Details

    • ItemCookingProperties

      public ItemCookingProperties(boolean food, String blockIdentifier, boolean replacementBlockItem)
      Creates an instance of a ItemCookingProperties record class.
      Parameters:
      food - the value for the food record component
      blockIdentifier - the value for the blockIdentifier record component
      replacementBlockItem - the value for the replacementBlockItem record component
  • Method Details

    • withComponentItemData

      public ItemCookingProperties withComponentItemData(com.viaversion.nbt.tag.CompoundTag components, String identifier, Function<String,String> resolveBlock)
      Apply compiled component data to an existing ComponentItem, retaining omitted components.
    • withLegacyItemData

      public ItemCookingProperties withLegacyItemData(com.viaversion.nbt.tag.CompoundTag components, Function<String,String> resolveBlock)
      Base Item uses a direct block name; ComponentItem placement properties do not apply.
    • category

      public ItemCookingProperties.Category category()
    • 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
    • equals

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

      public boolean food()
      Returns the value of the food record component.
      Returns:
      the value of the food record component
    • blockIdentifier

      public String blockIdentifier()
      Returns the value of the blockIdentifier record component.
      Returns:
      the value of the blockIdentifier record component
    • replacementBlockItem

      public boolean replacementBlockItem()
      Returns the value of the replacementBlockItem record component.
      Returns:
      the value of the replacementBlockItem record component