lib Namespace
The functions in this namespace provide support for common things that a script may do. This namespace is available for biome conditions, acoustic filtering, and chance percentages.
- Object lib.iif(boolean result, Object trueResult, Object falseResult)
Selects an object based on a boolean result.
- Arguments:
result (
Boolean()) – A boolean valuethat is used to make a result selectiontrueResult (
Object()) – The object to return if the result istruefalseResult (
Object()) – The object to return if the result isfalse
- Returns:
trueResultorfalseResultdepending on the value ofresult.- Return type:
Object
- Boolean lib.match(String pattern, String input)
Determines if the input matches the regular expression.
- Arguments:
pattern (
String()) – Regular expression to use for matchinginput (
String()) – The input to tapestry
- Returns:
Applies the provided regular expression
patternto determine ifinputis a match.- Return type:
Boolean
- Boolean lib.oneof(Object input, Object... possibles)
Determines of the input object is contained within the possible array.
- Arguments:
input (
Object()) – The input object of interestpossibles (
Array()) – The possible values to check for
- Returns:
trueifinputmatches one of the possible objects,falseotherwise- Return type:
Boolean
- Boolean lib.isBetween(Double value, Double min, Double max)
Determines if the value is in between the min and max values, inclusive.
- Arguments:
value (
Double()) – The value to check formin (
Double()) – The minimum value of the intervalmax (
Double()) – The maximum value of the interval
- Returns:
trueifvalueis betweenminandmax, inclusive.- Return type:
Boolean
- Boolean lib.isModLoaded(String modId)
Indicates whether the specified mod is loaded.
- Arguments:
modId (
String()) – The ID of the mod to test for
- Returns:
trueif the mod is present,falseotherwise- Return type:
Boolean