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

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.MapCodec<FromItemSetIngredientRandomizer>
     

    Fields inherited from interface com.petrolpark.core.recipe.ingredient.randomizer.IngredientRandomizer

    TYPED_CODEC
  • Constructor Summary

    Constructors
    Constructor
    Description
    FromItemSetIngredientRandomizer(net.minecraft.core.HolderSet<net.minecraft.world.item.Item> items)
    Creates an instance of a FromItemSetIngredientRandomizer record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    net.minecraft.world.item.crafting.Ingredient
    generate(net.minecraft.world.level.storage.loot.LootContext context)
     
     
    final int
    Returns a hash code value for this object.
    net.minecraft.core.HolderSet<net.minecraft.world.item.Item>
    Returns the value of the items record component.
    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 net.minecraft.world.level.storage.loot.LootContextUser

    getReferencedContextParams, validate
  • Field Details

  • Constructor Details

    • FromItemSetIngredientRandomizer

      public FromItemSetIngredientRandomizer(net.minecraft.core.HolderSet<net.minecraft.world.item.Item> items)
      Creates an instance of a FromItemSetIngredientRandomizer record class.
      Parameters:
      items - the value for the items record component
  • Method Details

    • generate

      public net.minecraft.world.item.crafting.Ingredient generate(net.minecraft.world.level.storage.loot.LootContext context)
      Specified by:
      generate in interface IngredientRandomizer
    • getType

      public IngredientRandomizerType getType()
      Specified by:
      getType in interface IngredientRandomizer
    • 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.
    • items

      public net.minecraft.core.HolderSet<net.minecraft.world.item.Item> items()
      Returns the value of the items record component.
      Returns:
      the value of the items record component