public interface BlockSelector
ConstantBlock| Modifier and Type | Interface and Description |
|---|---|
static interface |
BlockSelector.Entry
Represents a single weighted
BlockState in a BlockSelector. |
| Modifier and Type | Method and Description |
|---|---|
Stream<BlockSelector.Entry> |
entries() |
BlockState |
get(int index)
Gets the
BlockState at the given index. |
BlockState |
getWeighted(int index)
Gets the
BlockState at the given index, taking selection weights into account. |
BlockState |
select(@NonNull net.daporkchop.lib.random.PRandom random)
Selects a random
BlockState. |
BlockState |
selectWeighted(@NonNull net.daporkchop.lib.random.PRandom random)
Selects a random block, taking selection weights into account.
|
int |
size() |
int |
sizeWeighted() |
Stream<BlockState> |
states() |
int size()
BlockStates that this block selector can choose fromBlockState get(int index)
BlockState at the given index.index - the index of the BlockState to getBlockState at the given indexIndexOutOfBoundsException - if the given index is outside of the range [0-size())BlockState select(@NonNull @NonNull net.daporkchop.lib.random.PRandom random)
BlockState.random - the instance of PRandom to use for generating random numbersBlockStateStream<BlockState> states()
BlockStates that this instance can select fromint sizeWeighted()
BlockStates that this block selector can choose from, taking selection weights into accountBlockState getWeighted(int index)
BlockState at the given index, taking selection weights into account.index - the index of the BlockState to getBlockState at the given indexIndexOutOfBoundsException - if the given index is outside of the range [0-sizeWeighted())BlockState selectWeighted(@NonNull @NonNull net.daporkchop.lib.random.PRandom random)
random - the instance of PRandom to use for generating random numbersBlockStateStream<BlockSelector.Entry> entries()
BlockStates that this instance can select from, taking selection weights into accountCopyright © 2020. All rights reserved.