diff --git a/src/agent/commands/queries.js b/src/agent/commands/queries.js index 3d59135..19d5844 100644 --- a/src/agent/commands/queries.js +++ b/src/agent/commands/queries.js @@ -105,6 +105,14 @@ export const queryList = [ } if (blocks.length == 0) { res += ': none'; + } + else { + // Environmental Awareness + res += `\nBLOCK_ABOVE: ${world.getBlockAtPosition(bot, 0, 2, 0).name}`; + res += `\nBLOCK_BELOW: ${world.getBlockAtPosition(bot, 0, -1, 0).name}`; + res += `\nBLOCK_AT_HEAD: ${world.getBlockAtPosition(bot, 0, 1, 0).name}`; + res += `\nBLOCK_AT_LEGS: ${world.getBlockAtPosition(bot, 0, 0, 0).name}`; + res += `\nLOWEST_BLOCK_ABOVE: ${world.getLowestBlock(bot, null, null, 32).name}`; } return pad(res); } diff --git a/src/agent/library/world.js b/src/agent/library/world.js index 949838e..62570d3 100644 --- a/src/agent/library/world.js +++ b/src/agent/library/world.js @@ -67,7 +67,7 @@ export function getLowestBlock(bot, block_types=null, ignore_types=null, distanc * @param {number} distance - The maximum distance to search, default 32. * @returns {Block} - The lowest block. * @example - * let lowestBlock = world.getLowestBlock(bot, 0, -1, 0); + * let lowestBlock = world.getLowestBlock(bot, null, null, 32); **/ // if blocktypes is not a list, make it a list let search_blocks = []; diff --git a/src/utils/mcdata.js b/src/utils/mcdata.js index 4df8b2a..58cfbdb 100644 --- a/src/utils/mcdata.js +++ b/src/utils/mcdata.js @@ -18,7 +18,7 @@ const Item = prismarine_items(mc_version); * @typedef {string} BlockName */ -export const WOOD_TYPES = ['oak', 'spruce', 'birch', 'jungle', 'acacia', 'dark_oak']; +export const WOOD_TYPES = ['oak', 'spruce', 'birch', 'jungle', 'acacia', 'dark_oak', 'mangrove', 'cherry']; export const MATCHING_WOOD_BLOCKS = [ 'log', 'planks', @@ -202,7 +202,7 @@ export function isSmeltable(itemName) { } export function getSmeltingFuel(bot) { - let fuel = bot.inventory.items().find(i => i.name === 'coal' || i.name === 'charcoal') + let fuel = bot.inventory.items().find(i => i.name === 'coal' || i.name === 'charcoal' || i.name === 'blaze_rod') if (fuel) return fuel; fuel = bot.inventory.items().find(i => i.name.includes('log') || i.name.includes('planks')) @@ -214,6 +214,8 @@ export function getSmeltingFuel(bot) { export function getFuelSmeltOutput(fuelName) { if (fuelName === 'coal' || fuelName === 'charcoal') return 8; + if (fuelName === 'blaze_rod') + return 12; if (fuelName.includes('log') || fuelName.includes('planks')) return 1.5 if (fuelName === 'coal_block')