Record Class FromItemSetIngredientRandomizer
java.lang.Object
java.lang.Record
com.petrolpark.core.recipe.ingredient.randomizer.FromItemSetIngredientRandomizer
- All Implemented Interfaces:
IngredientRandomizer,net.minecraft.world.level.storage.loot.LootContextUser
public record FromItemSetIngredientRandomizer(net.minecraft.core.HolderSet<net.minecraft.world.item.Item> items)
extends Record
implements IngredientRandomizer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<FromItemSetIngredientRandomizer> Fields inherited from interface com.petrolpark.core.recipe.ingredient.randomizer.IngredientRandomizer
TYPED_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionFromItemSetIngredientRandomizer(net.minecraft.core.HolderSet<net.minecraft.world.item.Item> items) Creates an instance of aFromItemSetIngredientRandomizerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.net.minecraft.world.item.crafting.Ingredientgenerate(net.minecraft.world.level.storage.loot.LootContext context) getType()final inthashCode()Returns a hash code value for this object.net.minecraft.core.HolderSet<net.minecraft.world.item.Item> items()Returns the value of theitemsrecord component.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 net.minecraft.world.level.storage.loot.LootContextUser
getReferencedContextParams, validate
-
Field Details
-
CODEC
-
-
Constructor Details
-
FromItemSetIngredientRandomizer
public FromItemSetIngredientRandomizer(net.minecraft.core.HolderSet<net.minecraft.world.item.Item> items) Creates an instance of aFromItemSetIngredientRandomizerrecord class.- Parameters:
items- the value for theitemsrecord component
-
-
Method Details
-
generate
public net.minecraft.world.item.crafting.Ingredient generate(net.minecraft.world.level.storage.loot.LootContext context) - Specified by:
generatein interfaceIngredientRandomizer
-
getType
- Specified by:
getTypein interfaceIngredientRandomizer
-
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). -
items
public net.minecraft.core.HolderSet<net.minecraft.world.item.Item> items()Returns the value of theitemsrecord component.- Returns:
- the value of the
itemsrecord component
-