Pushed Clamp

This commit is contained in:
Waterpicker 2021-02-18 05:41:30 -06:00
parent 875bef25b6
commit 325d17c72e

View file

@ -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());
} }