fail silently when work is done
This commit is contained in:
parent
d57867e630
commit
0717f6f4f0
1 changed files with 4 additions and 0 deletions
|
@ -73,6 +73,10 @@ impl BuildSimple {
|
||||||
async fn place_block(&self, turtle: TurtleCommander, at: Vec3) -> Option<()> {
|
async fn place_block(&self, turtle: TurtleCommander, at: Vec3) -> Option<()> {
|
||||||
let mut near = turtle.goto_adjacent(at).await?;
|
let mut near = turtle.goto_adjacent(at).await?;
|
||||||
while let TurtleCommandResponse::Failure = turtle.execute(near.place(at)?).await.ret {
|
while let TurtleCommandResponse::Failure = turtle.execute(near.place(at)?).await.ret {
|
||||||
|
if turtle.world().occupied(at).await {
|
||||||
|
trace!("{at} already filled");
|
||||||
|
return None;
|
||||||
|
};
|
||||||
trace!("failed, looking for blocks");
|
trace!("failed, looking for blocks");
|
||||||
if let Some(slot) = turtle.inventory().await.iter().enumerate()
|
if let Some(slot) = turtle.inventory().await.iter().enumerate()
|
||||||
.filter(|n| n.1.clone().is_some_and(|s| s.count > 0))
|
.filter(|n| n.1.clone().is_some_and(|s| s.count > 0))
|
||||||
|
|
Loading…
Reference in a new issue