mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-09-10 12:02:59 +02:00
craftable library fix
This commit is contained in:
parent
bc511cac1a
commit
867f253b14
1 changed files with 3 additions and 3 deletions
|
@ -179,9 +179,9 @@ export function getCraftableItems(bot) {
|
||||||
* @example
|
* @example
|
||||||
* let craftableItems = world.getCraftableItems(bot);
|
* let craftableItems = world.getCraftableItems(bot);
|
||||||
**/
|
**/
|
||||||
let table = world.getNearestBlock(this.agent.bot, 'crafting_table');
|
let table = getNearestBlock(bot, 'crafting_table');
|
||||||
if (!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') {
|
if (item != null && item.name === 'crafting_table') {
|
||||||
table = item;
|
table = item;
|
||||||
break;
|
break;
|
||||||
|
@ -190,7 +190,7 @@ export function getCraftableItems(bot) {
|
||||||
}
|
}
|
||||||
let res = [];
|
let res = [];
|
||||||
for (const item of mc.getAllItems()) {
|
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)
|
if (recipes.length > 0)
|
||||||
res.push(item.name);
|
res.push(item.name);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue