mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-30 20:14:23 +00:00
fix: rust 1.95 lints
This commit is contained in:
@@ -73,7 +73,7 @@ struct_excessive_bools = "allow"
|
||||
[workspace.package]
|
||||
version = "0.1.0-dev+26.1"
|
||||
edition = "2024"
|
||||
rust-version = "1.94"
|
||||
rust-version = "1.95"
|
||||
license = "GPL-3.0"
|
||||
|
||||
[profile.release]
|
||||
|
||||
@@ -119,19 +119,17 @@ impl DynamicOps for JsonOps {
|
||||
DataResult::new_success,
|
||||
);
|
||||
}
|
||||
Value::String(string) => {
|
||||
if self.compressed {
|
||||
if let Ok(i) = string.parse::<i32>() {
|
||||
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}"));
|
||||
Value::String(string) if self.compressed => {
|
||||
if let Ok(i) = string.parse::<i32>() {
|
||||
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}"));
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
@@ -251,21 +251,26 @@ async fn count_bamboo_above(world: Arc<World>, pos: &BlockPos) -> usize {
|
||||
async fn bone_meal(world: Arc<World>, position: &BlockPos) {
|
||||
let mut bamboo_above = count_bamboo_above(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?
|
||||
for _ in 0..l {
|
||||
|
||||
let growth_amount = rand::rng().random_range(1..=3);
|
||||
|
||||
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_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;
|
||||
}
|
||||
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 {
|
||||
return;
|
||||
}
|
||||
|
||||
update_leaves_and_grow(Arc::clone(&world), position).await;
|
||||
new_height += 1;
|
||||
|
||||
bamboo_above += 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user