Class BooleanComponent

java.lang.Object
dev.latvian.mods.kubejs.recipe.component.BooleanComponent
All Implemented Interfaces:
RecipeComponent<Boolean>

public class BooleanComponent extends Object implements RecipeComponent<Boolean>
  • Field Details

  • Constructor Details

    • BooleanComponent

      public BooleanComponent()
  • Method Details

    • type

      public RecipeComponentType<?> type()
      Specified by:
      type in interface RecipeComponent<Boolean>
    • codec

      public com.mojang.serialization.Codec<Boolean> codec()
      Specified by:
      codec in interface RecipeComponent<Boolean>
    • typeInfo

      public dev.latvian.mods.rhino.type.TypeInfo typeInfo()
      Description copied from interface: RecipeComponent
      Defines 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:
      typeInfo in interface RecipeComponent<Boolean>
      Returns:
      A description of how this component may be constructed
    • wrap

      public Boolean wrap(RecipeScriptContext cx, Object from)
      Description copied from interface: RecipeComponent
      Method to read the value contained within this component from an input object; this may be some arbitrary value passed into a schema's constructor(s) or automatically generated builder methods. By default, it will attempt to type wrap based on RecipeComponent.typeInfo()
      Specified by:
      wrap in interface RecipeComponent<Boolean>
      Parameters:
      cx - Script context
      from - An object to be converted to a value for this component
      Returns:
      The value read from the input
    • hasPriority

      public boolean hasPriority(RecipeMatchContext cx, Object from)
      Description copied from interface: RecipeComponent
      Declares whether this component should take priority when being considered by e.g. an EitherRecipeComponent during deserialization.
      Specified by:
      hasPriority in interface RecipeComponent<Boolean>
      Parameters:
      cx - Script context
      from - The object to be deserialized from
      Returns:
      Whether this component should take priority
    • toString

      public String toString()
      Overrides:
      toString in class Object