From dbcac6ce163ee65fbae9f761cfca15a51a07f18b Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Sat, 16 Oct 2021 04:42:57 +0200 Subject: [PATCH 01/39] Update index.html --- index.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 2e471c0..e33dee3 100644 --- a/index.html +++ b/index.html @@ -132,9 +132,9 @@ async function getStats(username, key, uuid, uuidjson, profilenum, profilejson) { let skyblockskill = await fetch("https://api.hypixel.net/resources/skyblock/skills"); let skillsjson = await skyblockskill.json(); - console.log(skillsjson); - + + console.log(profilejson); let farming_level = getLevel('farming', profilejson, skillsjson, profilenum, uuid); let mining_level = getLevel('mining', profilejson, skillsjson, profilenum, uuid); let combat_level = getLevel('combat', profilejson, skillsjson, profilenum, uuid); @@ -151,6 +151,9 @@ console.log(enchanting_level); console.log(alchemy_level); console.log(taming_level); + + var var_php = "hi"; + var var_js = ''; } From 5af85bb40e22260986f118979fc9baad1c774efb Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Sat, 16 Oct 2021 05:09:44 +0200 Subject: [PATCH 02/39] Update index.html --- index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index e33dee3..c68182b 100644 --- a/index.html +++ b/index.html @@ -152,10 +152,12 @@ console.log(alchemy_level); console.log(taming_level); - var var_php = "hi"; - var var_js = ''; + var result = "If this is displayed, it was a success"; } + document.writeln(result);"; + ?>

Bad Skyblock API

From d4bf8f36f679026359437979a9aaf1d81233b908 Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Sat, 16 Oct 2021 05:20:11 +0200 Subject: [PATCH 03/39] Update index.html --- index.html | 5 ----- 1 file changed, 5 deletions(-) diff --git a/index.html b/index.html index c68182b..bbf2cf2 100644 --- a/index.html +++ b/index.html @@ -151,13 +151,8 @@ console.log(enchanting_level); console.log(alchemy_level); console.log(taming_level); - - var result = "If this is displayed, it was a success"; } - document.writeln(result);"; - ?>

Bad Skyblock API

From 3549030005607aa4683c2efd91578b673cc3f637 Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Mon, 18 Oct 2021 05:05:30 +0200 Subject: [PATCH 04/39] Update index.html --- index.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.html b/index.html index bbf2cf2..6fa1b2c 100644 --- a/index.html +++ b/index.html @@ -151,6 +151,9 @@ console.log(enchanting_level); console.log(alchemy_level); console.log(taming_level); + console.log(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data); + let inventoryunbase64 = btoa(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data) + console.log(inventoryunbase64); } From 5908d3c7775e8b07c2b8f2fde51cfbcf54c53643 Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Mon, 18 Oct 2021 05:07:15 +0200 Subject: [PATCH 05/39] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 6fa1b2c..d8b447e 100644 --- a/index.html +++ b/index.html @@ -152,7 +152,7 @@ console.log(alchemy_level); console.log(taming_level); console.log(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data); - let inventoryunbase64 = btoa(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data) + let inventoryunbase64 = atob(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data) console.log(inventoryunbase64); } From 627af455e560f4d6ead6a40cc9369fae02b18c1b Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Mon, 18 Oct 2021 05:27:39 +0200 Subject: [PATCH 06/39] Update index.html --- index.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.html b/index.html index d8b447e..34a9664 100644 --- a/index.html +++ b/index.html @@ -154,6 +154,13 @@ console.log(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data); let inventoryunbase64 = atob(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data) console.log(inventoryunbase64); + const fs = require('fs'); + const nbt = require('prismarine-nbt'); + + nbt.parse(inventoryunbase64, (err, dat) => { + if(err) throw err; + console.log(JSON.stringify(nbt.simplify(dat)))); + }); } From cc39fb7dd38e67b967cd11fa6f12e28f735fb042 Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Mon, 18 Oct 2021 05:28:08 +0200 Subject: [PATCH 07/39] Update index.html --- index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/index.html b/index.html index 34a9664..9dabaf2 100644 --- a/index.html +++ b/index.html @@ -154,7 +154,6 @@ console.log(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data); let inventoryunbase64 = atob(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data) console.log(inventoryunbase64); - const fs = require('fs'); const nbt = require('prismarine-nbt'); nbt.parse(inventoryunbase64, (err, dat) => { From 9ff8f8e2597ec687f542d5e9faec94969836cfd4 Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Mon, 18 Oct 2021 05:28:37 +0200 Subject: [PATCH 08/39] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 9dabaf2..aac3f9a 100644 --- a/index.html +++ b/index.html @@ -158,7 +158,7 @@ nbt.parse(inventoryunbase64, (err, dat) => { if(err) throw err; - console.log(JSON.stringify(nbt.simplify(dat)))); + console.log(JSON.stringify(nbt.simplify(dat))); }); } From 75f34819c7f65796d50fb75147296ea82924824d Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Mon, 18 Oct 2021 05:29:46 +0200 Subject: [PATCH 09/39] Update index.html --- index.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index aac3f9a..77bca85 100644 --- a/index.html +++ b/index.html @@ -154,11 +154,12 @@ console.log(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data); let inventoryunbase64 = atob(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data) console.log(inventoryunbase64); - const nbt = require('prismarine-nbt'); + + npm i prismarine-nbt - nbt.parse(inventoryunbase64, (err, dat) => { + prismarine-nbt.parse(inventoryunbase64, (err, dat) => { if(err) throw err; - console.log(JSON.stringify(nbt.simplify(dat))); + console.log(JSON.stringify(prismarine-nbt.simplify(dat))); }); } From 483489ce74c470346ef2e8ac8abda586c6631771 Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Mon, 18 Oct 2021 17:56:56 +0200 Subject: [PATCH 10/39] Update index.html --- index.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 77bca85..cb83bde 100644 --- a/index.html +++ b/index.html @@ -42,6 +42,7 @@ + From 2a96bc144caaad2e7646c7fb680ef8fce5236891 Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Mon, 18 Oct 2021 18:30:06 +0200 Subject: [PATCH 11/39] Create nbt.js --- nbt.js | 674 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 674 insertions(+) create mode 100644 nbt.js diff --git a/nbt.js b/nbt.js new file mode 100644 index 0000000..b55794a --- /dev/null +++ b/nbt.js @@ -0,0 +1,674 @@ +/* + NBT.js - a JavaScript parser for NBT archives + by Sijmen Mulder + + I, the copyright holder of this work, hereby release it into the public + domain. This applies worldwide. + + In case this is not legally possible: I grant anyone the right to use this + work for any purpose, without any conditions, unless such conditions are + required by law. +*/ + +(function() { + 'use strict'; + + if (typeof ArrayBuffer === 'undefined') { + throw new Error('Missing required type ArrayBuffer'); + } + if (typeof DataView === 'undefined') { + throw new Error('Missing required type DataView'); + } + if (typeof Uint8Array === 'undefined') { + throw new Error('Missing required type Uint8Array'); + } + + /** @exports nbt */ + + var nbt = this; + var zlib = typeof require !== 'undefined' ? require('zlib') : window.zlib; + + /** + * A mapping from type names to NBT type numbers. + * {@link module:nbt.Writer} and {@link module:nbt.Reader} + * have correspoding methods (e.g. {@link module:nbt.Writer#int}) + * for every type. + * + * @type Object + * @see module:nbt.tagTypeNames */ + nbt.tagTypes = { + 'end': 0, + 'byte': 1, + 'short': 2, + 'int': 3, + 'long': 4, + 'float': 5, + 'double': 6, + 'byteArray': 7, + 'string': 8, + 'list': 9, + 'compound': 10, + 'intArray': 11, + 'longArray': 12 + }; + + /** + * A mapping from NBT type numbers to type names. + * + * @type Object + * @see module:nbt.tagTypes */ + nbt.tagTypeNames = {}; + (function() { + for (var typeName in nbt.tagTypes) { + if (nbt.tagTypes.hasOwnProperty(typeName)) { + nbt.tagTypeNames[nbt.tagTypes[typeName]] = typeName; + } + } + })(); + + function hasGzipHeader(data) { + var head = new Uint8Array(data.slice(0, 2)); + return head.length === 2 && head[0] === 0x1f && head[1] === 0x8b; + } + + function encodeUTF8(str) { + var array = [], i, c; + for (i = 0; i < str.length; i++) { + c = str.charCodeAt(i); + if (c < 0x80) { + array.push(c); + } else if (c < 0x800) { + array.push(0xC0 | c >> 6); + array.push(0x80 | c & 0x3F); + } else if (c < 0x10000) { + array.push(0xE0 | c >> 12); + array.push(0x80 | (c >> 6) & 0x3F); + array.push(0x80 | c & 0x3F); + } else { + array.push(0xF0 | (c >> 18) & 0x07); + array.push(0x80 | (c >> 12) & 0x3F); + array.push(0x80 | (c >> 6) & 0x3F); + array.push(0x80 | c & 0x3F); + } + } + return array; + } + + function decodeUTF8(array) { + var codepoints = [], i; + for (i = 0; i < array.length; i++) { + if ((array[i] & 0x80) === 0) { + codepoints.push(array[i] & 0x7F); + } else if (i+1 < array.length && + (array[i] & 0xE0) === 0xC0 && + (array[i+1] & 0xC0) === 0x80) { + codepoints.push( + ((array[i] & 0x1F) << 6) | + ( array[i+1] & 0x3F)); + } else if (i+2 < array.length && + (array[i] & 0xF0) === 0xE0 && + (array[i+1] & 0xC0) === 0x80 && + (array[i+2] & 0xC0) === 0x80) { + codepoints.push( + ((array[i] & 0x0F) << 12) | + ((array[i+1] & 0x3F) << 6) | + ( array[i+2] & 0x3F)); + } else if (i+3 < array.length && + (array[i] & 0xF8) === 0xF0 && + (array[i+1] & 0xC0) === 0x80 && + (array[i+2] & 0xC0) === 0x80 && + (array[i+3] & 0xC0) === 0x80) { + codepoints.push( + ((array[i] & 0x07) << 18) | + ((array[i+1] & 0x3F) << 12) | + ((array[i+2] & 0x3F) << 6) | + ( array[i+3] & 0x3F)); + } + } + return String.fromCharCode.apply(null, codepoints); + } + + /* Not all environments, in particular PhantomJS, supply + Uint8Array.slice() */ + function sliceUint8Array(array, begin, end) { + if ('slice' in array) { + return array.slice(begin, end); + } else { + return new Uint8Array([].slice.call(array, begin, end)); + } + } + + /** + * In addition to the named writing methods documented below, + * the same methods are indexed by the NBT type number as well, + * as shown in the example below. + * + * @constructor + * @see module:nbt.Reader + * + * @example + * var writer = new nbt.Writer(); + * + * // all equivalent + * writer.int(42); + * writer[3](42); + * writer(nbt.tagTypes.int)(42); + * + * // overwrite the second int + * writer.offset = 0; + * writer.int(999); + * + * return writer.buffer; */ + nbt.Writer = function() { + var self = this; + + /* Will be resized (x2) on write if necessary. */ + var buffer = new ArrayBuffer(1024); + + /* These are recreated when the buffer is */ + var dataView = new DataView(buffer); + var arrayView = new Uint8Array(buffer); + + /** + * The location in the buffer where bytes are written or read. + * This increases after every write, but can be freely changed. + * The buffer will be resized when necessary. + * + * @type number */ + this.offset = 0; + + // Ensures that the buffer is large enough to write `size` bytes + // at the current `self.offset`. + function accommodate(size) { + var requiredLength = self.offset + size; + if (buffer.byteLength >= requiredLength) { + return; + } + + var newLength = buffer.byteLength; + while (newLength < requiredLength) { + newLength *= 2; + } + + var newBuffer = new ArrayBuffer(newLength); + var newArrayView = new Uint8Array(newBuffer); + newArrayView.set(arrayView); + + // If there's a gap between the end of the old buffer + // and the start of the new one, we need to zero it out + if (self.offset > buffer.byteLength) { + newArrayView.fill(0, buffer.byteLength, self.offset); + } + + buffer = newBuffer; + dataView = new DataView(newBuffer); + arrayView = newArrayView; + } + + function write(dataType, size, value) { + accommodate(size); + dataView['set' + dataType](self.offset, value); + self.offset += size; + return self; + } + + /** + * Returns the writen data as a slice from the internal buffer, + * cutting off any padding at the end. + * + * @returns {ArrayBuffer} a [0, offset] slice of the interal buffer */ + this.getData = function() { + accommodate(0); /* make sure the offset is inside the buffer */ + return buffer.slice(0, self.offset); + }; + + /** + * @method module:nbt.Writer#byte + * @param {number} value - a signed byte + * @returns {module:nbt.Writer} itself */ + this[nbt.tagTypes.byte] = write.bind(this, 'Int8', 1); + + /** + * @method module:nbt.Writer#ubyte + * @param {number} value - an unsigned byte + * @returns {module:nbt.Writer} itself */ + this.ubyte = write.bind(this, 'Uint8', 1); + + /** + * @method module:nbt.Writer#short + * @param {number} value - a signed 16-bit integer + * @returns {module:nbt.Writer} itself */ + this[nbt.tagTypes.short] = write.bind(this, 'Int16', 2); + + /** + * @method module:nbt.Writer#int + * @param {number} value - a signed 32-bit integer + * @returns {module:nbt.Writer} itself */ + this[nbt.tagTypes.int] = write.bind(this, 'Int32', 4); + + /** + * @method module:nbt.Writer#float + * @param {number} value - a signed 32-bit float + * @returns {module:nbt.Writer} itself */ + this[nbt.tagTypes.float] = write.bind(this, 'Float32', 4); + + /** + * @method module:nbt.Writer#float + * @param {number} value - a signed 64-bit float + * @returns {module:nbt.Writer} itself */ + this[nbt.tagTypes.double] = write.bind(this, 'Float64', 8); + + /** + * As JavaScript does not support 64-bit integers natively, this + * method takes an array of two 32-bit integers that make up the + * upper and lower halves of the long. + * + * @method module:nbt.Writer#long + * @param {Array.} value - [upper, lower] + * @returns {module:nbt.Writer} itself */ + this[nbt.tagTypes.long] = function(value) { + self.int(value[0]); + self.int(value[1]); + return self; + }; + + /** + * @method module:nbt.Writer#byteArray + * @param {Array.|Uint8Array|Buffer} value + * @returns {module:nbt.Writer} itself */ + this[nbt.tagTypes.byteArray] = function(value) { + this.int(value.length); + accommodate(value.length); + arrayView.set(value, this.offset); + this.offset += value.length; + return this; + }; + + /** + * @method module:nbt.Writer#intArray + * @param {Array.} value + * @returns {module:nbt.Writer} itself */ + this[nbt.tagTypes.intArray] = function(value) { + this.int(value.length); + var i; + for (i = 0; i < value.length; i++) { + this.int(value[i]); + } + return this; + }; + + /** + * @method module:nbt.Writer#longArray + * @param {Array.} value + * @returns {module:nbt.Writer} itself */ + this[nbt.tagTypes.longArray] = function(value) { + this.int(value.length); + var i; + for (i = 0; i < value.length; i++) { + this.long(value[i]); + } + return this; + }; + + /** + * @method module:nbt.Writer#string + * @param {string} value + * @returns {module:nbt.Writer} itself */ + this[nbt.tagTypes.string] = function(value) { + var bytes = encodeUTF8(value); + this.short(bytes.length); + accommodate(bytes.length); + arrayView.set(bytes, this.offset); + this.offset += bytes.length; + return this; + }; + + /** + * @method module:nbt.Writer#list + * @param {Object} value + * @param {number} value.type - the NBT type number + * @param {Array} value.value - an array of values + * @returns {module:nbt.Writer} itself */ + this[nbt.tagTypes.list] = function(value) { + this.byte(nbt.tagTypes[value.type]); + this.int(value.value.length); + var i; + for (i = 0; i < value.value.length; i++) { + this[value.type](value.value[i]); + } + return this; + }; + + /** + * @method module:nbt.Writer#compound + * @param {Object} value - a key/value map + * @param {Object} value.KEY + * @param {string} value.KEY.type - the NBT type number + * @param {Object} value.KEY.value - a value matching the type + * @returns {module:nbt.Writer} itself + * + * @example + * writer.compound({ + * foo: { type: 'int', value: 12 }, + * bar: { type: 'string', value: 'Hello, World!' } + * }); */ + this[nbt.tagTypes.compound] = function(value) { + var self = this; + Object.keys(value).map(function (key) { + self.byte(nbt.tagTypes[value[key].type]); + self.string(key); + self[value[key].type](value[key].value); + }); + this.byte(nbt.tagTypes.end); + return this; + }; + + var typeName; + for (typeName in nbt.tagTypes) { + if (nbt.tagTypes.hasOwnProperty(typeName)) { + this[typeName] = this[nbt.tagTypes[typeName]]; + } + } + }; + + /** + * In addition to the named writing methods documented below, + * the same methods are indexed by the NBT type number as well, + * as shown in the example below. + * + * @constructor + * @see module:nbt.Writer + * + * @example + * var reader = new nbt.Reader(buf); + * int x = reader.int(); + * int y = reader[3](); + * int z = reader[nbt.tagTypes.int](); */ + nbt.Reader = function(buffer) { + if (!buffer) { throw new Error('Argument "buffer" is falsy'); } + + var self = this; + + /** + * The current location in the buffer. Can be freely changed + * within the bounds of the buffer. + * + * @type number */ + this.offset = 0; + + var arrayView = new Uint8Array(buffer); + var dataView = new DataView(arrayView.buffer); + + function read(dataType, size) { + var val = dataView['get' + dataType](self.offset); + self.offset += size; + return val; + } + + /** + * @method module:nbt.Reader#byte + * @returns {number} the read byte */ + this[nbt.tagTypes.byte] = read.bind(this, 'Int8', 1); + + /** + * @method module:nbt.Reader#byte + * @returns {number} the read unsigned byte */ + this.ubyte = read.bind(this, 'Uint8', 1); + + /** + * @method module:nbt.Reader#short + * @returns {number} the read signed 16-bit short */ + this[nbt.tagTypes.short] = read.bind(this, 'Int16', 2); + + /** + * @method module:nbt.Reader#int + * @returns {number} the read signed 32-bit integer */ + this[nbt.tagTypes.int] = read.bind(this, 'Int32', 4); + + /** + * @method module:nbt.Reader#float + * @returns {number} the read signed 32-bit float */ + this[nbt.tagTypes.float] = read.bind(this, 'Float32', 4); + + /** + * @method module:nbt.Reader#double + * @returns {number} the read signed 64-bit float */ + this[nbt.tagTypes.double] = read.bind(this, 'Float64', 8); + + /** + * As JavaScript does not not natively support 64-bit + * integers, the value is returned as an array of two + * 32-bit integers, the upper and the lower. + * + * @method module:nbt.Reader#long + * @returns {Array.} [upper, lower] */ + this[nbt.tagTypes.long] = function() { + return [this.int(), this.int()]; + }; + + /** + * @method module:nbt.Reader#byteArray + * @returns {Array.} the read array */ + this[nbt.tagTypes.byteArray] = function() { + var length = this.int(); + var bytes = []; + var i; + for (i = 0; i < length; i++) { + bytes.push(this.byte()); + } + return bytes; + }; + + /** + * @method module:nbt.Reader#intArray + * @returns {Array.} the read array of 32-bit ints */ + this[nbt.tagTypes.intArray] = function() { + var length = this.int(); + var ints = []; + var i; + for (i = 0; i < length; i++) { + ints.push(this.int()); + } + return ints; + }; + + /** + * As JavaScript does not not natively support 64-bit + * integers, the value is returned as an array of arrays of two + * 32-bit integers, the upper and the lower. + * + * @method module:nbt.Reader#longArray + * @returns {Array.} the read array of 64-bit ints + * split into [upper, lower] */ + this[nbt.tagTypes.longArray] = function() { + var length = this.int(); + var longs = []; + var i; + for (i = 0; i < length; i++) { + longs.push(this.long()); + } + return longs; + }; + + /** + * @method module:nbt.Reader#string + * @returns {string} the read string */ + this[nbt.tagTypes.string] = function() { + var length = this.short(); + var slice = sliceUint8Array(arrayView, this.offset, + this.offset + length); + this.offset += length; + return decodeUTF8(slice); + }; + + /** + * @method module:nbt.Reader#list + * @returns {{type: string, value: Array}} + * + * @example + * reader.list(); + * // -> { type: 'string', values: ['foo', 'bar'] } */ + this[nbt.tagTypes.list] = function() { + var type = this.byte(); + var length = this.int(); + var values = []; + var i; + for (i = 0; i < length; i++) { + values.push(this[type]()); + } + return { type: nbt.tagTypeNames[type], value: values }; + }; + + /** + * @method module:nbt.Reader#compound + * @returns {Object.} + * + * @example + * reader.compound(); + * // -> { foo: { type: int, value: 42 }, + * // bar: { type: string, value: 'Hello! }} */ + this[nbt.tagTypes.compound] = function() { + var values = {}; + while (true) { + var type = this.byte(); + if (type === nbt.tagTypes.end) { + break; + } + var name = this.string(); + var value = this[type](); + values[name] = { type: nbt.tagTypeNames[type], value: value }; + } + return values; + }; + + var typeName; + for (typeName in nbt.tagTypes) { + if (nbt.tagTypes.hasOwnProperty(typeName)) { + this[typeName] = this[nbt.tagTypes[typeName]]; + } + } + }; + + /** + * @param {Object} value - a named compound + * @param {string} value.name - the top-level name + * @param {Object} value.value - a compound + * @returns {ArrayBuffer} + * + * @see module:nbt.parseUncompressed + * @see module:nbt.Writer#compound + * + * @example + * nbt.writeUncompressed({ + * name: 'My Level', + * value: { + * foo: { type: int, value: 42 }, + * bar: { type: string, value: 'Hi!' } + * } + * }); */ + nbt.writeUncompressed = function(value) { + if (!value) { throw new Error('Argument "value" is falsy'); } + + var writer = new nbt.Writer(); + + writer.byte(nbt.tagTypes.compound); + writer.string(value.name); + writer.compound(value.value); + + return writer.getData(); + }; + + /** + * @param {ArrayBuffer|Buffer} data - an uncompressed NBT archive + * @returns {{name: string, value: Object.}} + * a named compound + * + * @see module:nbt.parse + * @see module:nbt.writeUncompressed + * + * @example + * nbt.readUncompressed(buf); + * // -> { name: 'My Level', + * // value: { foo: { type: int, value: 42 }, + * // bar: { type: string, value: 'Hi!' }}} */ + nbt.parseUncompressed = function(data) { + if (!data) { throw new Error('Argument "data" is falsy'); } + + var reader = new nbt.Reader(data); + + var type = reader.byte(); + if (type !== nbt.tagTypes.compound) { + throw new Error('Top tag should be a compound'); + } + + return { + name: reader.string(), + value: reader.compound() + }; + }; + + /** + * @callback parseCallback + * @param {Object} error + * @param {Object} result - a named compound + * @param {string} result.name - the top-level name + * @param {Object} result.value - the top-level compound */ + + /** + * This accepts both gzipped and uncompressd NBT archives. + * If the archive is uncompressed, the callback will be + * called directly from this method. For gzipped files, the + * callback is async. + * + * For use in the browser, window.zlib must be defined to decode + * compressed archives. It will be passed a Buffer if the type is + * available, or an Uint8Array otherwise. + * + * @param {ArrayBuffer|Buffer} data - gzipped or uncompressed data + * @param {parseCallback} callback + * + * @see module:nbt.parseUncompressed + * @see module:nbt.Reader#compound + * + * @example + * nbt.parse(buf, function(error, results) { + * if (error) { + * throw error; + * } + * console.log(result.name); + * console.log(result.value.foo); + * }); */ + nbt.parse = function(data, callback) { + if (!data) { throw new Error('Argument "data" is falsy'); } + + var self = this; + + if (!hasGzipHeader(data)) { + callback(null, self.parseUncompressed(data)); + } else if (!zlib) { + callback(new Error('NBT archive is compressed but zlib is not ' + + 'available'), null); + } else { + /* zlib.gunzip take a Buffer, at least in Node, so try to convert + if possible. */ + var buffer; + if (data.length) { + buffer = data; + } else if (typeof Buffer !== 'undefined') { + buffer = new Buffer(data); + } else { + /* In the browser? Unknown zlib library. Let's settle for + Uint8Array and see what happens. */ + buffer = new Uint8Array(data); + } + + zlib.gunzip(buffer, function(error, uncompressed) { + if (error) { + callback(error, null); + } else { + callback(null, self.parseUncompressed(uncompressed)); + } + }); + } + }; +}).apply(typeof exports !== 'undefined' ? exports : (window.nbt = {})); From 502616d99d1ff2a2d9f6cfc012da0dd318f81b64 Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Mon, 18 Oct 2021 18:31:53 +0200 Subject: [PATCH 12/39] Update index.html --- index.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/index.html b/index.html index cb83bde..c189505 100644 --- a/index.html +++ b/index.html @@ -42,7 +42,7 @@ - +
From 59341dae6404b2b685e43fc8b64433bd2c0e1bbf Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Mon, 18 Oct 2021 23:41:16 +0200 Subject: [PATCH 16/39] Create gzip.min.js --- gzip.min.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 gzip.min.js diff --git a/gzip.min.js b/gzip.min.js new file mode 100644 index 0000000..986097a --- /dev/null +++ b/gzip.min.js @@ -0,0 +1,32 @@ +/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function() {'use strict';var p=void 0,v=!0,da=this;function fa(f,e){var c=f.split("."),a=da;!(c[0]in a)&&a.execScript&&a.execScript("var "+c[0]);for(var b;c.length&&(b=c.shift());)!c.length&&e!==p?a[b]=e:a=a[b]?a[b]:a[b]={}};var C="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Uint32Array&&"undefined"!==typeof DataView;function F(f,e){this.index="number"===typeof e?e:0;this.f=0;this.buffer=f instanceof(C?Uint8Array:Array)?f:new (C?Uint8Array:Array)(32768);if(2*this.buffer.length<=this.index)throw Error("invalid index");this.buffer.length<=this.index&&ga(this)}function ga(f){var e=f.buffer,c,a=e.length,b=new (C?Uint8Array:Array)(a<<1);if(C)b.set(e);else for(c=0;c>>8&255]<<16|H[f>>>16&255]<<8|H[f>>>24&255])>>32-e:H[f]>>8-e);if(8>e+g)l=l<>e-m-1&1,8===++g&&(g=0,a[b++]=H[l],l=0,b===a.length&&(a=ga(this)));a[b]=l;this.buffer=a;this.f=g;this.index=b};F.prototype.finish=function(){var f=this.buffer,e=this.index,c;0M;++M){for(var N=M,S=N,ja=7,N=N>>>1;N;N>>>=1)S<<=1,S|=N&1,--ja;ia[M]=(S<>>0}var H=ia;function ka(f,e,c){var a,b="number"===typeof e?e:e=0,g="number"===typeof c?c:f.length;a=-1;for(b=g&7;b--;++e)a=a>>>8^T[(a^f[e])&255];for(b=g>>3;b--;e+=8)a=a>>>8^T[(a^f[e])&255],a=a>>>8^T[(a^f[e+1])&255],a=a>>>8^T[(a^f[e+2])&255],a=a>>>8^T[(a^f[e+3])&255],a=a>>>8^T[(a^f[e+4])&255],a=a>>>8^T[(a^f[e+5])&255],a=a>>>8^T[(a^f[e+6])&255],a=a>>>8^T[(a^f[e+7])&255];return(a^4294967295)>>>0} +var la=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759, +2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977, +2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755, +2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956, +3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270, +936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],T=C?new Uint32Array(la):la;function U(f){this.buffer=new (C?Uint16Array:Array)(2*f);this.length=0}U.prototype.getParent=function(f){return 2*((f-2)/4|0)};U.prototype.push=function(f,e){var c,a,b=this.buffer,g;c=this.length;b[this.length++]=e;for(b[this.length++]=f;0b[a])g=b[c],b[c]=b[a],b[a]=g,g=b[c+1],b[c+1]=b[a+1],b[a+1]=g,c=a;else break;return this.length}; +U.prototype.pop=function(){var f,e,c=this.buffer,a,b,g;e=c[0];f=c[1];this.length-=2;c[0]=c[this.length];c[1]=c[this.length+1];for(g=0;;){b=2*g+2;if(b>=this.length)break;b+2c[b]&&(b+=2);if(c[b]>c[g])a=c[g],c[g]=c[b],c[b]=a,a=c[g+1],c[g+1]=c[b+1],c[b+1]=a;else break;g=b}return{index:f,value:e,length:this.length}};function ma(f,e){this.h=na;this.j=0;this.input=C&&f instanceof Array?new Uint8Array(f):f;this.c=0;e&&(e.lazy&&(this.j=e.lazy),"number"===typeof e.compressionType&&(this.h=e.compressionType),e.outputBuffer&&(this.a=C&&e.outputBuffer instanceof Array?new Uint8Array(e.outputBuffer):e.outputBuffer),"number"===typeof e.outputIndex&&(this.c=e.outputIndex));this.a||(this.a=new (C?Uint8Array:Array)(32768))}var na=2,V=[],$; +for($=0;288>$;$++)switch(v){case 143>=$:V.push([$+48,8]);break;case 255>=$:V.push([$-144+400,9]);break;case 279>=$:V.push([$-256+0,7]);break;case 287>=$:V.push([$-280+192,8]);break;default:throw"invalid literal: "+$;} +ma.prototype.g=function(){var f,e,c,a,b=this.input;switch(this.h){case 0:c=0;for(a=b.length;c>>8&255;n[k++]=h&255;n[k++]=h>>>8&255;if(C)n.set(g,k),k+=g.length,n=n.subarray(0,k);else{s=0;for(x=g.length;st)for(;0t?t:138,A>t-3&&A=A?(E[D++]=17,E[D++]=A-3,J[17]++):(E[D++]=18,E[D++]=A-11,J[18]++),t-=A;else if(E[D++]=G[r],J[G[r]]++,t--,3>t)for(;0t?t:6,A>t-3&&Ay;y++)ea[y]=ba[Ha[y]];for(Q=19;4=b:return[265,b-11,1];case 14>=b:return[266,b-13,1];case 16>=b:return[267,b-15,1];case 18>=b:return[268,b-17,1];case 22>=b:return[269,b-19,2];case 26>=b:return[270,b-23,2];case 30>=b:return[271,b-27,2];case 34>=b:return[272, +b-31,2];case 42>=b:return[273,b-35,3];case 50>=b:return[274,b-43,3];case 58>=b:return[275,b-51,3];case 66>=b:return[276,b-59,3];case 82>=b:return[277,b-67,4];case 98>=b:return[278,b-83,4];case 114>=b:return[279,b-99,4];case 130>=b:return[280,b-115,4];case 162>=b:return[281,b-131,5];case 194>=b:return[282,b-163,5];case 226>=b:return[283,b-195,5];case 257>=b:return[284,b-227,5];case 258===b:return[285,b-258,0];default:throw"invalid length: "+b;}}var e=[],c,a;for(c=3;258>=c;c++)a=f(c),e[c]=a[2]<<24| +a[1]<<16|a[0];return e}(),Ia=C?new Uint32Array(Ga):Ga; +function oa(f,e){function c(b,e){var a=b.k,c=[],g=0,f;f=Ia[b.length];c[g++]=f&65535;c[g++]=f>>16&255;c[g++]=f>>24;var d;switch(v){case 1===a:d=[0,a-1,0];break;case 2===a:d=[1,a-2,0];break;case 3===a:d=[2,a-3,0];break;case 4===a:d=[3,a-4,0];break;case 6>=a:d=[4,a-5,1];break;case 8>=a:d=[5,a-7,1];break;case 12>=a:d=[6,a-9,2];break;case 16>=a:d=[7,a-13,2];break;case 24>=a:d=[8,a-17,3];break;case 32>=a:d=[9,a-25,3];break;case 48>=a:d=[10,a-33,4];break;case 64>=a:d=[11,a-49,4];break;case 96>=a:d=[12,a- +65,5];break;case 128>=a:d=[13,a-97,5];break;case 192>=a:d=[14,a-129,6];break;case 256>=a:d=[15,a-193,6];break;case 384>=a:d=[16,a-257,7];break;case 512>=a:d=[17,a-385,7];break;case 768>=a:d=[18,a-513,8];break;case 1024>=a:d=[19,a-769,8];break;case 1536>=a:d=[20,a-1025,9];break;case 2048>=a:d=[21,a-1537,9];break;case 3072>=a:d=[22,a-2049,10];break;case 4096>=a:d=[23,a-3073,10];break;case 6144>=a:d=[24,a-4097,11];break;case 8192>=a:d=[25,a-6145,11];break;case 12288>=a:d=[26,a-8193,12];break;case 16384>= +a:d=[27,a-12289,12];break;case 24576>=a:d=[28,a-16385,13];break;case 32768>=a:d=[29,a-24577,13];break;default:throw"invalid distance";}f=d;c[g++]=f[0];c[g++]=f[1];c[g++]=f[2];var h,l;h=0;for(l=c.length;h=g;)u[g++]=0;for(g=0;29>=g;)w[g++]=0}u[256]=1;a=0;for(b=e.length;a=b){x&&c(x,-1);g=0;for(l=b-a;gl&&e+lg&&(b=a,g=l);if(258===l)break}return new Fa(g,e-b)} +function pa(f,e){var c=f.length,a=new U(572),b=new (C?Uint8Array:Array)(c),g,l,m,d,h;if(!C)for(d=0;d2*b[k-1]+g[k]&&(b[k]=2*b[k-1]+g[k]),m[k]=Array(b[k]),d[k]=Array(b[k]);for(n=0;nf[n]?(m[k][q]=u,d[k][q]=e,w+=2):(m[k][q]=f[n],d[k][q]=n,++n);h[k]=0;1===g[k]&&a(k)}return l} +function qa(f){var e=new (C?Uint16Array:Array)(f.length),c=[],a=[],b=0,g,l,m,d;g=0;for(l=f.length;g>>=1}return e};function La(f,e){this.input=f;this.c=this.i=0;this.d={};e&&(e.flags&&(this.d=e.flags),"string"===typeof e.filename&&(this.filename=e.filename),"string"===typeof e.comment&&(this.l=e.comment),e.deflateOptions&&(this.e=e.deflateOptions));this.e||(this.e={})} +La.prototype.g=function(){var f,e,c,a,b,g,l,m,d=new (C?Uint8Array:Array)(32768),h=0,s=this.input,x=this.i,n=this.filename,k=this.l;d[h++]=31;d[h++]=139;d[h++]=8;f=0;this.d.fname&&(f|=Ma);this.d.fcomment&&(f|=Na);this.d.fhcrc&&(f|=Oa);d[h++]=f;e=(Date.now?Date.now():+new Date)/1E3|0;d[h++]=e&255;d[h++]=e>>>8&255;d[h++]=e>>>16&255;d[h++]=e>>>24&255;d[h++]=0;d[h++]=Pa;if(this.d.fname!==p){l=0;for(m=n.length;l>>8&255),d[h++]=g&255;d[h++]=0}if(this.d.comment){l= +0;for(m=k.length;l>>8&255),d[h++]=g&255;d[h++]=0}this.d.fhcrc&&(c=ka(d,0,h)&65535,d[h++]=c&255,d[h++]=c>>>8&255);this.e.outputBuffer=d;this.e.outputIndex=h;b=new ma(s,this.e);d=b.g();h=b.c;C&&(h+8>d.buffer.byteLength?(this.a=new Uint8Array(h+8),this.a.set(new Uint8Array(d.buffer)),d=this.a):d=new Uint8Array(d.buffer));a=ka(s,p,p);d[h++]=a&255;d[h++]=a>>>8&255;d[h++]=a>>>16&255;d[h++]=a>>>24&255;m=s.length;d[h++]=m&255;d[h++]=m>>>8&255;d[h++]=m>>>16&255;d[h++]= +m>>>24&255;this.i=x;C&&h Date: Mon, 18 Oct 2021 23:51:57 +0200 Subject: [PATCH 17/39] Update index.html --- index.html | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index a825f8b..d81081d 100644 --- a/index.html +++ b/index.html @@ -42,6 +42,7 @@ + From 592ba22cb55156cf6ba13bba73debf3a70b15aae Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Mon, 18 Oct 2021 23:58:10 +0200 Subject: [PATCH 18/39] Update and rename gzip.min.js to nbt.js --- gzip.min.js | 32 -------------------------------- nbt.js | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 32 deletions(-) delete mode 100644 gzip.min.js create mode 100644 nbt.js diff --git a/gzip.min.js b/gzip.min.js deleted file mode 100644 index 986097a..0000000 --- a/gzip.min.js +++ /dev/null @@ -1,32 +0,0 @@ -/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function() {'use strict';var p=void 0,v=!0,da=this;function fa(f,e){var c=f.split("."),a=da;!(c[0]in a)&&a.execScript&&a.execScript("var "+c[0]);for(var b;c.length&&(b=c.shift());)!c.length&&e!==p?a[b]=e:a=a[b]?a[b]:a[b]={}};var C="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Uint32Array&&"undefined"!==typeof DataView;function F(f,e){this.index="number"===typeof e?e:0;this.f=0;this.buffer=f instanceof(C?Uint8Array:Array)?f:new (C?Uint8Array:Array)(32768);if(2*this.buffer.length<=this.index)throw Error("invalid index");this.buffer.length<=this.index&&ga(this)}function ga(f){var e=f.buffer,c,a=e.length,b=new (C?Uint8Array:Array)(a<<1);if(C)b.set(e);else for(c=0;c>>8&255]<<16|H[f>>>16&255]<<8|H[f>>>24&255])>>32-e:H[f]>>8-e);if(8>e+g)l=l<>e-m-1&1,8===++g&&(g=0,a[b++]=H[l],l=0,b===a.length&&(a=ga(this)));a[b]=l;this.buffer=a;this.f=g;this.index=b};F.prototype.finish=function(){var f=this.buffer,e=this.index,c;0M;++M){for(var N=M,S=N,ja=7,N=N>>>1;N;N>>>=1)S<<=1,S|=N&1,--ja;ia[M]=(S<>>0}var H=ia;function ka(f,e,c){var a,b="number"===typeof e?e:e=0,g="number"===typeof c?c:f.length;a=-1;for(b=g&7;b--;++e)a=a>>>8^T[(a^f[e])&255];for(b=g>>3;b--;e+=8)a=a>>>8^T[(a^f[e])&255],a=a>>>8^T[(a^f[e+1])&255],a=a>>>8^T[(a^f[e+2])&255],a=a>>>8^T[(a^f[e+3])&255],a=a>>>8^T[(a^f[e+4])&255],a=a>>>8^T[(a^f[e+5])&255],a=a>>>8^T[(a^f[e+6])&255],a=a>>>8^T[(a^f[e+7])&255];return(a^4294967295)>>>0} -var la=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759, -2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977, -2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755, -2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956, -3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270, -936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],T=C?new Uint32Array(la):la;function U(f){this.buffer=new (C?Uint16Array:Array)(2*f);this.length=0}U.prototype.getParent=function(f){return 2*((f-2)/4|0)};U.prototype.push=function(f,e){var c,a,b=this.buffer,g;c=this.length;b[this.length++]=e;for(b[this.length++]=f;0b[a])g=b[c],b[c]=b[a],b[a]=g,g=b[c+1],b[c+1]=b[a+1],b[a+1]=g,c=a;else break;return this.length}; -U.prototype.pop=function(){var f,e,c=this.buffer,a,b,g;e=c[0];f=c[1];this.length-=2;c[0]=c[this.length];c[1]=c[this.length+1];for(g=0;;){b=2*g+2;if(b>=this.length)break;b+2c[b]&&(b+=2);if(c[b]>c[g])a=c[g],c[g]=c[b],c[b]=a,a=c[g+1],c[g+1]=c[b+1],c[b+1]=a;else break;g=b}return{index:f,value:e,length:this.length}};function ma(f,e){this.h=na;this.j=0;this.input=C&&f instanceof Array?new Uint8Array(f):f;this.c=0;e&&(e.lazy&&(this.j=e.lazy),"number"===typeof e.compressionType&&(this.h=e.compressionType),e.outputBuffer&&(this.a=C&&e.outputBuffer instanceof Array?new Uint8Array(e.outputBuffer):e.outputBuffer),"number"===typeof e.outputIndex&&(this.c=e.outputIndex));this.a||(this.a=new (C?Uint8Array:Array)(32768))}var na=2,V=[],$; -for($=0;288>$;$++)switch(v){case 143>=$:V.push([$+48,8]);break;case 255>=$:V.push([$-144+400,9]);break;case 279>=$:V.push([$-256+0,7]);break;case 287>=$:V.push([$-280+192,8]);break;default:throw"invalid literal: "+$;} -ma.prototype.g=function(){var f,e,c,a,b=this.input;switch(this.h){case 0:c=0;for(a=b.length;c>>8&255;n[k++]=h&255;n[k++]=h>>>8&255;if(C)n.set(g,k),k+=g.length,n=n.subarray(0,k);else{s=0;for(x=g.length;st)for(;0t?t:138,A>t-3&&A=A?(E[D++]=17,E[D++]=A-3,J[17]++):(E[D++]=18,E[D++]=A-11,J[18]++),t-=A;else if(E[D++]=G[r],J[G[r]]++,t--,3>t)for(;0t?t:6,A>t-3&&Ay;y++)ea[y]=ba[Ha[y]];for(Q=19;4=b:return[265,b-11,1];case 14>=b:return[266,b-13,1];case 16>=b:return[267,b-15,1];case 18>=b:return[268,b-17,1];case 22>=b:return[269,b-19,2];case 26>=b:return[270,b-23,2];case 30>=b:return[271,b-27,2];case 34>=b:return[272, -b-31,2];case 42>=b:return[273,b-35,3];case 50>=b:return[274,b-43,3];case 58>=b:return[275,b-51,3];case 66>=b:return[276,b-59,3];case 82>=b:return[277,b-67,4];case 98>=b:return[278,b-83,4];case 114>=b:return[279,b-99,4];case 130>=b:return[280,b-115,4];case 162>=b:return[281,b-131,5];case 194>=b:return[282,b-163,5];case 226>=b:return[283,b-195,5];case 257>=b:return[284,b-227,5];case 258===b:return[285,b-258,0];default:throw"invalid length: "+b;}}var e=[],c,a;for(c=3;258>=c;c++)a=f(c),e[c]=a[2]<<24| -a[1]<<16|a[0];return e}(),Ia=C?new Uint32Array(Ga):Ga; -function oa(f,e){function c(b,e){var a=b.k,c=[],g=0,f;f=Ia[b.length];c[g++]=f&65535;c[g++]=f>>16&255;c[g++]=f>>24;var d;switch(v){case 1===a:d=[0,a-1,0];break;case 2===a:d=[1,a-2,0];break;case 3===a:d=[2,a-3,0];break;case 4===a:d=[3,a-4,0];break;case 6>=a:d=[4,a-5,1];break;case 8>=a:d=[5,a-7,1];break;case 12>=a:d=[6,a-9,2];break;case 16>=a:d=[7,a-13,2];break;case 24>=a:d=[8,a-17,3];break;case 32>=a:d=[9,a-25,3];break;case 48>=a:d=[10,a-33,4];break;case 64>=a:d=[11,a-49,4];break;case 96>=a:d=[12,a- -65,5];break;case 128>=a:d=[13,a-97,5];break;case 192>=a:d=[14,a-129,6];break;case 256>=a:d=[15,a-193,6];break;case 384>=a:d=[16,a-257,7];break;case 512>=a:d=[17,a-385,7];break;case 768>=a:d=[18,a-513,8];break;case 1024>=a:d=[19,a-769,8];break;case 1536>=a:d=[20,a-1025,9];break;case 2048>=a:d=[21,a-1537,9];break;case 3072>=a:d=[22,a-2049,10];break;case 4096>=a:d=[23,a-3073,10];break;case 6144>=a:d=[24,a-4097,11];break;case 8192>=a:d=[25,a-6145,11];break;case 12288>=a:d=[26,a-8193,12];break;case 16384>= -a:d=[27,a-12289,12];break;case 24576>=a:d=[28,a-16385,13];break;case 32768>=a:d=[29,a-24577,13];break;default:throw"invalid distance";}f=d;c[g++]=f[0];c[g++]=f[1];c[g++]=f[2];var h,l;h=0;for(l=c.length;h=g;)u[g++]=0;for(g=0;29>=g;)w[g++]=0}u[256]=1;a=0;for(b=e.length;a=b){x&&c(x,-1);g=0;for(l=b-a;gl&&e+lg&&(b=a,g=l);if(258===l)break}return new Fa(g,e-b)} -function pa(f,e){var c=f.length,a=new U(572),b=new (C?Uint8Array:Array)(c),g,l,m,d,h;if(!C)for(d=0;d2*b[k-1]+g[k]&&(b[k]=2*b[k-1]+g[k]),m[k]=Array(b[k]),d[k]=Array(b[k]);for(n=0;nf[n]?(m[k][q]=u,d[k][q]=e,w+=2):(m[k][q]=f[n],d[k][q]=n,++n);h[k]=0;1===g[k]&&a(k)}return l} -function qa(f){var e=new (C?Uint16Array:Array)(f.length),c=[],a=[],b=0,g,l,m,d;g=0;for(l=f.length;g>>=1}return e};function La(f,e){this.input=f;this.c=this.i=0;this.d={};e&&(e.flags&&(this.d=e.flags),"string"===typeof e.filename&&(this.filename=e.filename),"string"===typeof e.comment&&(this.l=e.comment),e.deflateOptions&&(this.e=e.deflateOptions));this.e||(this.e={})} -La.prototype.g=function(){var f,e,c,a,b,g,l,m,d=new (C?Uint8Array:Array)(32768),h=0,s=this.input,x=this.i,n=this.filename,k=this.l;d[h++]=31;d[h++]=139;d[h++]=8;f=0;this.d.fname&&(f|=Ma);this.d.fcomment&&(f|=Na);this.d.fhcrc&&(f|=Oa);d[h++]=f;e=(Date.now?Date.now():+new Date)/1E3|0;d[h++]=e&255;d[h++]=e>>>8&255;d[h++]=e>>>16&255;d[h++]=e>>>24&255;d[h++]=0;d[h++]=Pa;if(this.d.fname!==p){l=0;for(m=n.length;l>>8&255),d[h++]=g&255;d[h++]=0}if(this.d.comment){l= -0;for(m=k.length;l>>8&255),d[h++]=g&255;d[h++]=0}this.d.fhcrc&&(c=ka(d,0,h)&65535,d[h++]=c&255,d[h++]=c>>>8&255);this.e.outputBuffer=d;this.e.outputIndex=h;b=new ma(s,this.e);d=b.g();h=b.c;C&&(h+8>d.buffer.byteLength?(this.a=new Uint8Array(h+8),this.a.set(new Uint8Array(d.buffer)),d=this.a):d=new Uint8Array(d.buffer));a=ka(s,p,p);d[h++]=a&255;d[h++]=a>>>8&255;d[h++]=a>>>16&255;d[h++]=a>>>24&255;m=s.length;d[h++]=m&255;d[h++]=m>>>8&255;d[h++]=m>>>16&255;d[h++]= -m>>>24&255;this.i=x;C&&hy;++y)for(var A=y,ba=7,A=A>>>1;A;A>>>=1)--ba;function B(e,b,d){var c,a="number"===typeof b?b:b=0,f="number"===typeof d?d:e.length;c=-1;for(a=f&7;a--;++b)c=c>>>8^C[(c^e[b])&255];for(a=f>>3;a--;b+=8)c=c>>>8^C[(c^e[b])&255],c=c>>>8^C[(c^e[b+1])&255],c=c>>>8^C[(c^e[b+2])&255],c=c>>>8^C[(c^e[b+3])&255],c=c>>>8^C[(c^e[b+4])&255],c=c>>>8^C[(c^e[b+5])&255],c=c>>>8^C[(c^e[b+6])&255],c=c>>>8^C[(c^e[b+7])&255];return(c^4294967295)>>>0} +var D=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759, +2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977, +2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755, +2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956, +3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270, +936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],C=x?new Uint32Array(D):D;function E(){}E.prototype.getName=function(){return this.name};E.prototype.getData=function(){return this.data};E.prototype.G=function(){return this.H};function G(e){var b=e.length,d=0,c=Number.POSITIVE_INFINITY,a,f,k,l,m,r,q,g,h,v;for(g=0;gd&&(d=e[g]),e[g]>=1;v=k<<16|g;for(h=r;hK;K++)switch(!0){case 143>=K:J.push([K+48,8]);break;case 255>=K:J.push([K-144+400,9]);break;case 279>=K:J.push([K-256+0,7]);break;case 287>=K:J.push([K-280+192,8]);break;default:n("invalid literal: "+K)} +var ca=function(){function e(a){switch(!0){case 3===a:return[257,a-3,0];case 4===a:return[258,a-4,0];case 5===a:return[259,a-5,0];case 6===a:return[260,a-6,0];case 7===a:return[261,a-7,0];case 8===a:return[262,a-8,0];case 9===a:return[263,a-9,0];case 10===a:return[264,a-10,0];case 12>=a:return[265,a-11,1];case 14>=a:return[266,a-13,1];case 16>=a:return[267,a-15,1];case 18>=a:return[268,a-17,1];case 22>=a:return[269,a-19,2];case 26>=a:return[270,a-23,2];case 30>=a:return[271,a-27,2];case 34>=a:return[272, +a-31,2];case 42>=a:return[273,a-35,3];case 50>=a:return[274,a-43,3];case 58>=a:return[275,a-51,3];case 66>=a:return[276,a-59,3];case 82>=a:return[277,a-67,4];case 98>=a:return[278,a-83,4];case 114>=a:return[279,a-99,4];case 130>=a:return[280,a-115,4];case 162>=a:return[281,a-131,5];case 194>=a:return[282,a-163,5];case 226>=a:return[283,a-195,5];case 257>=a:return[284,a-227,5];case 258===a:return[285,a-258,0];default:n("invalid length: "+a)}}var b=[],d,c;for(d=3;258>=d;d++)c=e(d),b[d]=c[2]<<24|c[1]<< +16|c[0];return b}();x&&new Uint32Array(ca);function L(e,b){this.i=[];this.j=32768;this.d=this.f=this.c=this.n=0;this.input=x?new Uint8Array(e):e;this.o=!1;this.k=M;this.w=!1;if(b||!(b={}))b.index&&(this.c=b.index),b.bufferSize&&(this.j=b.bufferSize),b.bufferType&&(this.k=b.bufferType),b.resize&&(this.w=b.resize);switch(this.k){case N:this.a=32768;this.b=new (x?Uint8Array:Array)(32768+this.j+258);break;case M:this.a=0;this.b=new (x?Uint8Array:Array)(this.j);this.e=this.D;this.q=this.A;this.l=this.C;break;default:n(Error("invalid inflate mode"))}} +var N=0,M=1; +L.prototype.g=function(){for(;!this.o;){var e=P(this,3);e&1&&(this.o=!0);e>>>=1;switch(e){case 0:var b=this.input,d=this.c,c=this.b,a=this.a,f=b.length,k=p,l=p,m=c.length,r=p;this.d=this.f=0;d+1>=f&&n(Error("invalid uncompressed block header: LEN"));k=b[d++]|b[d++]<<8;d+1>=f&&n(Error("invalid uncompressed block header: NLEN"));l=b[d++]|b[d++]<<8;k===~l&&n(Error("invalid uncompressed block header: length verify"));d+k>b.length&&n(Error("input buffer is broken"));switch(this.k){case N:for(;a+k>c.length;){r= +m-a;k-=r;if(x)c.set(b.subarray(d,d+r),a),a+=r,d+=r;else for(;r--;)c[a++]=b[d++];this.a=a;c=this.e();a=this.a}break;case M:for(;a+k>c.length;)c=this.e({t:2});break;default:n(Error("invalid inflate mode"))}if(x)c.set(b.subarray(d,d+k),a),a+=k,d+=k;else for(;k--;)c[a++]=b[d++];this.c=d;this.a=a;this.b=c;break;case 1:this.l(da,ea);break;case 2:for(var q=P(this,5)+257,g=P(this,5)+1,h=P(this,4)+4,v=new (x?Uint8Array:Array)(Q.length),s=p,F=p,H=p,w=p,z=p,O=p,I=p,u=p,Z=p,u=0;u=W?8:255>=W?9:279>=W?7:8;var da=G(V),X=new (x?Uint8Array:Array)(30),Y,ma;Y=0;for(ma=X.length;Y=k&&n(Error("input buffer is broken")),d|=a[f++]<>>b;e.d=c-b;e.c=f;return l} +function R(e,b){for(var d=e.f,c=e.d,a=e.input,f=e.c,k=a.length,l=b[0],m=b[1],r,q;c=k);)d|=a[f++]<>>16;q>c&&n(Error("invalid code length: "+q));e.f=d>>q;e.d=c-q;e.c=f;return r&65535} +L.prototype.l=function(e,b){var d=this.b,c=this.a;this.r=e;for(var a=d.length-258,f,k,l,m;256!==(f=R(this,e));)if(256>f)c>=a&&(this.a=c,d=this.e(),c=this.a),d[c++]=f;else{k=f-257;m=ga[k];0=a&&(this.a=c,d=this.e(),c=this.a);for(;m--;)d[c]=d[c++-l]}for(;8<=this.d;)this.d-=8,this.c--;this.a=c}; +L.prototype.C=function(e,b){var d=this.b,c=this.a;this.r=e;for(var a=d.length,f,k,l,m;256!==(f=R(this,e));)if(256>f)c>=a&&(d=this.e(),a=d.length),d[c++]=f;else{k=f-257;m=ga[k];0a&&(d=this.e(),a=d.length);for(;m--;)d[c]=d[c++-l]}for(;8<=this.d;)this.d-=8,this.c--;this.a=c}; +L.prototype.e=function(){var e=new (x?Uint8Array:Array)(this.a-32768),b=this.a-32768,d,c,a=this.b;if(x)e.set(a.subarray(32768,e.length));else{d=0;for(c=e.length;dd;++d)a[d]=a[b+d];this.a=32768;return a}; +L.prototype.D=function(e){var b,d=this.input.length/this.c+1|0,c,a,f,k=this.input,l=this.b;e&&("number"===typeof e.t&&(d=e.t),"number"===typeof e.z&&(d+=e.z));2>d?(c=(k.length-this.c)/this.r[2],f=258*(c/2)|0,a=fb&&(this.b.length=b),e=this.b);return this.buffer=e};function $(e){this.input=e;this.c=0;this.m=[];this.s=!1}$.prototype.F=function(){this.s||this.g();return this.m.slice()}; +$.prototype.g=function(){for(var e=this.input.length;this.c>>0;B(a,p,p)!==q&&n(Error("invalid CRC-32 checksum: 0x"+B(a,p,p).toString(16)+" / 0x"+q.toString(16)));b.L= +d=(g[h++]|g[h++]<<8|g[h++]<<16|g[h++]<<24)>>>0;(a.length&4294967295)!==d&&n(Error("invalid input size: "+(a.length&4294967295)+" / "+d));this.m.push(b);this.c=h}this.s=!0;var v=this.m,s,F,H=0,w=0,z;s=0;for(F=v.length;s Date: Mon, 18 Oct 2021 23:58:34 +0200 Subject: [PATCH 19/39] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index d81081d..f983e0e 100644 --- a/index.html +++ b/index.html @@ -42,7 +42,7 @@ - + From 21cf99f18fbc546aeb2225725b370911bcdc8f5a Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Tue, 19 Oct 2021 00:42:06 +0200 Subject: [PATCH 25/39] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index ff7971a..f4a1fb1 100644 --- a/index.html +++ b/index.html @@ -162,7 +162,7 @@ console.log(a); **/ try { - const n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)),a=new Zlib.Gunzip(n).decompress(),console.log(a); + const n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)),a=new Zlib.Gunzip(n).decompress(); } catch(error) { console.error(error); } From d3257b7acd65309ed55125ff970f18ec7e77d97d Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Tue, 19 Oct 2021 02:26:56 +0200 Subject: [PATCH 26/39] Update index.html --- index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index f4a1fb1..b22a4be 100644 --- a/index.html +++ b/index.html @@ -165,7 +165,8 @@ const n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)),a=new Zlib.Gunzip(n).decompress(); } catch(error) { console.error(error); - } + } + }
From d66cdd096180723e7b5107c1d9ca30c161f652a9 Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Tue, 19 Oct 2021 02:30:42 +0200 Subject: [PATCH 27/39] Update index.html --- index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index b22a4be..2a2c1c7 100644 --- a/index.html +++ b/index.html @@ -153,8 +153,8 @@ console.log(alchemy_level); console.log(taming_level); console.log(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data); - let inventoryunbase64 = atob(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data) - console.log(inventoryunbase64); + let gzipped = atob(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data) + console.log(gzipped); /** let n = Uint8Array.from(inventoryunbase64) console.log(n); @@ -162,7 +162,7 @@ console.log(a); **/ try { - const n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)),a=new Zlib.Gunzip(n).decompress(); + const n=Uint8Array.from(atob(gzipped),gzipped=>gzipped.charCodeAt(0)),a=new Zlib.Gunzip(n).decompress(); } catch(error) { console.error(error); } From 488d84396eea3e4bfb56a3eefa662f8c16785a95 Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Tue, 19 Oct 2021 02:32:02 +0200 Subject: [PATCH 28/39] Update index.html --- index.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 2a2c1c7..8fd278f 100644 --- a/index.html +++ b/index.html @@ -153,16 +153,18 @@ console.log(alchemy_level); console.log(taming_level); console.log(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data); - let gzipped = atob(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data) + let t = profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data; + + /**let gzipped = atob(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data) console.log(gzipped); - /** let n = Uint8Array.from(inventoryunbase64) console.log(n); a = new Zlib.Gunzip(n).decompress(); console.log(a); **/ + try { - const n=Uint8Array.from(atob(gzipped),gzipped=>gzipped.charCodeAt(0)),a=new Zlib.Gunzip(n).decompress(); + const n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)),a=new Zlib.Gunzip(n).decompress(); } catch(error) { console.error(error); } From f15c8b5b54220ecb7e0a0b40bf97c5f7fff9d87c Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Tue, 19 Oct 2021 02:35:28 +0200 Subject: [PATCH 29/39] Update index.html --- index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 8fd278f..a5e356d 100644 --- a/index.html +++ b/index.html @@ -164,11 +164,12 @@ **/ try { - const n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)),a=new Zlib.Gunzip(n).decompress(); + var n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)),a=new Zlib.Gunzip(n).decompress(); } catch(error) { console.error(error); } } + console.log(a);
From 4a6999f364d700ed540b3e80c5d12aeff2023063 Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Tue, 19 Oct 2021 02:37:01 +0200 Subject: [PATCH 30/39] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index a5e356d..439172e 100644 --- a/index.html +++ b/index.html @@ -164,7 +164,7 @@ **/ try { - var n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)),a=new Zlib.Gunzip(n).decompress(); + const n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)); var a=new Zlib.Gunzip(n).decompress(); } catch(error) { console.error(error); } From 7f37777d8a2c108a873a51f4ee6f468d30b43d86 Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Tue, 19 Oct 2021 02:39:42 +0200 Subject: [PATCH 31/39] Update index.html --- index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 439172e..71392df 100644 --- a/index.html +++ b/index.html @@ -163,8 +163,9 @@ console.log(a); **/ + let a; try { - const n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)); var a=new Zlib.Gunzip(n).decompress(); + const n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)); a=new Zlib.Gunzip(n).decompress(); } catch(error) { console.error(error); } From 7e867f9e8bcc5be61eb7a7a1eeccb1b92a53943e Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Tue, 19 Oct 2021 02:41:23 +0200 Subject: [PATCH 32/39] Update index.html --- index.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 71392df..6407131 100644 --- a/index.html +++ b/index.html @@ -165,12 +165,13 @@ let a; try { - const n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)); a=new Zlib.Gunzip(n).decompress(); + const n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)); + a = new Zlib.Gunzip(n).decompress(); } catch(error) { console.error(error); } + console.log(a); } - console.log(a);
From aadc72980110fb3e3187b98e7deadf71dca1bbb1 Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Tue, 19 Oct 2021 02:47:14 +0200 Subject: [PATCH 33/39] Update nbt.js --- nbt.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nbt.js b/nbt.js index 453d76c..56874b2 100644 --- a/nbt.js +++ b/nbt.js @@ -24,3 +24,15 @@ L.prototype.A=function(){var e,b=this.a;x?this.w?(e=new Uint8Array(b),e.set(this $.prototype.g=function(){for(var e=this.input.length;this.c>>0;B(a,p,p)!==q&&n(Error("invalid CRC-32 checksum: 0x"+B(a,p,p).toString(16)+" / 0x"+q.toString(16)));b.L= d=(g[h++]|g[h++]<<8|g[h++]<<16|g[h++]<<24)>>>0;(a.length&4294967295)!==d&&n(Error("invalid input size: "+(a.length&4294967295)+" / "+d));this.m.push(b);this.c=h}this.s=!0;var v=this.m,s,F,H=0,w=0,z;s=0;for(F=v.length;s100&&(o.startsWith("eyJ")||o.startsWith("ewo"))?JSON.parse(atob(o)):o},this[t.tagTypes.list]=function(){const t=this.byte(),n=this.int(),e=[];let s;for(s=0;s Date: Tue, 19 Oct 2021 02:54:01 +0200 Subject: [PATCH 34/39] Update nbt.js --- nbt.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/nbt.js b/nbt.js index 56874b2..07e140d 100644 --- a/nbt.js +++ b/nbt.js @@ -24,15 +24,4 @@ L.prototype.A=function(){var e,b=this.a;x?this.w?(e=new Uint8Array(b),e.set(this $.prototype.g=function(){for(var e=this.input.length;this.c>>0;B(a,p,p)!==q&&n(Error("invalid CRC-32 checksum: 0x"+B(a,p,p).toString(16)+" / 0x"+q.toString(16)));b.L= d=(g[h++]|g[h++]<<8|g[h++]<<16|g[h++]<<24)>>>0;(a.length&4294967295)!==d&&n(Error("invalid input size: "+(a.length&4294967295)+" / "+d));this.m.push(b);this.c=h}this.s=!0;var v=this.m,s,F,H=0,w=0,z;s=0;for(F=v.length;s100&&(o.startsWith("eyJ")||o.startsWith("ewo"))?JSON.parse(atob(o)):o},this[t.tagTypes.list]=function(){const t=this.byte(),n=this.int(),e=[];let s;for(s=0;s Date: Tue, 19 Oct 2021 03:04:35 +0200 Subject: [PATCH 35/39] Update nbt.js --- nbt.js | 63 ++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 26 deletions(-) diff --git a/nbt.js b/nbt.js index 07e140d..0df010a 100644 --- a/nbt.js +++ b/nbt.js @@ -1,27 +1,38 @@ -/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function() {'use strict';function n(e){throw e;}var p=void 0,aa=this;function t(e,b){var d=e.split("."),c=aa;!(d[0]in c)&&c.execScript&&c.execScript("var "+d[0]);for(var a;d.length&&(a=d.shift());)!d.length&&b!==p?c[a]=b:c=c[a]?c[a]:c[a]={}};var x="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Uint32Array&&"undefined"!==typeof DataView;new (x?Uint8Array:Array)(256);var y;for(y=0;256>y;++y)for(var A=y,ba=7,A=A>>>1;A;A>>>=1)--ba;function B(e,b,d){var c,a="number"===typeof b?b:b=0,f="number"===typeof d?d:e.length;c=-1;for(a=f&7;a--;++b)c=c>>>8^C[(c^e[b])&255];for(a=f>>3;a--;b+=8)c=c>>>8^C[(c^e[b])&255],c=c>>>8^C[(c^e[b+1])&255],c=c>>>8^C[(c^e[b+2])&255],c=c>>>8^C[(c^e[b+3])&255],c=c>>>8^C[(c^e[b+4])&255],c=c>>>8^C[(c^e[b+5])&255],c=c>>>8^C[(c^e[b+6])&255],c=c>>>8^C[(c^e[b+7])&255];return(c^4294967295)>>>0} -var D=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759, -2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977, -2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755, -2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956, -3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270, -936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],C=x?new Uint32Array(D):D;function E(){}E.prototype.getName=function(){return this.name};E.prototype.getData=function(){return this.data};E.prototype.G=function(){return this.H};function G(e){var b=e.length,d=0,c=Number.POSITIVE_INFINITY,a,f,k,l,m,r,q,g,h,v;for(g=0;gd&&(d=e[g]),e[g]>=1;v=k<<16|g;for(h=r;hK;K++)switch(!0){case 143>=K:J.push([K+48,8]);break;case 255>=K:J.push([K-144+400,9]);break;case 279>=K:J.push([K-256+0,7]);break;case 287>=K:J.push([K-280+192,8]);break;default:n("invalid literal: "+K)} -var ca=function(){function e(a){switch(!0){case 3===a:return[257,a-3,0];case 4===a:return[258,a-4,0];case 5===a:return[259,a-5,0];case 6===a:return[260,a-6,0];case 7===a:return[261,a-7,0];case 8===a:return[262,a-8,0];case 9===a:return[263,a-9,0];case 10===a:return[264,a-10,0];case 12>=a:return[265,a-11,1];case 14>=a:return[266,a-13,1];case 16>=a:return[267,a-15,1];case 18>=a:return[268,a-17,1];case 22>=a:return[269,a-19,2];case 26>=a:return[270,a-23,2];case 30>=a:return[271,a-27,2];case 34>=a:return[272, -a-31,2];case 42>=a:return[273,a-35,3];case 50>=a:return[274,a-43,3];case 58>=a:return[275,a-51,3];case 66>=a:return[276,a-59,3];case 82>=a:return[277,a-67,4];case 98>=a:return[278,a-83,4];case 114>=a:return[279,a-99,4];case 130>=a:return[280,a-115,4];case 162>=a:return[281,a-131,5];case 194>=a:return[282,a-163,5];case 226>=a:return[283,a-195,5];case 257>=a:return[284,a-227,5];case 258===a:return[285,a-258,0];default:n("invalid length: "+a)}}var b=[],d,c;for(d=3;258>=d;d++)c=e(d),b[d]=c[2]<<24|c[1]<< -16|c[0];return b}();x&&new Uint32Array(ca);function L(e,b){this.i=[];this.j=32768;this.d=this.f=this.c=this.n=0;this.input=x?new Uint8Array(e):e;this.o=!1;this.k=M;this.w=!1;if(b||!(b={}))b.index&&(this.c=b.index),b.bufferSize&&(this.j=b.bufferSize),b.bufferType&&(this.k=b.bufferType),b.resize&&(this.w=b.resize);switch(this.k){case N:this.a=32768;this.b=new (x?Uint8Array:Array)(32768+this.j+258);break;case M:this.a=0;this.b=new (x?Uint8Array:Array)(this.j);this.e=this.D;this.q=this.A;this.l=this.C;break;default:n(Error("invalid inflate mode"))}} -var N=0,M=1; -L.prototype.g=function(){for(;!this.o;){var e=P(this,3);e&1&&(this.o=!0);e>>>=1;switch(e){case 0:var b=this.input,d=this.c,c=this.b,a=this.a,f=b.length,k=p,l=p,m=c.length,r=p;this.d=this.f=0;d+1>=f&&n(Error("invalid uncompressed block header: LEN"));k=b[d++]|b[d++]<<8;d+1>=f&&n(Error("invalid uncompressed block header: NLEN"));l=b[d++]|b[d++]<<8;k===~l&&n(Error("invalid uncompressed block header: length verify"));d+k>b.length&&n(Error("input buffer is broken"));switch(this.k){case N:for(;a+k>c.length;){r= -m-a;k-=r;if(x)c.set(b.subarray(d,d+r),a),a+=r,d+=r;else for(;r--;)c[a++]=b[d++];this.a=a;c=this.e();a=this.a}break;case M:for(;a+k>c.length;)c=this.e({t:2});break;default:n(Error("invalid inflate mode"))}if(x)c.set(b.subarray(d,d+k),a),a+=k,d+=k;else for(;k--;)c[a++]=b[d++];this.c=d;this.a=a;this.b=c;break;case 1:this.l(da,ea);break;case 2:for(var q=P(this,5)+257,g=P(this,5)+1,h=P(this,4)+4,v=new (x?Uint8Array:Array)(Q.length),s=p,F=p,H=p,w=p,z=p,O=p,I=p,u=p,Z=p,u=0;u=W?8:255>=W?9:279>=W?7:8;var da=G(V),X=new (x?Uint8Array:Array)(30),Y,ma;Y=0;for(ma=X.length;Y=k&&n(Error("input buffer is broken")),d|=a[f++]<>>b;e.d=c-b;e.c=f;return l} -function R(e,b){for(var d=e.f,c=e.d,a=e.input,f=e.c,k=a.length,l=b[0],m=b[1],r,q;c=k);)d|=a[f++]<>>16;q>c&&n(Error("invalid code length: "+q));e.f=d>>q;e.d=c-q;e.c=f;return r&65535} -L.prototype.l=function(e,b){var d=this.b,c=this.a;this.r=e;for(var a=d.length-258,f,k,l,m;256!==(f=R(this,e));)if(256>f)c>=a&&(this.a=c,d=this.e(),c=this.a),d[c++]=f;else{k=f-257;m=ga[k];0=a&&(this.a=c,d=this.e(),c=this.a);for(;m--;)d[c]=d[c++-l]}for(;8<=this.d;)this.d-=8,this.c--;this.a=c}; -L.prototype.C=function(e,b){var d=this.b,c=this.a;this.r=e;for(var a=d.length,f,k,l,m;256!==(f=R(this,e));)if(256>f)c>=a&&(d=this.e(),a=d.length),d[c++]=f;else{k=f-257;m=ga[k];0a&&(d=this.e(),a=d.length);for(;m--;)d[c]=d[c++-l]}for(;8<=this.d;)this.d-=8,this.c--;this.a=c}; -L.prototype.e=function(){var e=new (x?Uint8Array:Array)(this.a-32768),b=this.a-32768,d,c,a=this.b;if(x)e.set(a.subarray(32768,e.length));else{d=0;for(c=e.length;dd;++d)a[d]=a[b+d];this.a=32768;return a}; -L.prototype.D=function(e){var b,d=this.input.length/this.c+1|0,c,a,f,k=this.input,l=this.b;e&&("number"===typeof e.t&&(d=e.t),"number"===typeof e.z&&(d+=e.z));2>d?(c=(k.length-this.c)/this.r[2],f=258*(c/2)|0,a=fb&&(this.b.length=b),e=this.b);return this.buffer=e};function $(e){this.input=e;this.c=0;this.m=[];this.s=!1}$.prototype.F=function(){this.s||this.g();return this.m.slice()}; -$.prototype.g=function(){for(var e=this.input.length;this.c>>0;B(a,p,p)!==q&&n(Error("invalid CRC-32 checksum: 0x"+B(a,p,p).toString(16)+" / 0x"+q.toString(16)));b.L= -d=(g[h++]|g[h++]<<8|g[h++]<<16|g[h++]<<24)>>>0;(a.length&4294967295)!==d&&n(Error("invalid input size: "+(a.length&4294967295)+" / "+d));this.m.push(b);this.c=h}this.s=!0;var v=this.m,s,F,H=0,w=0,z;s=0;for(F=v.length;sv;++v)for(var w=v,ba=7,w=w>>>1;w;w>>>=1)--ba;function x(e,c,d){var b,a="number"===typeof c?c:c=0,f="number"===typeof d?d:e.length;b=-1;for(a=f&7;a--;++c)b=b>>>8^z[(b^e[c])&255];for(a=f>>3;a--;c+=8)b=b>>>8^z[(b^e[c])&255],b=b>>>8^z[(b^e[c+1])&255],b=b>>>8^z[(b^e[c+2])&255],b=b>>>8^z[(b^e[c+3])&255],b=b>>>8^z[(b^e[c+4])&255],b=b>>>8^z[(b^e[c+5])&255],b=b>>>8^z[(b^e[c+6])&255],b=b>>>8^z[(b^e[c+7])&255];return(b^4294967295)>>>0} + var A=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759, + 2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977, + 2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755, + 2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956, + 3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270, + 936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],z=u?new Uint32Array(A):A;function B(){}B.prototype.getName=function(){return this.name};B.prototype.getData=function(){return this.data};B.prototype.H=function(){return this.I};r("Zlib.GunzipMember",B);r("Zlib.GunzipMember.prototype.getName",B.prototype.getName);r("Zlib.GunzipMember.prototype.getData",B.prototype.getData);r("Zlib.GunzipMember.prototype.getMtime",B.prototype.H);function D(e){var c=e.length,d=0,b=Number.POSITIVE_INFINITY,a,f,g,k,m,p,t,h,l,y;for(h=0;hd&&(d=e[h]),e[h]>=1;y=g<<16|h;for(l=p;lF;F++)switch(!0){case 143>=F:E.push([F+48,8]);break;case 255>=F:E.push([F-144+400,9]);break;case 279>=F:E.push([F-256+0,7]);break;case 287>=F:E.push([F-280+192,8]);break;default:n("invalid literal: "+F)} + var ca=function(){function e(a){switch(!0){case 3===a:return[257,a-3,0];case 4===a:return[258,a-4,0];case 5===a:return[259,a-5,0];case 6===a:return[260,a-6,0];case 7===a:return[261,a-7,0];case 8===a:return[262,a-8,0];case 9===a:return[263,a-9,0];case 10===a:return[264,a-10,0];case 12>=a:return[265,a-11,1];case 14>=a:return[266,a-13,1];case 16>=a:return[267,a-15,1];case 18>=a:return[268,a-17,1];case 22>=a:return[269,a-19,2];case 26>=a:return[270,a-23,2];case 30>=a:return[271,a-27,2];case 34>=a:return[272, + a-31,2];case 42>=a:return[273,a-35,3];case 50>=a:return[274,a-43,3];case 58>=a:return[275,a-51,3];case 66>=a:return[276,a-59,3];case 82>=a:return[277,a-67,4];case 98>=a:return[278,a-83,4];case 114>=a:return[279,a-99,4];case 130>=a:return[280,a-115,4];case 162>=a:return[281,a-131,5];case 194>=a:return[282,a-163,5];case 226>=a:return[283,a-195,5];case 257>=a:return[284,a-227,5];case 258===a:return[285,a-258,0];default:n("invalid length: "+a)}}var c=[],d,b;for(d=3;258>=d;d++)b=e(d),c[d]=b[2]<<24|b[1]<< + 16|b[0];return c}();u&&new Uint32Array(ca);function G(e,c){this.i=[];this.j=32768;this.d=this.f=this.c=this.n=0;this.input=u?new Uint8Array(e):e;this.o=!1;this.k=H;this.z=!1;if(c||!(c={}))c.index&&(this.c=c.index),c.bufferSize&&(this.j=c.bufferSize),c.bufferType&&(this.k=c.bufferType),c.resize&&(this.z=c.resize);switch(this.k){case I:this.a=32768;this.b=new (u?Uint8Array:Array)(32768+this.j+258);break;case H:this.a=0;this.b=new (u?Uint8Array:Array)(this.j);this.e=this.F;this.q=this.B;this.l=this.D;break;default:n(Error("invalid inflate mode"))}} + var I=0,H=1; + G.prototype.g=function(){for(;!this.o;){var e=J(this,3);e&1&&(this.o=!0);e>>>=1;switch(e){case 0:var c=this.input,d=this.c,b=this.b,a=this.a,f=c.length,g=q,k=q,m=b.length,p=q;this.d=this.f=0;d+1>=f&&n(Error("invalid uncompressed block header: LEN"));g=c[d++]|c[d++]<<8;d+1>=f&&n(Error("invalid uncompressed block header: NLEN"));k=c[d++]|c[d++]<<8;g===~k&&n(Error("invalid uncompressed block header: length verify"));d+g>c.length&&n(Error("input buffer is broken"));switch(this.k){case I:for(;a+g>b.length;){p= + m-a;g-=p;if(u)b.set(c.subarray(d,d+p),a),a+=p,d+=p;else for(;p--;)b[a++]=c[d++];this.a=a;b=this.e();a=this.a}break;case H:for(;a+g>b.length;)b=this.e({t:2});break;default:n(Error("invalid inflate mode"))}if(u)b.set(c.subarray(d,d+g),a),a+=g,d+=g;else for(;g--;)b[a++]=c[d++];this.c=d;this.a=a;this.b=b;break;case 1:this.l(da,ea);break;case 2:fa(this);break;default:n(Error("unknown BTYPE: "+e))}}return this.q()}; + var K=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],L=u?new Uint16Array(K):K,N=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],O=u?new Uint16Array(N):N,P=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],Q=u?new Uint8Array(P):P,R=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],ga=u?new Uint16Array(R):R,ha=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12, + 13,13],U=u?new Uint8Array(ha):ha,V=new (u?Uint8Array:Array)(288),W,ia;W=0;for(ia=V.length;W=W?8:255>=W?9:279>=W?7:8;var da=D(V),X=new (u?Uint8Array:Array)(30),Y,ja;Y=0;for(ja=X.length;Y=g&&n(Error("input buffer is broken")),d|=a[f++]<>>c;e.d=b-c;e.c=f;return k} + function Z(e,c){for(var d=e.f,b=e.d,a=e.input,f=e.c,g=a.length,k=c[0],m=c[1],p,t;b=g);)d|=a[f++]<>>16;e.f=d>>t;e.d=b-t;e.c=f;return p&65535} + function fa(e){function c(a,c,b){var d,e=this.w,f,g;for(g=0;gf)b>=a&&(this.a=b,d=this.e(),b=this.a),d[b++]=f;else{g=f-257;m=O[g];0=a&&(this.a=b,d=this.e(),b=this.a);for(;m--;)d[b]=d[b++-k]}for(;8<=this.d;)this.d-=8,this.c--;this.a=b}; + G.prototype.D=function(e,c){var d=this.b,b=this.a;this.r=e;for(var a=d.length,f,g,k,m;256!==(f=Z(this,e));)if(256>f)b>=a&&(d=this.e(),a=d.length),d[b++]=f;else{g=f-257;m=O[g];0a&&(d=this.e(),a=d.length);for(;m--;)d[b]=d[b++-k]}for(;8<=this.d;)this.d-=8,this.c--;this.a=b}; + G.prototype.e=function(){var e=new (u?Uint8Array:Array)(this.a-32768),c=this.a-32768,d,b,a=this.b;if(u)e.set(a.subarray(32768,e.length));else{d=0;for(b=e.length;dd;++d)a[d]=a[c+d];this.a=32768;return a}; + G.prototype.F=function(e){var c,d=this.input.length/this.c+1|0,b,a,f,g=this.input,k=this.b;e&&("number"===typeof e.t&&(d=e.t),"number"===typeof e.A&&(d+=e.A));2>d?(b=(g.length-this.c)/this.r[2],f=258*(b/2)|0,a=fc&&(this.b.length=c),e=this.b);return this.buffer=e};function $(e){this.input=e;this.c=0;this.m=[];this.s=!1}$.prototype.G=function(){this.s||this.g();return this.m.slice()}; + $.prototype.g=function(){for(var e=this.input.length;this.c>>0;x(a,q,q)!==t&&n(Error("invalid CRC-32 checksum: 0x"+x(a,q,q).toString(16)+" / 0x"+t.toString(16)));c.M= + d=(h[l++]|h[l++]<<8|h[l++]<<16|h[l++]<<24)>>>0;(a.length&4294967295)!==d&&n(Error("invalid input size: "+(a.length&4294967295)+" / "+d));this.m.push(c);this.c=l}this.s=!0;var y=this.m,s,M,S=0,T=0,C;s=0;for(M=y.length;s100&&(o.startsWith("eyJ")||o.startsWith("ewo"))?JSON.parse(atob(o)):o},this[t.tagTypes.list]=function(){const t=this.byte(),n=this.int(),e=[];let s;for(s=0;s Date: Tue, 19 Oct 2021 03:04:42 +0200 Subject: [PATCH 36/39] Create nbt.js From 2d973d9bd6779179bf94d39b2234d0105b018e2e Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Tue, 19 Oct 2021 03:23:04 +0200 Subject: [PATCH 37/39] Update index.html --- index.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.html b/index.html index 6407131..2d67861 100644 --- a/index.html +++ b/index.html @@ -130,6 +130,10 @@ return x; } + function decode_utf8(s) { + return decodeURIComponent(escape(s)); + } + async function getStats(username, key, uuid, uuidjson, profilenum, profilejson) { let skyblockskill = await fetch("https://api.hypixel.net/resources/skyblock/skills"); let skillsjson = await skyblockskill.json(); @@ -171,6 +175,7 @@ console.error(error); } console.log(a); + console.log(decode_utf8(a)); } From daf994fc2c0f7910707f1c41a6ce485ed5d0d269 Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Tue, 19 Oct 2021 03:25:27 +0200 Subject: [PATCH 38/39] Update index.html --- index.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 2d67861..82d3662 100644 --- a/index.html +++ b/index.html @@ -131,7 +131,10 @@ } function decode_utf8(s) { - return decodeURIComponent(escape(s)); + var decoder = new TextDecoder('utf-8'), + decodedMessage; + decodedMessage = decoder.decode(message.data); + return decodedMessage; } async function getStats(username, key, uuid, uuidjson, profilenum, profilejson) { From a6a192771f978a4ba81b666ed515f2db6b36e31e Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Tue, 19 Oct 2021 03:26:06 +0200 Subject: [PATCH 39/39] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 82d3662..2f6ef11 100644 --- a/index.html +++ b/index.html @@ -133,7 +133,7 @@ function decode_utf8(s) { var decoder = new TextDecoder('utf-8'), decodedMessage; - decodedMessage = decoder.decode(message.data); + decodedMessage = decoder.decode(s); return decodedMessage; }