mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-01-22 07:00:05 +00:00
fix: recover from trimmed chunk (#2771)
- It's theoretically possible for the section FULL to return a null layer due to race condition with a trim operation - Locally cache result and if null, recover - I just had the error from #1592 again - This seems to have stopped the error, but adding logging did not log, so possibly some bigger bytecode changes? - Oh well
This commit is contained in:
parent
c7d6c907f1
commit
6a54c5bcb5
@ -17,13 +17,23 @@ public abstract class CharBlocks implements IBlocks {
|
|||||||
protected static final Section FULL = new Section() {
|
protected static final Section FULL = new Section() {
|
||||||
@Override
|
@Override
|
||||||
public char[] get(CharBlocks blocks, int layer) {
|
public char[] get(CharBlocks blocks, int layer) {
|
||||||
return blocks.blocks[layer];
|
char[] arr = blocks.blocks[layer];
|
||||||
|
if (arr == null) {
|
||||||
|
// Chunk probably trimmed mid-operations, but do nothing about it to avoid other issues
|
||||||
|
return EMPTY.get(blocks, layer, false);
|
||||||
|
}
|
||||||
|
return arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ignore aggressive switch here.
|
// Ignore aggressive switch here.
|
||||||
@Override
|
@Override
|
||||||
public char[] get(CharBlocks blocks, int layer, boolean aggressive) {
|
public char[] get(CharBlocks blocks, int layer, boolean aggressive) {
|
||||||
return blocks.blocks[layer];
|
char[] arr = blocks.blocks[layer];
|
||||||
|
if (arr == null) {
|
||||||
|
// Chunk probably trimmed mid-operations, but do nothing about it to avoid other issues
|
||||||
|
return EMPTY.get(blocks, layer, false);
|
||||||
|
}
|
||||||
|
return arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user