add support for block versions >25 and <28

master^2
Alexander Chibrikin 2019-01-30 23:09:35 +03:00 committed by GitHub
parent 16dfe8c706
commit f689bafd31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ public class MapBlockParser {
block.version = data[0];
if (block.version != 28) {
if (block.version < 25 || block.version > 28) {
logger.error("block version not supported: {}", block.version);
throw new IllegalArgumentException("block version not supported: " + block.version);
}
@ -68,7 +68,7 @@ public class MapBlockParser {
//data[4] = content_width (2)
//data[5] = params_width (2)
int dataOffset = 6;
int dataOffset = block.version >= 27 ? 6 : 4;
Inflater inflater = new Inflater();
inflater.setInput(data, dataOffset, data.length - dataOffset);