Closed lancewellspring closed 5 years ago
The problem was on my end. I was returning the schematic file from Node.js Express, and the jQuery ajax function I was using was interpreting it as a string. Using the code found at: https://www.henryalgus.com/reading-binary-files-using-jquery-ajax/, I was able to get the data as an ArrayBuffer instead, which fixed the problem.
As a side note, nbt.js doesn't work properly in the browser. It expects window.zlib to be available, but I couldn't figure out how to get that working. So I just added a reference to pako, and modified nbt.js slightly to use pako.inflate instead of zlib.gunzip.
I've tried several different schematics from several different websites, and they all give the same error. I've attached a schematic file that gives the error. According to the mcedit wiki, the schematic file format follows the nbt format, so I was hoping this script would work.
Webpage is served from a Debian server, and the script is being run via latest Chrome, on windows 10.
simple-contemporary.zip