mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-08-04 06:15:32 +02:00
hunting fix
This commit is contained in:
parent
57783fb4ca
commit
6b123c275e
3 changed files with 6 additions and 4 deletions
|
@ -7,7 +7,7 @@
|
|||
"torch",
|
||||
"stone_pickaxe",
|
||||
"stone_sword",
|
||||
"leather_tunic",
|
||||
"leather_chestplate",
|
||||
"iron_pickaxe",
|
||||
"iron_sword",
|
||||
"iron_helmet",
|
||||
|
|
|
@ -192,7 +192,6 @@ class ItemWrapper {
|
|||
this.methods.push(method);
|
||||
}
|
||||
|
||||
|
||||
createChildren() {
|
||||
let recipes = mc.getItemCraftingRecipes(this.name);
|
||||
if (recipes) {
|
||||
|
@ -302,7 +301,8 @@ export class ItemGoal {
|
|||
let next = goal.getNext();
|
||||
|
||||
// Prevent unnecessary attempts to obtain blocks that are not nearby
|
||||
if (next.type === 'block' && !world.getNearbyBlockTypes(this.agent.bot).includes(next.source)) {
|
||||
if (next.type === 'block' && !world.getNearbyBlockTypes(this.agent.bot).includes(next.source) ||
|
||||
next.type === 'hunt' && !world.getNearbyEntityTypes(this.agent.bot).includes(next.source)) {
|
||||
next.fails += 1;
|
||||
await new Promise((resolve) => setTimeout(resolve, 500));
|
||||
this.agent.bot.emit('idle');
|
||||
|
|
|
@ -172,7 +172,9 @@ export function getItemAnimalSource(itemName) {
|
|||
raw_mutton: 'sheep',
|
||||
raw_porkchop: 'pig',
|
||||
raw_rabbit: 'rabbit',
|
||||
raw_salmon: 'salmon'
|
||||
raw_salmon: 'salmon',
|
||||
leather: 'cow',
|
||||
wool: 'sheep'
|
||||
}[itemName];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue