Record Class BlockStateIngredient

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

public record BlockStateIngredient(net.minecraft.world.level.block.state.BlockState state) extends Record implements StateIngredient
  • Nested Class Summary

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

    Constructors
    Constructor
    Description
    BlockStateIngredient(net.minecraft.world.level.block.state.BlockState state)
    Creates an instance of a BlockStateIngredient record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    List<net.minecraft.network.chat.Component>
    A description tooltip to display in areas like JEI recipes.
    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)
     
    net.minecraft.world.level.block.state.BlockState
    Returns the value of the state record component.
    Stream<net.minecraft.world.level.block.state.BlockState>
     
    boolean
    test(net.minecraft.world.level.block.state.BlockState blockState)
     
    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
  • Constructor Details

    • BlockStateIngredient

      public BlockStateIngredient(net.minecraft.world.level.block.state.BlockState state)
      Creates an instance of a BlockStateIngredient record class.
      Parameters:
      state - the value for the state record component
  • Method Details

    • test

      public boolean test(net.minecraft.world.level.block.state.BlockState blockState)
      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

      Specified by:
      getType in interface StateIngredient
    • getDisplayedStacks

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

      public List<net.minecraft.network.chat.Component> descriptionTooltip()
      Description copied from interface: StateIngredient
      A description tooltip to display in areas like JEI recipes.
      Specified by:
      descriptionTooltip 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
    • state

      public net.minecraft.world.level.block.state.BlockState state()
      Returns the value of the state record component.
      Returns:
      the value of the state record component