Pushed Clamp
This commit is contained in:
parent
875bef25b6
commit
325d17c72e
1 changed files with 5 additions and 0 deletions
|
@ -7,6 +7,8 @@ import net.minecraft.util.Pair;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
public interface Equation {
|
public interface Equation {
|
||||||
double FALSE = 0d;
|
double FALSE = 0d;
|
||||||
double TRUE = 1d;
|
double TRUE = 1d;
|
||||||
|
@ -114,6 +116,9 @@ public interface Equation {
|
||||||
return min;
|
return min;
|
||||||
})));
|
})));
|
||||||
|
|
||||||
|
// clamp
|
||||||
|
parseRules.add(new FunctionParser("clamp", 3, 3, (stringDoubleMap, equations) -> MathHelper.clamp(equations[0].apply(stringDoubleMap), equations[1].apply(stringDoubleMap), equations[2].apply(stringDoubleMap))));
|
||||||
|
|
||||||
// variable replacer
|
// variable replacer
|
||||||
parseRules.add(new VariableReplacer());
|
parseRules.add(new VariableReplacer());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue