world: log light updates to debug missing lighting in 1.18
This commit is contained in:
parent
f83197ec39
commit
0d58156697
|
@ -67,7 +67,7 @@ pub enum BlockEntityAction {
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
||||||
enum LightType {
|
enum LightType {
|
||||||
Block,
|
Block,
|
||||||
Sky,
|
Sky,
|
||||||
|
@ -88,6 +88,7 @@ impl LightType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
struct LightUpdate {
|
struct LightUpdate {
|
||||||
ty: LightType,
|
ty: LightType,
|
||||||
pos: Position,
|
pos: Position,
|
||||||
|
@ -203,6 +204,7 @@ impl World {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update_light(&mut self, pos: Position, ty: LightType) {
|
fn update_light(&mut self, pos: Position, ty: LightType) {
|
||||||
|
println!("update_light {:?} {:?}", pos, ty);
|
||||||
self.light_updates.push_back(LightUpdate { ty, pos });
|
self.light_updates.push_back(LightUpdate { ty, pos });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -266,6 +268,7 @@ impl World {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn do_light_update(&mut self) {
|
fn do_light_update(&mut self) {
|
||||||
|
println!("do_light_update");
|
||||||
use std::cmp;
|
use std::cmp;
|
||||||
if let Some(update) = self.light_updates.pop_front() {
|
if let Some(update) = self.light_updates.pop_front() {
|
||||||
if update.pos.y < 0
|
if update.pos.y < 0
|
||||||
|
|
Loading…
Reference in New Issue