Record Class BlockHolderSetIngredient

java.lang.Object
java.lang.Record
com.petrolpark.core.recipe.ingredient.BlockHolderSetIngredient
All Implemented Interfaces:
net.neoforged.neoforge.common.crafting.ICustomIngredient

public record BlockHolderSetIngredient(net.minecraft.core.HolderSet<net.minecraft.world.level.block.Block> blocks) extends Record implements net.neoforged.neoforge.common.crafting.ICustomIngredient
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.MapCodec<BlockHolderSetIngredient>
     
    static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,BlockHolderSetIngredient>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    BlockHolderSetIngredient(net.minecraft.core.HolderSet<net.minecraft.world.level.block.Block> blocks)
    Creates an instance of a BlockHolderSetIngredient record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.core.HolderSet<net.minecraft.world.level.block.Block>
    Returns the value of the blocks record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    Stream<net.minecraft.world.item.ItemStack>
     
    net.neoforged.neoforge.common.crafting.IngredientType<?>
     
    final int
    Returns a hash code value for this object.
    boolean
     
    boolean
    test(net.minecraft.world.item.ItemStack stack)
     
    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.neoforged.neoforge.common.crafting.ICustomIngredient

    toVanilla
  • Field Details

    • CODEC

      public static final com.mojang.serialization.MapCodec<BlockHolderSetIngredient> CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,BlockHolderSetIngredient> STREAM_CODEC
  • Constructor Details

    • BlockHolderSetIngredient

      public BlockHolderSetIngredient(net.minecraft.core.HolderSet<net.minecraft.world.level.block.Block> blocks)
      Creates an instance of a BlockHolderSetIngredient record class.
      Parameters:
      blocks - the value for the blocks record component
  • Method Details

    • test

      public boolean test(@Nonnull net.minecraft.world.item.ItemStack stack)
      Specified by:
      test in interface net.neoforged.neoforge.common.crafting.ICustomIngredient
    • getItems

      public Stream<net.minecraft.world.item.ItemStack> getItems()
      Specified by:
      getItems in interface net.neoforged.neoforge.common.crafting.ICustomIngredient
    • isSimple

      public boolean isSimple()
      Specified by:
      isSimple in interface net.neoforged.neoforge.common.crafting.ICustomIngredient
    • getType

      public net.neoforged.neoforge.common.crafting.IngredientType<?> getType()
      Specified by:
      getType in interface net.neoforged.neoforge.common.crafting.ICustomIngredient
    • 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.
    • blocks

      public net.minecraft.core.HolderSet<net.minecraft.world.level.block.Block> blocks()
      Returns the value of the blocks record component.
      Returns:
      the value of the blocks record component