mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-18 01:46:11 +00:00
Revert 6b3426e1
.
Empty base blocks are always immutable. Fuzzy states don't have NBT.
This commit is contained in:
parent
42d0d6e79a
commit
4e66b9a336
@ -31,15 +31,15 @@ import java.util.stream.Collectors;
|
|||||||
public class RandomStatePattern implements Pattern {
|
public class RandomStatePattern implements Pattern {
|
||||||
|
|
||||||
private final Random rand = new Random();
|
private final Random rand = new Random();
|
||||||
private final List<BlockState> blocks;
|
private final List<BaseBlock> blocks;
|
||||||
|
|
||||||
public RandomStatePattern(FuzzyBlockState state) {
|
public RandomStatePattern(FuzzyBlockState state) {
|
||||||
blocks = state.getBlockType().getAllStates().stream().filter(state::equalsFuzzy)
|
blocks = state.getBlockType().getAllStates().stream().filter(state::equalsFuzzy)
|
||||||
.collect(Collectors.toList());
|
.map(BlockState::toBaseBlock).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBlock apply(BlockVector3 position) {
|
public BaseBlock apply(BlockVector3 position) {
|
||||||
return blocks.get(rand.nextInt(blocks.size())).toBaseBlock();
|
return blocks.get(rand.nextInt(blocks.size()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user