Update upstream

7e61ff1 Work around invalid legacy values in schematics (2171)
This commit is contained in:
Alexander Brandes 2022-08-29 17:21:21 +02:00
parent a51863c6f0
commit aa216a990a
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C

View File

@ -484,7 +484,12 @@ public class MCEditSchematicReader extends NBTSchematicReader {
}
private BlockState getBlockState(int id, int data) {
return LegacyMapper.getInstance().getBlockFromLegacy(id, data);
BlockState foundBlock = LegacyMapper.getInstance().getBlockFromLegacy(id, data);
if (foundBlock == null && data != 0) {
// Some schematics contain invalid data values, so try without the data value
return LegacyMapper.getInstance().getBlockFromLegacy(id, 0);
}
return foundBlock;
}
@Override