Record Class EnchantmentItemAdvancedIngredient.Type
java.lang.Object
java.lang.Record
com.petrolpark.core.recipe.ingredient.advanced.EnchantmentItemAdvancedIngredient.Type
- All Implemented Interfaces:
IAdvancedIngredientType<net.minecraft.world.item.ItemStack>,INamedAdvancedIngredientType<net.minecraft.world.item.ItemStack>
- Enclosing class:
EnchantmentItemAdvancedIngredient
public static record EnchantmentItemAdvancedIngredient.Type(String translationKey)
extends Record
implements INamedAdvancedIngredientType<net.minecraft.world.item.ItemStack>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<EnchantmentItemAdvancedIngredient> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.streamApplicableIngredients(net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack stack) net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, EnchantmentItemAdvancedIngredient> final StringtoString()Returns a string representation of this record class.Returns the value of thetranslationKeyrecord component.
-
Constructor Details
-
Type
Creates an instance of aTyperecord class.- Parameters:
translationKey- the value for thetranslationKeyrecord component
-
-
Method Details
-
codec
- Specified by:
codecin interfaceIAdvancedIngredientType<net.minecraft.world.item.ItemStack>
-
streamCodec
public net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,EnchantmentItemAdvancedIngredient> streamCodec()- Specified by:
streamCodecin interfaceIAdvancedIngredientType<net.minecraft.world.item.ItemStack>
-
streamApplicableIngredients
public Stream<EnchantmentItemAdvancedIngredient> streamApplicableIngredients(net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack stack) - Specified by:
streamApplicableIngredientsin interfaceIAdvancedIngredientType<net.minecraft.world.item.ItemStack>
-
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). -
translationKey
Returns the value of thetranslationKeyrecord component.- Specified by:
translationKeyin interfaceINamedAdvancedIngredientType<net.minecraft.world.item.ItemStack>- Returns:
- the value of the
translationKeyrecord component
-