Class CustomObjectRecipeComponent
java.lang.Object
dev.latvian.mods.kubejs.recipe.component.CustomObjectRecipeComponent
- All Implemented Interfaces:
RecipeComponent<List<CustomObjectRecipeComponent.Value>>
public class CustomObjectRecipeComponent
extends Object
implements RecipeComponent<List<CustomObjectRecipeComponent.Value>>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final record -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildUniqueId(UniqueIdBuilder builder, List<CustomObjectRecipeComponent.Value> list) com.mojang.serialization.Codec<List<CustomObjectRecipeComponent.Value>> codec()booleanhasPriority(RecipeMatchContext cx, Object from) Declares whether this component should take priority when being considered by e.g.hasPriority(Predicate<Set<String>> hasPriority) booleanShallow empty check functionkeys()com.mojang.serialization.MapCodec<List<CustomObjectRecipeComponent.Value>> mapCodec()booleanmatches(RecipeMatchContext cx, List<CustomObjectRecipeComponent.Value> value, ReplacementMatchInfo match) replace(RecipeScriptContext cx, List<CustomObjectRecipeComponent.Value> original, ReplacementMatchInfo match, Object with) toString()type()dev.latvian.mods.rhino.type.TypeInfotypeInfo()Defines a description for how this component may be constructed.voidwrap(RecipeScriptContext rcx, Object from) Method to read the value contained within this component from an input object; this may be some arbitrary value passed into aschema'sconstructor(s) or automatically generated builder methods.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.latvian.mods.kubejs.recipe.component.RecipeComponent
allowEmpty, asConditionalList, asConditionalListOrSelf, asList, asListOrSelf, asMap, asPatternKey, createBuilder, inputKey, isIgnored, key, or, orSelf, otherKey, outputKey, readFromJson, spread, toString, withCodec, writeToJson
-
Field Details
-
TYPE
-
hasPriority
-
-
Constructor Details
-
CustomObjectRecipeComponent
-
-
Method Details
-
type
- Specified by:
typein interfaceRecipeComponent<List<CustomObjectRecipeComponent.Value>>
-
keys
-
hasPriority
-
createCopy
-
wrap
Description copied from interface:RecipeComponentMethod to read the value contained within this component from an input object; this may be some arbitrary value passed into aschema'sconstructor(s) or automatically generated builder methods. By default, it will attempt to type wrap based onRecipeComponent.typeInfo()- Specified by:
wrapin interfaceRecipeComponent<List<CustomObjectRecipeComponent.Value>>- Parameters:
rcx- Script contextfrom- An object to be converted to a value for this component- Returns:
- The value read from the input
-
mapCodec
-
codec
- Specified by:
codecin interfaceRecipeComponent<List<CustomObjectRecipeComponent.Value>>
-
typeInfo
public dev.latvian.mods.rhino.type.TypeInfo typeInfo()Description copied from interface:RecipeComponentDefines a description for how this component may be constructed. Type descriptions may be comprised of a primitive type such as a string, number or Java class (which may be useful if that that class has an appropriate type wrapper for it already), an array of fixed or dynamic length, a map / object, or a union of multiple types.Type descriptions are used by addons like ProbeJS to provide typing hints.
- Specified by:
typeInfoin interfaceRecipeComponent<List<CustomObjectRecipeComponent.Value>>- Returns:
- A description of how this component may be constructed
-
hasPriority
Description copied from interface:RecipeComponentDeclares whether this component should take priority when being considered by e.g. anEitherRecipeComponentduring deserialization.- Specified by:
hasPriorityin interfaceRecipeComponent<List<CustomObjectRecipeComponent.Value>>- Parameters:
cx- Script contextfrom- The object to be deserialized from- Returns:
- Whether this component should take priority
-
matches
public boolean matches(RecipeMatchContext cx, List<CustomObjectRecipeComponent.Value> value, ReplacementMatchInfo match) - Specified by:
matchesin interfaceRecipeComponent<List<CustomObjectRecipeComponent.Value>>- Parameters:
cx- Script contextvalue- The value to checkmatch- The replacement match to check against- Returns:
- true if the given value matches the given replacement match.
-
replace
public List<CustomObjectRecipeComponent.Value> replace(RecipeScriptContext cx, List<CustomObjectRecipeComponent.Value> original, ReplacementMatchInfo match, Object with) - Specified by:
replacein interfaceRecipeComponent<List<CustomObjectRecipeComponent.Value>>
-
buildUniqueId
- Specified by:
buildUniqueIdin interfaceRecipeComponent<List<CustomObjectRecipeComponent.Value>>
-
validate
- Specified by:
validatein interfaceRecipeComponent<List<CustomObjectRecipeComponent.Value>>
-
isEmpty
Description copied from interface:RecipeComponentShallow empty check function- Specified by:
isEmptyin interfaceRecipeComponent<List<CustomObjectRecipeComponent.Value>>
-
toString
-