diff --git a/core/src/main/java/com/seibel/lod/core/datatype/IFullDataSource.java b/core/src/main/java/com/seibel/lod/core/datatype/IFullDataSource.java index cc7a28085..4fcf009bc 100644 --- a/core/src/main/java/com/seibel/lod/core/datatype/IFullDataSource.java +++ b/core/src/main/java/com/seibel/lod/core/datatype/IFullDataSource.java @@ -1,6 +1,6 @@ package com.seibel.lod.core.datatype; -import com.seibel.lod.core.datatype.full.ChunkSizedFullData; +import com.seibel.lod.core.datatype.full.ChunkSizedFullDataSource; import com.seibel.lod.core.datatype.full.FullDataPointIdMap; import com.seibel.lod.core.datatype.full.accessor.SingleFullArrayView; import com.seibel.lod.core.file.fullDatafile.FullDataMetaFile; @@ -18,7 +18,7 @@ public interface IFullDataSource byte getDataVersion(); - void update(ChunkSizedFullData data); + void update(ChunkSizedFullDataSource data); boolean isEmpty(); diff --git a/core/src/main/java/com/seibel/lod/core/datatype/IRenderSource.java b/core/src/main/java/com/seibel/lod/core/datatype/IRenderSource.java index aec75729c..f7f6f92e2 100644 --- a/core/src/main/java/com/seibel/lod/core/datatype/IRenderSource.java +++ b/core/src/main/java/com/seibel/lod/core/datatype/IRenderSource.java @@ -1,6 +1,6 @@ package com.seibel.lod.core.datatype; -import com.seibel.lod.core.datatype.full.ChunkSizedFullData; +import com.seibel.lod.core.datatype.full.ChunkSizedFullDataSource; import com.seibel.lod.core.level.IDhClientLevel; import com.seibel.lod.core.pos.DhSectionPos; import com.seibel.lod.core.render.LodQuadTree; @@ -47,7 +47,7 @@ public interface IRenderSource boolean isEmpty(); - void fastWrite(ChunkSizedFullData chunkData, IDhClientLevel level); + void fastWrite(ChunkSizedFullDataSource chunkData, IDhClientLevel level); /** Overrides any data that has not been written directly using write(). Skips empty source dataPoints. */ void updateFromRenderSource(IRenderSource source); diff --git a/core/src/main/java/com/seibel/lod/core/datatype/PlaceHolderRenderSource.java b/core/src/main/java/com/seibel/lod/core/datatype/PlaceHolderRenderSource.java index 96c84eb1a..3f5cfce6b 100644 --- a/core/src/main/java/com/seibel/lod/core/datatype/PlaceHolderRenderSource.java +++ b/core/src/main/java/com/seibel/lod/core/datatype/PlaceHolderRenderSource.java @@ -1,6 +1,6 @@ package com.seibel.lod.core.datatype; -import com.seibel.lod.core.datatype.full.ChunkSizedFullData; +import com.seibel.lod.core.datatype.full.ChunkSizedFullDataSource; import com.seibel.lod.core.level.IDhClientLevel; import com.seibel.lod.core.pos.DhSectionPos; import com.seibel.lod.core.render.LodQuadTree; @@ -54,7 +54,7 @@ public class PlaceHolderRenderSource implements IRenderSource public boolean isEmpty() { return true; } @Override - public void fastWrite(ChunkSizedFullData chunkData, IDhClientLevel level) { /* TODO */ } + public void fastWrite(ChunkSizedFullDataSource chunkData, IDhClientLevel level) { /* TODO */ } @Override public void updateFromRenderSource(IRenderSource source) { /* TODO */ } diff --git a/core/src/main/java/com/seibel/lod/core/datatype/column/ColumnRenderSource.java b/core/src/main/java/com/seibel/lod/core/datatype/column/ColumnRenderSource.java index 0b89cc180..043458937 100644 --- a/core/src/main/java/com/seibel/lod/core/datatype/column/ColumnRenderSource.java +++ b/core/src/main/java/com/seibel/lod/core/datatype/column/ColumnRenderSource.java @@ -3,7 +3,7 @@ package com.seibel.lod.core.datatype.column; import com.seibel.lod.core.ModInfo; import com.seibel.lod.core.datatype.column.accessor.*; import com.seibel.lod.core.datatype.column.render.ColumnRenderBuffer; -import com.seibel.lod.core.datatype.full.ChunkSizedFullData; +import com.seibel.lod.core.datatype.full.ChunkSizedFullDataSource; import com.seibel.lod.core.datatype.transform.FullToColumnTransformer; import com.seibel.lod.core.level.IDhClientLevel; import com.seibel.lod.core.pos.DhSectionPos; @@ -304,7 +304,7 @@ public class ColumnRenderSource implements IRenderSource, IColumnDatatype } @Override - public void fastWrite(ChunkSizedFullData chunkData, IDhClientLevel level) { FullToColumnTransformer.writeFullDataChunkToColumnData(this, level, chunkData); } + public void fastWrite(ChunkSizedFullDataSource chunkData, IDhClientLevel level) { FullToColumnTransformer.writeFullDataChunkToColumnData(this, level, chunkData); } diff --git a/core/src/main/java/com/seibel/lod/core/datatype/full/ChunkSizedFullData.java b/core/src/main/java/com/seibel/lod/core/datatype/full/ChunkSizedFullDataSource.java similarity index 86% rename from core/src/main/java/com/seibel/lod/core/datatype/full/ChunkSizedFullData.java rename to core/src/main/java/com/seibel/lod/core/datatype/full/ChunkSizedFullDataSource.java index fb8c90b4d..8df285bcf 100644 --- a/core/src/main/java/com/seibel/lod/core/datatype/full/ChunkSizedFullData.java +++ b/core/src/main/java/com/seibel/lod/core/datatype/full/ChunkSizedFullDataSource.java @@ -3,13 +3,13 @@ package com.seibel.lod.core.datatype.full; import com.seibel.lod.core.datatype.full.accessor.FullArrayView; import com.seibel.lod.core.pos.DhLodPos; -public class ChunkSizedFullData extends FullArrayView +public class ChunkSizedFullDataSource extends FullArrayView { public final byte dataDetail; public final int x; public final int z; - public ChunkSizedFullData(byte dataDetail, int x, int z) + public ChunkSizedFullDataSource(byte dataDetail, int x, int z) { super(new FullDataPointIdMap(), new long[16 * 16][0], 16); this.dataDetail = dataDetail; diff --git a/core/src/main/java/com/seibel/lod/core/datatype/full/FullDataSource.java b/core/src/main/java/com/seibel/lod/core/datatype/full/FullDataSource.java index 2311dea24..71454d5b7 100644 --- a/core/src/main/java/com/seibel/lod/core/datatype/full/FullDataSource.java +++ b/core/src/main/java/com/seibel/lod/core/datatype/full/FullDataSource.java @@ -60,7 +60,7 @@ public class FullDataSource extends FullArrayView implements IFullDataSource public SingleFullArrayView tryGet(int x, int z) { return this.get(x, z); } @Override - public void update(ChunkSizedFullData data) + public void update(ChunkSizedFullDataSource data) { LodUtil.assertTrue(this.sectionPos.getSectionBBoxPos().overlaps(data.getBBoxLodPos())); if (data.dataDetail == 0 && this.getDataDetail() == 0) diff --git a/core/src/main/java/com/seibel/lod/core/datatype/full/SingleChunkFullDataSource.java b/core/src/main/java/com/seibel/lod/core/datatype/full/SingleChunkFullDataSource.java index dd72228fb..adb0f68ac 100644 --- a/core/src/main/java/com/seibel/lod/core/datatype/full/SingleChunkFullDataSource.java +++ b/core/src/main/java/com/seibel/lod/core/datatype/full/SingleChunkFullDataSource.java @@ -47,7 +47,7 @@ public class SingleChunkFullDataSource extends FullArrayView implements IIncompl public byte getDataVersion() { return LATEST_VERSION; } @Override - public void update(ChunkSizedFullData data) + public void update(ChunkSizedFullDataSource data) { LodUtil.assertTrue(this.sectionPos.getSectionBBoxPos().overlaps(data.getBBoxLodPos())); diff --git a/core/src/main/java/com/seibel/lod/core/datatype/full/SparseFullDataSource.java b/core/src/main/java/com/seibel/lod/core/datatype/full/SparseFullDataSource.java index 37100d82a..9c2894d32 100644 --- a/core/src/main/java/com/seibel/lod/core/datatype/full/SparseFullDataSource.java +++ b/core/src/main/java/com/seibel/lod/core/datatype/full/SparseFullDataSource.java @@ -103,7 +103,7 @@ public class SparseFullDataSource implements IIncompleteFullDataSource @Override - public void update(ChunkSizedFullData data) + public void update(ChunkSizedFullDataSource data) { if (data.dataDetail != 0) { diff --git a/core/src/main/java/com/seibel/lod/core/datatype/transform/ChunkToLodBuilder.java b/core/src/main/java/com/seibel/lod/core/datatype/transform/ChunkToLodBuilder.java index 037c16bd5..962452563 100644 --- a/core/src/main/java/com/seibel/lod/core/datatype/transform/ChunkToLodBuilder.java +++ b/core/src/main/java/com/seibel/lod/core/datatype/transform/ChunkToLodBuilder.java @@ -3,7 +3,7 @@ package com.seibel.lod.core.datatype.transform; import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicInteger; -import com.seibel.lod.core.datatype.full.ChunkSizedFullData; +import com.seibel.lod.core.datatype.full.ChunkSizedFullDataSource; import com.seibel.lod.core.config.Config; import com.seibel.lod.core.logging.ConfigBasedLogger; import com.seibel.lod.core.pos.DhChunkPos; @@ -21,9 +21,9 @@ public class ChunkToLodBuilder private static class Task { final DhChunkPos chunkPos; - final CompletableFuture future; + final CompletableFuture future; - Task(DhChunkPos chunkPos, CompletableFuture future) + Task(DhChunkPos chunkPos, CompletableFuture future) { this.chunkPos = chunkPos; this.future = future; @@ -36,7 +36,7 @@ public class ChunkToLodBuilder - public CompletableFuture tryGenerateData(IChunkWrapper chunk) + public CompletableFuture tryGenerateData(IChunkWrapper chunk) { if (chunk == null) throw new NullPointerException("ChunkWrapper cannot be null!"); @@ -49,7 +49,7 @@ public class ChunkToLodBuilder return null; // Otherwise, it means we're the first to do so. Lets submit our task to this entry. - CompletableFuture future = new CompletableFuture<>(); + CompletableFuture future = new CompletableFuture<>(); taskToBuild.addLast(new Task(chunk.getChunkPos(), future)); return future; } @@ -105,7 +105,7 @@ public class ChunkToLodBuilder { if (LodDataBuilder.canGenerateLodFromChunk(latestChunk)) { - ChunkSizedFullData data = LodDataBuilder.createChunkData(latestChunk); + ChunkSizedFullDataSource data = LodDataBuilder.createChunkData(latestChunk); if (data != null) { task.future.complete(data); diff --git a/core/src/main/java/com/seibel/lod/core/datatype/transform/FullToColumnTransformer.java b/core/src/main/java/com/seibel/lod/core/datatype/transform/FullToColumnTransformer.java index 8e69acf63..c792af764 100644 --- a/core/src/main/java/com/seibel/lod/core/datatype/transform/FullToColumnTransformer.java +++ b/core/src/main/java/com/seibel/lod/core/datatype/transform/FullToColumnTransformer.java @@ -94,7 +94,7 @@ public class FullToColumnTransformer { return columnSource; } - public static void writeFullDataChunkToColumnData(ColumnRenderSource render, IDhClientLevel level, ChunkSizedFullData data) { + public static void writeFullDataChunkToColumnData(ColumnRenderSource render, IDhClientLevel level, ChunkSizedFullDataSource data) { if (data.dataDetail != 0) throw new UnsupportedOperationException("To be implemented"); diff --git a/core/src/main/java/com/seibel/lod/core/datatype/transform/LodDataBuilder.java b/core/src/main/java/com/seibel/lod/core/datatype/transform/LodDataBuilder.java index f2f568e8e..c849ac5db 100644 --- a/core/src/main/java/com/seibel/lod/core/datatype/transform/LodDataBuilder.java +++ b/core/src/main/java/com/seibel/lod/core/datatype/transform/LodDataBuilder.java @@ -1,6 +1,6 @@ package com.seibel.lod.core.datatype.transform; -import com.seibel.lod.core.datatype.full.ChunkSizedFullData; +import com.seibel.lod.core.datatype.full.ChunkSizedFullDataSource; import com.seibel.lod.core.datatype.full.FullDataPoint; import com.seibel.lod.core.dependencyInjection.SingletonInjector; import com.seibel.lod.core.util.LodUtil; @@ -12,10 +12,10 @@ import it.unimi.dsi.fastutil.longs.LongArrayList; public class LodDataBuilder { private static final IBlockStateWrapper AIR = SingletonInjector.INSTANCE.get(IWrapperFactory.class).getAirBlockStateWrapper(); - public static ChunkSizedFullData createChunkData(IChunkWrapper chunk) { + public static ChunkSizedFullDataSource createChunkData(IChunkWrapper chunk) { if (!canGenerateLodFromChunk(chunk)) return null; - ChunkSizedFullData chunkData = new ChunkSizedFullData((byte)0, chunk.getChunkPos().x, chunk.getChunkPos().z); + ChunkSizedFullDataSource chunkData = new ChunkSizedFullDataSource((byte)0, chunk.getChunkPos().x, chunk.getChunkPos().z); for (int x=0; x<16; x++) { for (int z=0; z<16; z++) { diff --git a/core/src/main/java/com/seibel/lod/core/file/fullDatafile/FullDataFileHandler.java b/core/src/main/java/com/seibel/lod/core/file/fullDatafile/FullDataFileHandler.java index 0fbfaaedd..1886d7425 100644 --- a/core/src/main/java/com/seibel/lod/core/file/fullDatafile/FullDataFileHandler.java +++ b/core/src/main/java/com/seibel/lod/core/file/fullDatafile/FullDataFileHandler.java @@ -3,7 +3,7 @@ package com.seibel.lod.core.file.fullDatafile; import com.google.common.collect.HashMultimap; import com.seibel.lod.core.datatype.IFullDataSource; import com.seibel.lod.core.datatype.IIncompleteFullDataSource; -import com.seibel.lod.core.datatype.full.ChunkSizedFullData; +import com.seibel.lod.core.datatype.full.ChunkSizedFullDataSource; import com.seibel.lod.core.datatype.full.FullDataSource; import com.seibel.lod.core.datatype.full.SingleChunkFullDataSource; import com.seibel.lod.core.datatype.full.SparseFullDataSource; @@ -292,14 +292,14 @@ public class FullDataFileHandler implements IFullDataSourceProvider /** This call is concurrent. I.e. it supports being called by multiple threads at the same time. */ @Override - public void write(DhSectionPos sectionPos, ChunkSizedFullData chunkData) + public void write(DhSectionPos sectionPos, ChunkSizedFullDataSource chunkData) { DhLodPos chunkPos = new DhLodPos((byte) (chunkData.dataDetail+4), chunkData.x, chunkData.z); LodUtil.assertTrue(chunkPos.overlaps(sectionPos.getSectionBBoxPos()), "Chunk {} does not overlap section {}", chunkPos, sectionPos); chunkPos = chunkPos.convertToDetailLevel((byte) this.minDetailLevel); this.recursiveWrite(new DhSectionPos(chunkPos.detailLevel, chunkPos.x, chunkPos.z), chunkData); } - private void recursiveWrite(DhSectionPos sectionPos, ChunkSizedFullData chunkData) + private void recursiveWrite(DhSectionPos sectionPos, ChunkSizedFullDataSource chunkData) { FullDataMetaFile metaFile = this.files.get(sectionPos); if (metaFile != null) diff --git a/core/src/main/java/com/seibel/lod/core/file/fullDatafile/FullDataMetaFile.java b/core/src/main/java/com/seibel/lod/core/file/fullDatafile/FullDataMetaFile.java index ce4acb33d..301e16376 100644 --- a/core/src/main/java/com/seibel/lod/core/file/fullDatafile/FullDataMetaFile.java +++ b/core/src/main/java/com/seibel/lod/core/file/fullDatafile/FullDataMetaFile.java @@ -10,7 +10,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; import com.seibel.lod.core.datatype.IFullDataSource; import com.seibel.lod.core.datatype.AbstractDataSourceLoader; -import com.seibel.lod.core.datatype.full.ChunkSizedFullData; +import com.seibel.lod.core.datatype.full.ChunkSizedFullDataSource; import com.seibel.lod.core.dependencyInjection.SingletonInjector; import com.seibel.lod.core.file.metaData.MetaData; import com.seibel.lod.core.pos.DhLodPos; @@ -46,7 +46,7 @@ public class FullDataMetaFile extends AbstractMetaDataFile //TODO: use ConcurrentAppendSingleSwapContainer instead of below: private static class GuardedMultiAppendQueue { ReentrantReadWriteLock appendLock = new ReentrantReadWriteLock(); - ConcurrentLinkedQueue queue = new ConcurrentLinkedQueue<>(); + ConcurrentLinkedQueue queue = new ConcurrentLinkedQueue<>(); } // ===Concurrent Write stuff=== @@ -140,7 +140,7 @@ public class FullDataMetaFile extends AbstractMetaDataFile // } // } - public void addToWriteQueue(ChunkSizedFullData datatype) { + public void addToWriteQueue(ChunkSizedFullDataSource datatype) { debugCheck(); DhLodPos chunkPos = new DhLodPos((byte) (datatype.dataDetail + 4), datatype.x, datatype.z); LodUtil.assertTrue(pos.getSectionBBoxPos().overlaps(chunkPos), "Chunk pos {} doesn't overlap with section {}", chunkPos, pos); @@ -377,7 +377,7 @@ public class FullDataMetaFile extends AbstractMetaDataFile { this.swapWriteQueue(); int count = this._backQueue.queue.size(); - for (ChunkSizedFullData chunk : this._backQueue.queue) + for (ChunkSizedFullDataSource chunk : this._backQueue.queue) { data.update(chunk); } diff --git a/core/src/main/java/com/seibel/lod/core/file/fullDatafile/GeneratedFullDataFileHandler.java b/core/src/main/java/com/seibel/lod/core/file/fullDatafile/GeneratedFullDataFileHandler.java index 9cb8e9a30..cb0fa2701 100644 --- a/core/src/main/java/com/seibel/lod/core/file/fullDatafile/GeneratedFullDataFileHandler.java +++ b/core/src/main/java/com/seibel/lod/core/file/fullDatafile/GeneratedFullDataFileHandler.java @@ -2,7 +2,7 @@ package com.seibel.lod.core.file.fullDatafile; import com.seibel.lod.core.datatype.IFullDataSource; import com.seibel.lod.core.datatype.IIncompleteFullDataSource; -import com.seibel.lod.core.datatype.full.ChunkSizedFullData; +import com.seibel.lod.core.datatype.full.ChunkSizedFullDataSource; import com.seibel.lod.core.datatype.full.SparseFullDataSource; import com.seibel.lod.core.datatype.full.SingleChunkFullDataSource; import com.seibel.lod.core.generation.tasks.AbstractWorldGenTaskTracker; @@ -158,7 +158,7 @@ public class GeneratedFullDataFileHandler extends FullDataFileHandler public boolean isMemoryAddressValid() { return this.targetData.get() != null; } @Override - public Consumer getConsumer() + public Consumer getConsumer() { if (this.loadedTargetData == null) { diff --git a/core/src/main/java/com/seibel/lod/core/file/fullDatafile/IFullDataSourceProvider.java b/core/src/main/java/com/seibel/lod/core/file/fullDatafile/IFullDataSourceProvider.java index 56a4d4e4e..6b99c9d93 100644 --- a/core/src/main/java/com/seibel/lod/core/file/fullDatafile/IFullDataSourceProvider.java +++ b/core/src/main/java/com/seibel/lod/core/file/fullDatafile/IFullDataSourceProvider.java @@ -1,7 +1,7 @@ package com.seibel.lod.core.file.fullDatafile; import com.seibel.lod.core.datatype.IFullDataSource; -import com.seibel.lod.core.datatype.full.ChunkSizedFullData; +import com.seibel.lod.core.datatype.full.ChunkSizedFullDataSource; import com.seibel.lod.core.file.metaData.MetaData; import com.seibel.lod.core.pos.DhSectionPos; @@ -16,7 +16,7 @@ public interface IFullDataSourceProvider extends AutoCloseable { void addScannedFile(Collection detectedFiles); CompletableFuture read(DhSectionPos pos); - void write(DhSectionPos sectionPos, ChunkSizedFullData chunkData); + void write(DhSectionPos sectionPos, ChunkSizedFullDataSource chunkData); CompletableFuture flushAndSave(); //long getCacheVersion(DhSectionPos sectionPos); diff --git a/core/src/main/java/com/seibel/lod/core/file/renderfile/ILodRenderSourceProvider.java b/core/src/main/java/com/seibel/lod/core/file/renderfile/ILodRenderSourceProvider.java index ec6950f89..4eebe2030 100644 --- a/core/src/main/java/com/seibel/lod/core/file/renderfile/ILodRenderSourceProvider.java +++ b/core/src/main/java/com/seibel/lod/core/file/renderfile/ILodRenderSourceProvider.java @@ -1,7 +1,7 @@ package com.seibel.lod.core.file.renderfile; import com.seibel.lod.core.datatype.IRenderSource; -import com.seibel.lod.core.datatype.full.ChunkSizedFullData; +import com.seibel.lod.core.datatype.full.ChunkSizedFullDataSource; import com.seibel.lod.core.pos.DhSectionPos; import java.io.File; @@ -18,7 +18,7 @@ public interface ILodRenderSourceProvider extends AutoCloseable { CompletableFuture read(DhSectionPos pos); void addScannedFile(Collection detectedFiles); - void write(DhSectionPos sectionPos, ChunkSizedFullData chunkData); + void write(DhSectionPos sectionPos, ChunkSizedFullDataSource chunkData); CompletableFuture flushAndSave(); /** Returns true if the data was refreshed, false otherwise */ diff --git a/core/src/main/java/com/seibel/lod/core/file/renderfile/RenderFileHandler.java b/core/src/main/java/com/seibel/lod/core/file/renderfile/RenderFileHandler.java index 6e6ba0c31..dec9c9787 100644 --- a/core/src/main/java/com/seibel/lod/core/file/renderfile/RenderFileHandler.java +++ b/core/src/main/java/com/seibel/lod/core/file/renderfile/RenderFileHandler.java @@ -6,7 +6,7 @@ import com.seibel.lod.core.datatype.PlaceHolderRenderSource; import com.seibel.lod.core.datatype.IRenderSource; import com.seibel.lod.core.datatype.AbstractRenderSourceLoader; import com.seibel.lod.core.datatype.column.ColumnRenderSource; -import com.seibel.lod.core.datatype.full.ChunkSizedFullData; +import com.seibel.lod.core.datatype.full.ChunkSizedFullDataSource; import com.seibel.lod.core.datatype.transform.DataRenderTransformer; import com.seibel.lod.core.file.fullDatafile.IFullDataSourceProvider; import com.seibel.lod.core.level.IDhClientLevel; @@ -218,12 +218,12 @@ public class RenderFileHandler implements ILodRenderSourceProvider /* This call is concurrent. I.e. it supports multiple threads calling this method at the same time. */ @Override - public void write(DhSectionPos sectionPos, ChunkSizedFullData chunkData) + public void write(DhSectionPos sectionPos, ChunkSizedFullDataSource chunkData) { this.writeRecursively(sectionPos,chunkData); this.fullDataSourceProvider.write(sectionPos, chunkData); // TODO why is there fullData handling in the render file handler? } - private void writeRecursively(DhSectionPos sectPos, ChunkSizedFullData chunkData) + private void writeRecursively(DhSectionPos sectPos, ChunkSizedFullDataSource chunkData) { if (!sectPos.getSectionBBoxPos().overlaps(new DhLodPos((byte) (4 + chunkData.dataDetail), chunkData.x, chunkData.z))) { diff --git a/core/src/main/java/com/seibel/lod/core/file/renderfile/RenderMetaDataFile.java b/core/src/main/java/com/seibel/lod/core/file/renderfile/RenderMetaDataFile.java index 6299bf21f..caa9fdfe4 100644 --- a/core/src/main/java/com/seibel/lod/core/file/renderfile/RenderMetaDataFile.java +++ b/core/src/main/java/com/seibel/lod/core/file/renderfile/RenderMetaDataFile.java @@ -2,7 +2,7 @@ package com.seibel.lod.core.file.renderfile; import com.seibel.lod.core.datatype.IRenderSource; import com.seibel.lod.core.datatype.AbstractRenderSourceLoader; -import com.seibel.lod.core.datatype.full.ChunkSizedFullData; +import com.seibel.lod.core.datatype.full.ChunkSizedFullDataSource; import com.seibel.lod.core.file.metaData.MetaData; import com.seibel.lod.core.level.IDhClientLevel; import com.seibel.lod.core.level.IDhLevel; @@ -86,7 +86,7 @@ public class RenderMetaDataFile extends AbstractMetaDataFile // FIXME: This can cause concurrent modification of LodRenderSource. // Not sure if it will cause issues or not. - public void updateChunkIfNeeded(ChunkSizedFullData chunkData, IDhClientLevel level) + public void updateChunkIfNeeded(ChunkSizedFullDataSource chunkData, IDhClientLevel level) { DhLodPos chunkPos = new DhLodPos((byte) (chunkData.dataDetail + 4), chunkData.x, chunkData.z); LodUtil.assertTrue(this.pos.getSectionBBoxPos().overlaps(chunkPos), "Chunk pos {} doesn't overlap with section {}", chunkPos, pos); diff --git a/core/src/main/java/com/seibel/lod/core/file/subDimMatching/SubDimensionLevelMatcher.java b/core/src/main/java/com/seibel/lod/core/file/subDimMatching/SubDimensionLevelMatcher.java index 9c57a2e8c..da97ed608 100644 --- a/core/src/main/java/com/seibel/lod/core/file/subDimMatching/SubDimensionLevelMatcher.java +++ b/core/src/main/java/com/seibel/lod/core/file/subDimMatching/SubDimensionLevelMatcher.java @@ -2,7 +2,7 @@ package com.seibel.lod.core.file.subDimMatching; import com.seibel.lod.core.config.Config; import com.seibel.lod.core.datatype.IFullDataSource; -import com.seibel.lod.core.datatype.full.ChunkSizedFullData; +import com.seibel.lod.core.datatype.full.ChunkSizedFullDataSource; import com.seibel.lod.core.datatype.full.FullDataPoint; import com.seibel.lod.core.datatype.full.accessor.SingleFullArrayView; import com.seibel.lod.core.datatype.transform.LodDataBuilder; @@ -164,20 +164,20 @@ public class SubDimensionLevelMatcher implements AutoCloseable LOGGER.info("Player block pos in dimension: [" + playerData.playerBlockPos.getX() + "," + playerData.playerBlockPos.getY() + "," + playerData.playerBlockPos.getZ() + "]"); // new chunk data - ChunkSizedFullData newChunkSizedFullData = LodDataBuilder.createChunkData(newlyLoadedChunk); + ChunkSizedFullDataSource newChunkSizedFullDataSource = LodDataBuilder.createChunkData(newlyLoadedChunk); long[][][] newChunkData = new long[LodUtil.CHUNK_WIDTH][LodUtil.CHUNK_WIDTH][]; - if (newChunkSizedFullData != null) + if (newChunkSizedFullDataSource != null) { for (int x = 0; x < LodUtil.CHUNK_WIDTH; x++) { for (int z = 0; z < LodUtil.CHUNK_WIDTH; z++) { - long[] array = newChunkSizedFullData.get(x, z).getRaw(); + long[] array = newChunkSizedFullDataSource.get(x, z).getRaw(); newChunkData[x][z] = array; } } } - boolean newChunkHasData = newChunkSizedFullData != null && newChunkSizedFullData.nonEmptyCount() != 0; + boolean newChunkHasData = newChunkSizedFullDataSource != null && newChunkSizedFullDataSource.nonEmptyCount() != 0; // check if the chunk is actually empty if (!newChunkHasData) diff --git a/core/src/main/java/com/seibel/lod/core/generation/WorldGenerationQueue.java b/core/src/main/java/com/seibel/lod/core/generation/WorldGenerationQueue.java index 7827e6de5..ddadec1b5 100644 --- a/core/src/main/java/com/seibel/lod/core/generation/WorldGenerationQueue.java +++ b/core/src/main/java/com/seibel/lod/core/generation/WorldGenerationQueue.java @@ -3,7 +3,7 @@ package com.seibel.lod.core.generation; import com.seibel.lod.api.enums.worldGeneration.EDhApiDistantGeneratorMode; import com.seibel.lod.api.interfaces.override.worldGenerator.IDhApiWorldGenerator; import com.seibel.lod.core.config.Config; -import com.seibel.lod.core.datatype.full.ChunkSizedFullData; +import com.seibel.lod.core.datatype.full.ChunkSizedFullDataSource; import com.seibel.lod.core.datatype.transform.LodDataBuilder; import com.seibel.lod.core.dependencyInjection.SingletonInjector; import com.seibel.lod.core.generation.tasks.*; @@ -674,7 +674,7 @@ public class WorldGenerationQueue implements Closeable private static CompletableFuture startGenerationEvent(IDhApiWorldGenerator worldGenerator, DhChunkPos chunkPosMin, byte granularity, byte targetDataDetail, - Consumer resultConsumer) + Consumer resultConsumer) { EDhApiDistantGeneratorMode generatorMode = Config.Client.WorldGenerator.distantGeneratorMode.get(); return worldGenerator.generateChunks(chunkPosMin.x, chunkPosMin.z, granularity, targetDataDetail, generatorMode, (objectArray) -> diff --git a/core/src/main/java/com/seibel/lod/core/generation/tasks/AbstractWorldGenTaskTracker.java b/core/src/main/java/com/seibel/lod/core/generation/tasks/AbstractWorldGenTaskTracker.java index fc01cc3c8..ad5c4d96c 100644 --- a/core/src/main/java/com/seibel/lod/core/generation/tasks/AbstractWorldGenTaskTracker.java +++ b/core/src/main/java/com/seibel/lod/core/generation/tasks/AbstractWorldGenTaskTracker.java @@ -1,6 +1,6 @@ package com.seibel.lod.core.generation.tasks; -import com.seibel.lod.core.datatype.full.ChunkSizedFullData; +import com.seibel.lod.core.datatype.full.ChunkSizedFullDataSource; import java.util.function.Consumer; @@ -16,6 +16,6 @@ public abstract class AbstractWorldGenTaskTracker */ public abstract boolean isMemoryAddressValid(); - public abstract Consumer getConsumer(); + public abstract Consumer getConsumer(); } diff --git a/core/src/main/java/com/seibel/lod/core/generation/tasks/SplitTaskTracker.java b/core/src/main/java/com/seibel/lod/core/generation/tasks/SplitTaskTracker.java index 4c4fee736..5adba26d8 100644 --- a/core/src/main/java/com/seibel/lod/core/generation/tasks/SplitTaskTracker.java +++ b/core/src/main/java/com/seibel/lod/core/generation/tasks/SplitTaskTracker.java @@ -1,6 +1,6 @@ package com.seibel.lod.core.generation.tasks; -import com.seibel.lod.core.datatype.full.ChunkSizedFullData; +import com.seibel.lod.core.datatype.full.ChunkSizedFullDataSource; import java.util.concurrent.CompletableFuture; import java.util.function.Consumer; @@ -52,6 +52,6 @@ public class SplitTaskTracker extends AbstractWorldGenTaskTracker public boolean isMemoryAddressValid() { return this.isValid; } @Override - public Consumer getConsumer() { return this.parentTracker.getConsumer(); } + public Consumer getConsumer() { return this.parentTracker.getConsumer(); } } diff --git a/core/src/main/java/com/seibel/lod/core/generation/tasks/WorldGenTaskGroup.java b/core/src/main/java/com/seibel/lod/core/generation/tasks/WorldGenTaskGroup.java index 3a1665281..d6ad9f760 100644 --- a/core/src/main/java/com/seibel/lod/core/generation/tasks/WorldGenTaskGroup.java +++ b/core/src/main/java/com/seibel/lod/core/generation/tasks/WorldGenTaskGroup.java @@ -1,6 +1,6 @@ package com.seibel.lod.core.generation.tasks; -import com.seibel.lod.core.datatype.full.ChunkSizedFullData; +import com.seibel.lod.core.datatype.full.ChunkSizedFullDataSource; import com.seibel.lod.core.pos.DhLodPos; import java.util.Iterator; @@ -28,13 +28,13 @@ public final class WorldGenTaskGroup - public void accept(ChunkSizedFullData data) + public void accept(ChunkSizedFullDataSource data) { Iterator tasks = this.generatorTasks.iterator(); while (tasks.hasNext()) { WorldGenTask task = tasks.next(); - Consumer consumer = task.taskTracker.getConsumer(); + Consumer consumer = task.taskTracker.getConsumer(); if (consumer == null) { tasks.remove(); diff --git a/core/src/main/java/com/seibel/lod/core/level/DhClientServerLevel.java b/core/src/main/java/com/seibel/lod/core/level/DhClientServerLevel.java index 76e78f63b..ce02b1c1c 100644 --- a/core/src/main/java/com/seibel/lod/core/level/DhClientServerLevel.java +++ b/core/src/main/java/com/seibel/lod/core/level/DhClientServerLevel.java @@ -3,7 +3,7 @@ package com.seibel.lod.core.level; import com.seibel.lod.api.interfaces.override.worldGenerator.IDhApiWorldGenerator; import com.seibel.lod.core.DependencyInjection.WorldGeneratorInjector; import com.seibel.lod.core.config.AppliedConfigState; -import com.seibel.lod.core.datatype.full.ChunkSizedFullData; +import com.seibel.lod.core.datatype.full.ChunkSizedFullDataSource; import com.seibel.lod.core.datatype.full.FullDataSource; import com.seibel.lod.core.datatype.transform.ChunkToLodBuilder; import com.seibel.lod.core.file.fullDatafile.IFullDataSourceProvider; @@ -124,7 +124,7 @@ public class DhClientServerLevel implements IDhClientLevel, IDhServerLevel renderState.renderer.bufferHandler.update(); } - private void saveWrites(ChunkSizedFullData data) + private void saveWrites(ChunkSizedFullDataSource data) { RenderState renderState = this.renderStateRef.get(); DhLodPos pos = data.getBBoxLodPos().convertToDetailLevel(FullDataSource.SECTION_SIZE_OFFSET); @@ -242,7 +242,7 @@ public class DhClientServerLevel implements IDhClientLevel, IDhServerLevel @Override public void updateChunkAsync(IChunkWrapper chunk) { - CompletableFuture future = this.chunkToLodBuilder.tryGenerateData(chunk); + CompletableFuture future = this.chunkToLodBuilder.tryGenerateData(chunk); if (future != null) { future.thenAccept(this::saveWrites);