From 0d16c037f50e3e03d4f54ca1046e6f34c96d48a5 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 18 Jun 2024 07:11:48 -0500 Subject: [PATCH 1/6] Increase default world gen timeout to 3 minutes (from 60 sec) --- .../java/com/seibel/distanthorizons/core/config/Config.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java b/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java index 2f7db291d..f424807d5 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java @@ -716,7 +716,7 @@ public class Config .build(); public static ConfigEntry worldGenerationTimeoutLengthInSeconds = new ConfigEntry.Builder() - .setMinDefaultMax(5, 60, 60 * 10/*10 minutes*/ ) + .setMinDefaultMax(5, 60 * 3, 60 * 10/*10 minutes*/ ) .comment("" + "How long should a world generator thread run for before timing out? \n" + "Note: If you are experiencing timeout errors it is better to lower your CPU usage first \n" From 30dda058febd0c56400118e9baa5150279f235a2 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sun, 23 Jun 2024 08:22:35 -0500 Subject: [PATCH 2/6] Throw an exception if the file handler can't read/write to the DB --- .../core/file/AbstractDataSourceHandler.java | 5 -- .../FullDataSourceProviderV1.java | 2 +- .../FullDataSourceProviderV2.java | 2 +- .../core/level/AbstractDhLevel.java | 5 +- .../core/level/DhClientLevel.java | 3 +- .../core/level/DhClientServerLevel.java | 3 +- .../core/level/DhServerLevel.java | 3 +- .../core/sql/DatabaseUpdater.java | 4 +- .../core/sql/repo/AbstractDhRepo.java | 57 +++++++++++++++++-- .../core/sql/repo/ChunkHashRepo.java | 5 +- .../core/sql/repo/FullDataSourceV1Repo.java | 5 +- .../core/sql/repo/FullDataSourceV2Repo.java | 5 +- .../testItems/sql/TestCompoundKeyRepo.java | 5 +- .../testItems/sql/TestPrimaryKeyRepo.java | 5 +- core/src/test/java/tests/CompressionTest.java | 4 +- .../src/test/java/tests/DhRepoSqliteTest.java | 8 +-- 16 files changed, 83 insertions(+), 38 deletions(-) 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 ec6c50f85..5b425a72f 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 @@ -80,11 +80,6 @@ public abstract class AbstractDataSourceHandler { this.level = level; this.saveDir = (saveDirOverride == null) ? saveStructure.getFullDataFolder(level.getLevelWrapper()) : saveDirOverride; - if (!this.saveDir.exists() && !this.saveDir.mkdirs()) - { - LOGGER.warn("Unable to create full data folder, file saving may fail."); - } - this.repo = this.createRepo(); } diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV1.java b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV1.java index 4c1e443fe..7081bea13 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV1.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV1.java @@ -64,7 +64,7 @@ public class FullDataSourceProviderV1 { try { - return new FullDataSourceV1Repo("jdbc:sqlite", this.saveDir.getPath() + "/" + AbstractSaveStructure.DATABASE_NAME); + return new FullDataSourceV1Repo("jdbc:sqlite", new File(this.saveDir.getPath() + File.pathSeparator + AbstractSaveStructure.DATABASE_NAME)); } catch (SQLException e) { diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV2.java b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV2.java index e19751fc9..7a45f8a1e 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV2.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV2.java @@ -142,7 +142,7 @@ public class FullDataSourceProviderV2 { try { - return new FullDataSourceV2Repo("jdbc:sqlite", this.saveDir.getPath() + "/" + AbstractSaveStructure.DATABASE_NAME); + return new FullDataSourceV2Repo("jdbc:sqlite", new File(this.saveDir.getPath() + File.pathSeparator + AbstractSaveStructure.DATABASE_NAME)); } catch (SQLException e) { diff --git a/core/src/main/java/com/seibel/distanthorizons/core/level/AbstractDhLevel.java b/core/src/main/java/com/seibel/distanthorizons/core/level/AbstractDhLevel.java index 5a7e3f5b3..6cb44e31e 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/level/AbstractDhLevel.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/level/AbstractDhLevel.java @@ -33,6 +33,7 @@ import com.seibel.distanthorizons.coreapi.DependencyInjection.ApiEventInjector; import org.apache.logging.log4j.Logger; import org.jetbrains.annotations.Nullable; +import java.io.File; import java.sql.SQLException; import java.util.HashSet; import java.util.concurrent.ConcurrentHashMap; @@ -59,12 +60,12 @@ public abstract class AbstractDhLevel implements IDhLevel protected AbstractDhLevel() { this.chunkToLodBuilder = new ChunkToLodBuilder(); } - protected void createAndSetChunkHashRepo(String databaseFilePath) + protected void createAndSetChunkHashRepo(File databaseFile) { ChunkHashRepo newChunkHashRepo = null; try { - newChunkHashRepo = new ChunkHashRepo("jdbc:sqlite", databaseFilePath); + newChunkHashRepo = new ChunkHashRepo("jdbc:sqlite", databaseFile); } catch (SQLException e) { diff --git a/core/src/main/java/com/seibel/distanthorizons/core/level/DhClientLevel.java b/core/src/main/java/com/seibel/distanthorizons/core/level/DhClientLevel.java index 42a9d5746..f3fa99055 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/level/DhClientLevel.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/level/DhClientLevel.java @@ -35,7 +35,6 @@ import org.apache.logging.log4j.Logger; import org.jetbrains.annotations.Nullable; import java.io.File; -import java.util.ArrayList; import java.util.List; import java.util.concurrent.CompletableFuture; @@ -63,7 +62,7 @@ public class DhClientLevel extends AbstractDhLevel implements IDhClientLevel this.dataFileHandler = new RemoteFullDataSourceProvider(this, saveStructure, fullDataSaveDirOverride); this.clientside = new ClientLevelModule(this); - this.createAndSetChunkHashRepo(this.dataFileHandler.repo.databaseLocation); + this.createAndSetChunkHashRepo(this.dataFileHandler.repo.databaseFile); if (enableRendering) { diff --git a/core/src/main/java/com/seibel/distanthorizons/core/level/DhClientServerLevel.java b/core/src/main/java/com/seibel/distanthorizons/core/level/DhClientServerLevel.java index 42b204e21..5a210bf08 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/level/DhClientServerLevel.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/level/DhClientServerLevel.java @@ -39,7 +39,6 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.world.IServerLevelWrapp import org.apache.logging.log4j.Logger; import java.awt.*; -import java.util.ArrayList; import java.util.List; import java.util.concurrent.CompletableFuture; @@ -69,7 +68,7 @@ public class DhClientServerLevel extends AbstractDhLevel implements IDhClientLev this.serverLevelWrapper = serverLevelWrapper; this.serverside = new ServerLevelModule(this, saveStructure); this.clientside = new ClientLevelModule(this); - this.createAndSetChunkHashRepo(this.serverside.fullDataFileHandler.repo.databaseLocation); + this.createAndSetChunkHashRepo(this.serverside.fullDataFileHandler.repo.databaseFile); LOGGER.info("Started " + DhClientServerLevel.class.getSimpleName() + " for " + serverLevelWrapper + " with saves at " + saveStructure); } diff --git a/core/src/main/java/com/seibel/distanthorizons/core/level/DhServerLevel.java b/core/src/main/java/com/seibel/distanthorizons/core/level/DhServerLevel.java index 142c1ade1..13a520ff8 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/level/DhServerLevel.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/level/DhServerLevel.java @@ -28,7 +28,6 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.world.IServerLevelWrapper; import org.apache.logging.log4j.Logger; -import java.util.ArrayList; import java.util.List; import java.util.concurrent.CompletableFuture; @@ -48,7 +47,7 @@ public class DhServerLevel extends AbstractDhLevel implements IDhServerLevel } this.serverLevelWrapper = serverLevelWrapper; this.serverside = new ServerLevelModule(this, saveStructure); - this.createAndSetChunkHashRepo(this.serverside.fullDataFileHandler.repo.databaseLocation); + this.createAndSetChunkHashRepo(this.serverside.fullDataFileHandler.repo.databaseFile); LOGGER.info("Started DHLevel for {} with saves at {}", serverLevelWrapper, saveStructure); } diff --git a/core/src/main/java/com/seibel/distanthorizons/core/sql/DatabaseUpdater.java b/core/src/main/java/com/seibel/distanthorizons/core/sql/DatabaseUpdater.java index 6d5c70b61..b3696d065 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/sql/DatabaseUpdater.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/sql/DatabaseUpdater.java @@ -97,7 +97,7 @@ public class DatabaseUpdater Map scriptAlreadyRunResult = repo.queryDictionaryFirst("SELECT EXISTS(SELECT 1 FROM "+SCHEMA_TABLE_NAME+" WHERE ScriptName='"+resource.name+"') as 'existingCount';"); if (scriptAlreadyRunResult != null && (int) scriptAlreadyRunResult.get("existingCount") == 0) { - LOGGER.info("Running SQL update script: ["+resource.name+"], for repo: ["+repo.databaseLocation+"]"); + LOGGER.info("Running SQL update script: ["+resource.name+"], for repo: ["+repo.databaseFile +"]"); int sqlIndex = 0; @@ -147,7 +147,7 @@ public class DatabaseUpdater catch (RuntimeException e) { // updating needs to stop to prevent data corruption - LOGGER.error("Unexpected error running database update script ["+resource.name+"] on database ["+repo.databaseLocation+"], stopping database update. Database reading/writing may fail if you continue. \n" + + LOGGER.error("Unexpected error running database update script ["+resource.name+"] on database ["+repo.databaseFile +"], stopping database update. Database reading/writing may fail if you continue. \n" + "Error: ["+e.getMessage()+"]. \n" + "Sql Script:["+resource.queryString+"]", e); throw e; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/sql/repo/AbstractDhRepo.java b/core/src/main/java/com/seibel/distanthorizons/core/sql/repo/AbstractDhRepo.java index 9d9b548e4..b4377a85d 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/sql/repo/AbstractDhRepo.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/sql/repo/AbstractDhRepo.java @@ -26,6 +26,8 @@ import com.seibel.distanthorizons.core.sql.dto.IBaseDTO; import org.apache.logging.log4j.Logger; import org.jetbrains.annotations.Nullable; +import java.io.File; +import java.io.IOException; import java.sql.*; import java.util.*; import java.util.concurrent.ConcurrentHashMap; @@ -49,7 +51,7 @@ public abstract class AbstractDhRepo> implemen private final Connection connection; public final String databaseType; - public final String databaseLocation; + public final File databaseFile; public final Class dtoClass; @@ -59,16 +61,15 @@ public abstract class AbstractDhRepo> implemen - //=============// // constructor // //=============// /** @throws SQLException if the repo is unable to access the database or has trouble updating said database. */ - public AbstractDhRepo(String databaseType, String databaseLocation, Class dtoClass) throws SQLException + public AbstractDhRepo(String databaseType, File databaseFile, Class dtoClass) throws SQLException { this.databaseType = databaseType; - this.databaseLocation = databaseLocation; + this.databaseFile = databaseFile; this.dtoClass = dtoClass; @@ -93,9 +94,55 @@ public abstract class AbstractDhRepo> implemen } + + //==========================// + // database file validation // + //==========================// + + // check that the database file exists + if (!databaseFile.exists()) + { + // check that the parent folder exists + File parentFolder = databaseFile.getParentFile(); + if (parentFolder != null && !parentFolder.exists()) + { + if (!parentFolder.mkdirs()) + { + throw new RuntimeException("Unable to create the necessary parent folders for the database file at location ["+databaseFile.getPath()+"]."); + } + } + + if (!databaseFile.exists()) + { + try + { + boolean fileCreated = databaseFile.createNewFile(); + } + catch (IOException e) + { + throw new RuntimeException("Unable to create database file at location ["+databaseFile.getPath()+"] due to error: ["+e.getMessage()+"]", e); + } + } + } + + if (!databaseFile.canRead()) + { + throw new RuntimeException("Unable to read database file at location ["+databaseFile.getPath()+"], please make sure the folder and file has the correct permissions."); + } + if (!databaseFile.canWrite()) + { + throw new RuntimeException("Unable to write database file at location ["+databaseFile.getPath()+"], please make sure the folder and file aren't set to read-only."); + } + + + + //==================// + // connection setup // + //==================// + // get or create the connection, // reusing existing connections reduces the chance of locking the database during trivial queries - this.connectionString = this.databaseType+":"+this.databaseLocation; + this.connectionString = this.databaseType+":"+this.databaseFile.getPath(); this.connection = CONNECTIONS_BY_CONNECTION_STRING.computeIfAbsent(this.connectionString, (connectionString) -> diff --git a/core/src/main/java/com/seibel/distanthorizons/core/sql/repo/ChunkHashRepo.java b/core/src/main/java/com/seibel/distanthorizons/core/sql/repo/ChunkHashRepo.java index ad9152886..4fc545b6a 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/sql/repo/ChunkHashRepo.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/sql/repo/ChunkHashRepo.java @@ -26,6 +26,7 @@ import com.seibel.distanthorizons.core.sql.dto.ChunkHashDTO; import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper; import org.apache.logging.log4j.Logger; +import java.io.File; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.Map; @@ -40,9 +41,9 @@ public class ChunkHashRepo extends AbstractDhRepo // constructor // //=============// - public ChunkHashRepo(String databaseType, String databaseLocation) throws SQLException + public ChunkHashRepo(String databaseType, File databaseFile) throws SQLException { - super(databaseType, databaseLocation, ChunkHashDTO.class); + super(databaseType, databaseFile, ChunkHashDTO.class); } diff --git a/core/src/main/java/com/seibel/distanthorizons/core/sql/repo/FullDataSourceV1Repo.java b/core/src/main/java/com/seibel/distanthorizons/core/sql/repo/FullDataSourceV1Repo.java index 0c7c444b7..a61bc22ab 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/sql/repo/FullDataSourceV1Repo.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/sql/repo/FullDataSourceV1Repo.java @@ -26,6 +26,7 @@ import com.seibel.distanthorizons.coreapi.util.StringUtil; import it.unimi.dsi.fastutil.longs.LongArrayList; import org.jetbrains.annotations.Nullable; +import java.io.File; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.ArrayList; @@ -42,9 +43,9 @@ public class FullDataSourceV1Repo extends AbstractDhRepo { - public TestCompoundKeyRepo(String databaseType, String databaseLocation) throws SQLException + public TestCompoundKeyRepo(String databaseType, File databaseFile) throws SQLException { - super(databaseType, databaseLocation, TestCompoundKeyDto.class); + super(databaseType, databaseFile, TestCompoundKeyDto.class); // note: this should only ever be done with the test repo. // All long term tables should be created using a sql Script. diff --git a/core/src/test/java/testItems/sql/TestPrimaryKeyRepo.java b/core/src/test/java/testItems/sql/TestPrimaryKeyRepo.java index 347e6d686..9df6a16c8 100644 --- a/core/src/test/java/testItems/sql/TestPrimaryKeyRepo.java +++ b/core/src/test/java/testItems/sql/TestPrimaryKeyRepo.java @@ -21,6 +21,7 @@ package testItems.sql; import com.seibel.distanthorizons.core.sql.repo.AbstractDhRepo; +import java.io.File; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.Map; @@ -28,9 +29,9 @@ import java.util.Map; public class TestPrimaryKeyRepo extends AbstractDhRepo { - public TestPrimaryKeyRepo(String databaseType, String databaseLocation) throws SQLException + public TestPrimaryKeyRepo(String databaseType, File databaseFile) throws SQLException { - super(databaseType, databaseLocation, TestSingleKeyDto.class); + super(databaseType, databaseFile, TestSingleKeyDto.class); // note: this should only ever be done with the test repo. // All long term tables should be created using a sql Script. diff --git a/core/src/test/java/tests/CompressionTest.java b/core/src/test/java/tests/CompressionTest.java index d871b58ac..f17af721a 100644 --- a/core/src/test/java/tests/CompressionTest.java +++ b/core/src/test/java/tests/CompressionTest.java @@ -259,7 +259,7 @@ public class CompressionTest File uncompressedDatabaseFile = new File(uncompressedDatabaseFilePath); Assert.assertTrue(uncompressedDatabaseFile.exists()); - FullDataSourceV2Repo uncompressedRepo = new FullDataSourceV2Repo("jdbc:sqlite", uncompressedDatabaseFilePath); + FullDataSourceV2Repo uncompressedRepo = new FullDataSourceV2Repo("jdbc:sqlite", uncompressedDatabaseFile); String compressedDatabaseFilePath = TEST_DIR + "/output/" + DB_FILE_NAME_PREFIX + "_" + compressorName + ".sqlite"; @@ -267,7 +267,7 @@ public class CompressionTest compressedDatabaseFile.mkdirs(); compressedDatabaseFile.delete(); Assert.assertTrue(!compressedDatabaseFile.exists()); - FullDataSourceV2Repo compressedRepo = new FullDataSourceV2Repo("jdbc:sqlite", compressedDatabaseFilePath); + FullDataSourceV2Repo compressedRepo = new FullDataSourceV2Repo("jdbc:sqlite", uncompressedDatabaseFile); diff --git a/core/src/test/java/tests/DhRepoSqliteTest.java b/core/src/test/java/tests/DhRepoSqliteTest.java index 066106110..bb9707b6c 100644 --- a/core/src/test/java/tests/DhRepoSqliteTest.java +++ b/core/src/test/java/tests/DhRepoSqliteTest.java @@ -62,7 +62,7 @@ public class DhRepoSqliteTest TestPrimaryKeyRepo primaryKeyRepo = null; try { - primaryKeyRepo = new TestPrimaryKeyRepo(DATABASE_TYPE, DB_FILE_NAME); + primaryKeyRepo = new TestPrimaryKeyRepo(DATABASE_TYPE, new File(DB_FILE_NAME)); @@ -78,8 +78,8 @@ public class DhRepoSqliteTest } // check that the update scripts aren't run multiple times - TestPrimaryKeyRepo altDataRepoOne = new TestPrimaryKeyRepo(DATABASE_TYPE, DB_FILE_NAME); - TestPrimaryKeyRepo altDataRepoTwo = new TestPrimaryKeyRepo(DATABASE_TYPE, DB_FILE_NAME); + TestPrimaryKeyRepo altDataRepoOne = new TestPrimaryKeyRepo(DATABASE_TYPE, new File(DB_FILE_NAME)); + TestPrimaryKeyRepo altDataRepoTwo = new TestPrimaryKeyRepo(DATABASE_TYPE, new File(DB_FILE_NAME)); @@ -142,7 +142,7 @@ public class DhRepoSqliteTest TestCompoundKeyRepo compoundKeyRepo = null; try { - compoundKeyRepo = new TestCompoundKeyRepo(DATABASE_TYPE, DB_FILE_NAME); + compoundKeyRepo = new TestCompoundKeyRepo(DATABASE_TYPE, new File(DB_FILE_NAME)); From 28e1eaae77547a47efb33b809ec022c9b7640eb0 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Mon, 24 Jun 2024 20:53:36 -0500 Subject: [PATCH 3/6] Up version 2.1.1-dev -> 2.1.2 --- .../main/java/com/seibel/distanthorizons/coreapi/ModInfo.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/ModInfo.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/ModInfo.java index efff0ef0f..9ddc02b07 100644 --- a/api/src/main/java/com/seibel/distanthorizons/coreapi/ModInfo.java +++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/ModInfo.java @@ -34,14 +34,14 @@ public final class ModInfo public static final String NAME = "DistantHorizons"; /** Human-readable version of NAME */ public static final String READABLE_NAME = "Distant Horizons"; - public static final String VERSION = "2.1.1-a-dev"; + public static final String VERSION = "2.1.2-a"; /** Returns true if the current build is an unstable developer build, false otherwise. */ public static boolean IS_DEV_BUILD = VERSION.toLowerCase().contains("dev"); /** This version should only be updated when breaking changes are introduced to the DH API */ public static final int API_MAJOR_VERSION = 2; /** This version should be updated whenever new methods are added to the DH API */ - public static final int API_MINOR_VERSION = 0; + public static final int API_MINOR_VERSION = 1; /** This version should be updated whenever non-breaking fixes are added to the DH API */ public static final int API_PATH_VERSION = 0; From 2ab7949ce5e6cbaaf14b11f8c12b2312fa6878d3 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 25 Jun 2024 19:23:53 -0500 Subject: [PATCH 4/6] Fix database file paths --- .../core/file/fullDatafile/FullDataSourceProviderV1.java | 2 +- .../core/file/fullDatafile/FullDataSourceProviderV2.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV1.java b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV1.java index 7081bea13..0311ed9ae 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV1.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV1.java @@ -64,7 +64,7 @@ public class FullDataSourceProviderV1 { try { - return new FullDataSourceV1Repo("jdbc:sqlite", new File(this.saveDir.getPath() + File.pathSeparator + AbstractSaveStructure.DATABASE_NAME)); + return new FullDataSourceV1Repo("jdbc:sqlite", new File(this.saveDir.getPath() + File.separator + AbstractSaveStructure.DATABASE_NAME)); } catch (SQLException e) { diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV2.java b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV2.java index 7a45f8a1e..a4ff3cbb0 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV2.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV2.java @@ -142,7 +142,7 @@ public class FullDataSourceProviderV2 { try { - return new FullDataSourceV2Repo("jdbc:sqlite", new File(this.saveDir.getPath() + File.pathSeparator + AbstractSaveStructure.DATABASE_NAME)); + return new FullDataSourceV2Repo("jdbc:sqlite", new File(this.saveDir.getPath() + File.separator + AbstractSaveStructure.DATABASE_NAME)); } catch (SQLException e) { From 71ffbfb7b98ea12c75190bb01ba8a79de88149a3 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 25 Jun 2024 19:24:07 -0500 Subject: [PATCH 5/6] add "warning" to the low memory warning message --- .../com/seibel/distanthorizons/core/api/internal/ClientApi.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ClientApi.java b/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ClientApi.java index 541227f65..4682c9de0 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ClientApi.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ClientApi.java @@ -667,7 +667,7 @@ public class ClientApi MC.sendChatMessage("\u00A76" + "Distant Horizons: Low memory detected." + "\u00A7r"); MC.sendChatMessage("Stuttering or low FPS may occur."); MC.sendChatMessage("Please increase Minecraft's available memory to 4 gigabytes."); - MC.sendChatMessage("This can be disabled in DH's config under Advanced -> Logging."); + MC.sendChatMessage("This warning can be disabled in DH's config under Advanced -> Logging."); MC.sendChatMessage(""); } } From 321afa2a9ee8cdaa8da8ff8b21d5120d7ab5e08d Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 25 Jun 2024 19:25:30 -0500 Subject: [PATCH 6/6] Up version 2.1.2 -> 2.1.3-dev --- .../main/java/com/seibel/distanthorizons/coreapi/ModInfo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/ModInfo.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/ModInfo.java index 9ddc02b07..9f2740bb6 100644 --- a/api/src/main/java/com/seibel/distanthorizons/coreapi/ModInfo.java +++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/ModInfo.java @@ -34,7 +34,7 @@ public final class ModInfo public static final String NAME = "DistantHorizons"; /** Human-readable version of NAME */ public static final String READABLE_NAME = "Distant Horizons"; - public static final String VERSION = "2.1.2-a"; + public static final String VERSION = "2.1.3-a-dev"; /** Returns true if the current build is an unstable developer build, false otherwise. */ public static boolean IS_DEV_BUILD = VERSION.toLowerCase().contains("dev");