Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-20 01:40:06 +01:00
Make sure to process all chunks in PQE even if PARALLEL_THREADS = 1 (#2611)
make sure to process all chunks in PQE even if PARALLEL_THREADS = 1
Dieser Commit ist enthalten in:
Ursprung
8363badf80
Commit
10dc64eeaf
@ -131,9 +131,12 @@ public class ParallelQueueExtent extends PassthroughExtent {
|
|||||||
|
|
||||||
// Get a pool, to operate on the chunks in parallel
|
// Get a pool, to operate on the chunks in parallel
|
||||||
final int size = Math.min(chunks.size(), Settings.settings().QUEUE.PARALLEL_THREADS);
|
final int size = Math.min(chunks.size(), Settings.settings().QUEUE.PARALLEL_THREADS);
|
||||||
if (size <= 1 && chunksIter.hasNext()) {
|
if (size <= 1) {
|
||||||
|
// if PQE is ever used with PARALLEL_THREADS = 1, or only one chunk is edited, just run sequentially
|
||||||
|
while (chunksIter.hasNext()) {
|
||||||
BlockVector2 pos = chunksIter.next();
|
BlockVector2 pos = chunksIter.next();
|
||||||
getExtent().apply(null, filter, region, pos.getX(), pos.getZ(), full);
|
getExtent().apply(null, filter, region, pos.getX(), pos.getZ(), full);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
final ForkJoinTask[] tasks = IntStream.range(0, size).mapToObj(i -> handler.submit(() -> {
|
final ForkJoinTask[] tasks = IntStream.range(0, size).mapToObj(i -> handler.submit(() -> {
|
||||||
try {
|
try {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren