Class Mth

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

public class Mth extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final double[]
     
    private static final float
     
    private static final int
     
    private static final double[]
     
    static final float
     
    static final float
     
    private static final double
     
    private static final int
     
    static final float
     
    private static final int
     
    private static final int[]
     
    private static final double
     
    static final float
     
    static final float
     
    private static final RandomSource
     
    private static final float[]
     
    private static final float
     
    static final float
     
    static final float
     
    private static final long
     
    private static final long
     
    private static final long
     
    private static final 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 float
    catmullrom(float p_216245_, float p_216246_, float p_216247_, float p_216248_, float p_216249_)
     
    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 float
    clampedMap(float p_184632_, float p_184633_, float p_184634_, float p_184635_, float p_184636_)
     
    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 float
    cube(float p_216300_)
     
    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(RandomSource p_216276_, double[] p_216277_)
     
    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 float
    inverseLerp(float p_184656_, float p_184657_, float p_184658_)
     
    static boolean
    isPowerOfTwo(int p_14153_)
     
    static double
    length(double p_184646_, double p_184647_)
     
    static double
    length(double p_184649_, double p_184650_, double p_184651_)
     
    static double
    lengthSquared(double p_211590_, double p_211591_)
     
    static double
    lengthSquared(double p_211593_, double p_211594_, double p_211595_)
     
    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 float
    map(float p_184638_, float p_184639_, float p_184640_, float p_184641_, float p_184642_)
     
    static int
    murmurHash3Mixer(int p_14184_)
     
    static long
    murmurHash3Mixer(long p_144887_)
     
    static double
    nextDouble(RandomSource p_216264_, double p_216265_, double p_216266_)
     
    static float
    nextFloat(RandomSource p_216268_, float p_216269_, float p_216270_)
     
    static int
    nextInt(RandomSource p_216272_, int p_216273_, int p_216274_)
     
    static float
    normal(RandomSource p_216292_, float p_216293_, float p_216294_)
     
    static IntStream
    outFromOrigin(int p_216296_, int p_216297_, int p_216298_)
     
    static IntStream
    outFromOrigin(int p_216251_, int p_216252_, int p_216253_, int p_216254_)
     
    static int
    positiveCeilDiv(int p_184653_, int p_184654_)
     
    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 int
    quantize(double p_184629_, int p_184630_)
     
    static float
    randomBetween(RandomSource p_216284_, float p_216285_, float p_216286_)
     
    static int
    randomBetweenInclusive(RandomSource p_216288_, int p_216289_, int p_216290_)
     
    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 long
    square(long p_184644_)
     
    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(RandomSource p_216272_, int p_216273_, int p_216274_)
    • nextFloat

      public static float nextFloat(RandomSource p_216268_, float p_216269_, float p_216270_)
    • nextDouble

      public static double nextDouble(RandomSource p_216264_, double p_216265_, double p_216266_)
    • 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(RandomSource p_216262_)
    • createInsecureUUID

      public static UUID createInsecureUUID()
    • inverseLerp

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

      public static float inverseLerp(float p_184656_, float p_184657_, float p_184658_)
    • 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(RandomSource p_216276_, double[] p_216277_)
    • 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_)
    • catmullrom

      public static float catmullrom(float p_216245_, float p_216246_, float p_216247_, float p_216248_, float p_216249_)
    • 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_)
    • square

      public static long square(long p_184644_)
    • cube

      public static float cube(float p_216300_)
    • clampedMap

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

      public static float clampedMap(float p_184632_, float p_184633_, float p_184634_, float p_184635_, float p_184636_)
    • map

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

      public static float map(float p_184638_, float p_184639_, float p_184640_, float p_184641_, float p_184642_)
    • wobble

      public static double wobble(double p_144955_)
    • roundToward

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

      public static int positiveCeilDiv(int p_184653_, int p_184654_)
    • randomBetweenInclusive

      public static int randomBetweenInclusive(RandomSource p_216288_, int p_216289_, int p_216290_)
    • randomBetween

      public static float randomBetween(RandomSource p_216284_, float p_216285_, float p_216286_)
    • normal

      public static float normal(RandomSource p_216292_, float p_216293_, float p_216294_)
    • lengthSquared

      public static double lengthSquared(double p_211590_, double p_211591_)
    • length

      public static double length(double p_184646_, double p_184647_)
    • lengthSquared

      public static double lengthSquared(double p_211593_, double p_211594_, double p_211595_)
    • length

      public static double length(double p_184649_, double p_184650_, double p_184651_)
    • quantize

      public static int quantize(double p_184629_, int p_184630_)
    • outFromOrigin

      public static IntStream outFromOrigin(int p_216296_, int p_216297_, int p_216298_)
    • outFromOrigin

      public static IntStream outFromOrigin(int p_216251_, int p_216252_, int p_216253_, int p_216254_)