Record Class FromArrayIngredientRandomizer.Entry
java.lang.Object
java.lang.Record
petrolpark.mc.library.core.data.recipe.ingredient.randomizer.FromArrayIngredientRandomizer.Entry
- Enclosing class:
FromArrayIngredientRandomizer
public static record FromArrayIngredientRandomizer.Entry(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> ingredient, net.minecraft.world.level.storage.loot.providers.number.NumberProvider weight)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<List<FromArrayIngredientRandomizer.Entry>> -
Constructor Summary
ConstructorsConstructorDescriptionEntry(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> ingredient) Entry(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> ingredient, net.minecraft.world.level.storage.loot.providers.number.NumberProvider weight) Creates an instance of aEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> Returns the value of theingredientrecord component.final StringtoString()Returns a string representation of this record class.net.minecraft.world.level.storage.loot.providers.number.NumberProviderweight()Returns the value of theweightrecord component.
-
Field Details
-
LIST_CODEC
public static final com.mojang.serialization.Codec<List<FromArrayIngredientRandomizer.Entry>> LIST_CODEC
-
-
Constructor Details
-
Entry
-
Entry
public Entry(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> ingredient, net.minecraft.world.level.storage.loot.providers.number.NumberProvider weight) Creates an instance of aEntryrecord class.- Parameters:
ingredient- the value for theingredientrecord componentweight- the value for theweightrecord component
-
-
Method Details
-
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
Returns the value of theingredientrecord component.- Returns:
- the value of the
ingredientrecord component
-
weight
public net.minecraft.world.level.storage.loot.providers.number.NumberProvider weight()Returns the value of theweightrecord component.- Returns:
- the value of the
weightrecord component
-