resources/region_files: add a zlib compressed chunk
parent
b5bb2f45c1
commit
e0cb220d37
Binary file not shown.
|
@ -5,9 +5,18 @@ else
|
|||
VERBOSE=false
|
||||
fi
|
||||
|
||||
if [ "$1" = "-n" ]; then
|
||||
DECOMPRESS=false
|
||||
shift
|
||||
else
|
||||
DECOMPRESS=true
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -f "$1" ]; then
|
||||
echo "Usage: $0 [-v] FILE"
|
||||
echo "Usage: $0 [-v] [-n] FILE"
|
||||
echo " -v display raw content and NBT dump"
|
||||
echo " -n don't decompress"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -62,13 +71,20 @@ sys.stdout.buffer.flush()
|
|||
esac
|
||||
echo " format: $FORMAT ($FORMAT_HEX)"
|
||||
|
||||
|
||||
if $DECOMPRESS; then
|
||||
dd if="$1" bs=4096 count=$LENGTH skip=$OFFSET 2>/dev/null | dd bs=1 skip=5 count=$(($COMPRESSED_LENGTH-1)) 2>/dev/null | UNCOMPRESS > /tmp/chunk_uncompressed_nbt
|
||||
else
|
||||
dd if="$1" bs=4096 count=$LENGTH skip=$OFFSET 2>/dev/null | dd bs=1 skip=5 count=$(($COMPRESSED_LENGTH-1)) 2>/dev/null > /tmp/chunk_compressed_nbt
|
||||
fi
|
||||
|
||||
if $VERBOSE; then
|
||||
echo "Raw chunk data:"
|
||||
echo "$DATA"
|
||||
echo "NBT dump:"
|
||||
|
||||
#TODO: use pipes instead of a file
|
||||
dd if="$1" bs=4096 count=$LENGTH skip=$OFFSET 2>/dev/null | dd bs=1 skip=5 count=$(($COMPRESSED_LENGTH-1)) 2>/dev/null | UNCOMPRESS > /tmp/chunk_uncompressed_nbt
|
||||
#TODO: fix this up to work with both compressed and uncompressed NBT
|
||||
dumpnbt /tmp/chunk_uncompressed_nbt
|
||||
rm /tmp/chunk_uncompressed_nbt
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue