Record Class RegExIngredient
java.lang.Object
java.lang.Record
dev.latvian.mods.kubejs.ingredient.RegExIngredient
- All Implemented Interfaces:
IngredientSupplierKJS,KubeJSIngredient,ItemPredicate,Predicate<net.minecraft.world.item.ItemStack>,net.neoforged.neoforge.common.crafting.ICustomIngredient
public record RegExIngredient(Pattern pattern, String patternString)
extends Record
implements KubeJSIngredient
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<RegExIngredient> static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, RegExIngredient> Fields inherited from interface dev.latvian.mods.kubejs.item.ItemPredicate
ALL, NONE, TYPE_INFO -
Constructor Summary
ConstructorsConstructorDescriptionRegExIngredient(Pattern pattern) RegExIngredient(Pattern pattern, String patternString) Creates an instance of aRegExIngredientrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.net.neoforged.neoforge.common.crafting.IngredientType<?> getType()inthashCode()Returns a hash code value for this object.pattern()Returns the value of thepatternrecord component.Returns the value of thepatternStringrecord component.booleantest(@Nullable net.minecraft.world.item.ItemStack stack) toString()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
toVanillaMethods inherited from interface dev.latvian.mods.kubejs.item.ItemPredicate
kjs$asIngredient, kjs$getDisplayStacks, kjs$getFirst, kjs$getItemIds, kjs$getItemStream, kjs$getItemTypes, kjs$getStackArray, kjs$getStacks, kjs$isWildcard, kjs$testItemMethods inherited from interface dev.latvian.mods.kubejs.ingredient.KubeJSIngredient
getItems, isSimple, kjs$canBeUsedForMatching
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,RegExIngredient> STREAM_CODEC
-
-
Constructor Details
-
RegExIngredient
-
RegExIngredient
Creates an instance of aRegExIngredientrecord class.- Parameters:
pattern- the value for thepatternrecord componentpatternString- the value for thepatternStringrecord component
-
-
Method Details
-
getType
public net.neoforged.neoforge.common.crafting.IngredientType<?> getType()- Specified by:
getTypein interfacenet.neoforged.neoforge.common.crafting.ICustomIngredient
-
test
public boolean test(@Nullable @Nullable net.minecraft.world.item.ItemStack stack) - Specified by:
testin interfacenet.neoforged.neoforge.common.crafting.ICustomIngredient- Specified by:
testin interfaceItemPredicate- Specified by:
testin interfaceKubeJSIngredient- Specified by:
testin interfacePredicate<net.minecraft.world.item.ItemStack>
-
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). -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. -
pattern
Returns the value of thepatternrecord component.- Returns:
- the value of the
patternrecord component
-
patternString
Returns the value of thepatternStringrecord component.- Returns:
- the value of the
patternStringrecord component
-