fix: rust 1.95 lints
This commit is contained in:
parent
e9423dcb9c
commit
9b2bd09dcc
@ -73,7 +73,7 @@ struct_excessive_bools = "allow"
|
|||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.1.0-dev+26.1"
|
version = "0.1.0-dev+26.1"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
rust-version = "1.94"
|
rust-version = "1.95"
|
||||||
license = "GPL-3.0"
|
license = "GPL-3.0"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
|
|||||||
@ -119,19 +119,17 @@ impl DynamicOps for JsonOps {
|
|||||||
DataResult::new_success,
|
DataResult::new_success,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Value::String(string) => {
|
Value::String(string) if self.compressed => {
|
||||||
if self.compressed {
|
if let Ok(i) = string.parse::<i32>() {
|
||||||
if let Ok(i) = string.parse::<i32>() {
|
return DataResult::new_success(Number::Int(i));
|
||||||
return DataResult::new_success(Number::Int(i));
|
|
||||||
}
|
|
||||||
if let Ok(l) = string.parse::<i64>() {
|
|
||||||
return DataResult::new_success(Number::Long(l));
|
|
||||||
}
|
|
||||||
if let Ok(d) = string.parse::<f64>() {
|
|
||||||
return DataResult::new_success(Number::Double(d));
|
|
||||||
}
|
|
||||||
return DataResult::new_error(format!("Number could not be parsed: {string}"));
|
|
||||||
}
|
}
|
||||||
|
if let Ok(l) = string.parse::<i64>() {
|
||||||
|
return DataResult::new_success(Number::Long(l));
|
||||||
|
}
|
||||||
|
if let Ok(d) = string.parse::<f64>() {
|
||||||
|
return DataResult::new_success(Number::Double(d));
|
||||||
|
}
|
||||||
|
return DataResult::new_error(format!("Number could not be parsed: {string}"));
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -251,21 +251,26 @@ async fn count_bamboo_above(world: Arc<World>, pos: &BlockPos) -> usize {
|
|||||||
async fn bone_meal(world: Arc<World>, position: &BlockPos) {
|
async fn bone_meal(world: Arc<World>, position: &BlockPos) {
|
||||||
let mut bamboo_above = count_bamboo_above(Arc::clone(&world), position).await;
|
let mut bamboo_above = count_bamboo_above(Arc::clone(&world), position).await;
|
||||||
let bamboo_below = count_bamboo_below(Arc::clone(&world), position).await;
|
let bamboo_below = count_bamboo_below(Arc::clone(&world), position).await;
|
||||||
let mut new_height = bamboo_above + bamboo_below + 1;
|
|
||||||
let l = rand::rng().random_range(0..=2) + 1; // what is this?
|
let growth_amount = rand::rng().random_range(1..=3);
|
||||||
for _ in 0..l {
|
|
||||||
|
for _ in 0..growth_amount {
|
||||||
|
let current_total_height = bamboo_above + bamboo_below + 1;
|
||||||
|
|
||||||
let next_pos = position.up_height(bamboo_above as i32);
|
let next_pos = position.up_height(bamboo_above as i32);
|
||||||
let next_state = world.get_block_state(&next_pos).await;
|
let next_state = world.get_block_state(&next_pos).await;
|
||||||
if !next_state.is_air() || new_height >= 16 {
|
|
||||||
|
if !next_state.is_air() || current_total_height >= 16 {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let next_props = BambooLikeProperties::from_state_id(next_state.id, &Block::BAMBOO);
|
|
||||||
|
|
||||||
|
let next_props = BambooLikeProperties::from_state_id(next_state.id, &Block::BAMBOO);
|
||||||
if next_props.stage == Integer0To1::L1 {
|
if next_props.stage == Integer0To1::L1 {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
update_leaves_and_grow(Arc::clone(&world), position).await;
|
update_leaves_and_grow(Arc::clone(&world), position).await;
|
||||||
new_height += 1;
|
|
||||||
bamboo_above += 1;
|
bamboo_above += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user