Skip corrupt tile entities in legacy schematics

This commit is contained in:
dordsor21 2021-08-23 21:46:50 +01:00
parent 6301a7adb9
commit 7d9abc9273
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B

View File

@ -203,6 +203,13 @@ public class MCEditSchematicReader extends NBTSchematicReader {
int z = t.getInt("z");
int index = y * width * length + z * width + x;
//FAWE start - tile entity safety - perhaps caused by the old issue with tile entities created in the wrong
// position in schematics?
if (index >= blocks.length) {
LOGGER.warn("Skipping corrupt tile entity at position " + x + " " + y + " " + z + " in schematic.");
continue;
}
BlockState block = getBlockState(blocks[index], blockData[index]);
BlockState newBlock = block;
if (newBlock != null) {