Class MathHelper2
java.lang.Object
io.github.xrickastley.sevenelements.util.MathHelper2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BlockPosasBlockPos(Vec3d pos) Creates aBlockPosfrom the providedVec3d.static doubleendOffset(double value, double offset, double start, double end) static booleaninRange(double value, double start, double end) static floatroundTo(float value, int sigFigs) Rounds a value to the specified amount of significant figures.
-
Constructor Details
-
MathHelper2
public MathHelper2()
-
-
Method Details
-
endOffset
public static double endOffset(double value, double offset, double start, double end) -
roundTo
public static float roundTo(float value, int sigFigs) Rounds a value to the specified amount of significant figures.- Parameters:
value- The value to round.sigFigs- The amount of significant figures.
-
asBlockPos
Creates aBlockPosfrom the providedVec3d.
This implementation ensures that the providedVec3drelative to the world will point to the sameBlockPosreturned by this method.- Parameters:
pos- The position to turn into aBlockPos.
-
inRange
public static boolean inRange(double value, double start, double end)
-