diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/FullDataSourceV1.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/FullDataSourceV1.java index 3d2955dee..26306e728 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/FullDataSourceV1.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/FullDataSourceV1.java @@ -48,7 +48,7 @@ import java.util.Arrays; * @see FullDataPointUtil * @see FullDataSourceV2 */ -public class FullDataSourceV1 implements IDataSource +public class FullDataSourceV1 implements IDataSource { private static final DhLogger LOGGER = new DhLoggerBuilder().build(); @@ -103,7 +103,7 @@ public class FullDataSourceV1 implements IDataSource @Deprecated @Override - public boolean update(FullDataSourceV2 dataSource, IDhLevel level) { throw new UnsupportedOperationException("Deprecated"); } + public boolean update(FullDataSourceV2 dataSource) { throw new UnsupportedOperationException("Deprecated"); } diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/FullDataSourceV2.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/FullDataSourceV2.java index 7838d941e..6a86c7027 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/FullDataSourceV2.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/FullDataSourceV2.java @@ -61,7 +61,7 @@ import java.util.List; */ public class FullDataSourceV2 extends AbstractPhantomArrayList - implements IDataSource, IDhApiFullDataSource + implements IDataSource, IDhApiFullDataSource { private static final DhLogger LOGGER = new DhLoggerBuilder().build(); /** useful for debugging, but can slow down update operations quite a bit due to being called so often. */ @@ -375,7 +375,6 @@ public class FullDataSourceV2 //==========// @Override - public boolean update(@NotNull FullDataSourceV2 inputDataSource, @Nullable IDhLevel level) { return this.update(inputDataSource); } public boolean update(@NotNull FullDataSourceV2 inputDataSource) { // don't try updating if the input is empty diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractDataSourceHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractDataSourceHandler.java index fa88da0a3..109f396b5 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractDataSourceHandler.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractDataSourceHandler.java @@ -32,7 +32,7 @@ import java.util.concurrent.locks.ReentrantLock; * @see GeneratedFullDataSourceProvider */ public abstract class AbstractDataSourceHandler - , + , TRepo extends AbstractDhRepo, TDhLevel extends IDhLevel> @@ -74,7 +74,7 @@ public abstract class AbstractDataSourceHandler public final TRepo repo; - public final ArrayList> dateSourceUpdateListeners = new ArrayList<>(); + public final ArrayList> dateSourceUpdateListeners = new ArrayList<>(); @@ -92,7 +92,6 @@ public abstract class AbstractDataSourceHandler - //==================// // abstract methods // //==================// @@ -265,7 +264,7 @@ public abstract class AbstractDataSourceHandler { if (recipientDataSource != null) { - boolean dataModified = recipientDataSource.update(inputData, this.level); + boolean dataModified = recipientDataSource.update(inputData); if (dataModified) { // save the updated data to the database @@ -275,7 +274,7 @@ public abstract class AbstractDataSourceHandler } - for (IDataSourceUpdateFunc listener : this.dateSourceUpdateListeners) + for (IDataSourceUpdateListenerFunc listener : this.dateSourceUpdateListeners) { if (listener != null) { @@ -302,9 +301,9 @@ public abstract class AbstractDataSourceHandler - //================// - // helper methods // - //================// + //==================// + // debugger methods // + //==================// /** used for debugging to track which positions are queued for updating */ private void markUpdateStart(long dataSourcePos) @@ -368,7 +367,7 @@ public abstract class AbstractDataSourceHandler //================// @FunctionalInterface - public interface IDataSourceUpdateFunc + public interface IDataSourceUpdateListenerFunc { void OnDataSourceUpdated(TDataSource updatedFullDataSource); } diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/IDataSource.java b/core/src/main/java/com/seibel/distanthorizons/core/file/IDataSource.java index a8c014e70..afc973290 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/file/IDataSource.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/file/IDataSource.java @@ -8,16 +8,14 @@ import com.seibel.distanthorizons.core.sql.dto.IBaseDTO; /** * Base for all data sources.

* - * AutoCloseable Can be implemented to allow for disposing of pooled data sources.

- * - * @param there are times when we need specifically a client level vs a more generic level + * AutoCloseable Can be implemented to allow for disposing of pooled data sources. */ -public interface IDataSource extends IBaseDTO, AutoCloseable +public interface IDataSource extends IBaseDTO, AutoCloseable { long getPos(); /** @return true if the data was changed */ - boolean update(FullDataSourceV2 chunkData, TDhLevel level); + boolean update(FullDataSourceV2 chunkData); diff --git a/core/src/main/java/com/seibel/distanthorizons/core/level/ClientLevelModule.java b/core/src/main/java/com/seibel/distanthorizons/core/level/ClientLevelModule.java index 8ad98d26c..b73fd8038 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/level/ClientLevelModule.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/level/ClientLevelModule.java @@ -19,8 +19,6 @@ package com.seibel.distanthorizons.core.level; -import com.seibel.distanthorizons.api.enums.rendering.EDhApiDebugRendering; -import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhApiRenderParam; import com.seibel.distanthorizons.core.config.Config; import com.seibel.distanthorizons.core.dataObjects.fullData.sources.FullDataSourceV2; import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector; @@ -31,10 +29,8 @@ import com.seibel.distanthorizons.core.pos.blockPos.DhBlockPos2D; import com.seibel.distanthorizons.core.render.LodQuadTree; import com.seibel.distanthorizons.core.render.RenderBufferHandler; import com.seibel.distanthorizons.core.render.renderer.generic.GenericObjectRenderer; -import com.seibel.distanthorizons.core.render.renderer.LodRenderer; import com.seibel.distanthorizons.core.util.LodUtil; import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftClientWrapper; -import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IProfilerWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.world.IClientLevelWrapper; import com.seibel.distanthorizons.core.logging.DhLogger; @@ -43,7 +39,7 @@ import java.io.Closeable; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicReference; -public class ClientLevelModule implements Closeable, AbstractDataSourceHandler.IDataSourceUpdateFunc +public class ClientLevelModule implements Closeable, AbstractDataSourceHandler.IDataSourceUpdateListenerFunc { private static final DhLogger LOGGER = new DhLoggerBuilder().build(); private static final IMinecraftClientWrapper MC_CLIENT = SingletonInjector.INSTANCE.get(IMinecraftClientWrapper.class);