diff --git a/SpigotCore_14/src/de/steamwar/sql/Schematic_14.java b/SpigotCore_14/src/de/steamwar/sql/Schematic_14.java index 2e02468..53c962d 100644 --- a/SpigotCore_14/src/de/steamwar/sql/Schematic_14.java +++ b/SpigotCore_14/src/de/steamwar/sql/Schematic_14.java @@ -239,34 +239,37 @@ class Schematic_14 { int index = y * width * length + z * width + x; - BlockState block = getBlockState(blocks[index], blockData[index]); - System.out.println(block.getBlockType().getId()); - BlockState newBlock = block; - if (newBlock != null) { - for (NBTCompatibilityHandler handler : COMPATIBILITY_HANDLERS) { - if (handler.isAffectedBlock(newBlock)) { - newBlock = handler.updateNBT(block, values); - if (newBlock == null || values.isEmpty()) { - break; + try{ + BlockState block = getBlockState(blocks[index], blockData[index]); + BlockState newBlock = block; + if (newBlock != null) { + for (NBTCompatibilityHandler handler : COMPATIBILITY_HANDLERS) { + if (handler.isAffectedBlock(newBlock)) { + newBlock = handler.updateNBT(block, values); + if (newBlock == null || values.isEmpty()) { + break; + } } } } - } - if (values.isEmpty()) { - t = null; - } else { - t = new CompoundTag(values); - } + if (values.isEmpty()) { + t = null; + } else { + t = new CompoundTag(values); + } - if (fixer != null && t != null) { - t = fixer.fixUp(DataFixer.FixTypes.BLOCK_ENTITY, t, -1); - } + if (fixer != null && t != null) { + t = fixer.fixUp(DataFixer.FixTypes.BLOCK_ENTITY, t, -1); + } - BlockVector3 vec = BlockVector3.at(x, y, z); - if (t != null) { - tileEntitiesMap.put(vec, t.getValue()); + BlockVector3 vec = BlockVector3.at(x, y, z); + if (t != null) { + tileEntitiesMap.put(vec, t.getValue()); + } + blockStates.put(vec, newBlock); + }catch(ArrayIndexOutOfBoundsException e){ + //ignored } - blockStates.put(vec, newBlock); } BlockArrayClipboard clipboard = new BlockArrayClipboard(region);