path tuning (in the wrong direction perhaps)
This commit is contained in:
parent
c4e745ba2e
commit
5b858f3d3b
3 changed files with 15 additions and 4 deletions
|
@ -33,7 +33,7 @@ impl Depots {
|
||||||
// dump inventory
|
// dump inventory
|
||||||
for i in 1..=16 {
|
for i in 1..=16 {
|
||||||
turtle.execute(Select(i)).await;
|
turtle.execute(Select(i)).await;
|
||||||
turtle.execute(DropFront(64)).await;
|
turtle.execute(DropDown(64)).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
// refuel
|
// refuel
|
||||||
|
@ -54,6 +54,12 @@ impl Depots {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// lava bucket fix
|
||||||
|
for i in 1..=16 {
|
||||||
|
turtle.execute(Select(i)).await;
|
||||||
|
turtle.execute(DropDown(64)).await;
|
||||||
|
}
|
||||||
|
|
||||||
turtle.execute(Backward(1)).await;
|
turtle.execute(Backward(1)).await;
|
||||||
|
|
||||||
drop(depot); // assumes that the turtle will very quickly leave
|
drop(depot); // assumes that the turtle will very quickly leave
|
||||||
|
|
|
@ -79,7 +79,7 @@ pub const TRANSPARENT: [&str; 3] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
/// Blocks that are fine to tunnel through
|
/// Blocks that are fine to tunnel through
|
||||||
const GARBAGE: [&str; 8] = [
|
const GARBAGE: [&str; 11] = [
|
||||||
"minecraft:stone",
|
"minecraft:stone",
|
||||||
"minecraft:dirt",
|
"minecraft:dirt",
|
||||||
"minecraft:andesite",
|
"minecraft:andesite",
|
||||||
|
@ -88,10 +88,13 @@ const GARBAGE: [&str; 8] = [
|
||||||
"minecraft:sandstone",
|
"minecraft:sandstone",
|
||||||
"minecraft:deepslate",
|
"minecraft:deepslate",
|
||||||
"twigs:rhyolite",
|
"twigs:rhyolite",
|
||||||
|
"minecraft:spruce_leaves",
|
||||||
|
"minecraft:oak_leaves",
|
||||||
|
"traverse:fir_leaves",
|
||||||
];
|
];
|
||||||
|
|
||||||
/// time taken to go through uncharted territory (in turtle. calls)
|
/// time taken to go through uncharted territory (in turtle. calls)
|
||||||
const UNKNOWN: Option<u32> = Some(2);
|
const UNKNOWN: Option<u32> = Some(1);
|
||||||
|
|
||||||
// time to go somewhere
|
// time to go somewhere
|
||||||
pub fn difficulty(name: &str) -> Option<u32> {
|
pub fn difficulty(name: &str) -> Option<u32> {
|
||||||
|
@ -101,5 +104,5 @@ pub fn difficulty(name: &str) -> Option<u32> {
|
||||||
if GARBAGE.contains(&name) {
|
if GARBAGE.contains(&name) {
|
||||||
return Some(2);
|
return Some(2);
|
||||||
};
|
};
|
||||||
None
|
Some(140) // providing a value here means that tunneling through builds is possible (bad)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
use log::trace;
|
||||||
use tokio;
|
use tokio;
|
||||||
use blocks::Vec3;
|
use blocks::Vec3;
|
||||||
use crate::fell::TreeFarm;
|
use crate::fell::TreeFarm;
|
||||||
|
@ -197,6 +198,7 @@ pub(crate) async fn command(
|
||||||
State(state): State<SharedControl>,
|
State(state): State<SharedControl>,
|
||||||
Json(req): Json<turtle::TurtleUpdate>,
|
Json(req): Json<turtle::TurtleUpdate>,
|
||||||
) -> Json<turtle::TurtleCommand> {
|
) -> Json<turtle::TurtleCommand> {
|
||||||
|
trace!("reply from turtle {id}: {req:?}");
|
||||||
let mut state = &mut state.read().await;
|
let mut state = &mut state.read().await;
|
||||||
|
|
||||||
if id as usize > state.turtles.len() {
|
if id as usize > state.turtles.len() {
|
||||||
|
|
Loading…
Reference in a new issue