small fix to block placing/farming

This commit is contained in:
MaxRobinsonTheGreat 2025-01-25 12:26:49 -06:00
parent 063d421764
commit e1a9ed811b
2 changed files with 9 additions and 3 deletions

View file

@ -160,7 +160,7 @@ export function parseCommandMessage(message) {
suppressNoDomainWarning = true; //Don't spam console. Only give the warning once.
}
} else if(param.type === 'BlockName') { //Check that there is a block with this name
if(getBlockId(arg) == null) return `Invalid block type: ${arg}.`
if(getBlockId(arg) == null && arg !== 'air') return `Invalid block type: ${arg}.`
} else if(param.type === 'ItemName') { //Check that there is an item with this name
if(getItemId(arg) == null) return `Invalid item type: ${arg}.`
}

View file

@ -1275,8 +1275,14 @@ export async function tillAndSow(bot, x, y, z, seedType=null) {
let block = bot.blockAt(new Vec3(x, y, z));
if (bot.modes.isOn('cheat')) {
placeBlock(bot, x, y, z, 'farmland');
placeBlock(bot, x, y+1, z, seedType);
let to_remove = ['_seed', '_seeds'];
for (let remove of to_remove) {
if (seedType.endsWith(remove)) {
seedType = seedType.replace(remove, '');
}
}
placeBlock(bot, 'farmland', x, y, z);
placeBlock(bot, seedType, x, y+1, z);
return true;
}