int i0 = 0;
for (CustomBlock block : blocks) {
byte i = -128;
do {
if (block.getBlockDesign(i) != null) {
BlockDesign design = block.getBlockDesign(i);
long beforeCRC = -1;
File target = new File(getPluginCacheFolder(plugin), String.valueOf(i0) + ".sbd");
if (!target.getParentFile().exists()) {
target.getParentFile().mkdirs();
}
if (target.exists()) {
beforeCRC = FileUtil.getCRC(target, new byte[(int) target.length()]);
target.delete();
}
try {
DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(target)));
out.writeShort((short)block.getCustomId());
out.writeByte(i);
design.write(out);
out.flush();
out.close();
} catch (IOException e) {
e.printStackTrace();