diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractNewDataSourceHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractNewDataSourceHandler.java index ed2bc7746..a2b1adf49 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractNewDataSourceHandler.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractNewDataSourceHandler.java @@ -22,7 +22,8 @@ import java.util.concurrent.locks.ReentrantLock; public abstract class AbstractNewDataSourceHandler , - TDTO extends IBaseDTO, + TDTO extends IBaseDTO, + TRepo extends AbstractDhRepo, TDhLevel extends IDhLevel> implements ISourceProvider { @@ -58,7 +59,7 @@ public abstract class AbstractNewDataSourceHandler protected final TDhLevel level; protected final File saveDir; - public final AbstractDhRepo repo; + public final TRepo repo; public final ArrayList> dateSourceUpdateListeners = new ArrayList<>(); @@ -89,7 +90,7 @@ public abstract class AbstractNewDataSourceHandler //==================// /** When this is called the parent folders should be created */ - protected abstract AbstractDhRepo createRepo(); + protected abstract TRepo createRepo(); protected abstract TDataSource createDataSourceFromDto(TDTO dto) throws InterruptedException, IOException; protected abstract TDTO createDtoFromDataSource(TDataSource dataSource); diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/NewFullDataFileHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/NewFullDataFileHandler.java index d7e7baffd..ad3e708aa 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/NewFullDataFileHandler.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/NewFullDataFileHandler.java @@ -46,7 +46,7 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.locks.ReentrantLock; public class NewFullDataFileHandler - extends AbstractNewDataSourceHandler + extends AbstractNewDataSourceHandler implements IFullDataSourceProvider, IDebugRenderable { private static final Logger LOGGER = DhLoggerBuilder.getLogger(); @@ -93,7 +93,7 @@ public class NewFullDataFileHandler //====================// @Override - protected AbstractDhRepo createRepo() + protected NewFullDataSourceRepo createRepo() { try { @@ -161,7 +161,7 @@ public class NewFullDataFileHandler && this.parentUpdatingPosSet.size() < MAX_UPDATE_TASK_COUNT) { // get the positions that need to be applied to their parents - ArrayList parentUpdatePosList = ((NewFullDataSourceRepo) this.repo).getPositionsToUpdate(MAX_UPDATE_TASK_COUNT); + ArrayList parentUpdatePosList = this.repo.getPositionsToUpdate(MAX_UPDATE_TASK_COUNT); HashMap> updatePosByParentPos = new HashMap<>(); for (DhSectionPos pos : parentUpdatePosList) @@ -217,7 +217,7 @@ public class NewFullDataFileHandler NewFullDataSource dataSource = this.get(childPos); this.updateDataSourceAtPos(parentUpdatePos, dataSource, false); - ((NewFullDataSourceRepo) this.repo).setApplyToParent(childPos, false); + this.repo.setApplyToParent(childPos, false); } catch (Exception e) { diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/NewGeneratedFullDataFileHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/NewGeneratedFullDataFileHandler.java index 81652fa0f..78e373202 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/NewGeneratedFullDataFileHandler.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/NewGeneratedFullDataFileHandler.java @@ -31,7 +31,6 @@ import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; import com.seibel.distanthorizons.core.pos.DhSectionPos; import com.seibel.distanthorizons.core.render.renderer.DebugRenderer; import com.seibel.distanthorizons.core.render.renderer.IDebugRenderable; -import com.seibel.distanthorizons.core.sql.repo.NewFullDataSourceRepo; import com.seibel.distanthorizons.core.util.LodUtil; import com.seibel.distanthorizons.core.util.threading.ThreadPoolUtil; import com.seibel.distanthorizons.coreapi.util.BitShiftUtil; @@ -233,7 +232,7 @@ public class NewGeneratedFullDataFileHandler extends NewFullDataFileHandler impl } else { - byte[] columnGenerationSteps = ((NewFullDataSourceRepo)this.repo).getColumnGenerationStepForPos(genPos); + byte[] columnGenerationSteps = this.repo.getColumnGenerationStepForPos(genPos); if (columnGenerationSteps == null) { // shouldn't happen, but just in case