Add a config for the MultiDimension Similarity
This commit is contained in:
@@ -135,9 +135,9 @@ public class LodBuilder
|
||||
catch (RuntimeException e)
|
||||
{
|
||||
ApiShared.LOGGER.error("LodBuilder Thread Uncaught Exception: ", e);
|
||||
// // if the world changes while LODs are being generated
|
||||
// // they will throw errors as they try to access things that no longer
|
||||
// // exist.
|
||||
// if the world changes while LODs are being generated
|
||||
// they will throw errors as they try to access things that no longer
|
||||
// exist.
|
||||
} finally {
|
||||
if (!retryNeeded)
|
||||
endCallback.run();
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.seibel.lod.core.objects.lod.RegionPos;
|
||||
import com.seibel.lod.core.util.LodUtil;
|
||||
import com.seibel.lod.core.wrapperInterfaces.chunk.AbstractChunkPosWrapper;
|
||||
import com.seibel.lod.core.wrapperInterfaces.chunk.IChunkWrapper;
|
||||
import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton;
|
||||
import com.seibel.lod.core.wrapperInterfaces.minecraft.IMinecraftClientWrapper;
|
||||
import com.seibel.lod.core.wrapperInterfaces.world.IDimensionTypeWrapper;
|
||||
import com.seibel.lod.core.wrapperInterfaces.world.IWorldWrapper;
|
||||
@@ -28,16 +29,11 @@ import java.util.UUID;
|
||||
public class LodDimensionFileHelper
|
||||
{
|
||||
private static final IMinecraftClientWrapper MC = SingletonHandler.get(IMinecraftClientWrapper.class);
|
||||
private static final ILodConfigWrapperSingleton CONFIG = SingletonHandler.get(ILodConfigWrapperSingleton.class);
|
||||
|
||||
/** Increasing this will increase accuracy but increase calculation time */
|
||||
private static final VerticalQuality VERTICAL_QUALITY_TO_TEST_WITH = VerticalQuality.LOW;
|
||||
|
||||
/**
|
||||
* The minimum percent of identical dataPoints to consider two chunks as the same. <Br>
|
||||
* 0.9 = 90%
|
||||
*/
|
||||
private static final double minimumSimilarityRequired = 0.9;
|
||||
|
||||
|
||||
/**
|
||||
* Currently this method checks a single chunk (where the player is)
|
||||
@@ -129,6 +125,7 @@ public class LodDimensionFileHelper
|
||||
File mostSimilarWorldFolder = null;
|
||||
int mostEqualLines = 0;
|
||||
boolean oneDimensionIsValid = false;
|
||||
double minimumSimilarityRequired = CONFIG.client().multiplayer().getMultiDimensionRequiredSimilarity();
|
||||
|
||||
for (File testDimFolder : dimensionFolder.listFiles())
|
||||
{
|
||||
@@ -176,10 +173,7 @@ public class LodDimensionFileHelper
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// String message = "test data [" + testDimFolder.getName().substring(0, 6) + "...] " + testChunkData[0][0][0] + " equal lines: " + equalLines + "/" + totalLineCount;
|
||||
// MC.sendChatMessage(message);
|
||||
// ApiShared.LOGGER.info(message);
|
||||
|
||||
|
||||
// determine if this world is closer to the newly loaded world
|
||||
double percentEqual = (double) equalLines / (double) totalLineCount;
|
||||
@@ -188,6 +182,9 @@ public class LodDimensionFileHelper
|
||||
mostEqualLines = equalLines;
|
||||
mostSimilarWorldFolder = testDimFolder;
|
||||
}
|
||||
// String message = "test data [" + testDimFolder.getName().substring(0, 6) + "...] " + testChunkData[0][0][0] + " equal lines: " + equalLines + "/" + totalLineCount + " = " + percentEqual;
|
||||
// MC.sendChatMessage(message);
|
||||
// ApiShared.LOGGER.info(message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+13
@@ -354,6 +354,19 @@ public interface ILodConfigWrapperSingleton extends IBindable
|
||||
+ "\n";
|
||||
ServerFolderNameMode getServerFolderNameMode();
|
||||
void setServerFolderNameMode(ServerFolderNameMode newServerFolderNameMode);
|
||||
|
||||
double MULTI_DIMENSION_REQUIRED_SIMILARITY_DEFAULT = 0.8;
|
||||
String MULTI_DIMENSION_REQUIRED_SIMILARITY_DESC = ""
|
||||
+ " When matching worlds of the same dimension type the \n"
|
||||
+ " chunks tested must be at least this percent the same \n"
|
||||
+ " in order to be considered the same world. \n"
|
||||
+ "\n"
|
||||
+ " 1 (100%) means the chunks must be identical. \n"
|
||||
+ " 0.5 (50%) means the chunks must be half the same. \n"
|
||||
+ " 0 (0%) means almost any world will match. \n"
|
||||
+ "\n";
|
||||
double getMultiDimensionRequiredSimilarity();
|
||||
void setMultiDimensionRequiredSimilarity(double newMultiDimensionMinimumSimilarityPercent);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -120,7 +120,11 @@
|
||||
"DistantHorizons.config.client.multiplayer.serverFolderNameMode":
|
||||
"Server Folder Mode",
|
||||
"DistantHorizons.config.client.multiplayer.serverFolderNameMode.@tooltip":
|
||||
"Determines the folder format for local multiplayer data.\n\n§6Auto:§r\nUses \"Name, IP\" for LAN worlds and \"Name, IP, Port\" for standard multiplayer.\n§6Name Only:§r\nUses the server browser name. Ex: \"Minecraft Server\"\n§6Name IP:§r\n\"Minecraft Server, IP 192.168.1.40\"\n§6Name, IP, Port:§r\n\"Minecraft Server, IP 192.168.1.40:25565\"\n§6Name, IP, Port, MC Version:§r\n\"Minecraft Server, IP 192.168.1.40:25565, GameVersion 1.18.1\"\n\n§c§lCaution:§r changing while connected to a multiplayer server may cause glitches.",
|
||||
"Determines the folder format for local multiplayer data.\n\n§6Auto:§r\nUses \"Name, IP\" for LAN worlds and \"Name, IP, Port\" for standard multiplayer.\n§6Name Only:§r\nUses the server browser name. Ex: \"Minecraft Server\"\n§6Name IP:§r\n\"Minecraft Server, IP 192.168.1.40\"\n§6Name, IP, Port:§r\n\"Minecraft Server, IP 192.168.1.40:25565\"\n§6Name, IP, Port, MC Version:§r\n\"Minecraft Server, IP 192.168.1.40:25565, GameVersion 1.18.1\"\n\n§c§lCaution:§r changing while connected to a multiplayer server may cause glitches.",
|
||||
"DistantHorizons.config.client.multiplayer.multiDimensionRequiredSimilarity":
|
||||
"Multi Dimension Required Similarity",
|
||||
"DistantHorizons.config.client.multiplayer.multiDimensionRequiredSimilarity.@tooltip":
|
||||
"When matching worlds of the same dimension type the\nchunks tested must be at least this percent the same\nin order to be considered the same world.\n\n§61:§r the chunks must be identical.\n§60.5:§r the chunks must be half the same.\n§60:§r almost any world will match.",
|
||||
"DistantHorizons.config.client.advanced":
|
||||
"Advanced Options",
|
||||
"DistantHorizons.config.client.advanced.threading":
|
||||
|
||||
Reference in New Issue
Block a user