Record Class BlockTagIngredient

java.lang.Object
java.lang.Record
vazkii.botania.common.crafting.BlockTagIngredient
All Implemented Interfaces:
Predicate<net.minecraft.world.level.block.state.BlockState>, StateIngredient

public record BlockTagIngredient(net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> tag) extends Record implements StateIngredient
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    BlockTagIngredient(net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> tag)
    Creates an instance of a BlockTagIngredient record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether some other object is "equal to" this one.
    List<net.minecraft.world.level.block.state.BlockState>
     
    List<net.minecraft.world.item.ItemStack>
     
     
    final int
    Returns a hash code value for this object.
    net.minecraft.world.level.block.state.BlockState
    pick(net.minecraft.util.RandomSource random)
     
    Stream<net.minecraft.world.level.block.Block>
     
    Stream<net.minecraft.world.level.block.state.BlockState>
     
    net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block>
    tag()
    Returns the value of the tag record component.
    boolean
    test(net.minecraft.world.level.block.state.BlockState state)
     
    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 java.util.function.Predicate

    and, negate, or

    Methods inherited from interface vazkii.botania.api.recipe.StateIngredient

    descriptionTooltip
  • Constructor Details

    • BlockTagIngredient

      public BlockTagIngredient(net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> tag)
      Creates an instance of a BlockTagIngredient record class.
      Parameters:
      tag - the value for the tag record component
  • Method Details

    • resolve

      public Stream<net.minecraft.world.level.block.Block> resolve()
    • test

      public boolean test(net.minecraft.world.level.block.state.BlockState state)
      Specified by:
      test in interface Predicate<net.minecraft.world.level.block.state.BlockState>
      Specified by:
      test in interface StateIngredient
    • pick

      public net.minecraft.world.level.block.state.BlockState pick(net.minecraft.util.RandomSource random)
      Specified by:
      pick in interface StateIngredient
    • getType

      public StateIngredientType getType()
      Specified by:
      getType in interface StateIngredient
    • getDisplayedStacks

      public List<net.minecraft.world.item.ItemStack> getDisplayedStacks()
      Specified by:
      getDisplayedStacks in interface StateIngredient
    • getDisplayed

      public List<net.minecraft.world.level.block.state.BlockState> getDisplayed()
      Specified by:
      getDisplayed in interface StateIngredient
    • streamBlockStates

      public Stream<net.minecraft.world.level.block.state.BlockState> streamBlockStates()
      Specified by:
      streamBlockStates in interface StateIngredient
    • equals

      public 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.
    • toString

      public 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
    • tag

      public net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> tag()
      Returns the value of the tag record component.
      Returns:
      the value of the tag record component