Record Class BlockTypeIngredient

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

public record BlockTypeIngredient(net.minecraft.world.level.block.Block block) extends Record implements StateIngredient
  • Constructor Details

    • BlockTypeIngredient

      public BlockTypeIngredient(net.minecraft.world.level.block.Block block)
      Creates an instance of a BlockTypeIngredient record class.
      Parameters:
      block - the value for the block 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
    • 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
    • block

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