mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-12-26 15:06:28 +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
a8de91d541
commit
e762d69d0b
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