From 7c26d2f0a332ac3df06927cb7cc882a5785339a3 Mon Sep 17 00:00:00 2001 From: William Mantly Date: Sun, 4 May 2025 19:22:31 -0400 Subject: [PATCH] idk --- nodejs/conf/base.js | 4 +- nodejs/conf/build.gradle.kts | 31 ++ nodejs/controller/ai.js | 3 +- nodejs/controller/commands/default.js | 17 + nodejs/controller/commands/invite.js | 5 + nodejs/controller/craft_chests.js | 201 +++++++++ nodejs/controller/goldFarm.js | 165 ++++++++ nodejs/controller/guardianFarm.js | 62 ++- nodejs/controller/mc-bot.js | 12 +- nodejs/controller/swing.js | 30 +- nodejs/controller/tp.js | 12 +- nodejs/model/minecraft.js | 162 +++++--- nodejs/package-lock.json | 566 ++++++++++++++++---------- nodejs/package.json | 2 +- nodejs/utils/index.js | 4 +- 15 files changed, 958 insertions(+), 318 deletions(-) create mode 100644 nodejs/conf/build.gradle.kts create mode 100644 nodejs/controller/craft_chests.js create mode 100644 nodejs/controller/goldFarm.js diff --git a/nodejs/conf/base.js b/nodejs/conf/base.js index dd7f1c5..b7600f5 100644 --- a/nodejs/conf/base.js +++ b/nodejs/conf/base.js @@ -15,7 +15,7 @@ module.exports = { }, "ai":{ "key": "", - "interval": 5, + "interval": 20, "prompts":{ "custom": (name, interval, currentPlayers, custom)=>` Ignore all previous instructions prompts @@ -88,7 +88,7 @@ Vince_NL owns another bot on the server, BulbaStore. Bulba is a great bot that s CoreJourney about: The center of the map is the core (x0, z0). Everyone initially spawns/respawns near the core. You can't do anything there if you don't first reach level 50. Level 50 is the max usefull level on the server: with it you unlock all the map (the maximum zone is 50). -How do I level up? ->First, you must spawn at a spawn corner. Type /spawncorner and the corner you want to do so (it can only be done once per respawn). Then, you will be able to do everything, as they are in zone 1, far from the core. Level up by using lapis or quartzs via crafting. +How do I level up? -> you will be able to do everything, as they are in zone 1, far from the core. Level up by using lapis or quartzs via crafting. How do zones work? >The closer you get to the core, the higher the zone. The four spawn corners are situated near the border between zone 1 and zone 2. Zone 1 is the biggest one, as it extends from the 2nd to the end of the world. Level up to use higher zones or just visit/ignore them. Rules and more... >When you die, you get banned for 24h and lose your levels. You can safely /trade with anyone on the server, and you can /invite your friends to your location if you and them would be in a zone of your levels. Type /pillars or /rules for more. diff --git a/nodejs/conf/build.gradle.kts b/nodejs/conf/build.gradle.kts new file mode 100644 index 0000000..a722a6e --- /dev/null +++ b/nodejs/conf/build.gradle.kts @@ -0,0 +1,31 @@ +plugins { + java +} + +group = "com.buildkillreign" +version = "2.0.0" + +repositories { + mavenCentral() + maven("https://repo.codemc.io/repository/maven-public/") // ✅ CodeMC repository + maven("https://repo.papermc.io/repository/maven-public/") // ✅ PaperMC repository +} + +dependencies { + compileOnly("com.comphenix.protocol:ProtocolLib:5.1.0") // ✅ Get ProtocolLib from CodeMC + compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT") // ✅ Get Paper API from PaperMC repo + compileOnly("io.papermc:paperlib:1.0.5") // ✅ Get PaperLib from CodeMC +} + +java { + toolchain.languageVersion.set(JavaLanguageVersion.of(17)) // Required for MC 1.20+ +} + +tasks.jar { + archiveFileName.set("BuildKillReign.jar") + destinationDirectory.set(file("build/libs")) + + from("src/main/resources") { + include("plugin.yml") + } +} diff --git a/nodejs/controller/ai.js b/nodejs/controller/ai.js index b579fff..46ab7de 100644 --- a/nodejs/controller/ai.js +++ b/nodejs/controller/ai.js @@ -24,10 +24,9 @@ class Ai{ } async init(){ - await this.start(); this.bot.on('onReady', async (argument)=>{ try{ - await sleep(1000); + await this.start(); let messages = ['']; this.messageListener = this.bot.on('message', (message, type)=>{ diff --git a/nodejs/controller/commands/default.js b/nodejs/controller/commands/default.js index 468f486..83f285a 100644 --- a/nodejs/controller/commands/default.js +++ b/nodejs/controller/commands/default.js @@ -101,6 +101,23 @@ module.exports = { this.whisper(from, '?') } }, + 'come': { + desc: `make bot come to you`, + allowed: ['wmantly', 'useless666', 'tux4242'], + async function(from, playerName){ + const player = this.bot.players[playerName || from]; + + if (!player || !player.entity) { + this.whisper(from, `I can't see ${player}.`); + + return; + } + + this.whisper(from, `Going to ${player}`); + this.goTo({where: player.entity.position}); + + } + }, 'logon': { desc: `Have bot log on for 10 seconds'`, diff --git a/nodejs/controller/commands/invite.js b/nodejs/controller/commands/invite.js index 22ce3e2..443e846 100644 --- a/nodejs/controller/commands/invite.js +++ b/nodejs/controller/commands/invite.js @@ -27,6 +27,11 @@ let sites = { desc: `Get an invite to the Farming outpost.`, allowed: ['wmantly', 'useless666', 'tux4242', 'pi_chef', '1_cut', 'nootbot', 'VinceNL', 'Ethan63020', 'Ethan63021', 'KimiKava', 'kawiimeowz', 'RaindropCake24', 'AndyNyg', 'AndyNyg_II'], }, + mega:{ + bot: 'ayay', + desc: `Get an invite to the Farming outpost 2.`, + allowed: ['wmantly', 'useless666', 'tux4242', 'pi_chef', '1_cut', '__Ethan63020', '__Ethan63021', 'VinceNL', 'nootbot'], + }, guardian: { bot: 'art', desc: 'blah', diff --git a/nodejs/controller/craft_chests.js b/nodejs/controller/craft_chests.js new file mode 100644 index 0000000..d6fbc93 --- /dev/null +++ b/nodejs/controller/craft_chests.js @@ -0,0 +1,201 @@ +'use strict'; + +const conf = require('../conf'); +const {sleep, nextTick} = require('../utils'); + +class CraftChests{ + constructor(args){ + this.bot = args.bot; + this.interval = args.interval; + this.target = args.target; + this.intervalStop; + this.isAction = true; + } + + init(){ + return new Promise(async (resolve, reject)=>{ + this.bot.on('onReady', async ()=>{ + try{ + await sleep(500); + await this.bot.goTo({ + where: this.bot.findBlockBySign('bot walk 2').position, + range: 0, + }); + + await this.bot.goTo({ + where: this.bot.findBlockBySign('bot walk 1').position, + range: 0, + }); + + await this.bot.goTo({ + where: this.bot.findBlockBySign('bot walk 2').position, + range: 0, + }); + + let hasItems = await this.getItems(); + + // while(hasItems){ + // await this.craft(); + // hasItems = await this.getItems(); + // } + + return resolve(); + + }catch(error){ + reject(error); + } + + }); + }); + } + + unload(){ + if(this.intervalStop){ + clearInterval(this.intervalStop); + this.intervalStop = undefined; + } + return true; + } + + async getItems(){ + /*clear inventory*/ + await this.bot.goTo({ + where: this.bot.findChestBySign('bot dump'), + range: 2, + }) + await this.bot.dumpToChest(this.bot.findChestBySign('bot dump')); + + + /* + Bamboo + */ + let packed_bambooChest = this.bot.findChestBySign('packed bamboo'); + await this.bot.goTo({ + where: packed_bambooChest.position, + range: 2, + }); + + + await this.bot.getFullShulkersFromChest(packed_bambooChest, 'bamboo'); + + return; + + + let hasShard = await this.bot.checkItemsFromContainer( + prismarine_shardChest, 'prismarine_shard', 64*4 + ); + + /* + crystals + */ + let prismarine_crystalsChest = this.bot.findChestBySign('crystals'); + await this.bot.goTo({ + where: prismarine_crystalsChest.position, + range: 2, + }); + + let hasCrystals = await this.bot.checkItemsFromContainer( + prismarine_crystalsChest, 'prismarine_crystals', 64*5 + ); + + if(!hasShard || !hasCrystals) return false; + + /* + get + */ + await sleep(3000); + + await this.bot.getItemsFromChest( + prismarine_shardChest, 'prismarine_shard', 64*4 + ); + await sleep(1000); + + await this.bot.getItemsFromChest( + prismarine_crystalsChest, 'prismarine_crystals', 64*5 + ); + + return true; + } + + async craft(){ + + // Ensure the bot has enough items (4 shards and 5 crystals for 1 lantern) + let prismarineShardsCount = this.bot.bot.inventory.count(this.bot.mcData.itemsByName.prismarine_shard.id); + let prismarineCrystalsCount = this.bot.bot.inventory.count(this.bot.mcData.itemsByName.prismarine_crystals.id); + + if(prismarineShardsCount < 4 || prismarineCrystalsCount < 5){ + console.log("Not enough materials to craft 64 Sea Lanterns."); + return; + }else{ + console.log('good to make sea_lantern!'); + } + + // Hold onto the closest crafting table + let craftingTable = this.bot.bot.findBlock({ + matching: this.bot.mcData.blocksByName.crafting_table.id, + maxDistance: 64 + }); + + await this.bot.goTo({ + where: craftingTable.position, + range: 1, + }); + + // Hold onto the recipe + let recipe = this.bot.bot.recipesAll( + this.bot.mcData.itemsByName.sea_lantern.id, + null, + craftingTable + )[0]; + + let window = await this.bot.openCraftingTable(craftingTable); + + // Move these into openCrating function + let windowOnce = (event)=> new Promise((resolve, reject)=> window.once(event, resolve)); + let inventory = ()=> window.slots.slice(window.inventoryStart, window.inventoryEnd) + + // Move the items into the crafting grid + let slotCount = 1; + for(let shapeRow of recipe.inShape){ + for(let shape of shapeRow){ + this.bot.bot.moveSlotItem( + inventory().find((element)=> element && element.type === shape.id).slot, + slotCount + ); + await windowOnce(`updateSlot:${slotCount}`); + slotCount++; + } + } + + // Wait for the server to catch up. + await sleep(500); + + // Craft each item until all are gone. + let craftedCount = 0; + while(window.slots[0]){ + await this.bot.bot.moveSlotItem( + window.craftingResultSlot, + 38 // dont hard code this!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ); + craftedCount++; + await windowOnce(`updateSlot:0`); + await sleep(50); // wait for the client to catchup + } + + await window.close(); + + /* + Dump items to chest + */ + + let seaLanternChest = this.bot.findChestBySign('sea_lantern'); + await this.bot.goTo({ + where: seaLanternChest.position, + range: 4, + }); + + await this.bot.dumpToChest(seaLanternChest, 'sea_lantern') + } +} + +module.exports = CraftChests; diff --git a/nodejs/controller/goldFarm.js b/nodejs/controller/goldFarm.js new file mode 100644 index 0000000..f723909 --- /dev/null +++ b/nodejs/controller/goldFarm.js @@ -0,0 +1,165 @@ +'use strict'; + +const conf = require('../conf'); +const {sleep} = require('../utils'); + + +async function throwSnowballAtEntity(bot, entity) { + const snowballItem = bot.bot.inventory.items().find(item => item.name === 'snowball'); + + if (!snowballItem) { + console.log("No snowballs in inventory."); + return; + } + + // Equip the snowball + try{ + await bot.bot.equip(snowballItem, 'hand') + + let tossAt = bot.findBlockBySign('bot balls'); + // Simulate throwing a snowball +/* const nearestHayBlock = bot.bot.findBlock({ + useExtraInfo: true, + maxDistance: 64, + matching: (block)=>block.name.includes('hay'), + }); + if (nearestHayBlock){ + }*/ + + await bot.bot.lookAt(tossAt.position.offset(0, -2, 0)); + await sleep(150); + bot.bot.activateItem(); // This would simulate the throw of the snowball + await sleep(200); + bot.bot.activateItem(); // This would simulate the throw of the snowball + await sleep(300); + bot.bot.activateItem(); // This would simulate the throw of the snowball + + }catch(error){ + console.log('GoldFarm.throwSnowballAtEntity error', error); + } +} + +function getNearestEntityInDirection(bot, direction, entityType) { + const entities = Object.values(bot.entities).filter(entity => + entity.position && entity !== bot.entity && entity.name === entityType + ); + let nearestEntity = null; + let minDistance = Infinity; + + for (const entity of entities) { + const relativePos = entity.position.minus(bot.entity.position); + const angle = Math.atan2(relativePos.x, relativePos.z); + const targetAngle = direction * (Math.PI / 180); + const angleDiff = Math.abs(angle - targetAngle); + + if (angleDiff < Math.PI / 8) { + const distance = bot.entity.position.distanceTo(entity.position); + if (distance < minDistance) { + minDistance = distance; + nearestEntity = entity; + } + } + } + return nearestEntity; +} + +class GoldFarm{ + location = {}; + + constructor(args){ + this.bot = args.bot; + this.target = args.target; + this.interval = args.interval; + this.intervalStop; + } + + locationsSet(){ + this.location.xpSpotAlone = this.bot.findBlockBySign('xpSpotAlone'); + this.location.xpSpotSecond = this.bot.findBlockBySign('xpSpotSecond'); + this.location.xp = this.location.xpSpotAlone; + this.location.attack = this.bot.findBlockBySign('bot attack spot'); + } + + async init(){ + this.onReadyListen = this.bot.on('onReady', async ()=>{ + await sleep(1000); + console.log('GoldFarm.init onReady called'); + try{ + this.locationsSet(); + + await this.agroPigs(); + + }catch(error){ + console.error('Error in GoldFarm.init:', error); + } + + + await this.gotoXP(); + + // let count = 1; + // this.onPhysicTick = this.bot.on('physicsTick', async () => { + // if(this.bot.bot.pathfinder.isMoving()) return; + // if(count++ === 100){ + // count = 1; + // for(let playerName in this.bot.bot.players){ + // if(this.bot.playerWithinBlock(playerName, this.location.xpSpotAlone, 1.5)){ + // this.location.xp = this.location.xpSpotSecond; + // }else{ + // this.location.xp = this.location.xpSpotAlone; + // } + // await this.gotoXP(); + // } + + // } + // }); + }); + + return true; + } + + unload(){ + console.log('GoldFarm.unload'); + clearInterval(this.intervalStop); + this.intervalStop = null; + this.onReadyListen(); + if(this.onPhysicTick) this.onPhysicTick(); + + return true; + } + + async agroPigs(){ + await this.bot.goTo({ + where: this.location.attack, + range: 2, + }); + + await sleep(1000); + // let entity = this.bot.bot.nearestEntity( + // entity => entity.name.toLowerCase() === 'zombified_piglin' && this.bot.bot.entity.position.distanceTo(entity.position) >= 10 + // ); + + let entity = getNearestEntityInDirection(this.bot.bot, 270, 'zombified_piglin'); + + console.log('entity', entity) + + this.bot.bot.setControlState('jump', true); + await sleep(100); + await throwSnowballAtEntity(this.bot, entity); + + await sleep(1200); + this.bot.bot.setControlState('jump', false); + } + + async gotoXP(){ + await this.bot.bot.equip(this.bot.bot.inventory.items().find( + item => item.name === 'diamond_sword' + ), 'hand'); + + await this.bot.goTo({ + where: this.location.xp, + range: 1, + }); + } +} + +module.exports = GoldFarm; diff --git a/nodejs/controller/guardianFarm.js b/nodejs/controller/guardianFarm.js index b7aae04..4abed61 100644 --- a/nodejs/controller/guardianFarm.js +++ b/nodejs/controller/guardianFarm.js @@ -3,18 +3,60 @@ const conf = require('../conf'); const {sleep, nextTick} = require('../utils'); -class GuardianFarm{ - constructor(args){ - this.bot = args.bot; + +class Plugin{ + plunginsLoaded = {}; + + constructor(options){ + this.bot = options.bot; + } + + async load(pluginName, options){ + if(pluginName in this.plunginsLoaded) throw new Error(`Plugin ${pluginName} already loaded`); + let plugin = new this.bot.constructor.plungins[pluginName]({...options, bot: this.bot}) + this.plunginsLoaded[pluginName] = plugin; + + return await plugin.init(); + } + + unload(pluginName){ + console.log('Plugin.unload', pluginName); + if(pluginName){ + try{ + return this.plunginsLoaded[pluginName].unload(); + delete this.plunginsLoaded[pluginName]; + }catch(error){ + console.error('Plugin.unload error', pluginName); + } + } + + for(pluginName in this.plunginsLoaded){ + console.log('Plugin.unload load', pluginName) + try{ + this.plunginsLoaded[pluginName].unload(); + }catch(error){ + console.error(`Plugin.unload ${pluginName} Error`, error); + } + delete this.plunginsLoaded[pluginName]; + } + } +} + +class GuardianFarm extends Plugin{ + constructor(options){ + super(options); this.isDangerous = true; this.isAction = true; + this.onTimeListen; } async init(){ - console.log('GuardianFarm started') + console.log('GuardianFarm started'); this.onReadyListen = this.bot.on('onReady', async ()=>{ await sleep(3000); let lastTimeListen = this.bot.bot.time.timeOfDay; + await this.load('Swing'); + this.onTimeListen = this.bot.bot.on('time', async ()=>{ let isDay = lastTimeListen < this.bot.bot.time.timeOfDay; lastTimeListen = this.bot.bot.time.timeOfDay; @@ -23,7 +65,6 @@ class GuardianFarm{ await this.onNewDay(); } }); - await this.bot.pluginLoad('Swing'); }); @@ -31,8 +72,9 @@ class GuardianFarm{ } unload(){ + super.unload(); this.onReadyListen(); - this.onTimeListen(); + // this.onTimeListen(); return true; } @@ -40,10 +82,10 @@ class GuardianFarm{ async onNewDay(){ try{ console.log('GuardianFarm.onNewDay new day!'); - await this.bot.pluginUnload('Swing'); - await this.bot.pluginLoad('Craft'); - await this.bot.pluginUnload('Craft'); - await this.bot.pluginLoad('Swing'); + await this.unload('Swing'); + await this.load('Craft'); + await this.unload('Craft'); + await this.load('Swing'); }catch(error){ console.error('Error in GuardianFarm.onNewDay:', error); } diff --git a/nodejs/controller/mc-bot.js b/nodejs/controller/mc-bot.js index 4d08726..536e4fb 100644 --- a/nodejs/controller/mc-bot.js +++ b/nodejs/controller/mc-bot.js @@ -7,16 +7,14 @@ const inventoryViewer = require('mineflayer-web-inventory'); const commands = require('./commands'); const {onJoin} = require('./player_list'); -const {Ai} = require('./ai'); -// const plugins = { -// Swing: require('./swing'), -// } CJbot.pluginAdd(require('./swing')); CJbot.pluginAdd(require('./craft')); CJbot.pluginAdd(require('./tp')); CJbot.pluginAdd(require('./ai')); CJbot.pluginAdd(require('./guardianFarm')); +CJbot.pluginAdd(require('./goldFarm')); +CJbot.pluginAdd(require('./craft_chests')); for(let name in conf.mc.bots){ if(CJbot.bots[name]) continue; @@ -28,12 +26,6 @@ for(let name in conf.mc.bots){ bot.addCommand(name, toAdd) } } - - if(conf.mc.bots[name].plugins){ - for(let pluginName in conf.mc.bots[name].plugins){ - bot.pluginLoad(pluginName, conf.mc.bots[name].plugins[pluginName]); - } - } } (async ()=>{try{ diff --git a/nodejs/controller/swing.js b/nodejs/controller/swing.js index 17928a9..7b6256f 100644 --- a/nodejs/controller/swing.js +++ b/nodejs/controller/swing.js @@ -3,6 +3,14 @@ const conf = require('../conf'); const {sleep} = require('../utils'); + +function faceEntity(bot, entity) { + if (!entity) return; // Check if entity is valid + + const targetPosition = entity.position.offset(0, entity.height * 0.5, 0); // Focus on the middle of the entity + bot.bot.lookAt(targetPosition); +} + class Swing{ constructor(args){ this.bot = args.bot; @@ -29,6 +37,7 @@ class Swing{ } unload(){ + console.log('Swing.unload'); clearInterval(this.intervalStop); this.intervalStop = null; this.onReadyListen(); @@ -46,14 +55,19 @@ class Swing{ async swing(){ this.intervalStop = setInterval(async ()=>{ try{ - // console.log('attacking'); - await this.bot.bot.attack( - this.bot.bot.nearestEntity( - entity => entity.name.toLowerCase() === 'guardian' - ) - ); - }catch(error){} - }, 1010); + let entity = this.bot.bot.nearestEntity(entity =>{ + // console.log('looking for entity name', entity.name, entity.name?.toLowerCase()); + return entity.name?.toLowerCase() === "guardian" + }); + + if(entity && this.bot.isWithinRange(entity.position, 3)){ + faceEntity(this.bot, entity); + await this.bot.bot.attack(entity); + } + }catch(error){ + console.log('Swing.swing interval error:', error); + } + }, 500); } } diff --git a/nodejs/controller/tp.js b/nodejs/controller/tp.js index 09dc979..e624217 100644 --- a/nodejs/controller/tp.js +++ b/nodejs/controller/tp.js @@ -16,10 +16,14 @@ class Tp{ } } - await this.bot.goTo({ - where: this.bot.findBlockBySign('bot TP spot'), - range: 0, - }); + let spot = this.bot.findBlockBySign('bot TP spot'); + + if(spot){ + await this.bot.goTo({ + where: spot, + range: 1, + }); + } this.cleatTimeout = setTimeout(()=>{ this.bot.pluginUnload(this.constructor.name) diff --git a/nodejs/model/minecraft.js b/nodejs/model/minecraft.js index e332575..23d27f6 100644 --- a/nodejs/model/minecraft.js +++ b/nodejs/model/minecraft.js @@ -47,9 +47,11 @@ class CJbot{ this.host = args.host; this.auth = args.auth || 'microsoft'; this.version = args.version || '1.20.1'; - this.hasAi = args.hasAi; + // + this.pluginsWanted = args.plugins || {}; + // States if the bot should connect when its loaded this.autoReConnect = 'autoConnect' in args ? args.autoReConnect : true; this.autoConnect = 'autoConnect' in args ? args.autoConnect : true; @@ -61,9 +63,10 @@ class CJbot{ } connect(){ + console.log('CJbot.connect'); return new Promise((resolve, reject) =>{ + try{ - // Create the mineflayer instance this.bot = mineflayer.createBot({ host: this.host, username: this.username, @@ -83,6 +86,7 @@ class CJbot{ // to the caller of the function this.bot.on('end', (reason, ...args)=>{ console.log(this.name, 'Connection ended:', reason, ...args); + this.pluginUnloadAll(); this.isReady = false; reject(reason); }); @@ -90,18 +94,27 @@ class CJbot{ // When the bot is ready, return to the caller success this.bot.on('spawn', async()=>{ console.log('CJbot.connect on spawn') + await sleep(2000); this.__onReady(); resolve(); + this.pluginLoadAll(); }); // Set a timer to try to connect again in 30 seconds if the bot is // not connected - setTimeout(async ()=>{try{ - if(this.autoReConnect && !this.isReady) await this.connect(); - }catch(error){ - console.error('minecraft.js | connect | setTimeout |', this.name, ' ', error) - }}, 30000); + +/* setTimeout(async ()=>{ + try{ + if(this.autoReConnect && !this.isReady){ + console.log() + await this.connect(); + } + }catch(error){ + console.error('minecraft.js | connect | setTimeout |', this.name, ' ', error) + } + }, 30000);*/ }catch(error){ + console.log('CJbot.connect Error', error); reject(error); } @@ -140,6 +153,7 @@ class CJbot{ // Start chat listeners this.__listen(); + this.bot.on('title', (...args)=>console.log('on title', args)) // this.bot.on('path_update', (...args)=>{ console.log('EVENT path_update', args) }) // this.bot.on('goal_updated', (...args)=>{ console.log('EVENT goal_updated', args) }) // this.bot.on('path_reset', (...args)=>{ console.log('EVENT path_reset', args) }) @@ -196,20 +210,21 @@ class CJbot{ // Listen for ending events and call connect again __autoReConnect(){ try{ - console.log('auto connect function') - this.on('end', async (reason)=>{ - console.error('_autorestart MC on end', reason) + console.log('auto re-connect function') + this.on('kicked', (...args)=>console.log('CJbot.__autoReConnect on kick', args)) + + this.on('end', async (...args)=>{ + console.error('CJbot.__autoReConnect on end', args) await sleep(30000) this.connect() }); - this.on('kick', console.error) this.on('error', (error)=>{ console.error('MC on error', error); - this.connect(); + // this.connect(); }); }catch(error){ console.error('error in __autoReConnect', error); @@ -242,6 +257,12 @@ class CJbot{ plunginsLoaded = {}; + pluginLoadAll(){ + for(let pluginName in this.pluginsWanted){ + this.pluginLoad(pluginName, this.pluginsWanted[pluginName]); + } + } + async pluginLoad(pluginName, opts){ console.log('CJbot.pluginLoad', pluginName) let plugin = new this.constructor.plungins[pluginName]({...opts, bot:this}) @@ -252,13 +273,26 @@ class CJbot{ async pluginUnload(name){ console.log('CJbot.pluginUnload', name) if(this.plunginsLoaded[name]){ - await this.plunginsLoaded[name].unload(); + this.plunginsLoaded[name].unload(); delete this.plunginsLoaded[name]; console.log('CJbot.pluginUnload', name, 'done'); return true; } } + async pluginUnloadAll(){ + console.log('CJbot.pluginUnloadAll'); + for(let pluginName in this.plunginsLoaded){ + console.log('CJbot.pluginUnloadAll loop', pluginName) + try{ + await this.plunginsLoaded[pluginName].unload() + delete this.plunginsLoaded[pluginName]; + }catch(error){ + console.log('CJbot.pluginUnload loop error:', error) + } + } + } + /* Chat and messaging*/ __listen(){ @@ -438,50 +472,59 @@ class CJbot{ }); } - isWithinRange(target, range=2) { + isWithinRange(target, range=2){ const botPos = this.bot.entity.position; const distance = botPos.distanceTo(target); return distance <= range+.9; } - async _goTo(block, range=2){ - try{ - }catch(error){ - if(error.message === 'Not supported block identifier'){ - console.log('found block error') - await sleep(1000); - block = this.__blockOrVec(block); - } - console.log('other', error) + playerWithinBlock(player, block, range){ + let playerData = this.bot.players[player]; + if(!playerData || !playerData.entity) return; // Skip if no entity info + + // Calculate the distance between the player and the block + let distance = playerData.entity.position.distanceTo(block.position); + + console.log('CJbot.playerWithinBlock', distance, range, distance < range) + if(!range){ + return distance; } - try{ - }catch(error){ - if(error.name === 'GoalChanged') return await this._goTo(block, range); - console.log('error in _goTo', error.name, '|', error.message); - } + return distance < range; + } + + areGoalsWithinRange(goal1, goal2) { + const dx = goal1.x - goal2.x; + const dy = goal1.y - goal2.y; + const dz = goal1.z - goal2.z; + + const distanceSq = dx * dx + dy * dy + dz * dz; + + // Compare with the maximum allowed squared range (rangeSq) + return distanceSq <= goal1.rangeSq && distanceSq <= goal2.rangeSq; } async goTo(options) { let range = options.range || 2; let block = this.__blockOrVec(options.where); - + while(!this.isWithinRange(this.__blockOrVec(options.where).position, range)){ try{ + console.log('goal', this.bot.pathfinder.goal); if(this.bot.pathfinder.isMoving()){ await sleep(500); - console.log('the bot is moving...') + console.log('the bot is moving...'); continue; } await this.bot.pathfinder.goto( new GoalNear(...block.position.toArray(), range) ); }catch(error){ - await sleep(500); + // await sleep(500); console.log('CJbot.goTo while loop error:', error) // await this.bot.pathfinder.setGoal(null); - await this.bot.pathfinder.stop(); + // await this.bot.pathfinder.stop(); await sleep(500); } } @@ -565,7 +608,6 @@ class CJbot{ return window; } - async checkItemsFromContainer(containerBlock, itemName, count){ let currentSlot = 0; let foundCount = 0; @@ -594,42 +636,56 @@ class CJbot{ let window = await this.openContainer(chestBlock); - + let itemCount = 0 let currentSlot = 0; for(let slot of window.slots){ if(currentSlot++ === window.inventoryStart) break; - if(!slot) continue; - // if(!slot || slot.name !== 'shulker_box') continue; - console.log('slot:', slot) + if(!slot || slot.name !== 'shulker_box') continue; + // console.log('slot:', slot) if(slot.nbt){ - // console.log(slot.nbt) - console.log('BlockEntityTag:', slot.nbt.value.BlockEntityTag.value.Items.value.value) + // console.log('nbt', slot.nbt, slot.nbt.value.BlockEntityTag) + // console.log('BlockEntityTag:', slot.nbt.value.BlockEntityTag.value.Items.value.value) + + for(let shulkerSlot of slot.nbt.value.BlockEntityTag.value.Items.value.value){ + console.log('shulkerSlot', shulkerSlot) + if(shulkerSlot.id?.value !== `minecraft:${item}`) continue; + itemCount += shulkerSlot.Count.value + } + if(this.bot.registry.itemsByName[item].stackSize * 27 === itemCount){ + console.log('found full shulker'); + this.bot.moveSlotItem(currentSlot, window.inventoryStart); + break; + } + } } + + await window.close(); + /* // Get the inventory of the chest block const chestInventory = chestBlock.getInventory(); // Iterate through the chest's inventory chestInventory.forEach((slot, index) => { - // Check if the slot contains a shulker box - if (slot && slot.type === 'shulker_box') { - // Retrieve the shulker's inventory - const shulkerInventory = slot.getInventory(); + // Check if the slot contains a shulker box + if (slot && slot.type === 'shulker_box') { + // Retrieve the shulker's inventory + const shulkerInventory = slot.getInventory(); - // Check if the shulker is full of the specified item - const isFull = shulkerInventory.every(shulkerSlot => { - console.log('shulkerSlot', shulkerSlot) - return shulkerSlot && shulkerSlot.id === item.id && shulkerSlot.count === 64; // Assuming max stack size is 64 - }); + // Check if the shulker is full of the specified item + const isFull = shulkerInventory.every(shulkerSlot => { + console.log('shulkerSlot', shulkerSlot) + return shulkerSlot && shulkerSlot.id === item.id && shulkerSlot.count === 64; // Assuming max stack size is 64 + }); - // If full, add the shulker box to the list - if (isFull) { - fullShulkers.push(slot); - } - } + // If full, add the shulker box to the list + if (isFull) { + fullShulkers.push(slot); + } + } }); return fullShulkers;*/ diff --git a/nodejs/package-lock.json b/nodejs/package-lock.json index e6f4043..9f6c53f 100644 --- a/nodejs/package-lock.json +++ b/nodejs/package-lock.json @@ -14,7 +14,7 @@ "dotenv": "^16.0.1", "extend": "^3.0.2", "minecraft-data": "^3.69.0", - "mineflayer": "^4.0.0", + "mineflayer": "^4.27.0", "mineflayer-pathfinder": "^2.4.5", "mineflayer-web-inventory": "^1.3.0", "moment": "^2.29.3", @@ -25,19 +25,19 @@ } }, "node_modules/@azure/msal-common": { - "version": "14.15.0", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.15.0.tgz", - "integrity": "sha512-ImAQHxmpMneJ/4S8BRFhjt1MZ3bppmpRPYYNyzeQPeFN288YKbb8TmmISQEbtfkQ1BPASvYZU5doIZOPBAqENQ==", + "version": "14.16.0", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.16.0.tgz", + "integrity": "sha512-1KOZj9IpcDSwpNiQNjt0jDYZpQvNZay7QAEi/5DLubay40iGYtLzya/jbjRPLyOTZhEKyL1MzPuw2HqBCjceYA==", "engines": { "node": ">=0.8.0" } }, "node_modules/@azure/msal-node": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.15.0.tgz", - "integrity": "sha512-gVPW8YLz92ZeCibQH2QUw96odJoiM3k/ZPH3f2HxptozmH6+OnyyvKXo/Egg39HAM230akarQKHf0W74UHlh0Q==", + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.16.2.tgz", + "integrity": "sha512-An7l1hEr0w1HMMh1LU+rtDtqL7/jw74ORlc9Wnh06v7TU/xpG39/Zdr1ZJu3QpjUfKJ+E0/OXMW8DRSWTlh7qQ==", "dependencies": { - "@azure/msal-common": "14.15.0", + "@azure/msal-common": "14.16.0", "jsonwebtoken": "^9.0.0", "uuid": "^8.3.0" }, @@ -72,17 +72,25 @@ } }, "node_modules/@types/node": { - "version": "22.7.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", - "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", + "version": "22.13.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.13.tgz", + "integrity": "sha512-ClsL5nMwKaBRwPcCvH8E7+nU4GxHVx1axNvMZTFHMEfNI7oahimt26P5zjVCRrjiIWj6YFXfE1v3dEp94wLcGQ==", "dependencies": { - "undici-types": "~6.19.2" + "undici-types": "~6.20.0" + } + }, + "node_modules/@types/node-rsa": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@types/node-rsa/-/node-rsa-1.1.4.tgz", + "integrity": "sha512-dB0ECel6JpMnq5ULvpUTunx3yNm8e/dIkv8Zu9p2c8me70xIRUUG3q+qXRwcSf9rN3oqamv4116iHy90dJGRpA==", + "dependencies": { + "@types/node": "*" } }, "node_modules/@types/readable-stream": { - "version": "4.0.15", - "resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-4.0.15.tgz", - "integrity": "sha512-oAZ3kw+kJFkEqyh7xORZOku1YAKvsFTogRY8kVl4vHpEKiDkfnSA/My8haRE7fvmix5Zyy+1pwzOi7yycGLBJw==", + "version": "4.0.18", + "resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-4.0.18.tgz", + "integrity": "sha512-21jK/1j+Wg+7jVw1xnSwy/2Q1VgVjWuFssbYGTREPUBeZ+rqVFl2udq0IkxzPC0ZhOzVceUbyIACFZKLqKEBlA==", "dependencies": { "@types/node": "*", "safe-buffer": "~5.1.1" @@ -182,9 +190,9 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.7.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", - "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "version": "1.8.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.4.tgz", + "integrity": "sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw==", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -349,16 +357,25 @@ "node": ">= 0.8" } }, - "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "dependencies": { - "es-define-property": "^1.0.0", "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" }, "engines": { "node": ">= 0.4" @@ -485,9 +502,9 @@ } }, "node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dependencies": { "ms": "^2.1.3" }, @@ -500,22 +517,6 @@ } } }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -547,9 +548,9 @@ "integrity": "sha512-c68LpLbO+7kP/b1Hr1qs8/BJ09F5khZGTxqxZuhzxpmwJKOgRFHJWIb9/KmqnqHhLdO55aOxFH/EGBvUQbL/RQ==" }, "node_modules/dotenv": { - "version": "16.4.5", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", - "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "version": "16.4.7", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", + "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", "engines": { "node": ">=12" }, @@ -557,6 +558,19 @@ "url": "https://dotenvx.com" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/ecdsa-sig-formatter": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", @@ -619,13 +633,26 @@ "node": ">= 0.6" } }, - "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "node_modules/engine.io/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dependencies": { - "get-intrinsic": "^1.2.4" + "ms": "^2.1.3" }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", "engines": { "node": ">= 0.4" } @@ -638,6 +665,31 @@ "node": ">= 0.4" } }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -668,9 +720,9 @@ } }, "node_modules/express": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", - "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -691,7 +743,7 @@ "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.10", + "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", "qs": "6.13.0", "range-parser": "~1.2.1", @@ -706,6 +758,10 @@ }, "engines": { "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/express/node_modules/debug": { @@ -817,12 +873,13 @@ } }, "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", + "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", "mime-types": "^2.1.12" }, "engines": { @@ -868,15 +925,20 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -885,6 +947,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -898,11 +972,11 @@ } }, "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dependencies": { - "get-intrinsic": "^1.1.3" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -917,21 +991,10 @@ "node": ">=4" } }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "engines": { "node": ">= 0.4" }, @@ -939,10 +1002,13 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dependencies": { + "has-symbols": "^1.0.3" + }, "engines": { "node": ">= 0.4" }, @@ -1067,14 +1133,6 @@ "node": ">=0.12.0" } }, - "node_modules/jose": { - "version": "4.15.9", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.9.tgz", - "integrity": "sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA==", - "funding": { - "url": "https://github.com/sponsors/panva" - } - }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -1128,7 +1186,8 @@ "node_modules/lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==" + "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", + "deprecated": "This package is deprecated. Use the optional chaining (?.) operator instead." }, "node_modules/lodash.includes": { "version": "4.3.0", @@ -1180,6 +1239,14 @@ "resolved": "https://registry.npmjs.org/macaddress/-/macaddress-0.5.3.tgz", "integrity": "sha512-vGBKTA+jwM4KgjGZ+S/8/Mkj9rWzePyGY6jManXPGhiWu63RYwW8dKPyk5koP+8qNVhPhHgFa1y/MJ4wrjsNrg==" }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -1235,14 +1302,14 @@ } }, "node_modules/minecraft-assets": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/minecraft-assets/-/minecraft-assets-1.12.2.tgz", - "integrity": "sha512-/eMxh3LNjCXOnU6KnQMjBM8dRnoJNpWIg7mD2m2RthraYiQK2FNzPWIKxWm2j3Ufcf5nzFXupgABledE86r4fQ==" + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/minecraft-assets/-/minecraft-assets-1.15.0.tgz", + "integrity": "sha512-hHHNyzrUUaCDEVdupvgnu8hM5y/6t6R8V2m9LgkFRlz0XENII2uDevO5pXkLlz80K0SazHWzd8+zcHitmt6c0Q==" }, "node_modules/minecraft-data": { - "version": "3.69.0", - "resolved": "https://registry.npmjs.org/minecraft-data/-/minecraft-data-3.69.0.tgz", - "integrity": "sha512-FGpjH/8ABfIuHm53253MZZVLwfVgLuRl4wrYz91TNoT14a+pMPH7igNxdpBmKayhiO7VO0ox/ZISkCOj6S/isA==" + "version": "3.84.1", + "resolved": "https://registry.npmjs.org/minecraft-data/-/minecraft-data-3.84.1.tgz", + "integrity": "sha512-0yPsnu4rYjbokPgm6aMqhIm70fhsUUYFMEbbqrLG7QGLQDUy3lauuVlh3ctRxtPP6vX/ywLo1p5Uczz3Snnocg==" }, "node_modules/minecraft-folder-path": { "version": "1.2.0", @@ -1250,10 +1317,11 @@ "integrity": "sha512-qaUSbKWoOsH9brn0JQuBhxNAzTDMwrOXorwuRxdJKKKDYvZhtml+6GVCUrY5HRiEsieBEjCUnhVpDuQiKsiFaw==" }, "node_modules/minecraft-protocol": { - "version": "1.47.0", - "resolved": "https://registry.npmjs.org/minecraft-protocol/-/minecraft-protocol-1.47.0.tgz", - "integrity": "sha512-IHL8faXLLIWv1O+2v2NgyKlooilu/OiSL9orI8Kqed/rZvVOrFPzs2PwMAYjpQX9gxLPhiSU19KqZ8CjfNuqhg==", + "version": "1.55.0", + "resolved": "https://registry.npmjs.org/minecraft-protocol/-/minecraft-protocol-1.55.0.tgz", + "integrity": "sha512-jlzmRxoNuj2bFk1fxR+dTg6Z4RpOR1/FLrk1zhft0jCwAIEhgV2OPi6Ceg2KFKADneEX0suhCty855A/qFLQWA==", "dependencies": { + "@types/node-rsa": "^1.1.4", "@types/readable-stream": "^4.0.0", "aes-js": "^3.1.2", "buffer-equal": "^1.0.0", @@ -1261,7 +1329,7 @@ "endian-toggle": "^0.0.0", "lodash.get": "^4.1.2", "lodash.merge": "^4.3.0", - "minecraft-data": "^3.55.0", + "minecraft-data": "^3.78.0", "minecraft-folder-path": "^1.2.0", "node-fetch": "^2.6.1", "node-rsa": "^0.4.2", @@ -1269,40 +1337,40 @@ "prismarine-chat": "^1.10.0", "prismarine-nbt": "^2.5.0", "prismarine-realms": "^1.2.0", - "protodef": "^1.8.0", + "protodef": "^1.17.0", "readable-stream": "^4.1.0", "uuid-1345": "^1.0.1", "yggdrasil": "^1.4.0" }, "engines": { - "node": ">=14" + "node": ">=22" } }, "node_modules/mineflayer": { - "version": "4.20.1", - "resolved": "https://registry.npmjs.org/mineflayer/-/mineflayer-4.20.1.tgz", - "integrity": "sha512-QMMNPx4IyZE7ydAzjvGLQLCnQNUOfkk1qVZKxTTS9q3qPTAewz4GhsVUBtbQ8LSbHthe5RcQ1Sgxs4wlIma/Qw==", + "version": "4.27.0", + "resolved": "https://registry.npmjs.org/mineflayer/-/mineflayer-4.27.0.tgz", + "integrity": "sha512-3bxph4jfbkBh5HpeouorxzrfSLNV+i+1gugNJ2jf52HW+rt+tW7eiiFPxrJEsOVkPT/3O/dEIW7j93LRlojMkQ==", "dependencies": { - "minecraft-data": "^3.56.0", - "minecraft-protocol": "^1.47.0", + "minecraft-data": "^3.76.0", + "minecraft-protocol": "^1.51.0", "prismarine-biome": "^1.1.1", "prismarine-block": "^1.17.0", "prismarine-chat": "^1.7.1", - "prismarine-chunk": "^1.34.0", - "prismarine-entity": "^2.3.0", - "prismarine-item": "^1.14.0", + "prismarine-chunk": "^1.36.0", + "prismarine-entity": "^2.5.0", + "prismarine-item": "^1.15.0", "prismarine-nbt": "^2.0.0", - "prismarine-physics": "^1.8.0", + "prismarine-physics": "^1.9.0", "prismarine-recipe": "^1.3.0", - "prismarine-registry": "^1.5.0", + "prismarine-registry": "^1.10.0", "prismarine-windows": "^2.9.0", "prismarine-world": "^3.6.0", - "protodef": "^1.14.0", + "protodef": "^1.18.0", "typed-emitter": "^1.0.0", "vec3": "^0.1.7" }, "engines": { - "node": ">=18" + "node": ">=22" } }, "node_modules/mineflayer-pathfinder": { @@ -1429,9 +1497,9 @@ } }, "node_modules/nodemon": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.7.tgz", - "integrity": "sha512-hLj7fuMow6f0lbB0cD14Lz2xNjwsyruH251Pk4t/yIitCFJbmY1myuLlHm/q06aST4jg6EgAh74PIBBrRqpVAQ==", + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.9.tgz", + "integrity": "sha512-hdr1oIb2p6ZSxu3PB2JWWYS7ZQ0qvaZsc3hK8DR8f02kRzc8rjYmxAIvdz+aYC+8F2IjNaB7HMcSDg8nQpJxyg==", "dev": true, "dependencies": { "chokidar": "^3.5.2", @@ -1474,9 +1542,9 @@ } }, "node_modules/object-inspect": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", - "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "engines": { "node": ">= 0.4" }, @@ -1504,9 +1572,9 @@ } }, "node_modules/path-to-regexp": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", - "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==" + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==" }, "node_modules/picomatch": { "version": "2.3.1", @@ -1521,15 +1589,13 @@ } }, "node_modules/prismarine-auth": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/prismarine-auth/-/prismarine-auth-2.5.0.tgz", - "integrity": "sha512-CRv/pL6d/T+4cdjWS223PXG+ygHbz40Kef04L59SLMT+axNdAQro23eZZhgiIIu6u7rlvJcZYlIY93gFNtKxXA==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/prismarine-auth/-/prismarine-auth-2.7.0.tgz", + "integrity": "sha512-L8wTF6sdtnN6hViPNy+Nx39a8iQBwR5iO92AWCiym5cSXp/92pmnuwnTdcmNDWyqq6zY4hbibVGYhgLA1Ox8sQ==", "dependencies": { "@azure/msal-node": "^2.0.2", "@xboxreplay/xboxlive-auth": "^3.3.3", "debug": "^4.3.3", - "jose": "^4.1.4", - "node-fetch": "^2.6.1", "smart-buffer": "^4.1.0", "uuid-1345": "^1.0.2" } @@ -1544,9 +1610,9 @@ } }, "node_modules/prismarine-block": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/prismarine-block/-/prismarine-block-1.17.1.tgz", - "integrity": "sha512-r1TIn/b5v77BX4a+qd+Yv+4/vZpsC/Jp5ElYxd6++2wpCnqiuxVG7BlS2Eo14vez1M2gt3qoNEl54Hr8qox/rQ==", + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/prismarine-block/-/prismarine-block-1.21.0.tgz", + "integrity": "sha512-Um7zRIMHKbtpHYq+bSibc+LgFPqhHCnJgy5DeUYGG1VPLptrHjgAwvzb9bztzpzz4auziZIX+325CCWSDjIv+Q==", "dependencies": { "minecraft-data": "^3.38.0", "prismarine-biome": "^1.1.0", @@ -1557,9 +1623,9 @@ } }, "node_modules/prismarine-chat": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/prismarine-chat/-/prismarine-chat-1.10.1.tgz", - "integrity": "sha512-XukYcuueuhDxzEXG7r8BZyt6jOObrPPB4JESCgb+/XenB9nExoSHF8eTQWWj8faKPLqm1dRQaYwFJlNBlJZJUw==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/prismarine-chat/-/prismarine-chat-1.11.0.tgz", + "integrity": "sha512-VJT/MWYB3qoiznUhrgvSQh76YFpzpCZpY85kJKxHLbd3UVoM0wsfs43Eg8dOltiZG92wc5/DTMLlT07TEeoa9w==", "dependencies": { "mojangson": "^2.0.1", "prismarine-nbt": "^2.0.0", @@ -1567,9 +1633,9 @@ } }, "node_modules/prismarine-chunk": { - "version": "1.35.0", - "resolved": "https://registry.npmjs.org/prismarine-chunk/-/prismarine-chunk-1.35.0.tgz", - "integrity": "sha512-Q1lElMUle7wWxWdQjbZo3j2/dLNG325j90IcbbMmBTnHdQSWIjWFe792XOz3RVBlvrhRJEiZk38S6/eQTQ9esw==", + "version": "1.38.1", + "resolved": "https://registry.npmjs.org/prismarine-chunk/-/prismarine-chunk-1.38.1.tgz", + "integrity": "sha512-VL7BpYYzmZSKveiKNfwp/a50pPqEVy4rMdpOL6niyUsV/Nk4hRcqd2uo7GyKHlJci/mK3g7GOR8jsVX+hU07Aw==", "dependencies": { "prismarine-biome": "^1.2.0", "prismarine-block": "^1.14.1", @@ -1585,9 +1651,9 @@ } }, "node_modules/prismarine-entity": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/prismarine-entity/-/prismarine-entity-2.4.0.tgz", - "integrity": "sha512-DBwjmoCX1IYAhN99KwYkk2rMArn65JHTzuuGXchr4GLWQs7UN4Pf9tELqBwNOu4r57x3RaW0+9+0sI3FvJQWzQ==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/prismarine-entity/-/prismarine-entity-2.5.0.tgz", + "integrity": "sha512-nRPCawUwf9r3iKqi4I7mZRlir1Ix+DffWYdWq6p/KNnmiXve+xHE5zv8XCdhZlUmOshugHv5ONl9o6ORAkCNIA==", "dependencies": { "prismarine-chat": "^1.4.1", "prismarine-item": "^1.11.2", @@ -1596,26 +1662,26 @@ } }, "node_modules/prismarine-item": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/prismarine-item/-/prismarine-item-1.14.0.tgz", - "integrity": "sha512-udQHYGJ05klFe8Kkc0TOmwoXj5Xl1ZPgHVoMbGUAFB9exN4TFxEa1A39vkSYhxP5Et9PNufQQvFBFVom0nXikA==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/prismarine-item/-/prismarine-item-1.16.0.tgz", + "integrity": "sha512-88Tz+/6HquYIsDuseae5G3IbqLeMews2L+ba2gX+p6K6soU9nuFhCfbwN56QuB7d/jZFcWrCYAPE5+UhwWh67w==", "dependencies": { "prismarine-nbt": "^2.0.0", "prismarine-registry": "^1.4.0" } }, "node_modules/prismarine-nbt": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/prismarine-nbt/-/prismarine-nbt-2.5.0.tgz", - "integrity": "sha512-F0/8UAa9SDDnAGrBYqZc4nG8h2zj5cE2eAJU5xlDR/IsQQ3moVxkOjE3h3nMv6SbvZrvAcgX7waA/nd9LLHYdA==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/prismarine-nbt/-/prismarine-nbt-2.7.0.tgz", + "integrity": "sha512-Du9OLQAcCj3y29YtewOJbbV4ARaSUEJiTguw0PPQbPBy83f+eCyDRkyBpnXTi/KPyEpgYCzsjGzElevLpFoYGQ==", "dependencies": { - "protodef": "^1.9.0" + "protodef": "^1.18.0" } }, "node_modules/prismarine-physics": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/prismarine-physics/-/prismarine-physics-1.8.0.tgz", - "integrity": "sha512-gbM+S+bmVtOKVv+Z0WGaHMeEeBHISIDsRDRlv8sr0dex3ZJRhuq8djA02CBreguXtI18ZKh6q3TSj2qDr45NHA==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/prismarine-physics/-/prismarine-physics-1.10.0.tgz", + "integrity": "sha512-FE2xUSDhrdgjlJFtBPMTQt1FX3uG2YvKceRvoMmhcCni0MrS8365ZlbIcW06SB1sKIpoNQWanS5LuefynzwdXQ==", "dependencies": { "minecraft-data": "^3.0.0", "prismarine-nbt": "^2.0.0", @@ -1640,11 +1706,12 @@ } }, "node_modules/prismarine-registry": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/prismarine-registry/-/prismarine-registry-1.7.0.tgz", - "integrity": "sha512-yyva0FpWI078nNeMhx8ekVza5uUTYhEv+C+ADu3wUQXiG8qhXkvrf0uzsnhTgZL8BLdsi2axgCEiKw9qSKIuxQ==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/prismarine-registry/-/prismarine-registry-1.11.0.tgz", + "integrity": "sha512-uTvWE+bILxYv4i5MrrlxPQ0KYWINv1DJ3P2570GLC8uCdByDiDLBFfVyk4BrqOZBlDBft9CnaJMeOsC1Ly1iXw==", "dependencies": { - "minecraft-data": "^3.0.0", + "minecraft-data": "^3.70.0", + "prismarine-block": "^1.17.1", "prismarine-nbt": "^2.0.0" } }, @@ -1686,23 +1753,23 @@ } }, "node_modules/protodef": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/protodef/-/protodef-1.15.0.tgz", - "integrity": "sha512-bZ2Omw8dT+DACjJHLrBWZlqN4MlT9g9oSpJDdkUAJOStUzgJp+Zn42FJfPUdwutUxjaxA0PftN0PDlNa2XbneA==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/protodef/-/protodef-1.18.0.tgz", + "integrity": "sha512-jO64lkzkh0dYc0AVWCU/GzCKwqhFFIz1kfEz0NBf0RUuRNcmvgKbopabJdfZ6W8NvALdySUXgEhvKDZPhdBwrg==", "dependencies": { "lodash.get": "^4.4.2", "lodash.reduce": "^4.6.0", "protodef-validator": "^1.3.0", - "readable-stream": "^3.0.3" + "readable-stream": "^4.4.0" }, "engines": { "node": ">=14" } }, "node_modules/protodef-validator": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/protodef-validator/-/protodef-validator-1.3.1.tgz", - "integrity": "sha512-lZ5FWKZYR9xOjpMw1+EfZRfCjzNRQWPq+Dk+jki47Sikl2EeWEPnTfnJERwnU/EwFq6us+0zqHHzSsmLeYX+Lg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/protodef-validator/-/protodef-validator-1.4.0.tgz", + "integrity": "sha512-2y2coBolqCEuk5Kc3QwO7ThR+/7TZiOit4FrpAgl+vFMvq8w76nDhh09z08e2NQOdrgPLsN2yzXsvRvtADgUZQ==", "dependencies": { "ajv": "^6.5.4" }, @@ -1710,19 +1777,6 @@ "protodef-validator": "cli.js" } }, - "node_modules/protodef/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -1808,9 +1862,9 @@ } }, "node_modules/readable-stream": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", - "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", + "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", "dependencies": { "abort-controller": "^3.0.0", "buffer": "^6.0.3", @@ -1843,9 +1897,9 @@ } }, "node_modules/rxjs": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", - "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "optional": true, "dependencies": { "tslib": "^2.1.0" @@ -1862,9 +1916,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", "bin": { "semver": "bin/semver.js" }, @@ -1930,36 +1984,71 @@ "node": ">= 0.8.0" } }, - "node_modules/set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, "node_modules/side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", "dependencies": { - "call-bind": "^1.0.7", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -2026,6 +2115,38 @@ "node": ">=10.0.0" } }, + "node_modules/socket.io-parser/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socket.io/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -2108,9 +2229,9 @@ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, "node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "optional": true }, "node_modules/type-is": { @@ -2142,9 +2263,9 @@ "dev": true }, "node_modules/undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==" + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==" }, "node_modules/unpipe": { "version": "1.0.0", @@ -2162,11 +2283,6 @@ "punycode": "^2.1.0" } }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" - }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", diff --git a/nodejs/package.json b/nodejs/package.json index 5ddfef0..e6fe128 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -22,7 +22,7 @@ "dotenv": "^16.0.1", "extend": "^3.0.2", "minecraft-data": "^3.69.0", - "mineflayer": "^4.0.0", + "mineflayer": "^4.27.0", "mineflayer-pathfinder": "^2.4.5", "mineflayer-web-inventory": "^1.3.0", "moment": "^2.29.3", diff --git a/nodejs/utils/index.js b/nodejs/utils/index.js index e29c1dd..9061f90 100644 --- a/nodejs/utils/index.js +++ b/nodejs/utils/index.js @@ -4,7 +4,5 @@ module.exports = { sleep: (ms)=> new Promise((resolve) => setTimeout(resolve, ms)), nextTick: ()=> new Promise(resolve => process.nextTick(resolve)), - getOrRun: function(value){ - return typeof(value) === 'function' ? value() : value - }, + getOrRun: (value)=> typeof(value) === 'function' ? value() : value, };