diff options
Diffstat (limited to 'build/cleaners')
-rw-r--r-- | build/cleaners/skyblock/inventory.js | 1 | ||||
-rw-r--r-- | build/cleaners/skyblock/member.js | 2 | ||||
-rw-r--r-- | build/cleaners/skyblock/profile.js | 12 |
3 files changed, 13 insertions, 2 deletions
diff --git a/build/cleaners/skyblock/inventory.js b/build/cleaners/skyblock/inventory.js index 0131e1b..400408c 100644 --- a/build/cleaners/skyblock/inventory.js +++ b/build/cleaners/skyblock/inventory.js @@ -20,6 +20,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.cleanInventories = exports.INVENTORIES = exports.cleanInventory = void 0; +// maybe todo?: create a fast replacement for prismarine-nbt const nbt = __importStar(require("prismarine-nbt")); function base64decode(base64) { return Buffer.from(base64, 'base64'); diff --git a/build/cleaners/skyblock/member.js b/build/cleaners/skyblock/member.js index 9869646..ce322bc 100644 --- a/build/cleaners/skyblock/member.js +++ b/build/cleaners/skyblock/member.js @@ -45,7 +45,7 @@ exports.cleanSkyBlockProfileMemberResponseBasic = cleanSkyBlockProfileMemberResp async function cleanSkyBlockProfileMemberResponse(member, included = null) { var _a; // profiles.members[] - const inventoriesIncluded = included == null || included.includes('inventories'); + const inventoriesIncluded = included === null || included.includes('inventories'); const player = await cached.fetchPlayer(member.uuid); if (!player) return; diff --git a/build/cleaners/skyblock/profile.js b/build/cleaners/skyblock/profile.js index ef90ce8..ba2c030 100644 --- a/build/cleaners/skyblock/profile.js +++ b/build/cleaners/skyblock/profile.js @@ -31,9 +31,19 @@ async function cleanSkyblockProfileResponse(data, options) { for (const memberUUID in data.members) { const memberRaw = data.members[memberUUID]; memberRaw.uuid = memberUUID; - promises.push(member_1.cleanSkyBlockProfileMemberResponse(memberRaw, ['stats', (options === null || options === void 0 ? void 0 : options.mainMemberUuid) === memberUUID ? 'inventories' : undefined])); + promises.push(member_1.cleanSkyBlockProfileMemberResponse(memberRaw, [ + !(options === null || options === void 0 ? void 0 : options.basic) ? 'stats' : undefined, + (options === null || options === void 0 ? void 0 : options.mainMemberUuid) === memberUUID ? 'inventories' : undefined + ])); } const cleanedMembers = (await Promise.all(promises)).filter(m => m !== null && m !== undefined); + if (options === null || options === void 0 ? void 0 : options.basic) { + return { + uuid: data.profile_id, + name: data.cute_name, + members: cleanedMembers, + }; + } const memberMinions = []; for (const member of cleanedMembers) { memberMinions.push(member.minions); |