From a787a89493608719028cbf2ad0abfff6efba034d Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Sun, 24 Mar 2024 18:55:52 +0100 Subject: [PATCH] resources/region_files: add a zlib compressed chunk --- resources/region_files/chunk_compressed_nbt | Bin 0 -> 8890 bytes resources/region_files/first_chunk.sh | 20 ++++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 resources/region_files/chunk_compressed_nbt diff --git a/resources/region_files/chunk_compressed_nbt b/resources/region_files/chunk_compressed_nbt new file mode 100644 index 0000000000000000000000000000000000000000..b1b8ba8141d824baac29095e1d998f282b84a158 GIT binary patch literal 8890 zcmV;rB1PSJob6qGY#hgRpS?RCKSYVUBqdRn?A}q9Yo}InM+!xoqyQySP6H_xWr^3MUIEa-(HWb4Uq`w+BKv4$`;QSH)VgI8Ph~f_=FwnHMQ#&91 zNS)SkoH%LHe6jOp-t6wo?%v+V-cd>S+2Y%ooq50a-puaKy_ucuBczAKPgF9M)iR0Y zR~HwfB=%?1#WJDPOSYX^EN0Km=9VgjN+HKG2`%slEwHh%@yi(LJDMq1W|rqOl^i=s zmfq_ledS7NHCtIN<;pbiKrWvv<(9I!az7b5Us%dzOPPG-gK$({phvWlMg;Ydc)5}( zRcJ-GvQg4kGR1La;*$%jOXvO+5J%vCz*fjiZfm4zn|H3(KHe%XKBso{j29e zCz@U;Q3ppCmdog%VLM>9SSl6fizNZ70Vq`T0FB!~cL6B<_j3g_)+lHML8Bg^w^5KE zAn2$7<#Gq@a%tBol*&SC)JN)Go76PrKXfrA+NdcpAJF$B=sWZ{g`humZ8WWZ&@P`w z1M9wrpnpjDyYSD~e{mmEK4_CVN%?<+)K>dnw-4wP1$hfWAE5ldTtK6Z`me_a^!KpQ zzDJMudo)_ZpmCo@dp|Z5fPNV6QQ+cMyQiOf{|K!E&?9g^3j);7y+>`9&U#qd@I9s1 z2XrU4=@04g`_St5TtS=YNSX)eRvYLJ5734$nO+~zZFtKD_v(1}bnm@Q+~>S{uK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0yYL4X`!;fhPwD!b&XPQ; zOpuA17AG2Y+}dftZJh=j=ro|-X+WdXfP/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