Added sanity check to DataValidatorExtent.

This commit is contained in:
sk89q 2014-04-03 20:09:01 -07:00
parent 0ed62b8f90
commit 16e89c23f5

View File

@ -60,10 +60,16 @@ public class DataValidatorExtent extends AbstractDelegateExtent {
return false; return false;
} }
if (type == 0) { if (block.getData() < 0) {
block.setData(0); throw new SevereValidationException("Cannot set a data value that is less than 0");
} }
return super.setBlock(location, block); return super.setBlock(location, block);
} }
private static class SevereValidationException extends WorldEditException {
private SevereValidationException(String message) {
super(message);
}
}
} }