Class MathHelper2

java.lang.Object
io.github.xrickastley.sevenelements.util.MathHelper2

public final class MathHelper2 extends Object
  • 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

      public static BlockPos asBlockPos(Vec3d pos)
      Creates a BlockPos from the provided Vec3d.

      This implementation ensures that the provided Vec3d relative to the world will point to the same BlockPos returned by this method.
      Parameters:
      pos - The position to turn into a BlockPos.
    • inRange

      public static boolean inRange(double value, double start, double end)