From 4e66b9a3366681c8ca9d66381ffe1bacebe188f3 Mon Sep 17 00:00:00 2001 From: wizjany Date: Sat, 30 Mar 2019 00:41:47 -0400 Subject: [PATCH] Revert 6b3426e1. Empty base blocks are always immutable. Fuzzy states don't have NBT. --- .../worldedit/function/pattern/RandomStatePattern.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomStatePattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomStatePattern.java index 698111dac..f2e2870a9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomStatePattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomStatePattern.java @@ -31,15 +31,15 @@ import java.util.stream.Collectors; public class RandomStatePattern implements Pattern { private final Random rand = new Random(); - private final List blocks; + private final List 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())); } }