mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-11-10 20:45:59 +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
@ -114,15 +114,8 @@ public class GPULightVolume extends LightVolume {
|
|||||||
if (lightData == null) return;
|
if (lightData == null) return;
|
||||||
|
|
||||||
if (box.contains(newSampleVolume)) {
|
if (box.contains(newSampleVolume)) {
|
||||||
if (newSampleVolume.intersects(sampleVolume)) {
|
sampleVolume.assign(newSampleVolume);
|
||||||
GridAlignedBB newArea = newSampleVolume.intersect(sampleVolume);
|
initialize(world);
|
||||||
sampleVolume.assign(newSampleVolume);
|
|
||||||
|
|
||||||
copyLight(world, newArea);
|
|
||||||
} else {
|
|
||||||
sampleVolume.assign(newSampleVolume);
|
|
||||||
initialize(world);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
super.move(world, newSampleVolume);
|
super.move(world, newSampleVolume);
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,19 @@ public class LightUpdater {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void tick() {
|
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<>();
|
Queue<LightListener> listeners = new ConcurrentLinkedQueue<>();
|
||||||
|
|
||||||
taskEngine.group("LightUpdater")
|
taskEngine.group("LightUpdater")
|
||||||
|
Loading…
Reference in New Issue
Block a user