Interface NumberComponent<S,T extends Number>
- All Superinterfaces:
RecipeComponent<T>
- All Known Implementing Classes:
NumberComponent.DoubleRange,NumberComponent.FloatRange,NumberComponent.IntRange,NumberComponent.LongRange
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordstatic final recordstatic final recordstatic final record -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NumberComponent.DoubleRangestatic final RecipeComponentType<?> static final NumberComponent.FloatRangestatic final RecipeComponentType<?> static final NumberComponent.IntRangestatic final RecipeComponentType<?> static final NumberComponent.LongRangestatic final RecipeComponentType<?> static final RecipeComponentType<Double> static final RecipeComponentType<Float> static final RecipeComponentType<Integer> static final RecipeComponentType<Long> static final RecipeComponentType<Double> static final RecipeComponentType<Float> static final RecipeComponentType<Integer> static final RecipeComponentType<Long> -
Method Summary
Modifier and TypeMethodDescriptionstatic NumberComponent.DoubleRangedoubleRange(double min, double max) static NumberComponent.FloatRangefloatRange(float min, float max) default booleanhasPriority(RecipeMatchContext cx, Object from) Declares whether this component should take priority when being considered by e.g.static NumberComponent.IntRangeintRange(int min, int max) static NumberComponent.LongRangelongRange(long min, long max) max()default NumberComponent<S, T> min()default NumberComponent<S, T> default StringtoString(@Nullable RecipeComponentType<?> typeOverride, String name, T min, T max) default dev.latvian.mods.rhino.type.TypeInfotypeInfo()Defines a description for how this component may be constructed.Methods inherited from interface dev.latvian.mods.kubejs.recipe.component.RecipeComponent
allowEmpty, asConditionalList, asConditionalListOrSelf, asList, asListOrSelf, asMap, asPatternKey, buildUniqueId, codec, createBuilder, inputKey, isEmpty, isIgnored, key, matches, or, orSelf, otherKey, outputKey, readFromJson, replace, spread, toString, type, validate, withCodec, wrap, writeToJson
-
Field Details
-
INT
-
LONG
-
FLOAT
-
DOUBLE
-
INT_TYPE
-
LONG_TYPE
-
FLOAT_TYPE
-
DOUBLE_TYPE
-
NON_NEGATIVE_INT
-
POSITIVE_INT
-
NON_NEGATIVE_LONG
-
POSITIVE_LONG
-
NON_NEGATIVE_FLOAT
-
POSITIVE_FLOAT
-
NON_NEGATIVE_DOUBLE
-
POSITIVE_DOUBLE
-
-
Method Details
-
intRange
-
longRange
-
floatRange
-
doubleRange
-
typeInfo
default 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<S>- 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<S>- Parameters:
cx- Script contextfrom- The object to be deserialized from- Returns:
- Whether this component should take priority
-
min
T min() -
max
T max() -
range
-
min
-
max
-
toString
default String toString(@Nullable @Nullable RecipeComponentType<?> typeOverride, String name, T min, T max)
-