Class BooleanComponent
java.lang.Object
dev.latvian.mods.kubejs.recipe.component.BooleanComponent
- All Implemented Interfaces:
RecipeComponent<Boolean>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.Codec<Boolean> codec()booleanhasPriority(RecipeMatchContext cx, Object from) Declares whether this component should take priority when being considered by e.g.toString()type()dev.latvian.mods.rhino.type.TypeInfotypeInfo()Defines a description for how this component may be constructed.wrap(RecipeScriptContext cx, 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, buildUniqueId, createBuilder, inputKey, isEmpty, isIgnored, key, matches, or, orSelf, otherKey, outputKey, readFromJson, replace, spread, toString, validate, withCodec, writeToJson
-
Field Details
-
BOOLEAN
-
-
Constructor Details
-
BooleanComponent
public BooleanComponent()
-
-
Method Details
-
type
- Specified by:
typein interfaceRecipeComponent<Boolean>
-
codec
- Specified by:
codecin interfaceRecipeComponent<Boolean>
-
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<Boolean>- Returns:
- A description of how this component may be constructed
-
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<Boolean>- Parameters:
cx- Script contextfrom- An object to be converted to a value for this component- Returns:
- The value read from the input
-
hasPriority
Description copied from interface:RecipeComponentDeclares whether this component should take priority when being considered by e.g. anEitherRecipeComponentduring deserialization.- Specified by:
hasPriorityin interfaceRecipeComponent<Boolean>- Parameters:
cx- Script contextfrom- The object to be deserialized from- Returns:
- Whether this component should take priority
-
toString
-