Record Class ItemCompressionManager.CompressionRecipe

java.lang.Object
java.lang.Record
com.petrolpark.core.recipe.compression.ItemCompressionManager.CompressionRecipe
All Implemented Interfaces:
IItemCompression
Enclosing class:
ItemCompressionManager

public static record ItemCompressionManager.CompressionRecipe(net.minecraft.world.item.crafting.Ingredient ingredient, ItemCompression compression) extends Record implements IItemCompression
  • Field Summary

    Fields inherited from interface com.petrolpark.core.recipe.compression.IItemCompression

    CODEC, NONE, STREAM_CODEC
  • Constructor Summary

    Constructors
    Constructor
    Description
    CompressionRecipe(net.minecraft.world.item.crafting.Ingredient ingredient, int count, net.minecraft.world.item.ItemStack result)
     
    CompressionRecipe(net.minecraft.world.item.crafting.Ingredient ingredient, ItemCompression compression)
    Creates an instance of a CompressionRecipe record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the compression record component.
    int
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    net.minecraft.world.item.crafting.Ingredient
    Returns the value of the ingredient record component.
    boolean
    isDecompressedStacks(net.minecraft.world.item.ItemStack decompressed)
    Whether the given Item Stack is the exact reversal of this Compression.
    net.minecraft.world.item.ItemStack
     
    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

    Methods inherited from interface com.petrolpark.core.recipe.compression.IItemCompression

    ratio
  • Constructor Details

    • CompressionRecipe

      public CompressionRecipe(net.minecraft.world.item.crafting.Ingredient ingredient, int count, net.minecraft.world.item.ItemStack result)
    • CompressionRecipe

      public CompressionRecipe(net.minecraft.world.item.crafting.Ingredient ingredient, ItemCompression compression)
      Creates an instance of a CompressionRecipe record class.
      Parameters:
      ingredient - the value for the ingredient record component
      compression - the value for the compression record component
  • Method Details

    • isDecompressedStacks

      public boolean isDecompressedStacks(net.minecraft.world.item.ItemStack decompressed)
      Whether the given Item Stack is the exact reversal of this Compression.
      Parameters:
      decompressed -
    • count

      public int count()
      Specified by:
      count in interface IItemCompression
    • result

      public net.minecraft.world.item.ItemStack result()
      Specified by:
      result in interface IItemCompression
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • ingredient

      public net.minecraft.world.item.crafting.Ingredient ingredient()
      Returns the value of the ingredient record component.
      Returns:
      the value of the ingredient record component
    • compression

      public ItemCompression compression()
      Returns the value of the compression record component.
      Returns:
      the value of the compression record component