Downgrade to Java 8

This commit is contained in:
James Seibel
2023-02-23 19:27:29 -06:00
parent af9215c849
commit 5174c71363
8 changed files with 15 additions and 10 deletions
@@ -137,9 +137,9 @@ public class DhApiTerrainDataRepo implements IDhApiTerrainDataRepo
int dataColumnsReturned = 0;
// get each column over the area
for (var x = 0; x < widthOfAreaInBlocks; x++)
for (int x = 0; x < widthOfAreaInBlocks; x++)
{
for (var z = 0; z < widthOfAreaInBlocks; z++)
for (int z = 0; z < widthOfAreaInBlocks; z++)
{
DhLodPos blockColumnPos = new DhLodPos(LodUtil.BLOCK_DETAIL_LEVEL, startingBlockPos.x + x, startingBlockPos.z + z);
DhApiResult<DhApiTerrainDataPoint[]> result = getTerrainDataColumnArray(levelWrapper, blockColumnPos, null);
@@ -154,7 +154,9 @@ public class SingleChunkFullDataSource extends FullArrayView implements IIncompl
throw new IOException(LodUtil.formatLog("Spotty Flag BitSet size outside reasonable range: {} (expects {} to {})",
length, 1, SECTION_SIZE * SECTION_SIZE / 8 + 63));
}
byte[] bytes = dos.readNBytes(length);
byte[] bytes = new byte[length];
dos.readFully(bytes, 0, length);
BitSet isColumnNotEmpty = BitSet.valueOf(bytes);
// Data array content
@@ -364,7 +364,8 @@ public class SparseFullDataSource implements IIncompleteFullDataSource
}
// read in the presence of each data column
byte[] bytes = inputStream.readNBytes(numberOfDataColumns);
byte[] bytes = new byte[numberOfDataColumns];
inputStream.readFully(bytes, 0, numberOfDataColumns);
BitSet dataArrayIndexHasData = BitSet.valueOf(bytes);
@@ -10,7 +10,7 @@ public interface IColumnDataView
default Iterator<Long> iterator()
{
return new Iterator<>()
return new Iterator<Long>()
{
private int index = 0;
private final int size = size();
@@ -375,7 +375,7 @@ public class FullDataFileHandler implements IFullDataSourceProvider
})
);
}
return CompletableFuture.allOf(futures.toArray(CompletableFuture[]::new))
return CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]))
.thenApply((v) -> dataSource.trySelfPromote());
}
@@ -110,7 +110,7 @@ public class GeneratedFullDataFileHandler extends FullDataFileHandler
})
);
}
return CompletableFuture.allOf(futures.toArray(CompletableFuture[]::new))
return CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]))
.thenApply((voidValue) -> dataSource.trySelfPromote());
}
}
@@ -13,6 +13,7 @@ import com.seibel.lod.core.wrapperInterfaces.world.ILevelWrapper;
import javax.annotation.Nullable;
import java.io.File;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
@@ -122,7 +123,7 @@ public class ClientOnlySaveStructure extends AbstractSaveStructure
}
).sorted();
return fileStream.toList();
return fileStream.collect(Collectors.toList());
}
@Override
@@ -610,7 +610,7 @@ public class WorldGenerationQueue implements Closeable
return null;
}));
});
this.generatorClosingFuture = CompletableFuture.allOf(array.toArray(CompletableFuture[]::new)); //FIXME: Closer threading issues with runCurrentGenTasksUntilBusy
this.generatorClosingFuture = CompletableFuture.allOf(array.toArray(new CompletableFuture[0])); //FIXME: Closer threading issues with runCurrentGenTasksUntilBusy
this.looseWoldGenTasks.forEach(t -> t.future.complete(false));
this.looseWoldGenTasks.clear();
return this.generatorClosingFuture;
@@ -627,7 +627,8 @@ public class WorldGenerationQueue implements Closeable
try
{
this.generatorClosingFuture.orTimeout(SHUTDOWN_TIMEOUT_SEC, TimeUnit.SECONDS).join();
// this will throw a timeout exception if the generator doesn't return soon enough
this.generatorClosingFuture.get(SHUTDOWN_TIMEOUT_SEC, TimeUnit.SECONDS);
}
catch (Throwable e)
{