3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-24 01:50:06 +01:00
Empty base blocks are always immutable. Fuzzy states don't have NBT.
Dieser Commit ist enthalten in:
wizjany 2019-03-30 00:41:47 -04:00
Ursprung 42d0d6e79a
Commit 4e66b9a336

Datei anzeigen

@ -31,15 +31,15 @@ import java.util.stream.Collectors;
public class RandomStatePattern implements Pattern {
private final Random rand = new Random();
private final List<BlockState> blocks;
private final List<BaseBlock> blocks;
public RandomStatePattern(FuzzyBlockState state) {
blocks = state.getBlockType().getAllStates().stream().filter(state::equalsFuzzy)
.collect(Collectors.toList());
.map(BlockState::toBaseBlock).collect(Collectors.toList());
}
@Override
public BaseBlock apply(BlockVector3 position) {
return blocks.get(rand.nextInt(blocks.size())).toBaseBlock();
return blocks.get(rand.nextInt(blocks.size()));
}
}