chore: Update adapters

This commit is contained in:
NotMyFault 2021-10-17 17:33:48 +02:00
parent f0880a27a0
commit 74486fc8c9
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C
2 changed files with 4 additions and 4 deletions

View File

@ -159,7 +159,7 @@ public abstract class Regenerator<IChunkAccess, ProtoChunk extends IChunkAccess,
//generate chunk coords lists with a certain radius //generate chunk coords lists with a certain radius
Int2ObjectOpenHashMap<List<Long>> chunkCoordsForRadius = new Int2ObjectOpenHashMap<>(); Int2ObjectOpenHashMap<List<Long>> chunkCoordsForRadius = new Int2ObjectOpenHashMap<>();
chunkStati.keySet().stream().map(ChunkStatusWrapper::requiredNeigborChunkRadius0).distinct().forEach(radius -> { chunkStati.keySet().stream().map(ChunkStatusWrapper::requiredNeighborChunkRadius0).distinct().forEach(radius -> {
if (radius == -1) { //ignore ChunkStatus.EMPTY if (radius == -1) { //ignore ChunkStatus.EMPTY
return; return;
} }
@ -176,7 +176,7 @@ public abstract class Regenerator<IChunkAccess, ProtoChunk extends IChunkAccess,
//generate lists for RegionLimitedWorldAccess, need to be square with odd length (e.g. 17x17), 17 = 1 middle chunk + 8 border chunks * 2 //generate lists for RegionLimitedWorldAccess, need to be square with odd length (e.g. 17x17), 17 = 1 middle chunk + 8 border chunks * 2
Int2ObjectOpenHashMap<Long2ObjectOpenHashMap<List<IChunkAccess>>> worldlimits = new Int2ObjectOpenHashMap<>(); Int2ObjectOpenHashMap<Long2ObjectOpenHashMap<List<IChunkAccess>>> worldlimits = new Int2ObjectOpenHashMap<>();
chunkStati.keySet().stream().map(ChunkStatusWrapper::requiredNeigborChunkRadius0).distinct().forEach(radius -> { chunkStati.keySet().stream().map(ChunkStatusWrapper::requiredNeighborChunkRadius0).distinct().forEach(radius -> {
if (radius == -1) { //ignore ChunkStatus.EMPTY if (radius == -1) { //ignore ChunkStatus.EMPTY
return; return;
} }
@ -198,7 +198,7 @@ public abstract class Regenerator<IChunkAccess, ProtoChunk extends IChunkAccess,
//run generation tasks excluding FULL chunk status //run generation tasks excluding FULL chunk status
for (Map.Entry<ChunkStatus, Concurrency> entry : chunkStati.entrySet()) { for (Map.Entry<ChunkStatus, Concurrency> entry : chunkStati.entrySet()) {
ChunkStatus chunkStatus = entry.getKey(); ChunkStatus chunkStatus = entry.getKey();
int radius = chunkStatus.requiredNeigborChunkRadius0(); int radius = chunkStatus.requiredNeighborChunkRadius0();
List<Long> coords = chunkCoordsForRadius.get(radius); List<Long> coords = chunkCoordsForRadius.get(radius);
if (this.generateConcurrent && entry.getValue() == Concurrency.RADIUS) { if (this.generateConcurrent && entry.getValue() == Concurrency.RADIUS) {
@ -502,7 +502,7 @@ public abstract class Regenerator<IChunkAccess, ProtoChunk extends IChunkAccess,
*/ */
public abstract int requiredNeighborChunkRadius(); public abstract int requiredNeighborChunkRadius();
int requiredNeigborChunkRadius0() { int requiredNeighborChunkRadius0() {
return Math.max(0, requiredNeighborChunkRadius()); return Math.max(0, requiredNeighborChunkRadius());
} }