Class BedrockRandom

java.lang.Object
java.util.Random
net.daporkchop.lib.random.impl.AbstractFastPRandom
org.cloudburstmc.server.math.BedrockRandom
All Implemented Interfaces:
Serializable, net.daporkchop.lib.random.PRandom

public class BedrockRandom extends net.daporkchop.lib.random.impl.AbstractFastPRandom
Bedrock-style PRNG.

Warning: very slow!

See Also:
Serialized Form
  • Field Summary

    Fields inherited from class net.daporkchop.lib.random.impl.AbstractFastPRandom

    DOUBLE_UNIT, FLOAT_UNIT, nextGaussian
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    BedrockRandom​(int seed)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
     
    com.nukkitx.math.vector.Vector3f
     
    int
     
    long
     
    com.nukkitx.math.vector.Vector3f
     
    void
    setSeed​(int seed)
     
    void
    setSeed​(long seed)
     

    Methods inherited from class net.daporkchop.lib.random.impl.AbstractFastPRandom

    asJava, next, next, nextBoolean, nextByte, nextBytes, nextBytes, nextBytes32, nextBytes32Fast, nextBytes64, nextBytes64Fast, nextDouble, nextDouble, nextDouble, nextFloat, nextFloat, nextFloat, nextGaussian, nextGaussianDouble, nextGaussianFloat, nextInt, nextInt, nextLong, nextLong, nextShort, nextUnsignedInt, nextUnsignedLong

    Methods inherited from class java.util.Random

    doubles, doubles, doubles, doubles, ints, ints, ints, ints, longs, longs, longs, longs

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.daporkchop.lib.random.PRandom

    shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle
  • Constructor Details

    • BedrockRandom

      public BedrockRandom()
    • BedrockRandom

      public BedrockRandom(int seed)
  • Method Details

    • getThreadLocal

      public static BedrockRandom getThreadLocal()
    • getSeed

      public int getSeed()
    • setSeed

      public void setSeed(int seed)
    • setSeed

      public void setSeed(long seed)
      Overrides:
      setSeed in class Random
    • nextInt

      public int nextInt()
      Specified by:
      nextInt in interface net.daporkchop.lib.random.PRandom
      Specified by:
      nextInt in class net.daporkchop.lib.random.impl.AbstractFastPRandom
    • nextLong

      public long nextLong()
      Specified by:
      nextLong in interface net.daporkchop.lib.random.PRandom
      Specified by:
      nextLong in class net.daporkchop.lib.random.impl.AbstractFastPRandom
    • nextVector3

      public com.nukkitx.math.vector.Vector3f nextVector3()
    • nextGaussianVector3

      public com.nukkitx.math.vector.Vector3f nextGaussianVector3()