diff --git a/src/main/java/com/sk89q/worldedit/foundation/Block.java b/src/main/java/com/sk89q/worldedit/foundation/Block.java index a155f3198..464ad2173 100644 --- a/src/main/java/com/sk89q/worldedit/foundation/Block.java +++ b/src/main/java/com/sk89q/worldedit/foundation/Block.java @@ -156,8 +156,8 @@ public class Block implements TileEntityBlock { + data + " given)"); } - if (data < 0) { - throw new IllegalArgumentException("Can't have a block data value below 0"); + if (data < -1) { + throw new IllegalArgumentException("Can't have a block data value below -1"); } this.data = (short) data; @@ -176,6 +176,16 @@ public class Block implements TileEntityBlock { setData(data); } + /** + * Returns whether the data value is -1, indicating that this block is to be + * used as a wildcard matching block. + * + * @return true if the data value is -1 + */ + public boolean hasWildcardData() { + return getData() == -1; + } + @Override public boolean hasNbtData() { return getNbtData() != null;