mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2025-03-07 13:48:00 +08:00
Fix block state mask with string properties (#2091)
This commit is contained in:
parent
14ecf9320c
commit
3eefaa29dd
@ -28,6 +28,7 @@
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class BlockStateMask extends AbstractExtentMask {
|
||||
@ -58,8 +59,12 @@ public boolean test(BlockVector3 vector) {
|
||||
if (strict && checkProps.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
return checkProps.entrySet().stream()
|
||||
.allMatch(entry -> block.getState(entry.getKey()) == entry.getValue());
|
||||
for (Map.Entry<Property<Object>, Object> entry : checkProps.entrySet()) {
|
||||
if (!Objects.equals(block.getState(entry.getKey()), entry.getValue())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
Loading…
Reference in New Issue
Block a user