rename several FullData objects
This commit is contained in:
@@ -6,7 +6,7 @@ import com.seibel.lod.core.datatype.column.ColumnRenderLoader;
|
||||
import com.seibel.lod.core.datatype.full.FullDataLoader;
|
||||
import com.seibel.lod.core.datatype.full.SparseDataLoader;
|
||||
import com.seibel.lod.api.DhApiMain;
|
||||
import com.seibel.lod.core.datatype.full.SpottyDataLoader;
|
||||
import com.seibel.lod.core.datatype.full.SingleChunkFullDataLoader;
|
||||
import com.seibel.lod.core.render.DhApiRenderProxy;
|
||||
import com.seibel.lod.core.world.DhApiWorldProxy;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class Initializer
|
||||
ColumnRenderLoader unused = new ColumnRenderLoader(); // Auto register into the loader system
|
||||
FullDataLoader unused2 = new FullDataLoader(); // Auto register into the loader system
|
||||
SparseDataLoader unused3 = new SparseDataLoader(); // Auto register
|
||||
SpottyDataLoader unused4 = new SpottyDataLoader(); // Auto register
|
||||
SingleChunkFullDataLoader unused4 = new SingleChunkFullDataLoader(); // Auto register
|
||||
|
||||
// link Core's config to the API
|
||||
DhApiMain.Delayed.configs = DhApiConfig.INSTANCE;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.seibel.lod.core.datatype;
|
||||
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedData;
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedFullData;
|
||||
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(ChunkSizedData data);
|
||||
void update(ChunkSizedFullData data);
|
||||
|
||||
boolean isEmpty();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.seibel.lod.core.datatype;
|
||||
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedData;
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedFullData;
|
||||
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(ChunkSizedData chunkData, IDhClientLevel level);
|
||||
void fastWrite(ChunkSizedFullData chunkData, IDhClientLevel level);
|
||||
|
||||
/** Overrides any data that has not been written directly using write(). Skips empty source dataPoints. */
|
||||
void updateFromRenderSource(IRenderSource source);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.seibel.lod.core.datatype;
|
||||
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedData;
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedFullData;
|
||||
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(ChunkSizedData chunkData, IDhClientLevel level) { /* TODO */ }
|
||||
public void fastWrite(ChunkSizedFullData chunkData, IDhClientLevel level) { /* TODO */ }
|
||||
|
||||
@Override
|
||||
public void updateFromRenderSource(IRenderSource source) { /* TODO */ }
|
||||
|
||||
@@ -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.ChunkSizedData;
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedFullData;
|
||||
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(ChunkSizedData chunkData, IDhClientLevel level) { FullToColumnTransformer.writeFullDataChunkToColumnData(this, level, chunkData); }
|
||||
public void fastWrite(ChunkSizedFullData chunkData, IDhClientLevel level) { FullToColumnTransformer.writeFullDataChunkToColumnData(this, level, chunkData); }
|
||||
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -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 ChunkSizedData extends FullArrayView
|
||||
public class ChunkSizedFullData extends FullArrayView
|
||||
{
|
||||
public final byte dataDetail;
|
||||
public final int x;
|
||||
public final int z;
|
||||
|
||||
public ChunkSizedData(byte dataDetail, int x, int z)
|
||||
public ChunkSizedFullData(byte dataDetail, int x, int z)
|
||||
{
|
||||
super(new FullDataPointIdMap(), new long[16 * 16][0], 16);
|
||||
this.dataDetail = dataDetail;
|
||||
@@ -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(ChunkSizedData data)
|
||||
public void update(ChunkSizedFullData data)
|
||||
{
|
||||
LodUtil.assertTrue(this.sectionPos.getSectionBBoxPos().overlaps(data.getBBoxLodPos()));
|
||||
if (data.dataDetail == 0 && this.getDataDetail() == 0)
|
||||
|
||||
+2
-2
@@ -8,9 +8,9 @@ import com.seibel.lod.core.level.IDhLevel;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
public class SpottyDataLoader extends AbstractDataSourceLoader
|
||||
public class SingleChunkFullDataLoader extends AbstractDataSourceLoader
|
||||
{
|
||||
public SpottyDataLoader() {
|
||||
public SingleChunkFullDataLoader() {
|
||||
super(SingleChunkFullDataSource.class, SingleChunkFullDataSource.TYPE_ID, new byte[]{ SingleChunkFullDataSource.LATEST_VERSION});
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class SingleChunkFullDataSource extends FullArrayView implements IIncompl
|
||||
public byte getDataVersion() { return LATEST_VERSION; }
|
||||
|
||||
@Override
|
||||
public void update(ChunkSizedData data)
|
||||
public void update(ChunkSizedFullData data)
|
||||
{
|
||||
LodUtil.assertTrue(this.sectionPos.getSectionBBoxPos().overlaps(data.getBBoxLodPos()));
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
package com.seibel.lod.core.datatype.transform;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedData;
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedFullData;
|
||||
import com.seibel.lod.core.config.Config;
|
||||
import com.seibel.lod.core.logging.ConfigBasedLogger;
|
||||
import com.seibel.lod.core.pos.DhChunkPos;
|
||||
@@ -22,9 +21,9 @@ public class ChunkToLodBuilder
|
||||
private static class Task
|
||||
{
|
||||
final DhChunkPos chunkPos;
|
||||
final CompletableFuture<ChunkSizedData> future;
|
||||
final CompletableFuture<ChunkSizedFullData> future;
|
||||
|
||||
Task(DhChunkPos chunkPos, CompletableFuture<ChunkSizedData> future)
|
||||
Task(DhChunkPos chunkPos, CompletableFuture<ChunkSizedFullData> future)
|
||||
{
|
||||
this.chunkPos = chunkPos;
|
||||
this.future = future;
|
||||
@@ -37,7 +36,7 @@ public class ChunkToLodBuilder
|
||||
|
||||
|
||||
|
||||
public CompletableFuture<ChunkSizedData> tryGenerateData(IChunkWrapper chunk)
|
||||
public CompletableFuture<ChunkSizedFullData> tryGenerateData(IChunkWrapper chunk)
|
||||
{
|
||||
if (chunk == null)
|
||||
throw new NullPointerException("ChunkWrapper cannot be null!");
|
||||
@@ -50,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<ChunkSizedData> future = new CompletableFuture<>();
|
||||
CompletableFuture<ChunkSizedFullData> future = new CompletableFuture<>();
|
||||
taskToBuild.addLast(new Task(chunk.getChunkPos(), future));
|
||||
return future;
|
||||
}
|
||||
@@ -106,7 +105,7 @@ public class ChunkToLodBuilder
|
||||
{
|
||||
if (LodDataBuilder.canGenerateLodFromChunk(latestChunk))
|
||||
{
|
||||
ChunkSizedData data = LodDataBuilder.createChunkData(latestChunk);
|
||||
ChunkSizedFullData data = LodDataBuilder.createChunkData(latestChunk);
|
||||
if (data != null)
|
||||
{
|
||||
task.future.complete(data);
|
||||
|
||||
+1
-1
@@ -94,7 +94,7 @@ public class FullToColumnTransformer {
|
||||
return columnSource;
|
||||
}
|
||||
|
||||
public static void writeFullDataChunkToColumnData(ColumnRenderSource render, IDhClientLevel level, ChunkSizedData data) {
|
||||
public static void writeFullDataChunkToColumnData(ColumnRenderSource render, IDhClientLevel level, ChunkSizedFullData data) {
|
||||
if (data.dataDetail != 0)
|
||||
throw new UnsupportedOperationException("To be implemented");
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.seibel.lod.core.datatype.transform;
|
||||
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedData;
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedFullData;
|
||||
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 ChunkSizedData createChunkData(IChunkWrapper chunk) {
|
||||
public static ChunkSizedFullData createChunkData(IChunkWrapper chunk) {
|
||||
if (!canGenerateLodFromChunk(chunk)) return null;
|
||||
|
||||
ChunkSizedData chunkData = new ChunkSizedData((byte)0, chunk.getChunkPos().x, chunk.getChunkPos().z);
|
||||
ChunkSizedFullData chunkData = new ChunkSizedFullData((byte)0, chunk.getChunkPos().x, chunk.getChunkPos().z);
|
||||
|
||||
for (int x=0; x<16; x++) {
|
||||
for (int z=0; z<16; z++) {
|
||||
|
||||
@@ -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.ChunkSizedData;
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedFullData;
|
||||
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, ChunkSizedData chunkData)
|
||||
public void write(DhSectionPos sectionPos, ChunkSizedFullData 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, ChunkSizedData chunkData)
|
||||
private void recursiveWrite(DhSectionPos sectionPos, ChunkSizedFullData chunkData)
|
||||
{
|
||||
FullDataMetaFile metaFile = this.files.get(sectionPos);
|
||||
if (metaFile != null)
|
||||
|
||||
@@ -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.ChunkSizedData;
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedFullData;
|
||||
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<LodDataSource> instead of below:
|
||||
private static class GuardedMultiAppendQueue {
|
||||
ReentrantReadWriteLock appendLock = new ReentrantReadWriteLock();
|
||||
ConcurrentLinkedQueue<ChunkSizedData> queue = new ConcurrentLinkedQueue<>();
|
||||
ConcurrentLinkedQueue<ChunkSizedFullData> queue = new ConcurrentLinkedQueue<>();
|
||||
}
|
||||
|
||||
// ===Concurrent Write stuff===
|
||||
@@ -140,7 +140,7 @@ public class FullDataMetaFile extends AbstractMetaDataFile
|
||||
// }
|
||||
// }
|
||||
|
||||
public void addToWriteQueue(ChunkSizedData datatype) {
|
||||
public void addToWriteQueue(ChunkSizedFullData 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 (ChunkSizedData chunk : this._backQueue.queue)
|
||||
for (ChunkSizedFullData chunk : this._backQueue.queue)
|
||||
{
|
||||
data.update(chunk);
|
||||
}
|
||||
|
||||
+2
-2
@@ -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.ChunkSizedData;
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedFullData;
|
||||
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<ChunkSizedData> getConsumer()
|
||||
public Consumer<ChunkSizedFullData> getConsumer()
|
||||
{
|
||||
if (this.loadedTargetData == null)
|
||||
{
|
||||
|
||||
+2
-2
@@ -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.ChunkSizedData;
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedFullData;
|
||||
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<File> detectedFiles);
|
||||
|
||||
CompletableFuture<IFullDataSource> read(DhSectionPos pos);
|
||||
void write(DhSectionPos sectionPos, ChunkSizedData chunkData);
|
||||
void write(DhSectionPos sectionPos, ChunkSizedFullData chunkData);
|
||||
CompletableFuture<Void> flushAndSave();
|
||||
|
||||
//long getCacheVersion(DhSectionPos sectionPos);
|
||||
|
||||
+2
-2
@@ -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.ChunkSizedData;
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedFullData;
|
||||
import com.seibel.lod.core.pos.DhSectionPos;
|
||||
|
||||
import java.io.File;
|
||||
@@ -18,7 +18,7 @@ public interface ILodRenderSourceProvider extends AutoCloseable
|
||||
{
|
||||
CompletableFuture<IRenderSource> read(DhSectionPos pos);
|
||||
void addScannedFile(Collection<File> detectedFiles);
|
||||
void write(DhSectionPos sectionPos, ChunkSizedData chunkData);
|
||||
void write(DhSectionPos sectionPos, ChunkSizedFullData chunkData);
|
||||
CompletableFuture<Void> flushAndSave();
|
||||
|
||||
/** Returns true if the data was refreshed, false otherwise */
|
||||
|
||||
@@ -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.ChunkSizedData;
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedFullData;
|
||||
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, ChunkSizedData chunkData)
|
||||
public void write(DhSectionPos sectionPos, ChunkSizedFullData 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, ChunkSizedData chunkData)
|
||||
private void writeRecursively(DhSectionPos sectPos, ChunkSizedFullData chunkData)
|
||||
{
|
||||
if (!sectPos.getSectionBBoxPos().overlaps(new DhLodPos((byte) (4 + chunkData.dataDetail), chunkData.x, chunkData.z)))
|
||||
{
|
||||
@@ -321,8 +321,6 @@ public class RenderFileHandler implements ILodRenderSourceProvider
|
||||
|
||||
public IRenderSource onRenderFileLoaded(IRenderSource renderSource, RenderMetaDataFile file)
|
||||
{
|
||||
// TODO
|
||||
|
||||
// if (!this.fullDataSourceProvider.isCacheVersionValid(file.pos, file.metaData.dataVersion.get()))
|
||||
// {
|
||||
this.updateCache(renderSource, file);
|
||||
|
||||
@@ -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.ChunkSizedData;
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedFullData;
|
||||
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(ChunkSizedData chunkData, IDhClientLevel level)
|
||||
public void updateChunkIfNeeded(ChunkSizedFullData 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);
|
||||
|
||||
+5
-5
@@ -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.ChunkSizedData;
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedFullData;
|
||||
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
|
||||
ChunkSizedData newChunkSizedData = LodDataBuilder.createChunkData(newlyLoadedChunk);
|
||||
ChunkSizedFullData newChunkSizedFullData = LodDataBuilder.createChunkData(newlyLoadedChunk);
|
||||
long[][][] newChunkData = new long[LodUtil.CHUNK_WIDTH][LodUtil.CHUNK_WIDTH][];
|
||||
if (newChunkSizedData != null)
|
||||
if (newChunkSizedFullData != null)
|
||||
{
|
||||
for (int x = 0; x < LodUtil.CHUNK_WIDTH; x++)
|
||||
{
|
||||
for (int z = 0; z < LodUtil.CHUNK_WIDTH; z++)
|
||||
{
|
||||
long[] array = newChunkSizedData.get(x, z).getRaw();
|
||||
long[] array = newChunkSizedFullData.get(x, z).getRaw();
|
||||
newChunkData[x][z] = array;
|
||||
}
|
||||
}
|
||||
}
|
||||
boolean newChunkHasData = newChunkSizedData != null && newChunkSizedData.nonEmptyCount() != 0;
|
||||
boolean newChunkHasData = newChunkSizedFullData != null && newChunkSizedFullData.nonEmptyCount() != 0;
|
||||
|
||||
// check if the chunk is actually empty
|
||||
if (!newChunkHasData)
|
||||
|
||||
@@ -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.ChunkSizedData;
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedFullData;
|
||||
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<Void> startGenerationEvent(IDhApiWorldGenerator worldGenerator,
|
||||
DhChunkPos chunkPosMin,
|
||||
byte granularity, byte targetDataDetail,
|
||||
Consumer<ChunkSizedData> resultConsumer)
|
||||
Consumer<ChunkSizedFullData> resultConsumer)
|
||||
{
|
||||
EDhApiDistantGeneratorMode generatorMode = Config.Client.WorldGenerator.distantGeneratorMode.get();
|
||||
return worldGenerator.generateChunks(chunkPosMin.x, chunkPosMin.z, granularity, targetDataDetail, generatorMode, (objectArray) ->
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.seibel.lod.core.generation.tasks;
|
||||
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedData;
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedFullData;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@@ -16,6 +16,6 @@ public abstract class AbstractWorldGenTaskTracker
|
||||
*/
|
||||
public abstract boolean isMemoryAddressValid();
|
||||
|
||||
public abstract Consumer<ChunkSizedData> getConsumer();
|
||||
public abstract Consumer<ChunkSizedFullData> getConsumer();
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.seibel.lod.core.generation.tasks;
|
||||
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedData;
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedFullData;
|
||||
|
||||
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<ChunkSizedData> getConsumer() { return this.parentTracker.getConsumer(); }
|
||||
public Consumer<ChunkSizedFullData> getConsumer() { return this.parentTracker.getConsumer(); }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.seibel.lod.core.generation.tasks;
|
||||
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedData;
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedFullData;
|
||||
import com.seibel.lod.core.pos.DhLodPos;
|
||||
|
||||
import java.util.Iterator;
|
||||
@@ -28,13 +28,13 @@ public final class WorldGenTaskGroup
|
||||
|
||||
|
||||
|
||||
public void accept(ChunkSizedData data)
|
||||
public void accept(ChunkSizedFullData data)
|
||||
{
|
||||
Iterator<WorldGenTask> tasks = this.generatorTasks.iterator();
|
||||
while (tasks.hasNext())
|
||||
{
|
||||
WorldGenTask task = tasks.next();
|
||||
Consumer<ChunkSizedData> consumer = task.taskTracker.getConsumer();
|
||||
Consumer<ChunkSizedFullData> consumer = task.taskTracker.getConsumer();
|
||||
if (consumer == null)
|
||||
{
|
||||
tasks.remove();
|
||||
|
||||
@@ -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.ChunkSizedData;
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedFullData;
|
||||
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(ChunkSizedData data)
|
||||
private void saveWrites(ChunkSizedFullData 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<ChunkSizedData> future = this.chunkToLodBuilder.tryGenerateData(chunk);
|
||||
CompletableFuture<ChunkSizedFullData> future = this.chunkToLodBuilder.tryGenerateData(chunk);
|
||||
if (future != null)
|
||||
{
|
||||
future.thenAccept(this::saveWrites);
|
||||
|
||||
Reference in New Issue
Block a user