mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-31 12:23:51 -07:00
Fix concurrency issue in light engine (Vanilla bug)
Mojang implemented a cache like chunks have, but this cache is accessed by multiple threads and is totally not safe. So just remove it Fixes #3466 Also missed a pooled nibble release, so slid that in there too.
This commit is contained in:
@@ -57,7 +57,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
public void a(long i) {
|
||||
if (this.isVisible) { throw new IllegalStateException("writing to visible data"); } // Paper - avoid copying light data
|
||||
- this.data.queueUpdate(i, ((NibbleArray) this.data.getUpdating(i)).b()); // Paper - avoid copying light data
|
||||
+ this.data.queueUpdate(i, new NibbleArray().markPoolSafe(this.data.getUpdating(i).getCloneIfSet())); // Paper - avoid copying light data - pool safe clone
|
||||
+ NibbleArray updating = this.data.getUpdating(i); // Paper - pool nibbles
|
||||
+ this.data.queueUpdate(i, new NibbleArray().markPoolSafe(updating.getCloneIfSet())); // Paper - avoid copying light data - pool safe clone
|
||||
+ if (updating.cleaner != null) updating.cleaner.run(); // Paper
|
||||
this.c();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user