Add "Dh" prefix to DistantHorizons levels
This commit is contained in:
@@ -22,13 +22,13 @@ package com.seibel.lod.core.api.internal;
|
||||
import com.seibel.lod.api.methods.events.abstractEvents.*;
|
||||
import com.seibel.lod.api.methods.events.sharedParameterObjects.DhApiRenderParam;
|
||||
import com.seibel.lod.core.DependencyInjection.DhApiEventInjector;
|
||||
import com.seibel.lod.core.level.IClientLevel;
|
||||
import com.seibel.lod.core.level.IDhClientLevel;
|
||||
import com.seibel.lod.core.config.Config;
|
||||
import com.seibel.lod.core.ModInfo;
|
||||
import com.seibel.lod.api.enums.rendering.EDebugMode;
|
||||
import com.seibel.lod.api.enums.rendering.ERendererMode;
|
||||
import com.seibel.lod.core.dependencyInjection.SingletonInjector;
|
||||
import com.seibel.lod.core.level.ILevel;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
import com.seibel.lod.core.logging.ConfigBasedLogger;
|
||||
import com.seibel.lod.core.logging.ConfigBasedSpamLogger;
|
||||
import com.seibel.lod.core.logging.SpamReducedLogger;
|
||||
@@ -140,7 +140,7 @@ public class ClientApi
|
||||
{
|
||||
if (SharedApi.getEnvironment() == WorldEnvironment.Client_Only)
|
||||
{
|
||||
ILevel dhLevel = SharedApi.currentWorld.getLevel(level);
|
||||
IDhLevel dhLevel = SharedApi.currentWorld.getLevel(level);
|
||||
if (dhLevel != null)
|
||||
{
|
||||
dhLevel.updateChunk(chunk);
|
||||
@@ -252,7 +252,7 @@ public class ClientApi
|
||||
//FIXME: Improve class hierarchy of DhWorld, IClientWorld, IServerWorld to fix all this hard casting
|
||||
// (also in RenderUtil)
|
||||
DhWorld dhWorld = SharedApi.currentWorld;
|
||||
IClientLevel level = (IClientLevel) dhWorld.getOrLoadLevel(levelWrapper);
|
||||
IDhClientLevel level = (IDhClientLevel) dhWorld.getOrLoadLevel(levelWrapper);
|
||||
|
||||
if (prefLoggerEnabled)
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ import com.seibel.lod.api.methods.events.abstractEvents.DhApiLevelLoadEvent;
|
||||
import com.seibel.lod.api.methods.events.abstractEvents.DhApiLevelSaveEvent;
|
||||
import com.seibel.lod.api.methods.events.abstractEvents.DhApiLevelUnloadEvent;
|
||||
import com.seibel.lod.core.DependencyInjection.DhApiEventInjector;
|
||||
import com.seibel.lod.core.level.ILevel;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
import com.seibel.lod.core.world.DhClientServerWorld;
|
||||
import com.seibel.lod.core.world.DhServerWorld;
|
||||
import com.seibel.lod.core.world.IServerWorld;
|
||||
@@ -121,7 +121,7 @@ public class ServerApi
|
||||
{
|
||||
SharedApi.currentWorld.saveAndFlush();
|
||||
|
||||
for (ILevel level : SharedApi.currentWorld.getAllLoadedLevels())
|
||||
for (IDhLevel level : SharedApi.currentWorld.getAllLoadedLevels())
|
||||
{
|
||||
DhApiEventInjector.INSTANCE.fireAllEvents(DhApiLevelSaveEvent.class, new DhApiLevelSaveEvent.EventParam(level.getLevelWrapper()));
|
||||
}
|
||||
@@ -129,14 +129,14 @@ public class ServerApi
|
||||
}
|
||||
|
||||
public void serverChunkLoadEvent(IChunkWrapper chunk, ILevelWrapper level) {
|
||||
ILevel dhLevel = SharedApi.currentWorld.getLevel(level);
|
||||
IDhLevel dhLevel = SharedApi.currentWorld.getLevel(level);
|
||||
if (dhLevel != null)
|
||||
{
|
||||
dhLevel.updateChunk(chunk);
|
||||
}
|
||||
}
|
||||
public void serverChunkSaveEvent(IChunkWrapper chunk, ILevelWrapper level) {
|
||||
ILevel dhLevel = SharedApi.currentWorld.getLevel(level);
|
||||
IDhLevel dhLevel = SharedApi.currentWorld.getLevel(level);
|
||||
if (dhLevel != null)
|
||||
{
|
||||
dhLevel.updateChunk(chunk);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.seibel.lod.core.datatype;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.seibel.lod.core.level.ILevel;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
import com.seibel.lod.core.file.datafile.DataMetaFile;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -52,7 +52,7 @@ public abstract class DataSourceLoader {
|
||||
}
|
||||
|
||||
// Can return null as meaning the requirement is not met
|
||||
public abstract LodDataSource loadData(DataMetaFile dataFile, InputStream data, ILevel level) throws IOException;
|
||||
public abstract LodDataSource loadData(DataMetaFile dataFile, InputStream data, IDhLevel level) throws IOException;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.seibel.lod.core.datatype;
|
||||
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedData;
|
||||
import com.seibel.lod.core.level.ILevel;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
import com.seibel.lod.core.pos.DhSectionPos;
|
||||
import com.seibel.lod.core.file.datafile.DataMetaFile;
|
||||
|
||||
@@ -18,5 +18,5 @@ public interface LodDataSource {
|
||||
boolean isEmpty();
|
||||
|
||||
// Saving related
|
||||
void saveData(ILevel level, DataMetaFile file, OutputStream dataStream) throws IOException;
|
||||
void saveData(IDhLevel level, DataMetaFile file, OutputStream dataStream) throws IOException;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.seibel.lod.core.datatype;
|
||||
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedData;
|
||||
import com.seibel.lod.core.level.IClientLevel;
|
||||
import com.seibel.lod.core.level.IDhClientLevel;
|
||||
import com.seibel.lod.core.pos.DhSectionPos;
|
||||
import com.seibel.lod.core.render.LodQuadTree;
|
||||
import com.seibel.lod.core.render.RenderBuffer;
|
||||
@@ -15,7 +15,7 @@ public interface LodRenderSource {
|
||||
DhSectionPos getSectionPos();
|
||||
byte getDataDetail();
|
||||
|
||||
void enableRender(IClientLevel level, LodQuadTree quadTree);
|
||||
void enableRender(IDhClientLevel level, LodQuadTree quadTree);
|
||||
void disableRender();
|
||||
void dispose(); // notify the container that the parent lodSection is now disposed (can be in loaded or unloaded state)
|
||||
|
||||
@@ -28,7 +28,7 @@ public interface LodRenderSource {
|
||||
*/
|
||||
boolean trySwapRenderBuffer(LodQuadTree quadTree, AtomicReference<RenderBuffer> referenceSlot);
|
||||
|
||||
void saveRender(IClientLevel level, RenderMetaFile file, OutputStream dataStream) throws IOException;
|
||||
void saveRender(IDhClientLevel level, RenderMetaFile file, OutputStream dataStream) throws IOException;
|
||||
|
||||
byte getRenderVersion();
|
||||
|
||||
@@ -39,7 +39,7 @@ public interface LodRenderSource {
|
||||
|
||||
boolean isEmpty();
|
||||
|
||||
void fastWrite(ChunkSizedData chunkData, IClientLevel level);
|
||||
void fastWrite(ChunkSizedData chunkData, IDhClientLevel level);
|
||||
// Only override the data that has not been written directly using write(), and skip those that are empty
|
||||
void weakWrite(LodRenderSource source);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.seibel.lod.core.datatype;
|
||||
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedData;
|
||||
import com.seibel.lod.core.level.IClientLevel;
|
||||
import com.seibel.lod.core.level.IDhClientLevel;
|
||||
import com.seibel.lod.core.pos.DhSectionPos;
|
||||
import com.seibel.lod.core.render.LodQuadTree;
|
||||
import com.seibel.lod.core.render.RenderBuffer;
|
||||
@@ -29,7 +29,7 @@ public class PlaceHolderRenderSource implements LodRenderSource {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableRender(IClientLevel level, LodQuadTree quadTree) {
|
||||
public void enableRender(IDhClientLevel level, LodQuadTree quadTree) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -41,7 +41,7 @@ public class PlaceHolderRenderSource implements LodRenderSource {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public void saveRender(IClientLevel level, RenderMetaFile file, OutputStream dataStream) throws IOException {
|
||||
public void saveRender(IDhClientLevel level, RenderMetaFile file, OutputStream dataStream) throws IOException {
|
||||
throw new UnsupportedOperationException("EmptyRenderSource should NEVER be saved!");
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class PlaceHolderRenderSource implements LodRenderSource {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fastWrite(ChunkSizedData chunkData, IClientLevel level) {}
|
||||
public void fastWrite(ChunkSizedData chunkData, IDhClientLevel level) {}
|
||||
|
||||
@Override
|
||||
public void weakWrite(LodRenderSource source) {}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.seibel.lod.core.datatype;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.seibel.lod.core.level.IClientLevel;
|
||||
import com.seibel.lod.core.level.ILevel;
|
||||
import com.seibel.lod.core.level.IDhClientLevel;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
import com.seibel.lod.core.file.renderfile.RenderMetaFile;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -54,8 +54,8 @@ public abstract class RenderSourceLoader {
|
||||
}
|
||||
|
||||
// Can return null as meaning the file is out of date or something
|
||||
public abstract LodRenderSource loadRender(RenderMetaFile renderFile, InputStream data, ILevel level) throws IOException;
|
||||
public abstract LodRenderSource createRender(LodDataSource dataSource, IClientLevel level);
|
||||
public abstract LodRenderSource loadRender(RenderMetaFile renderFile, InputStream data, IDhLevel level) throws IOException;
|
||||
public abstract LodRenderSource createRender(LodDataSource dataSource, IDhClientLevel level);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@ import com.seibel.lod.core.datatype.LodDataSource;
|
||||
import com.seibel.lod.core.datatype.full.FullDataSource;
|
||||
import com.seibel.lod.core.datatype.full.SparseDataSource;
|
||||
import com.seibel.lod.core.datatype.transform.FullToColumnTransformer;
|
||||
import com.seibel.lod.core.level.IClientLevel;
|
||||
import com.seibel.lod.core.level.IDhClientLevel;
|
||||
import com.seibel.lod.core.datatype.LodRenderSource;
|
||||
import com.seibel.lod.core.datatype.RenderSourceLoader;
|
||||
import com.seibel.lod.core.level.ILevel;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
import com.seibel.lod.core.file.renderfile.RenderMetaFile;
|
||||
import com.seibel.lod.core.util.LodUtil;
|
||||
|
||||
@@ -21,13 +21,13 @@ public class ColumnRenderLoader extends RenderSourceLoader {
|
||||
}
|
||||
|
||||
@Override
|
||||
public LodRenderSource loadRender(RenderMetaFile dataFile, InputStream data, ILevel level) throws IOException {
|
||||
public LodRenderSource loadRender(RenderMetaFile dataFile, InputStream data, IDhLevel level) throws IOException {
|
||||
DataInputStream dis = new DataInputStream(data); // DO NOT CLOSE
|
||||
return new ColumnRenderSource(dataFile.pos, dis, dataFile.metaData.loaderVersion, level);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LodRenderSource createRender(LodDataSource dataSource, IClientLevel level) {
|
||||
public LodRenderSource createRender(LodDataSource dataSource, IDhClientLevel level) {
|
||||
if (dataSource instanceof FullDataSource) {
|
||||
return FullToColumnTransformer.transformFullDataToColumnData(level, (FullDataSource) dataSource);
|
||||
} else if (dataSource instanceof SparseDataSource) {
|
||||
|
||||
@@ -4,14 +4,13 @@ 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.transform.FullToColumnTransformer;
|
||||
import com.seibel.lod.core.level.IClientLevel;
|
||||
import com.seibel.lod.core.level.IDhClientLevel;
|
||||
import com.seibel.lod.core.pos.DhSectionPos;
|
||||
import com.seibel.lod.core.render.RenderBuffer;
|
||||
import com.seibel.lod.core.render.renderer.LodRenderer;
|
||||
import com.seibel.lod.core.file.renderfile.RenderMetaFile;
|
||||
import com.seibel.lod.core.enums.ELodDirection;
|
||||
import com.seibel.lod.core.logging.DhLoggerBuilder;
|
||||
import com.seibel.lod.core.level.ILevel;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
import com.seibel.lod.core.render.LodQuadTree;
|
||||
import com.seibel.lod.core.render.LodRenderSection;
|
||||
import com.seibel.lod.core.datatype.LodRenderSource;
|
||||
@@ -115,7 +114,7 @@ public class ColumnRenderSource implements LodRenderSource, IColumnDatatype {
|
||||
}
|
||||
|
||||
// Load from data stream with maxVerticalSize loaded from the data stream
|
||||
public ColumnRenderSource(DhSectionPos sectionPos, DataInputStream inputData, int version, ILevel level) throws IOException {
|
||||
public ColumnRenderSource(DhSectionPos sectionPos, DataInputStream inputData, int version, IDhLevel level) throws IOException {
|
||||
this.sectionPos = sectionPos;
|
||||
yOffset = level.getMinY();
|
||||
byte detailLevel = inputData.readByte();
|
||||
@@ -298,7 +297,7 @@ public class ColumnRenderSource implements LodRenderSource, IColumnDatatype {
|
||||
private Reference<ColumnRenderBuffer> usedBuffer = new Reference<>();
|
||||
|
||||
|
||||
private void tryBuildBuffer(IClientLevel level, LodQuadTree quadTree) {
|
||||
private void tryBuildBuffer(IDhClientLevel level, LodQuadTree quadTree) {
|
||||
if (inBuildRenderBuffer == null && !ColumnRenderBuffer.isBusy() && !isEmpty) {
|
||||
ColumnRenderSource[] data = new ColumnRenderSource[ELodDirection.ADJ_DIRECTIONS.length];
|
||||
for (ELodDirection direction : ELodDirection.ADJ_DIRECTIONS) {
|
||||
@@ -318,9 +317,9 @@ public class ColumnRenderSource implements LodRenderSource, IColumnDatatype {
|
||||
}
|
||||
}
|
||||
|
||||
private IClientLevel level = null; //FIXME: hack to pass level into tryBuildBuffer
|
||||
private IDhClientLevel level = null; //FIXME: hack to pass level into tryBuildBuffer
|
||||
@Override
|
||||
public void enableRender(IClientLevel level, LodQuadTree quadTree) {
|
||||
public void enableRender(IDhClientLevel level, LodQuadTree quadTree) {
|
||||
this.level = level;
|
||||
//tryBuildBuffer(level, quadTree);
|
||||
}
|
||||
@@ -369,7 +368,7 @@ public class ColumnRenderSource implements LodRenderSource, IColumnDatatype {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveRender(IClientLevel level, RenderMetaFile file, OutputStream dataStream) throws IOException {
|
||||
public void saveRender(IDhClientLevel level, RenderMetaFile file, OutputStream dataStream) throws IOException {
|
||||
DataOutputStream dos = new DataOutputStream(dataStream); // DO NOT CLOSE
|
||||
writeData(dos);
|
||||
}
|
||||
@@ -416,7 +415,7 @@ public class ColumnRenderSource implements LodRenderSource, IColumnDatatype {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fastWrite(ChunkSizedData chunkData, IClientLevel level) {
|
||||
public void fastWrite(ChunkSizedData chunkData, IDhClientLevel level) {
|
||||
FullToColumnTransformer.writeFullDataChunkToColumnData(this, level, chunkData);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@ package com.seibel.lod.core.datatype.column.render;
|
||||
import com.seibel.lod.core.datatype.column.ColumnRenderSource;
|
||||
import com.seibel.lod.core.datatype.column.accessor.ColumnArrayView;
|
||||
import com.seibel.lod.core.datatype.column.accessor.ColumnFormat;
|
||||
import com.seibel.lod.core.level.IClientLevel;
|
||||
import com.seibel.lod.core.level.IDhClientLevel;
|
||||
import com.seibel.lod.core.render.renderer.LodRenderer;
|
||||
import com.seibel.lod.core.util.objects.UncheckedInterruptedException;
|
||||
import com.seibel.lod.core.render.RenderBuffer;
|
||||
@@ -217,7 +217,7 @@ public class ColumnRenderBuffer extends RenderBuffer {
|
||||
return getCurrentJobsCount() > MAX_CONCURRENT_CALL;
|
||||
}
|
||||
|
||||
public static CompletableFuture<ColumnRenderBuffer> build(IClientLevel clientLevel, Reference<ColumnRenderBuffer> usedBufferSlot, ColumnRenderSource data, ColumnRenderSource[] adjData) {
|
||||
public static CompletableFuture<ColumnRenderBuffer> build(IDhClientLevel clientLevel, Reference<ColumnRenderBuffer> usedBufferSlot, ColumnRenderSource data, ColumnRenderSource[] adjData) {
|
||||
if (isBusy()) return null;
|
||||
//LOGGER.info("RenderRegion startBuild @ {}", data.sectionPos);
|
||||
return CompletableFuture.supplyAsync(() -> {
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.seibel.lod.core.datatype.full;
|
||||
|
||||
import com.seibel.lod.core.datatype.DataSourceLoader;
|
||||
import com.seibel.lod.core.datatype.LodDataSource;
|
||||
import com.seibel.lod.core.level.ILevel;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
import com.seibel.lod.core.file.datafile.DataMetaFile;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -14,7 +14,7 @@ public class FullDataLoader extends DataSourceLoader {
|
||||
}
|
||||
|
||||
@Override
|
||||
public LodDataSource loadData(DataMetaFile dataFile, InputStream data, ILevel level) throws IOException {
|
||||
public LodDataSource loadData(DataMetaFile dataFile, InputStream data, IDhLevel level) throws IOException {
|
||||
//TODO: Add decompressor here
|
||||
return FullDataSource.loadData(dataFile, data, level);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.seibel.lod.core.datatype.full;
|
||||
|
||||
import com.seibel.lod.core.datatype.full.accessor.FullArrayView;
|
||||
import com.seibel.lod.core.datatype.full.accessor.SingleFullArrayView;
|
||||
import com.seibel.lod.core.level.ILevel;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
import com.seibel.lod.core.pos.DhBlockPos2D;
|
||||
import com.seibel.lod.core.pos.DhLodPos;
|
||||
import com.seibel.lod.core.file.datafile.DataMetaFile;
|
||||
@@ -101,7 +101,7 @@ public class FullDataSource extends FullArrayView implements LodDataSource { //
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveData(ILevel level, DataMetaFile file, OutputStream dataStream) throws IOException {
|
||||
public void saveData(IDhLevel level, DataMetaFile file, OutputStream dataStream) throws IOException {
|
||||
DataOutputStream dos = new DataOutputStream(dataStream); // DO NOT CLOSE
|
||||
{
|
||||
dos.writeInt(getDataDetail());
|
||||
@@ -138,7 +138,7 @@ public class FullDataSource extends FullArrayView implements LodDataSource { //
|
||||
}
|
||||
|
||||
|
||||
public static FullDataSource loadData(DataMetaFile dataFile, InputStream dataStream, ILevel level) throws IOException {
|
||||
public static FullDataSource loadData(DataMetaFile dataFile, InputStream dataStream, IDhLevel level) throws IOException {
|
||||
DataInputStream dos = new DataInputStream(dataStream); // DO NOT CLOSE
|
||||
{
|
||||
int dataDetail = dos.readInt();
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.seibel.lod.core.datatype.full;
|
||||
|
||||
import com.seibel.lod.core.datatype.DataSourceLoader;
|
||||
import com.seibel.lod.core.datatype.LodDataSource;
|
||||
import com.seibel.lod.core.level.ILevel;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
import com.seibel.lod.core.file.datafile.DataMetaFile;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -14,7 +14,7 @@ public class SparseDataLoader extends DataSourceLoader {
|
||||
}
|
||||
|
||||
@Override
|
||||
public LodDataSource loadData(DataMetaFile dataFile, InputStream data, ILevel level) throws IOException {
|
||||
public LodDataSource loadData(DataMetaFile dataFile, InputStream data, IDhLevel level) throws IOException {
|
||||
return SparseDataSource.loadData(dataFile, data, level);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.seibel.lod.core.datatype.full;
|
||||
import com.seibel.lod.core.datatype.LodDataSource;
|
||||
import com.seibel.lod.core.datatype.full.accessor.FullArrayView;
|
||||
import com.seibel.lod.core.datatype.full.accessor.SingleFullArrayView;
|
||||
import com.seibel.lod.core.level.ILevel;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
import com.seibel.lod.core.pos.DhLodPos;
|
||||
import com.seibel.lod.core.pos.DhSectionPos;
|
||||
import com.seibel.lod.core.file.datafile.DataMetaFile;
|
||||
@@ -162,7 +162,7 @@ public class SparseDataSource implements LodDataSource {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveData(ILevel level, DataMetaFile file, OutputStream dataStream) throws IOException {
|
||||
public void saveData(IDhLevel level, DataMetaFile file, OutputStream dataStream) throws IOException {
|
||||
try (DataOutputStream dos = new DataOutputStream(dataStream)) {
|
||||
dos.writeShort(getDataDetail());
|
||||
dos.writeShort(SPARSE_UNIT_DETAIL);
|
||||
@@ -209,7 +209,7 @@ public class SparseDataSource implements LodDataSource {
|
||||
}
|
||||
}
|
||||
|
||||
public static SparseDataSource loadData(DataMetaFile dataFile, InputStream dataStream, ILevel level) throws IOException {
|
||||
public static SparseDataSource loadData(DataMetaFile dataFile, InputStream dataStream, IDhLevel level) throws IOException {
|
||||
LodUtil.assertTrue(dataFile.pos.sectionDetail > SPARSE_UNIT_DETAIL);
|
||||
LodUtil.assertTrue(dataFile.pos.sectionDetail <= MAX_SECTION_DETAIL);
|
||||
DataInputStream dos = new DataInputStream(dataStream); // DO NOT CLOSE!
|
||||
|
||||
+4
-4
@@ -4,7 +4,7 @@ import com.seibel.lod.core.datatype.LodDataSource;
|
||||
import com.seibel.lod.core.datatype.LodRenderSource;
|
||||
import com.seibel.lod.core.datatype.column.ColumnRenderLoader;
|
||||
import com.seibel.lod.core.datatype.column.ColumnRenderSource;
|
||||
import com.seibel.lod.core.level.IClientLevel;
|
||||
import com.seibel.lod.core.level.IDhClientLevel;
|
||||
import com.seibel.lod.core.util.LodUtil;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
@@ -15,15 +15,15 @@ public class DataRenderTransformer {
|
||||
public static final ExecutorService TRANSFORMER_THREADS
|
||||
= LodUtil.makeThreadPool(4, "Data/Render Transformer");
|
||||
|
||||
public static CompletableFuture<LodRenderSource> transformDataSource(LodDataSource data, IClientLevel level) {
|
||||
public static CompletableFuture<LodRenderSource> transformDataSource(LodDataSource data, IDhClientLevel level) {
|
||||
return CompletableFuture.supplyAsync(() -> transform(data, level), TRANSFORMER_THREADS);
|
||||
}
|
||||
|
||||
public static CompletableFuture<LodRenderSource> asyncTransformDataSource(CompletableFuture<LodDataSource> data, IClientLevel level) {
|
||||
public static CompletableFuture<LodRenderSource> asyncTransformDataSource(CompletableFuture<LodDataSource> data, IDhClientLevel level) {
|
||||
return data.thenApplyAsync((d) -> transform(d, level), TRANSFORMER_THREADS);
|
||||
}
|
||||
|
||||
private static LodRenderSource transform(LodDataSource dataSource, IClientLevel level) {
|
||||
private static LodRenderSource transform(LodDataSource dataSource, IDhClientLevel level) {
|
||||
if (dataSource == null) return null;
|
||||
return ColumnRenderLoader.loaderRegistry.get(ColumnRenderSource.class)
|
||||
.stream().findFirst().get().createRender(dataSource, level);
|
||||
|
||||
+6
-6
@@ -7,7 +7,7 @@ import com.seibel.lod.core.datatype.column.accessor.ColumnArrayView;
|
||||
import com.seibel.lod.core.datatype.column.accessor.ColumnQuadView;
|
||||
import com.seibel.lod.core.datatype.full.*;
|
||||
import com.seibel.lod.core.datatype.full.accessor.SingleFullArrayView;
|
||||
import com.seibel.lod.core.level.IClientLevel;
|
||||
import com.seibel.lod.core.level.IDhClientLevel;
|
||||
import com.seibel.lod.core.pos.DhSectionPos;
|
||||
import com.seibel.lod.core.config.Config;
|
||||
import com.seibel.lod.core.dependencyInjection.SingletonInjector;
|
||||
@@ -26,7 +26,7 @@ public class FullToColumnTransformer {
|
||||
* @throws IllegalArgumentException thrown if either the chunk or world is null.
|
||||
*/
|
||||
|
||||
public static ColumnRenderSource transformFullDataToColumnData(IClientLevel level, FullDataSource data) {
|
||||
public static ColumnRenderSource transformFullDataToColumnData(IDhClientLevel level, FullDataSource data) {
|
||||
final DhSectionPos pos = data.getSectionPos();
|
||||
final byte dataDetail = data.getDataDetail();
|
||||
final int vertSize = Config.Client.Graphics.Quality.verticalQuality.get().calculateMaxVerticalData(data.getDataDetail());
|
||||
@@ -66,7 +66,7 @@ public class FullToColumnTransformer {
|
||||
return columnSource;
|
||||
}
|
||||
|
||||
public static LodRenderSource transformSparseDataToColumnData(IClientLevel level, SparseDataSource data) {
|
||||
public static LodRenderSource transformSparseDataToColumnData(IDhClientLevel level, SparseDataSource data) {
|
||||
final DhSectionPos pos = data.getSectionPos();
|
||||
final byte dataDetail = data.getDataDetail();
|
||||
final int vertSize = Config.Client.Graphics.Quality.verticalQuality.get().calculateMaxVerticalData(data.getDataDetail());
|
||||
@@ -94,7 +94,7 @@ public class FullToColumnTransformer {
|
||||
return columnSource;
|
||||
}
|
||||
|
||||
public static void writeFullDataChunkToColumnData(ColumnRenderSource render, IClientLevel level, ChunkSizedData data) {
|
||||
public static void writeFullDataChunkToColumnData(ColumnRenderSource render, IDhClientLevel level, ChunkSizedData data) {
|
||||
if (data.dataDetail != 0)
|
||||
throw new UnsupportedOperationException("To be implemented");
|
||||
|
||||
@@ -148,7 +148,7 @@ public class FullToColumnTransformer {
|
||||
}
|
||||
}
|
||||
|
||||
private static void convertColumnData(IClientLevel level, int blockX, int blockZ, ColumnArrayView columnArrayView, SingleFullArrayView fullArrayView, int genMode) {
|
||||
private static void convertColumnData(IDhClientLevel level, int blockX, int blockZ, ColumnArrayView columnArrayView, SingleFullArrayView fullArrayView, int genMode) {
|
||||
if (!fullArrayView.doesItExist()) return;
|
||||
int dataTotalLength = fullArrayView.getSingleLength();
|
||||
if (dataTotalLength == 0) return;
|
||||
@@ -162,7 +162,7 @@ public class FullToColumnTransformer {
|
||||
}
|
||||
}
|
||||
|
||||
private static void iterateAndConvert(IClientLevel level, int blockX, int blockZ, int genMode, ColumnArrayView column, SingleFullArrayView data) {
|
||||
private static void iterateAndConvert(IDhClientLevel level, int blockX, int blockZ, int genMode, ColumnArrayView column, SingleFullArrayView data) {
|
||||
IdBiomeBlockStateMap mapping = data.getMapping();
|
||||
boolean isVoid = true;
|
||||
int offset = 0;
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.seibel.lod.core.datatype.full.ChunkSizedData;
|
||||
import com.seibel.lod.core.datatype.full.FullDataSource;
|
||||
import com.seibel.lod.core.datatype.full.SparseDataSource;
|
||||
import com.seibel.lod.core.file.MetaFile;
|
||||
import com.seibel.lod.core.level.ILevel;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
import com.seibel.lod.core.pos.DhLodPos;
|
||||
import com.seibel.lod.core.pos.DhSectionPos;
|
||||
import com.seibel.lod.core.logging.DhLoggerBuilder;
|
||||
@@ -32,12 +32,12 @@ public class DataFileHandler implements IDataSourceProvider {
|
||||
private static final Logger LOGGER = DhLoggerBuilder.getLogger();
|
||||
final ExecutorService fileReaderThread = LodUtil.makeThreadPool(4, "FileReaderThread");
|
||||
final ConcurrentHashMap<DhSectionPos, DataMetaFile> files = new ConcurrentHashMap<>();
|
||||
final ILevel level;
|
||||
final IDhLevel level;
|
||||
final File saveDir;
|
||||
AtomicInteger topDetailLevel = new AtomicInteger(-1);
|
||||
final int minDetailLevel = FullDataSource.SECTION_SIZE_OFFSET;
|
||||
|
||||
public DataFileHandler(ILevel level, File saveRootDir) {
|
||||
public DataFileHandler(IDhLevel level, File saveRootDir) {
|
||||
this.saveDir = saveRootDir;
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.seibel.lod.core.datatype.DataSourceLoader;
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedData;
|
||||
import com.seibel.lod.core.pos.DhLodPos;
|
||||
import com.seibel.lod.core.file.MetaFile;
|
||||
import com.seibel.lod.core.level.ILevel;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
import com.seibel.lod.core.pos.DhSectionPos;
|
||||
import com.seibel.lod.core.logging.DhLoggerBuilder;
|
||||
import com.seibel.lod.core.util.LodUtil;
|
||||
@@ -24,7 +24,7 @@ public class DataMetaFile extends MetaFile
|
||||
{
|
||||
private static final Logger LOGGER = DhLoggerBuilder.getLogger(DataMetaFile.class.getSimpleName());
|
||||
|
||||
private final ILevel level;
|
||||
private final IDhLevel level;
|
||||
private final IDataSourceProvider handler;
|
||||
private boolean doesFileExist;
|
||||
|
||||
@@ -71,7 +71,7 @@ public class DataMetaFile extends MetaFile
|
||||
|
||||
|
||||
// Create a new metaFile
|
||||
public DataMetaFile(IDataSourceProvider handler, ILevel level, DhSectionPos pos) throws IOException {
|
||||
public DataMetaFile(IDataSourceProvider handler, IDhLevel level, DhSectionPos pos) throws IOException {
|
||||
super(handler.computeDataFilePath(pos), pos);
|
||||
debugCheck();
|
||||
this.handler = handler;
|
||||
@@ -80,7 +80,7 @@ public class DataMetaFile extends MetaFile
|
||||
doesFileExist = false;
|
||||
}
|
||||
|
||||
public DataMetaFile(IDataSourceProvider handler, ILevel level, File path) throws IOException {
|
||||
public DataMetaFile(IDataSourceProvider handler, IDhLevel level, File path) throws IOException {
|
||||
super(path);
|
||||
debugCheck();
|
||||
this.handler = handler;
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.seibel.lod.core.datatype.full.ChunkSizedData;
|
||||
import com.seibel.lod.core.datatype.full.FullDataSource;
|
||||
import com.seibel.lod.core.datatype.full.SparseDataSource;
|
||||
import com.seibel.lod.core.generation.GenerationQueue;
|
||||
import com.seibel.lod.core.level.IServerLevel;
|
||||
import com.seibel.lod.core.level.IDhServerLevel;
|
||||
import com.seibel.lod.core.pos.DhSectionPos;
|
||||
import com.seibel.lod.core.logging.DhLoggerBuilder;
|
||||
import com.seibel.lod.core.util.LodUtil;
|
||||
@@ -55,7 +55,7 @@ public class GeneratedDataFileHandler extends DataFileHandler {
|
||||
}
|
||||
|
||||
|
||||
public GeneratedDataFileHandler(IServerLevel level, File saveRootDir) {
|
||||
public GeneratedDataFileHandler(IDhServerLevel level, File saveRootDir) {
|
||||
super(level, saveRootDir);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.seibel.lod.core.file.datafile;
|
||||
|
||||
import com.seibel.lod.core.level.ILevel;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class RemoteDataFileHandler extends DataFileHandler {
|
||||
public RemoteDataFileHandler(ILevel level, File saveRootDir) {
|
||||
public RemoteDataFileHandler(IDhLevel level, File saveRootDir) {
|
||||
super(level, saveRootDir);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.seibel.lod.core.datatype.column.ColumnRenderSource;
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedData;
|
||||
import com.seibel.lod.core.datatype.transform.DataRenderTransformer;
|
||||
import com.seibel.lod.core.file.datafile.IDataSourceProvider;
|
||||
import com.seibel.lod.core.level.IClientLevel;
|
||||
import com.seibel.lod.core.level.IDhClientLevel;
|
||||
import com.seibel.lod.core.pos.DhLodPos;
|
||||
import com.seibel.lod.core.pos.DhSectionPos;
|
||||
import com.seibel.lod.core.util.objects.UncheckedInterruptedException;
|
||||
@@ -30,11 +30,11 @@ public class RenderFileHandler implements IRenderSourceProvider {
|
||||
private static final Logger LOGGER = DhLoggerBuilder.getLogger();
|
||||
final ExecutorService renderCacheThread = LodUtil.makeSingleThreadPool("RenderCacheThread");
|
||||
final ConcurrentHashMap<DhSectionPos, RenderMetaFile> files = new ConcurrentHashMap<>();
|
||||
final IClientLevel level;
|
||||
final IDhClientLevel level;
|
||||
final File saveDir;
|
||||
final IDataSourceProvider dataSourceProvider;
|
||||
|
||||
public RenderFileHandler(IDataSourceProvider sourceProvider, IClientLevel level, File saveRootDir) {
|
||||
public RenderFileHandler(IDataSourceProvider sourceProvider, IDhClientLevel level, File saveRootDir) {
|
||||
this.dataSourceProvider = sourceProvider;
|
||||
this.level = level;
|
||||
this.saveDir = saveRootDir;
|
||||
|
||||
@@ -4,8 +4,8 @@ import com.seibel.lod.core.datatype.LodDataSource;
|
||||
import com.seibel.lod.core.datatype.LodRenderSource;
|
||||
import com.seibel.lod.core.datatype.RenderSourceLoader;
|
||||
import com.seibel.lod.core.datatype.full.ChunkSizedData;
|
||||
import com.seibel.lod.core.level.IClientLevel;
|
||||
import com.seibel.lod.core.level.ILevel;
|
||||
import com.seibel.lod.core.level.IDhClientLevel;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
import com.seibel.lod.core.pos.DhLodPos;
|
||||
import com.seibel.lod.core.file.MetaFile;
|
||||
import com.seibel.lod.core.pos.DhSectionPos;
|
||||
@@ -37,7 +37,7 @@ public class RenderMetaFile extends MetaFile
|
||||
|
||||
//FIXME: This can cause concurrent modification of LodRenderSource.
|
||||
// Not sure if it will cause issues or not.
|
||||
public void updateChunkIfNeeded(ChunkSizedData chunkData, IClientLevel level) {
|
||||
public void updateChunkIfNeeded(ChunkSizedData chunkData, IDhClientLevel level) {
|
||||
DhLodPos chunkPos = new DhLodPos((byte) (chunkData.dataDetail + 4), chunkData.x, chunkData.z);
|
||||
LodUtil.assertTrue(pos.getSectionBBoxPos().overlaps(chunkPos), "Chunk pos {} doesn't overlap with section {}", chunkPos, pos);
|
||||
|
||||
@@ -111,7 +111,7 @@ public class RenderMetaFile extends MetaFile
|
||||
|
||||
// Cause: Generic Type runtime casting cannot safety check it.
|
||||
// However, the Union type ensures the 'data' should only contain the listed type.
|
||||
public CompletableFuture<LodRenderSource> loadOrGetCached(Executor fileReaderThreads, ILevel level) {
|
||||
public CompletableFuture<LodRenderSource> loadOrGetCached(Executor fileReaderThreads, IDhLevel level) {
|
||||
Object obj = data.get();
|
||||
|
||||
CompletableFuture<LodRenderSource> cached = _readCached(obj);
|
||||
@@ -201,7 +201,7 @@ public class RenderMetaFile extends MetaFile
|
||||
return fin;
|
||||
}
|
||||
|
||||
public void save(LodRenderSource data, IClientLevel level) {
|
||||
public void save(LodRenderSource data, IDhClientLevel level) {
|
||||
if (data.isEmpty()) {
|
||||
if (path.exists()) if (!path.delete()) LOGGER.warn("Failed to delete render file at {}", path);
|
||||
doesFileExist = false;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
package com.seibel.lod.core.generation;
|
||||
|
||||
import com.seibel.lod.core.level.ILevel;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
import com.seibel.lod.core.config.Config;
|
||||
import com.seibel.lod.api.enums.config.EDistanceGenerationMode;
|
||||
import com.seibel.lod.core.dependencyInjection.SingletonInjector;
|
||||
@@ -43,11 +43,11 @@ public class BatchGenerator implements IChunkGenerator
|
||||
private static final IMinecraftClientWrapper MC = SingletonInjector.INSTANCE.get(IMinecraftClientWrapper.class);
|
||||
private static final IWrapperFactory FACTORY = SingletonInjector.INSTANCE.get(IWrapperFactory.class);
|
||||
public AbstractBatchGenerationEnvionmentWrapper generationGroup;
|
||||
public ILevel targetLodLevel;
|
||||
public IDhLevel targetLodLevel;
|
||||
public static final int generationGroupSize = 4;
|
||||
private static final Logger LOGGER = DhLoggerBuilder.getLogger(MethodHandles.lookup().lookupClass().getSimpleName());
|
||||
|
||||
public BatchGenerator(ILevel targetLodLevel) {
|
||||
public BatchGenerator(IDhLevel targetLodLevel) {
|
||||
this.targetLodLevel = targetLodLevel;
|
||||
generationGroup = FACTORY.createBatchGenerator(targetLodLevel);
|
||||
LOGGER.info("Batch Chunk Generator initialized");
|
||||
|
||||
@@ -24,7 +24,8 @@ import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class DhClientLevel implements IClientLevel {
|
||||
public class DhClientLevel implements IDhClientLevel
|
||||
{
|
||||
private static final Logger LOGGER = DhLoggerBuilder.getLogger();
|
||||
private static final IMinecraftClientWrapper MC_CLIENT = SingletonInjector.INSTANCE.get(IMinecraftClientWrapper.class);
|
||||
public final ClientOnlySaveStructure save;
|
||||
@@ -74,15 +75,10 @@ public class DhClientLevel implements IClientLevel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IClientLevelWrapper getClientLevelWrapper() {
|
||||
return level;
|
||||
}
|
||||
public IClientLevelWrapper getClientLevelWrapper() { return level; }
|
||||
|
||||
@Override
|
||||
public ILevelWrapper getLevelWrapper()
|
||||
{
|
||||
return this.level;
|
||||
}
|
||||
public ILevelWrapper getLevelWrapper() { return this.level; }
|
||||
|
||||
@Override
|
||||
public void updateChunk(IChunkWrapper chunk) {
|
||||
@@ -90,14 +86,10 @@ public class DhClientLevel implements IClientLevel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinY() {
|
||||
return level.getMinHeight();
|
||||
}
|
||||
public int getMinY() { return level.getMinHeight(); }
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Void> save() {
|
||||
return renderFileHandler.flushAndSave();
|
||||
}
|
||||
public CompletableFuture<Void> save() { return renderFileHandler.flushAndSave(); }
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
|
||||
@@ -36,7 +36,8 @@ import org.apache.logging.log4j.Logger;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
public class DhClientServerLevel implements IClientLevel, IServerLevel {
|
||||
public class DhClientServerLevel implements IDhClientLevel, IDhServerLevel
|
||||
{
|
||||
class RenderState {
|
||||
final IClientLevelWrapper clientLevel;
|
||||
final LodQuadTree tree;
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class DhServerLevel implements IServerLevel
|
||||
public class DhServerLevel implements IDhServerLevel
|
||||
{
|
||||
private static final Logger LOGGER = DhLoggerBuilder.getLogger();
|
||||
|
||||
|
||||
+7
-8
@@ -1,6 +1,5 @@
|
||||
package com.seibel.lod.core.level;
|
||||
|
||||
import com.seibel.lod.core.render.RenderBufferHandler;
|
||||
import com.seibel.lod.core.pos.DhBlockPos;
|
||||
import com.seibel.lod.core.util.math.Mat4f;
|
||||
import com.seibel.lod.core.wrapperInterfaces.block.IBlockStateWrapper;
|
||||
@@ -8,15 +7,15 @@ import com.seibel.lod.core.wrapperInterfaces.minecraft.IProfilerWrapper;
|
||||
import com.seibel.lod.core.wrapperInterfaces.world.IBiomeWrapper;
|
||||
import com.seibel.lod.core.wrapperInterfaces.world.IClientLevelWrapper;
|
||||
|
||||
public interface IClientLevel extends ILevel {
|
||||
/**
|
||||
* Return whether the level needs to be reloaded
|
||||
*/
|
||||
public interface IDhClientLevel extends IDhLevel
|
||||
{
|
||||
/** Return whether the level needs to be reloaded */
|
||||
void clientTick();
|
||||
|
||||
|
||||
void render(Mat4f mcModelViewMatrix, Mat4f mcProjectionMatrix, float partialTicks, IProfilerWrapper profiler);
|
||||
|
||||
|
||||
int computeBaseColor(DhBlockPos pos, IBiomeWrapper biome, IBlockStateWrapper block);
|
||||
|
||||
|
||||
IClientLevelWrapper getClientLevelWrapper();
|
||||
|
||||
}
|
||||
+5
-4
@@ -5,15 +5,16 @@ import com.seibel.lod.core.wrapperInterfaces.world.ILevelWrapper;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public interface ILevel extends AutoCloseable
|
||||
public interface IDhLevel extends AutoCloseable
|
||||
{
|
||||
int getMinY();
|
||||
CompletableFuture<Void> save();
|
||||
|
||||
|
||||
void dumpRamUsage();
|
||||
|
||||
|
||||
/** May return either a client or server level wrapper. */
|
||||
ILevelWrapper getLevelWrapper();
|
||||
|
||||
|
||||
void updateChunk(IChunkWrapper chunk);
|
||||
|
||||
}
|
||||
+4
-2
@@ -2,9 +2,11 @@ package com.seibel.lod.core.level;
|
||||
|
||||
import com.seibel.lod.core.wrapperInterfaces.world.IServerLevelWrapper;
|
||||
|
||||
public interface IServerLevel extends ILevel {
|
||||
public interface IDhServerLevel extends IDhLevel
|
||||
{
|
||||
void serverTick();
|
||||
void doWorldGen();
|
||||
|
||||
|
||||
IServerLevelWrapper getServerLevelWrapper();
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.seibel.lod.core.render;
|
||||
|
||||
import com.seibel.lod.core.datatype.column.ColumnRenderSource;
|
||||
import com.seibel.lod.core.level.IClientLevel;
|
||||
import com.seibel.lod.core.level.IDhClientLevel;
|
||||
import com.seibel.lod.core.pos.DhBlockPos2D;
|
||||
import com.seibel.lod.core.pos.DhSectionPos;
|
||||
import com.seibel.lod.core.file.renderfile.IRenderSourceProvider;
|
||||
@@ -52,7 +52,7 @@ public class LodQuadTree implements AutoCloseable {
|
||||
public final int viewDistance;
|
||||
private final IRenderSourceProvider renderSourceProvider;
|
||||
|
||||
private final IClientLevel level; //FIXME: Proper hierarchy to remove this reference!
|
||||
private final IDhClientLevel level; //FIXME: Proper hierarchy to remove this reference!
|
||||
|
||||
/**
|
||||
* Constructor of the quadTree
|
||||
@@ -60,7 +60,7 @@ public class LodQuadTree implements AutoCloseable {
|
||||
* @param initialPlayerX player x coordinate
|
||||
* @param initialPlayerZ player z coordinate
|
||||
*/
|
||||
public LodQuadTree(IClientLevel level, int viewDistance, int initialPlayerX, int initialPlayerZ, IRenderSourceProvider provider) {
|
||||
public LodQuadTree(IDhClientLevel level, int viewDistance, int initialPlayerX, int initialPlayerZ, IRenderSourceProvider provider) {
|
||||
DetailDistanceUtil.updateSettings(); //TODO: Move this to somewhere else
|
||||
this.level = level;
|
||||
renderSourceProvider = provider;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.seibel.lod.core.render;
|
||||
|
||||
import com.seibel.lod.core.level.IClientLevel;
|
||||
import com.seibel.lod.core.level.IDhClientLevel;
|
||||
import com.seibel.lod.core.pos.DhSectionPos;
|
||||
import com.seibel.lod.core.datatype.LodRenderSource;
|
||||
import com.seibel.lod.core.file.renderfile.IRenderSourceProvider;
|
||||
@@ -26,7 +26,7 @@ public class LodRenderSection {
|
||||
this.pos = pos;
|
||||
}
|
||||
|
||||
public void enableRender(IClientLevel level, LodQuadTree quadTree) {
|
||||
public void enableRender(IDhClientLevel level, LodQuadTree quadTree) {
|
||||
if (isRenderEnabled) return;
|
||||
loadFuture = provider.read(pos);
|
||||
isRenderEnabled = true;
|
||||
@@ -60,7 +60,7 @@ public class LodRenderSection {
|
||||
loadFuture = renderDataProvider.read(pos);
|
||||
}
|
||||
|
||||
public void tick(LodQuadTree quadTree, IClientLevel level) {
|
||||
public void tick(LodQuadTree quadTree, IDhClientLevel level) {
|
||||
if (loadFuture != null && loadFuture.isDone()) {
|
||||
lodRenderSource = loadFuture.join();
|
||||
loadFuture = null;
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
package com.seibel.lod.core.render.renderer;
|
||||
|
||||
import com.seibel.lod.core.level.IClientLevel;
|
||||
import com.seibel.lod.core.config.Config;
|
||||
import com.seibel.lod.core.config.types.ConfigEntry;
|
||||
import com.seibel.lod.api.enums.rendering.EDebugMode;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
package com.seibel.lod.core.util;
|
||||
|
||||
import com.seibel.lod.core.level.IClientLevel;
|
||||
import com.seibel.lod.core.level.IDhClientLevel;
|
||||
import com.seibel.lod.core.world.DhWorld;
|
||||
import com.seibel.lod.core.world.IClientWorld;
|
||||
import com.seibel.lod.core.api.internal.SharedApi;
|
||||
@@ -218,7 +218,7 @@ public class RenderUtil
|
||||
|
||||
//FIXME: Improve class hierarchy of DhWorld, IClientWorld, IServerWorld to fix all this hard casting
|
||||
// (also in ClientApi)
|
||||
IClientLevel level = (IClientLevel) dhWorld.getOrLoadLevel(levelWrapper);
|
||||
IDhClientLevel level = (IDhClientLevel) dhWorld.getOrLoadLevel(levelWrapper);
|
||||
if (level == null)
|
||||
return false; //Level is not ready yet.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.seibel.lod.core.world;
|
||||
|
||||
import com.seibel.lod.core.level.DhClientServerLevel;
|
||||
import com.seibel.lod.core.level.ILevel;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
import com.seibel.lod.core.file.structure.LocalSaveStructure;
|
||||
import com.seibel.lod.core.logging.f3.F3Screen;
|
||||
import com.seibel.lod.core.util.objects.EventLoop;
|
||||
@@ -64,7 +64,7 @@ public class DhClientServerWorld extends DhWorld implements IClientWorld, IServe
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<? extends ILevel> getAllLoadedLevels()
|
||||
public Iterable<? extends IDhLevel> getAllLoadedLevels()
|
||||
{
|
||||
return dhLevels;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.seibel.lod.core.world;
|
||||
|
||||
import com.seibel.lod.core.level.DhClientLevel;
|
||||
import com.seibel.lod.core.level.ILevel;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
import com.seibel.lod.core.file.structure.ClientOnlySaveStructure;
|
||||
import com.seibel.lod.core.config.Config;
|
||||
import com.seibel.lod.core.util.DetailDistanceUtil;
|
||||
@@ -48,7 +48,7 @@ public class DhClientWorld extends DhWorld implements IClientWorld
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<? extends ILevel> getAllLoadedLevels()
|
||||
public Iterable<? extends IDhLevel> getAllLoadedLevels()
|
||||
{
|
||||
return levels.values();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.seibel.lod.core.world;
|
||||
|
||||
import com.seibel.lod.core.level.DhServerLevel;
|
||||
import com.seibel.lod.core.level.ILevel;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
import com.seibel.lod.core.file.structure.LocalSaveStructure;
|
||||
import com.seibel.lod.core.util.LodUtil;
|
||||
import com.seibel.lod.core.wrapperInterfaces.world.ILevelWrapper;
|
||||
@@ -40,7 +40,7 @@ public class DhServerWorld extends DhWorld implements IServerWorld
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<? extends ILevel> getAllLoadedLevels()
|
||||
public Iterable<? extends IDhLevel> getAllLoadedLevels()
|
||||
{
|
||||
return levels.values();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.seibel.lod.core.world;
|
||||
|
||||
import com.seibel.lod.core.level.ILevel;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
import com.seibel.lod.core.logging.DhLoggerBuilder;
|
||||
import com.seibel.lod.core.wrapperInterfaces.world.ILevelWrapper;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -17,10 +17,10 @@ public abstract class DhWorld implements Closeable
|
||||
protected DhWorld(WorldEnvironment environment) {
|
||||
this.environment = environment;
|
||||
}
|
||||
public abstract ILevel getOrLoadLevel(ILevelWrapper wrapper);
|
||||
public abstract IDhLevel getOrLoadLevel(ILevelWrapper wrapper);
|
||||
|
||||
public abstract ILevel getLevel(ILevelWrapper wrapper);
|
||||
public abstract Iterable<? extends ILevel> getAllLoadedLevels();
|
||||
public abstract IDhLevel getLevel(ILevelWrapper wrapper);
|
||||
public abstract Iterable<? extends IDhLevel> getAllLoadedLevels();
|
||||
|
||||
public abstract void unloadLevel(ILevelWrapper wrapper);
|
||||
public abstract CompletableFuture<Void> saveAndFlush();
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
package com.seibel.lod.core.wrapperInterfaces;
|
||||
|
||||
import com.seibel.lod.core.level.ILevel;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
import com.seibel.lod.core.interfaces.dependencyInjection.IBindable;
|
||||
import com.seibel.lod.core.wrapperInterfaces.block.IBlockStateWrapper;
|
||||
import com.seibel.lod.core.wrapperInterfaces.world.IBiomeWrapper;
|
||||
@@ -35,7 +35,7 @@ import java.io.IOException;
|
||||
*/
|
||||
public interface IWrapperFactory extends IBindable
|
||||
{
|
||||
AbstractBatchGenerationEnvionmentWrapper createBatchGenerator(ILevel targetLevel);
|
||||
AbstractBatchGenerationEnvionmentWrapper createBatchGenerator(IDhLevel targetLevel);
|
||||
IBiomeWrapper deserializeBiomeWrapper(String str) throws IOException;
|
||||
IBlockStateWrapper deserializeBlockStateWrapper(String str) throws IOException;
|
||||
IBlockStateWrapper getAirBlockStateWrapper();
|
||||
|
||||
+2
-2
@@ -19,7 +19,7 @@
|
||||
|
||||
package com.seibel.lod.core.wrapperInterfaces.worldGeneration;
|
||||
|
||||
import com.seibel.lod.core.level.ILevel;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
import com.seibel.lod.core.wrapperInterfaces.chunk.IChunkWrapper;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
@@ -30,7 +30,7 @@ public abstract class AbstractBatchGenerationEnvionmentWrapper {
|
||||
Empty, StructureStart, StructureReference, Biomes, Noise, Surface, Carvers, LiquidCarvers, Features, Light,
|
||||
}
|
||||
|
||||
public AbstractBatchGenerationEnvionmentWrapper(ILevel level) {
|
||||
public AbstractBatchGenerationEnvionmentWrapper(IDhLevel level) {
|
||||
}
|
||||
|
||||
public abstract void resizeThreadPool(int newThreadCount);
|
||||
|
||||
Reference in New Issue
Block a user