mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-12-27 07:26:48 +01:00
Fix spooky shaded contraptions
- Logic error in GPULightVolume#move - Race condition from LightUpdater showing up in LightVolume#initialize
This commit is contained in:
parent
9a69ed1906
commit
af11d1e78b
2 changed files with 15 additions and 9 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue