public final class ConstantBlock extends Object implements BlockFilter, BlockSelector, BlockSelector.Entry
BlockSelector.EntryAIR, REPLACEABLE| Constructor and Description |
|---|
ConstantBlock(Identifier id,
int meta) |
ConstantBlock(String value) |
| 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(net.daporkchop.lib.random.PRandom random)
Selects a random
BlockState. |
BlockState |
selectWeighted(net.daporkchop.lib.random.PRandom random)
Selects a random block, taking selection weights into account.
|
int |
size() |
int |
sizeWeighted() |
BlockState |
state() |
Stream<BlockState> |
states() |
boolean |
test(BlockState state) |
int |
weight() |
public ConstantBlock(Identifier id, int meta)
public ConstantBlock(String value)
public BlockState state()
state in interface BlockSelector.EntryBlockState used by this entrypublic boolean test(BlockState state)
test in interface Predicate<BlockState>test in interface BlockFilterpublic int size()
size in interface BlockSelectorBlockStates that this block selector can choose frompublic BlockState get(int index)
BlockSelectorBlockState at the given index.get in interface BlockSelectorindex - the index of the BlockState to getBlockState at the given indexpublic BlockState select(net.daporkchop.lib.random.PRandom random)
BlockSelectorBlockState.select in interface BlockSelectorrandom - the instance of PRandom to use for generating random numbersBlockStatepublic Stream<BlockState> states()
states in interface BlockSelectorBlockStates that this instance can select frompublic int sizeWeighted()
sizeWeighted in interface BlockSelectorBlockStates that this block selector can choose from, taking selection weights into accountpublic BlockState getWeighted(int index)
BlockSelectorBlockState at the given index, taking selection weights into account.getWeighted in interface BlockSelectorindex - the index of the BlockState to getBlockState at the given indexpublic BlockState selectWeighted(net.daporkchop.lib.random.PRandom random)
BlockSelectorselectWeighted in interface BlockSelectorrandom - the instance of PRandom to use for generating random numbersBlockStatepublic Stream<BlockSelector.Entry> entries()
entries in interface BlockSelectorBlockStates that this instance can select from, taking selection weights into accountpublic int weight()
weight in interface BlockSelector.EntryCopyright © 2020. All rights reserved.