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
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<BlockHolderSetIngredient> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, BlockHolderSetIngredient> -
Constructor Summary
ConstructorsConstructorDescriptionBlockHolderSetIngredient(net.minecraft.core.HolderSet<net.minecraft.world.level.block.Block> blocks) Creates an instance of aBlockHolderSetIngredientrecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.core.HolderSet<net.minecraft.world.level.block.Block> blocks()Returns the value of theblocksrecord component.final booleanIndicates whether some other object is "equal to" this one.Stream<net.minecraft.world.item.ItemStack> getItems()net.neoforged.neoforge.common.crafting.IngredientType<?> getType()final inthashCode()Returns a hash code value for this object.booleanisSimple()booleantest(net.minecraft.world.item.ItemStack stack) final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.common.crafting.ICustomIngredient
toVanilla
-
Field Details
-
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 aBlockHolderSetIngredientrecord class.- Parameters:
blocks- the value for theblocksrecord component
-
-
Method Details
-
test
public boolean test(@Nonnull net.minecraft.world.item.ItemStack stack) - Specified by:
testin interfacenet.neoforged.neoforge.common.crafting.ICustomIngredient
-
getItems
- Specified by:
getItemsin interfacenet.neoforged.neoforge.common.crafting.ICustomIngredient
-
isSimple
public boolean isSimple()- Specified by:
isSimplein interfacenet.neoforged.neoforge.common.crafting.ICustomIngredient
-
getType
public net.neoforged.neoforge.common.crafting.IngredientType<?> getType()- Specified by:
getTypein interfacenet.neoforged.neoforge.common.crafting.ICustomIngredient
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
blocks
public net.minecraft.core.HolderSet<net.minecraft.world.level.block.Block> blocks()Returns the value of theblocksrecord component.- Returns:
- the value of the
blocksrecord component
-