Class IntRange
java.lang.Object
org.cloudburstmc.server.level.generator.standard.misc.IntRange
Represents a numerical range.
Note that max is always an exclusive bound.
- Author:
- DaPorkchop_
-
Field Details
-
EMPTY_RANGE
-
ONE
-
WHOLE_WORLD
-
min
public final int min -
max
public final int max -
gaussian
public final boolean gaussian -
downwardBias
public final boolean downwardBias
-
-
Constructor Details
-
IntRange
public IntRange(int min, int max) -
IntRange
public IntRange(int min, int max, boolean gaussian, boolean downwardBias) -
IntRange
-
IntRange
public IntRange(int value)
-
-
Method Details
-
rand
public int rand(@NonNull @NonNull net.daporkchop.lib.random.PRandom random)Gets a random value within thisIntRange.- Parameters:
random- an instance ofPRandomto use for generating random numbers- Returns:
- a random value within this
IntRange
-
empty
public boolean empty()- Returns:
- whether or not this
IntRangeis empty
-
size
public int size()- Returns:
- the size of this
IntRange
-
contains
public boolean contains(int value)Whether or not the given value is included in this range.- Parameters:
value- the value to check- Returns:
- whether or not this range contains the givenv alue
-
toString
-