Potential fix for anvil issues

This commit is contained in:
Jesse Boyd 2018-08-16 03:07:36 +10:00
parent c836e0ef68
commit a703bba082
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
4 changed files with 8 additions and 1 deletions

View File

@ -670,6 +670,7 @@ public class MCAFile {
pool.awaitQuiescence(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
}
}
chunks.clear();
}
IterableThreadLocal.clean(byteStore1);
IterableThreadLocal.clean(byteStore2);

View File

@ -70,6 +70,10 @@ public class MCAQueue extends NMSMappedFaweQueue<FaweQueue, FaweChunk, FaweChunk
this.hasSky = hasSky;
}
public boolean hasParent() {
return parent != null || parentNMS != null;
}
@Override
public FaweChunk loadChunk(FaweQueue faweQueue, int x, int z, boolean generate) {
return getFaweChunk(x, z);

View File

@ -193,6 +193,8 @@ public class MCAQueueMap implements IFaweQueueMap {
lastZ = Integer.MIN_VALUE;
lastFileX = Integer.MIN_VALUE;
lastFileZ = Integer.MIN_VALUE;
lastChunk = null;
lastFile = null;
if (!mcaFileMap.isEmpty()) {
Iterator<Map.Entry<Long, MCAFile>> iter = mcaFileMap.entrySet().iterator();
boolean result;

View File

@ -1309,7 +1309,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
queue.dequeue();
return;
}
if (Fawe.isMainThread()) {
if (Fawe.isMainThread() && (!(queue instanceof MCAQueue) || ((MCAQueue) queue).hasParent())) {
SetQueue.IMP.flush(queue);
} else {
queue.flush();