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
ConstructorsConstructorDescriptionCompressionRecipe(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 aCompressionReciperecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecompressionrecord component.intcount()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.world.item.crafting.IngredientReturns the value of theingredientrecord component.booleanisDecompressedStacks(net.minecraft.world.item.ItemStack decompressed) Whether the given Item Stack is the exact reversal of this Compression.net.minecraft.world.item.ItemStackresult()final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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 aCompressionReciperecord class.- Parameters:
ingredient- the value for theingredientrecord componentcompression- the value for thecompressionrecord 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:
countin interfaceIItemCompression
-
result
public net.minecraft.world.item.ItemStack result()- Specified by:
resultin interfaceIItemCompression
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
ingredient
public net.minecraft.world.item.crafting.Ingredient ingredient()Returns the value of theingredientrecord component.- Returns:
- the value of the
ingredientrecord component
-
compression
Returns the value of thecompressionrecord component.- Returns:
- the value of the
compressionrecord component
-