minor datasource renaming

This commit is contained in:
James Seibel
2025-11-01 16:27:54 -04:00
parent e355366ffc
commit 0567195f73
5 changed files with 15 additions and 23 deletions
@@ -48,7 +48,7 @@ import java.util.Arrays;
* @see FullDataPointUtil
* @see FullDataSourceV2
*/
public class FullDataSourceV1 implements IDataSource<IDhLevel>
public class FullDataSourceV1 implements IDataSource
{
private static final DhLogger LOGGER = new DhLoggerBuilder().build();
@@ -103,7 +103,7 @@ public class FullDataSourceV1 implements IDataSource<IDhLevel>
@Deprecated
@Override
public boolean update(FullDataSourceV2 dataSource, IDhLevel level) { throw new UnsupportedOperationException("Deprecated"); }
public boolean update(FullDataSourceV2 dataSource) { throw new UnsupportedOperationException("Deprecated"); }
@@ -61,7 +61,7 @@ import java.util.List;
*/
public class FullDataSourceV2
extends AbstractPhantomArrayList
implements IDataSource<IDhLevel>, 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
@@ -32,7 +32,7 @@ import java.util.concurrent.locks.ReentrantLock;
* @see GeneratedFullDataSourceProvider
*/
public abstract class AbstractDataSourceHandler
<TDataSource extends IDataSource<TDhLevel>,
<TDataSource extends IDataSource,
TDTO extends IBaseDTO<Long>,
TRepo extends AbstractDhRepo<Long, TDTO>,
TDhLevel extends IDhLevel>
@@ -74,7 +74,7 @@ public abstract class AbstractDataSourceHandler
public final TRepo repo;
public final ArrayList<IDataSourceUpdateFunc<TDataSource>> dateSourceUpdateListeners = new ArrayList<>();
public final ArrayList<IDataSourceUpdateListenerFunc<TDataSource>> 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<TDataSource> listener : this.dateSourceUpdateListeners)
for (IDataSourceUpdateListenerFunc<TDataSource> 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<TDataSource>
public interface IDataSourceUpdateListenerFunc<TDataSource>
{
void OnDataSourceUpdated(TDataSource updatedFullDataSource);
}
@@ -8,16 +8,14 @@ import com.seibel.distanthorizons.core.sql.dto.IBaseDTO;
/**
* Base for all data sources. <br><br>
*
* AutoCloseable Can be implemented to allow for disposing of pooled data sources. <br><br>
*
* @param <TDhLevel> 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<TDhLevel extends IDhLevel> extends IBaseDTO<Long>, AutoCloseable
public interface IDataSource extends IBaseDTO<Long>, AutoCloseable
{
long getPos();
/** @return true if the data was changed */
boolean update(FullDataSourceV2 chunkData, TDhLevel level);
boolean update(FullDataSourceV2 chunkData);
@@ -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<FullDataSourceV2>
public class ClientLevelModule implements Closeable, AbstractDataSourceHandler.IDataSourceUpdateListenerFunc<FullDataSourceV2>
{
private static final DhLogger LOGGER = new DhLoggerBuilder().build();
private static final IMinecraftClientWrapper MC_CLIENT = SingletonInjector.INSTANCE.get(IMinecraftClientWrapper.class);