added fireflies to reed and flowers, readded sunflowers

This commit is contained in:
Monty Marz 2020-08-31 18:16:37 +02:00 committed by Joshua Barretto
parent 8a25ad91df
commit c3ae56114a
3 changed files with 46 additions and 12 deletions

View File

@ -321,9 +321,17 @@ impl ParticleMgr {
|_| true,
),
(
|boi| &boi.grass,
|boi| &boi.reeds,
3,
0.01,
40.0,
ParticleMode::Firefly,
|sd| sd.state.get_day_period().is_dark(),
),
(
|boi| &boi.flowers,
5,
0.001,
0.005,
40.0,
ParticleMode::Firefly,
|sd| sd.state.get_day_period().is_dark(),

View File

@ -10,6 +10,8 @@ pub struct BlocksOfInterest {
pub grass: Vec<Vec3<i32>>,
pub embers: Vec<Vec3<i32>>,
pub beehives: Vec<Vec3<i32>>,
pub reeds: Vec<Vec3<i32>>,
pub flowers: Vec<Vec3<i32>>,
}
impl BlocksOfInterest {
@ -18,6 +20,8 @@ impl BlocksOfInterest {
let mut grass = Vec::new();
let mut embers = Vec::new();
let mut beehives = Vec::new();
let mut reeds = Vec::new();
let mut flowers = Vec::new();
chunk
.vol_iter(
@ -28,16 +32,27 @@ impl BlocksOfInterest {
chunk.get_max_z(),
),
)
.for_each(|(pos, block)| {
if block.kind() == BlockKind::Leaves && thread_rng().gen_range(0, 16) == 0 {
leaves.push(pos);
} else if block.kind() == BlockKind::Grass && thread_rng().gen_range(0, 16) == 0 {
grass.push(pos);
} else if block.kind() == BlockKind::Ember {
embers.push(pos);
} else if block.kind() == BlockKind::Beehive {
beehives.push(pos);
}
.for_each(|(pos, block)| match block.kind() {
BlockKind::Leaves => {
if thread_rng().gen_range(0, 16) == 0 {
leaves.push(pos)
}
},
BlockKind::Grass => {
if thread_rng().gen_range(0, 16) == 0 {
grass.push(pos)
}
},
BlockKind::Ember => embers.push(pos),
BlockKind::Beehive => beehives.push(pos),
BlockKind::Reed => reeds.push(pos),
BlockKind::PinkFlower => flowers.push(pos),
BlockKind::PurpleFlower => flowers.push(pos),
BlockKind::RedFlower => flowers.push(pos),
BlockKind::WhiteFlower => flowers.push(pos),
BlockKind::YellowFlower => flowers.push(pos),
BlockKind::Sunflower => flowers.push(pos),
_ => {},
});
Self {
@ -45,6 +60,8 @@ impl BlocksOfInterest {
grass,
embers,
beehives,
reeds,
flowers,
}
}
}

View File

@ -69,6 +69,15 @@ pub fn apply_scatter_to<'a>(
Some((64.0, 0.2)),
)
}),
(Sunflower, false, |c, col| {
(
close(c.temp, 0.0, 0.7).min(close(c.humidity, CONFIG.jungle_hum, 0.4))
* col.tree_density
* MUSH_FACT
* 350.0,
Some((1024.0, 0.15)),
)
}),
(PurpleFlower, false, |c, col| {
(
close(c.temp, CONFIG.temperate_temp, 0.7).min(close(