Class MathHelper

java.lang.Object
net.minecraft.src.MathHelper

public class MathHelper extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static float
    abs(float par0)
     
    static int
    abs_int(int par0)
    Returns the unsigned value of an int.
    static double
    abs_max(double par0, double par2)
    Maximum of the absolute value of two numbers.
    static double
    average(long[] par0ArrayOfLong)
     
    static int
    bucketInt(int par0, int par1)
    Buckets an integer with specifed bucket sizes.
    static int
    ceiling_double_int(double par0)
     
    static int
    ceiling_float_int(float par0)
     
    static float
    clamp_float(float par0, float par1, float par2)
    Returns the value of the first parameter, clamped to be within the lower and upper limits given by the second and third parameters
    static int
    clamp_int(int par0, int par1, int par2)
    Returns the value of the first parameter, clamped to be within the lower and upper limits given by the second and third parameters.
    static final float
    cos(float par0)
    cos looked up in the sin table with the appropriate offset
    static int
    floor_double(double par0)
    Returns the greatest integer less than or equal to the double argument
    static long
    floor_double_long(double par0)
    Long version of floor_double
    static int
    floor_float(float par0)
    Returns the greatest integer less than or equal to the float argument
    static double
    func_82713_a(String par0Str, double par1, double par3)
     
    static double
    getRandomDoubleInRange(Random par0Random, double par1, double par3)
     
    static int
    getRandomIntegerInRange(Random par0Random, int par1, int par2)
     
    static double
    parseDoubleWithDefault(String par0Str, double par1)
    parses the string as double or returns the second parameter if it fails.
    static int
    parseIntWithDefault(String par0Str, int par1)
    parses the string as integer or returns the second parameter if it fails
    static int
    parseIntWithDefaultAndMax(String par0Str, int par1, int par2)
    parses the string as integer or returns the second parameter if it fails. this value is capped to par2
    static final float
    sin(float par0)
    sin looked up in a table
    static final float
    sqrt_double(double par0)
     
    static final float
    sqrt_float(float par0)
     
    static boolean
    Tests if a string is null or of length zero
    static int
    truncateDoubleToInt(double par0)
    returns par0 cast as an int, and no greater than Integer.MAX_VALUE-1024
    static double
    wrapAngleTo180_double(double par0)
    the angle is reduced to an angle between -180 and +180 by mod, and a 360 check
    static float
    the angle is reduced to an angle between -180 and +180 by mod, and a 360 check

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MathHelper

      public MathHelper()
  • Method Details

    • sin

      public static final float sin(float par0)
      sin looked up in a table
    • cos

      public static final float cos(float par0)
      cos looked up in the sin table with the appropriate offset
    • sqrt_float

      public static final float sqrt_float(float par0)
    • sqrt_double

      public static final float sqrt_double(double par0)
    • floor_float

      public static int floor_float(float par0)
      Returns the greatest integer less than or equal to the float argument
    • truncateDoubleToInt

      public static int truncateDoubleToInt(double par0)
      returns par0 cast as an int, and no greater than Integer.MAX_VALUE-1024
    • floor_double

      public static int floor_double(double par0)
      Returns the greatest integer less than or equal to the double argument
    • floor_double_long

      public static long floor_double_long(double par0)
      Long version of floor_double
    • abs

      public static float abs(float par0)
    • abs_int

      public static int abs_int(int par0)
      Returns the unsigned value of an int.
    • ceiling_float_int

      public static int ceiling_float_int(float par0)
    • ceiling_double_int

      public static int ceiling_double_int(double par0)
    • clamp_int

      public static int clamp_int(int par0, int par1, int par2)
      Returns the value of the first parameter, clamped to be within the lower and upper limits given by the second and third parameters.
    • clamp_float

      public static float clamp_float(float par0, float par1, float par2)
      Returns the value of the first parameter, clamped to be within the lower and upper limits given by the second and third parameters
    • abs_max

      public static double abs_max(double par0, double par2)
      Maximum of the absolute value of two numbers.
    • bucketInt

      public static int bucketInt(int par0, int par1)
      Buckets an integer with specifed bucket sizes. Args: i, bucketSize
    • stringNullOrLengthZero

      public static boolean stringNullOrLengthZero(String par0Str)
      Tests if a string is null or of length zero
    • getRandomIntegerInRange

      public static int getRandomIntegerInRange(Random par0Random, int par1, int par2)
    • getRandomDoubleInRange

      public static double getRandomDoubleInRange(Random par0Random, double par1, double par3)
    • average

      public static double average(long[] par0ArrayOfLong)
    • wrapAngleTo180_float

      public static float wrapAngleTo180_float(float par0)
      the angle is reduced to an angle between -180 and +180 by mod, and a 360 check
    • wrapAngleTo180_double

      public static double wrapAngleTo180_double(double par0)
      the angle is reduced to an angle between -180 and +180 by mod, and a 360 check
    • parseIntWithDefault

      public static int parseIntWithDefault(String par0Str, int par1)
      parses the string as integer or returns the second parameter if it fails
    • parseIntWithDefaultAndMax

      public static int parseIntWithDefaultAndMax(String par0Str, int par1, int par2)
      parses the string as integer or returns the second parameter if it fails. this value is capped to par2
    • parseDoubleWithDefault

      public static double parseDoubleWithDefault(String par0Str, double par1)
      parses the string as double or returns the second parameter if it fails.
    • func_82713_a

      public static double func_82713_a(String par0Str, double par1, double par3)