Fix spooky shaded contraptions

- Logic error in GPULightVolume#move
 - Race condition from LightUpdater showing up in LightVolume#initialize
This commit is contained in:
Jozufozu 2022-04-08 17:23:02 -07:00
parent a8de91d541
commit e762d69d0b
2 changed files with 15 additions and 9 deletions

View File

@ -114,15 +114,8 @@ public class GPULightVolume extends LightVolume {
if (lightData == null) return;
if (box.contains(newSampleVolume)) {
if (newSampleVolume.intersects(sampleVolume)) {
GridAlignedBB newArea = newSampleVolume.intersect(sampleVolume);
sampleVolume.assign(newSampleVolume);
copyLight(world, newArea);
} else {
sampleVolume.assign(newSampleVolume);
initialize(world);
}
sampleVolume.assign(newSampleVolume);
initialize(world);
} else {
super.move(world, newSampleVolume);
}

View File

@ -46,6 +46,19 @@ public class LightUpdater {
}
public void tick() {
tickSerial();
//tickParallel();
}
private void tickSerial() {
for (MovingListener movingListener : movingListeners) {
if (movingListener.update(provider)) {
addListener(movingListener);
}
}
}
private void tickParallel() {
Queue<LightListener> listeners = new ConcurrentLinkedQueue<>();
taskEngine.group("LightUpdater")