Class MathUtils

java.lang.Object
com.shanebeestudios.nms.api.util.MathUtils

public class MathUtils extends Object
Utility class for math methods
  • Method Details

    • clamp

      public static float clamp(float num, float min, float max)
      Clamp a float between a min and a max
      Parameters:
      num - Float to clamp
      min - Min value
      max - Max value
      Returns:
      Clamped float
    • clamp

      public static int clamp(int num, int min, int max)
      Clamp an int between a min and a max
      Parameters:
      num - Int to clamp
      min - Min value
      max - Max value
      Returns:
      Clamped int