From 867f253b14760841da9590c27d92290539e26998 Mon Sep 17 00:00:00 2001 From: Kolby Nottingham Date: Tue, 5 Nov 2024 15:30:12 -0800 Subject: [PATCH] craftable library fix --- src/agent/library/world.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/agent/library/world.js b/src/agent/library/world.js index 4e86475..01d54c3 100644 --- a/src/agent/library/world.js +++ b/src/agent/library/world.js @@ -179,9 +179,9 @@ export function getCraftableItems(bot) { * @example * let craftableItems = world.getCraftableItems(bot); **/ - let table = world.getNearestBlock(this.agent.bot, 'crafting_table'); + let table = getNearestBlock(bot, 'crafting_table'); if (!table) { - for (const item of this.agent.bot.inventory.items()) { + for (const item of bot.inventory.items()) { if (item != null && item.name === 'crafting_table') { table = item; break; @@ -190,7 +190,7 @@ export function getCraftableItems(bot) { } let res = []; for (const item of mc.getAllItems()) { - let recipes = this.agent.bot.recipesFor(item.id, null, 1, table); + let recipes = bot.recipesFor(item.id, null, 1, table); if (recipes.length > 0) res.push(item.name); }