Class Mth

java.lang.Object
net.minecraft.util.Mth

public class Mth extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static double[]
     
    private static float
     
    private static int
     
    private static double[]
     
    static float
     
    static float
     
    private static double
     
    private static int
     
    static float
     
    private static int
     
    private static int[]
     
    private static double
     
    static float
     
    static float
     
    private static Random
     
    private static float[]
     
    private static float
     
    static float
     
    static float
     
    private static long
     
    private static long
     
    private static long
     
    private static long
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Mth()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static float
    abs​(float p_14155_)
     
    static int
    abs​(int p_14041_)
     
    static int
    absFloor​(double p_144940_)
     
    static double
    absMax​(double p_14006_, double p_14007_)
     
    static float
    approach​(float p_14122_, float p_14123_, float p_14124_)
     
    static float
    approachDegrees​(float p_14149_, float p_14150_, float p_14151_)
     
    static double
    atan2​(double p_14137_, double p_14138_)
     
    static double
    average​(long[] p_14079_)
     
    static int
    binarySearch​(int p_14050_, int p_14051_, IntPredicate p_14052_)
     
    static double[]
    binBiModalNormalDistribution​(double p_144858_, double p_144859_, double p_144860_, double p_144861_, double p_144862_, double p_144863_, int p_144864_, int p_144865_)
     
    static double[]
    binLogDistribution​(double p_144873_, double p_144874_, int p_144875_, int p_144876_)
     
    static double[]
    binNormalDistribution​(double p_144867_, double p_144868_, double p_144869_, int p_144870_, int p_144871_)
     
    static Vec3
    catmullRomSplinePos​(Vec3 p_144893_, Vec3 p_144894_, Vec3 p_144895_, Vec3 p_144896_, double p_144897_)
     
    static int
    ceil​(double p_14166_)
     
    static int
    ceil​(float p_14168_)
     
    static int
    ceillog2​(int p_14164_)
     
    static byte
    clamp​(byte p_144848_, byte p_144849_, byte p_144850_)
     
    static double
    clamp​(double p_14009_, double p_14010_, double p_14011_)
     
    static float
    clamp​(float p_14037_, float p_14038_, float p_14039_)
     
    static int
    clamp​(int p_14046_, int p_14047_, int p_14048_)
     
    static long
    clamp​(long p_14054_, long p_14055_, long p_14056_)
     
    static double
    clampedLerp​(double p_14086_, double p_14087_, double p_14088_)
     
    static float
    clampedLerp​(float p_144921_, float p_144922_, float p_144923_)
     
    static double
    clampedMap​(double p_144852_, double p_144853_, double p_144854_, double p_144855_, double p_144856_)
     
    static int
    color​(float p_14160_, float p_14161_, float p_14162_)
     
    static int
    color​(int p_14104_, int p_14105_, int p_14106_)
     
    static int
    colorMultiply​(int p_144882_, float p_144883_, float p_144884_, float p_144885_)
     
    static int
    colorMultiply​(int p_144933_, int p_144934_)
     
    static float
    cos​(float p_14090_)
     
    static UUID
     
    static UUID
     
    static double[]
    cumulativeSum​(double... p_144913_)
     
    static float
    degreesDifference​(float p_14119_, float p_14120_)
     
    static float
    degreesDifferenceAbs​(float p_14146_, float p_14147_)
     
    static float
    diffuseLight​(float p_144949_, float p_144950_, float p_144951_)
     
    static boolean
    equal​(double p_14083_, double p_14084_)
     
    static boolean
    equal​(float p_14034_, float p_14035_)
     
    static int
    fastFloor​(double p_14081_)
     
    static float
    fastInvCubeRoot​(float p_14200_)
     
    static double
    fastInvSqrt​(double p_14194_)
     
    static float
    fastInvSqrt​(float p_14196_)
     
    static int
    floor​(double p_14108_)
     
    static int
    floor​(float p_14144_)
     
    static double
    frac​(double p_14186_)
     
    static float
    frac​(float p_14188_)
     
    static double
    getDouble​(String p_144899_, double p_144900_)
     
    static double
    getDouble​(String p_144902_, double p_144903_, double p_144904_)
     
    static int
    getInt​(String p_14060_, int p_14061_)
     
    static int
    getInt​(String p_144906_, int p_144907_, int p_144908_)
     
    static int
    getRandomForDistributionIntegral​(Random p_144910_, double[] p_144911_)
     
    static long
    getSeed​(int p_14131_, int p_14132_, int p_14133_)
     
    static long
    getSeed​(Vec3i p_14058_)
     
    static int
    hsvToRgb​(float p_14170_, float p_14171_, float p_14172_)
     
    static int
    intFloorDiv​(int p_14043_, int p_14044_)
     
    static double
    inverseLerp​(double p_14113_, double p_14114_, double p_14115_)
     
    static boolean
    isPowerOfTwo​(int p_14153_)
     
    static double
    length​(int p_144878_, double p_144879_, int p_144880_)
     
    static double
    lerp​(double p_14140_, double p_14141_, double p_14142_)
     
    static float
    lerp​(float p_14180_, float p_14181_, float p_14182_)
     
    static double
    lerp2​(double p_14013_, double p_14014_, double p_14015_, double p_14016_, double p_14017_, double p_14018_)
     
    static double
    lerp3​(double p_14020_, double p_14021_, double p_14022_, double p_14023_, double p_14024_, double p_14025_, double p_14026_, double p_14027_, double p_14028_, double p_14029_, double p_14030_)
     
    static long
    lfloor​(double p_14135_)
     
    static int
    log2​(int p_14174_)
     
    static double
    map​(double p_144915_, double p_144916_, double p_144917_, double p_144918_, double p_144919_)
     
    static int
    murmurHash3Mixer​(int p_14184_)
     
    static long
    murmurHash3Mixer​(long p_144887_)
     
    static double
    nextDouble​(Random p_14065_, double p_14066_, double p_14067_)
     
    static float
    nextFloat​(Random p_14069_, float p_14070_, float p_14071_)
     
    static int
    nextInt​(Random p_14073_, int p_14074_, int p_14075_)
     
    static float
    normal​(Random p_144936_, float p_144937_, float p_144938_)
     
    static double
    positiveModulo​(double p_14110_, double p_14111_)
     
    static float
    positiveModulo​(float p_14092_, float p_14093_)
     
    static int
    positiveModulo​(int p_14101_, int p_14102_)
     
    static float
    randomBetween​(Random p_144925_, float p_144926_, float p_144927_)
     
    static int
    randomBetweenInclusive​(Random p_144929_, int p_144930_, int p_144931_)
     
    static boolean
    rayIntersectsAABB​(Vec3 p_144889_, Vec3 p_144890_, AABB p_144891_)
     
    static float
    rotateIfNecessary​(float p_14095_, float p_14096_, float p_14097_)
     
    static float
    rotlerp​(float p_14202_, float p_14203_, float p_14204_)
    Deprecated.
    static float
    rotLerp​(float p_14190_, float p_14191_, float p_14192_)
     
    static float
    rotWrap​(double p_14210_)
    Deprecated.
    static int
    roundToward​(int p_144942_, int p_144943_)
     
    static int
    sign​(double p_14206_)
     
    static float
    sin​(float p_14032_)
     
    static int
     
    static double
    smoothstep​(double p_14198_)
     
    static double
    smoothstepDerivative​(double p_144947_)
     
    static float
    sqrt​(float p_14117_)
     
    static double
    square​(double p_144953_)
     
    static float
    square​(float p_14208_)
     
    static int
    square​(int p_144945_)
     
    static float
    triangleWave​(float p_14157_, float p_14158_)
     
    static double
    wobble​(double p_144955_)
     
    static double
    wrapDegrees​(double p_14176_)
     
    static float
    wrapDegrees​(float p_14178_)
     
    static int
    wrapDegrees​(int p_14099_)
     

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • Mth

      public Mth()
  • Method Details

    • sin

      public static float sin(float p_14032_)
    • cos

      public static float cos(float p_14090_)
    • sqrt

      public static float sqrt(float p_14117_)
    • floor

      public static int floor(float p_14144_)
    • fastFloor

      public static int fastFloor(double p_14081_)
    • floor

      public static int floor(double p_14108_)
    • lfloor

      public static long lfloor(double p_14135_)
    • absFloor

      public static int absFloor(double p_144940_)
    • abs

      public static float abs(float p_14155_)
    • abs

      public static int abs(int p_14041_)
    • ceil

      public static int ceil(float p_14168_)
    • ceil

      public static int ceil(double p_14166_)
    • clamp

      public static byte clamp(byte p_144848_, byte p_144849_, byte p_144850_)
    • clamp

      public static int clamp(int p_14046_, int p_14047_, int p_14048_)
    • clamp

      public static long clamp(long p_14054_, long p_14055_, long p_14056_)
    • clamp

      public static float clamp(float p_14037_, float p_14038_, float p_14039_)
    • clamp

      public static double clamp(double p_14009_, double p_14010_, double p_14011_)
    • clampedLerp

      public static double clampedLerp(double p_14086_, double p_14087_, double p_14088_)
    • clampedLerp

      public static float clampedLerp(float p_144921_, float p_144922_, float p_144923_)
    • absMax

      public static double absMax(double p_14006_, double p_14007_)
    • intFloorDiv

      public static int intFloorDiv(int p_14043_, int p_14044_)
    • nextInt

      public static int nextInt(Random p_14073_, int p_14074_, int p_14075_)
    • nextFloat

      public static float nextFloat(Random p_14069_, float p_14070_, float p_14071_)
    • nextDouble

      public static double nextDouble(Random p_14065_, double p_14066_, double p_14067_)
    • average

      public static double average(long[] p_14079_)
    • equal

      public static boolean equal(float p_14034_, float p_14035_)
    • equal

      public static boolean equal(double p_14083_, double p_14084_)
    • positiveModulo

      public static int positiveModulo(int p_14101_, int p_14102_)
    • positiveModulo

      public static float positiveModulo(float p_14092_, float p_14093_)
    • positiveModulo

      public static double positiveModulo(double p_14110_, double p_14111_)
    • wrapDegrees

      public static int wrapDegrees(int p_14099_)
    • wrapDegrees

      public static float wrapDegrees(float p_14178_)
    • wrapDegrees

      public static double wrapDegrees(double p_14176_)
    • degreesDifference

      public static float degreesDifference(float p_14119_, float p_14120_)
    • degreesDifferenceAbs

      public static float degreesDifferenceAbs(float p_14146_, float p_14147_)
    • rotateIfNecessary

      public static float rotateIfNecessary(float p_14095_, float p_14096_, float p_14097_)
    • approach

      public static float approach(float p_14122_, float p_14123_, float p_14124_)
    • approachDegrees

      public static float approachDegrees(float p_14149_, float p_14150_, float p_14151_)
    • getInt

      public static int getInt(String p_14060_, int p_14061_)
    • getInt

      public static int getInt(String p_144906_, int p_144907_, int p_144908_)
    • getDouble

      public static double getDouble(String p_144899_, double p_144900_)
    • getDouble

      public static double getDouble(String p_144902_, double p_144903_, double p_144904_)
    • smallestEncompassingPowerOfTwo

      public static int smallestEncompassingPowerOfTwo(int p_14126_)
    • isPowerOfTwo

      public static boolean isPowerOfTwo(int p_14153_)
    • ceillog2

      public static int ceillog2(int p_14164_)
    • log2

      public static int log2(int p_14174_)
    • color

      public static int color(float p_14160_, float p_14161_, float p_14162_)
    • color

      public static int color(int p_14104_, int p_14105_, int p_14106_)
    • colorMultiply

      public static int colorMultiply(int p_144933_, int p_144934_)
    • colorMultiply

      public static int colorMultiply(int p_144882_, float p_144883_, float p_144884_, float p_144885_)
    • frac

      public static float frac(float p_14188_)
    • frac

      public static double frac(double p_14186_)
    • catmullRomSplinePos

      public static Vec3 catmullRomSplinePos(Vec3 p_144893_, Vec3 p_144894_, Vec3 p_144895_, Vec3 p_144896_, double p_144897_)
    • getSeed

      public static long getSeed(Vec3i p_14058_)
    • getSeed

      public static long getSeed(int p_14131_, int p_14132_, int p_14133_)
    • createInsecureUUID

      public static UUID createInsecureUUID(Random p_14063_)
    • createInsecureUUID

      public static UUID createInsecureUUID()
    • inverseLerp

      public static double inverseLerp(double p_14113_, double p_14114_, double p_14115_)
    • rayIntersectsAABB

      public static boolean rayIntersectsAABB(Vec3 p_144889_, Vec3 p_144890_, AABB p_144891_)
    • atan2

      public static double atan2(double p_14137_, double p_14138_)
    • fastInvSqrt

      public static float fastInvSqrt(float p_14196_)
    • fastInvSqrt

      public static double fastInvSqrt(double p_14194_)
    • fastInvCubeRoot

      public static float fastInvCubeRoot(float p_14200_)
    • hsvToRgb

      public static int hsvToRgb(float p_14170_, float p_14171_, float p_14172_)
    • murmurHash3Mixer

      public static int murmurHash3Mixer(int p_14184_)
    • murmurHash3Mixer

      public static long murmurHash3Mixer(long p_144887_)
    • cumulativeSum

      public static double[] cumulativeSum(double... p_144913_)
    • getRandomForDistributionIntegral

      public static int getRandomForDistributionIntegral(Random p_144910_, double[] p_144911_)
    • binNormalDistribution

      public static double[] binNormalDistribution(double p_144867_, double p_144868_, double p_144869_, int p_144870_, int p_144871_)
    • binBiModalNormalDistribution

      public static double[] binBiModalNormalDistribution(double p_144858_, double p_144859_, double p_144860_, double p_144861_, double p_144862_, double p_144863_, int p_144864_, int p_144865_)
    • binLogDistribution

      public static double[] binLogDistribution(double p_144873_, double p_144874_, int p_144875_, int p_144876_)
    • binarySearch

      public static int binarySearch(int p_14050_, int p_14051_, IntPredicate p_14052_)
    • lerp

      public static float lerp(float p_14180_, float p_14181_, float p_14182_)
    • lerp

      public static double lerp(double p_14140_, double p_14141_, double p_14142_)
    • lerp2

      public static double lerp2(double p_14013_, double p_14014_, double p_14015_, double p_14016_, double p_14017_, double p_14018_)
    • lerp3

      public static double lerp3(double p_14020_, double p_14021_, double p_14022_, double p_14023_, double p_14024_, double p_14025_, double p_14026_, double p_14027_, double p_14028_, double p_14029_, double p_14030_)
    • smoothstep

      public static double smoothstep(double p_14198_)
    • smoothstepDerivative

      public static double smoothstepDerivative(double p_144947_)
    • sign

      public static int sign(double p_14206_)
    • rotLerp

      public static float rotLerp(float p_14190_, float p_14191_, float p_14192_)
    • diffuseLight

      public static float diffuseLight(float p_144949_, float p_144950_, float p_144951_)
    • rotlerp

      @Deprecated public static float rotlerp(float p_14202_, float p_14203_, float p_14204_)
      Deprecated.
    • rotWrap

      @Deprecated public static float rotWrap(double p_14210_)
      Deprecated.
    • triangleWave

      public static float triangleWave(float p_14157_, float p_14158_)
    • square

      public static float square(float p_14208_)
    • square

      public static double square(double p_144953_)
    • square

      public static int square(int p_144945_)
    • clampedMap

      public static double clampedMap(double p_144852_, double p_144853_, double p_144854_, double p_144855_, double p_144856_)
    • map

      public static double map(double p_144915_, double p_144916_, double p_144917_, double p_144918_, double p_144919_)
    • wobble

      public static double wobble(double p_144955_)
    • roundToward

      public static int roundToward(int p_144942_, int p_144943_)
    • randomBetweenInclusive

      public static int randomBetweenInclusive(Random p_144929_, int p_144930_, int p_144931_)
    • randomBetween

      public static float randomBetween(Random p_144925_, float p_144926_, float p_144927_)
    • normal

      public static float normal(Random p_144936_, float p_144937_, float p_144938_)
    • length

      public static double length(int p_144878_, double p_144879_, int p_144880_)