diff --git a/_Misc Files/IDE files/Eclipse Auto Formatting V1.xml b/_Misc Files/IDE files/Eclipse Auto Formatting V1.xml
deleted file mode 100644
index 659ba3b52..000000000
--- a/_Misc Files/IDE files/Eclipse Auto Formatting V1.xml
+++ /dev/null
@@ -1,390 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/_Misc Files/IDE files/README.txt b/_Misc Files/IDE files/README.txt
deleted file mode 100644
index 737e01295..000000000
--- a/_Misc Files/IDE files/README.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-These Files are used when developing the mod.
-
-Eclipse Auto Formatting
-IntelliJ Auto Formatting
-- These files are the auto-formatting settings that should be used when developing for the mod. We want to make sure the style of code is consistant regardless of who is writting the code.
-
-renderDocMcDistantHorizonsSettings
-- This file contains the configuration to run a remote debug instance so you can edit the mod in your IDE while also viewing the OpenGL code in RenderDoc.
-
-minecraft launch options
-- This file contains the Java command line arguments used to launch the mod from a development environment (specifically Eclipse, James didn't test it with IntelliJ), and is included to more easily edit the options for RenderDoc
\ No newline at end of file
diff --git a/_Misc Files/IDE files/intellij Auto Formatting V1.xml b/_Misc Files/IDE files/intellij Auto Formatting V1.xml
deleted file mode 100644
index 126cc559c..000000000
--- a/_Misc Files/IDE files/intellij Auto Formatting V1.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/_Misc Files/IDE files/minecraft launch options.txt b/_Misc Files/IDE files/minecraft launch options.txt
deleted file mode 100644
index b22d7a44d..000000000
Binary files a/_Misc Files/IDE files/minecraft launch options.txt and /dev/null differ
diff --git a/_Misc Files/IDE files/renderDocMcDistantHorizonsSettings-1.16.5.cap b/_Misc Files/IDE files/renderDocMcDistantHorizonsSettings-1.16.5.cap
deleted file mode 100644
index 4f4f409ab..000000000
--- a/_Misc Files/IDE files/renderDocMcDistantHorizonsSettings-1.16.5.cap
+++ /dev/null
@@ -1,87 +0,0 @@
-{
- "rdocCaptureSettings": 1,
- "settings": {
- "autoStart": false,
- "commandLine": "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=localhost:8000 -Dforge.logging.console.level=debug -Dforge.logging.markers=REGISTRIES \"-Dnet.minecraftforge.gradle.GradleStart.srg.srg-mcp=C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\build\\createSrgToMcp\\output.srg\" -Dmixin.env.remapRefMap=true \"-Dmixin.env.refMapRemappingFile=C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\build\\createSrgToMcp\\output.srg\" -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump \"-Dos.name=Windows 10\" -Dos.version=10.0 \"-Djava.library.path=C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\build\\natives;C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\build\\natives;C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\build\\natives;C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\build\\natives;C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\build\\natives;C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\build\\natives;C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\build\\natives\" \"-javaagent:C:\\Users\\James Seibel\\Documents\\Eclipse\\configuration\\org.eclipse.osgi\\687\\0\\.cp\\lib\\javaagent-shaded.jar\" -Dfile.encoding=Cp1252 -classpath \"C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\bin\\main;C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\bin\\test;C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\bin\\core;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.tukaani\\xz\\1.9\\1ea4bec1a921180164852c65006d928617bd2caf\\xz-1.9.jar;C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\build\\fg_cache\\net\\minecraftforge\\forge\\1.16.5-36.1.0_mapped_official_1.16.5\\forge-1.16.5-36.1.0_mapped_official_1.16.5-recomp.jar;C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\build\\fg_cache\\net\\minecraftforge\\forge\\1.16.5-36.1.0_mapped_official_1.16.5\\forge-1.16.5-36.1.0_mapped_official_1.16.5-launcher.jar;C:\\Users\\James Seibel\\.gradle\\caches\\forge_gradle\\minecraft_repo\\versions\\1.16.5\\client-extra.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.commons\\commons-compress\\1.21\\4ec95b60d4e86b5c95a0e919cb172a0af98011ef\\commons-compress-1.21.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\accesstransformers\\3.0.1\\6d23c1b9cb0607fddc38d09730796f68db96f546\\accesstransformers-3.0.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\eventbus\\4.0.0\\260e34800723e4c098c4e247cf2b900535e01b6d\\eventbus-4.0.0.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\coremods\\4.0.6\\d6d761379c841e2610abebcbf70ed20b65f728f0\\coremods-4.0.6.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\forgespi\\3.2.0\\c6ca4e4e4a0343701407c760e642537b613b543\\forgespi-3.2.0.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\modlauncher\\8.0.9\\bb848f57758808692b9108df61c909c0a961ba81\\modlauncher-8.0.9.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\modlauncher\\8.0.9\\476a62d2a2ebd3573134b8bcd8f0bc21bbdf29ac\\modlauncher-8.0.9-api.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.google.code.findbugs\\jsr305\\3.0.2\\25ea2e8b0c338a877313bd4672d3fe056ea78f0d\\jsr305-3.0.2.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\mergetool\\1.0.9\\d1e1ba354a40b5703340b5cb02fdca489cff3646\\mergetool-1.0.9-api.jar;C:\\Users\\James Seibel\\.gradle\\caches\\forge_gradle\\mcp_repo\\net\\minecraft\\mapping\\1.16.5\\mapping-1.16.5-mapping.zip;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-commons\\9.0\\5a34a3a9ac44f362f35d1b27932380b0031a3334\\asm-commons-9.0.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-util\\9.0\\7c059a94ab5eed3347bf954e27fab58e52968848\\asm-util-9.0.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-analysis\\9.0\\4630afefbb43939c739445dde0af1a5729a0fb4e\\asm-analysis-9.0.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-tree\\9.0\\9df939f25c556b0c7efe00701d47e77a49837f24\\asm-tree-9.0.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm\\9.0\\af582ff60bc567c42d931500c3fdc20e0141ddf9\\asm-9.0.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\grossjava9hacks\\1.3.3\\e49222512ea6cabdd8b49761cef1d5a207b1f0d9\\grossjava9hacks-1.3.3.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.antlr\\antlr4-runtime\\4.9.1\\428664f05d2b7f7b7610204b5aa7c1763f62011a\\antlr4-runtime-4.9.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\unsafe\\0.2.0\\54d7a0a5e8fdb71b973025caa46f341ae5904f39\\unsafe-0.2.0.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.electronwill.night-config\\toml\\3.6.3\\2b05b4d606c517da4d1a7b6d2b97d751c92887d7\\toml-3.6.3.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.electronwill.night-config\\core\\3.6.3\\c601bfeaeb2c0abe7aaa901b0bbe6d1beff49281\\core-3.6.3.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.jline\\jline\\3.12.1\\de2bd909cb9f8eaa741bd03df4a1bd3f6eb593c7\\jline-3.12.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.maven\\maven-artifact\\3.6.3\\f8ff8032903882376e8d000c51e3e16d20fc7df7\\maven-artifact-3.6.3.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.jodah\\typetools\\0.8.3\\98f84f353457629e81cc6827224871b1a8faa7af\\typetools-0.8.3.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.minecrell\\terminalconsoleappender\\1.2.0\\96d02cd3b384ff015a8fef4223bcb4ccf1717c95\\terminalconsoleappender-1.2.0.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.logging.log4j\\log4j-core\\2.11.2\\6c2fb3f5b7cd27504726aef1b674b542a0c9cf53\\log4j-core-2.11.2.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.logging.log4j\\log4j-api\\2.11.2\\f5e9a2ffca496057d6891a3de65128efc636e26e\\log4j-api-2.11.2.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.sf.jopt-simple\\jopt-simple\\5.0.4\\4fdac2fbe92dfad86aa6e9301736f6b4342a3f5c\\jopt-simple-5.0.4.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.spongepowered\\mixin\\0.8.2\\1cf212283d26f706fd3074318870bebd14d2a9ed\\mixin-0.8.2.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\nashorn-core-compat\\15.1.1.1\\1817deb38a5a8811148dca0d23161d92bdbd6184\\nashorn-core-compat-15.1.1.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.mojang\\patchy\\1.2.3\\e3107ca512d704a434076a153a6e1149e3787275\\patchy-1.2.3.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\oshi-project\\oshi-core\\1.1\\9ddf7b048a8d701be231c0f4f95fd986198fd2d8\\oshi-core-1.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.java.dev.jna\\jna\\4.4.0\\cb208278274bf12ebdb56c61bd7407e6f774d65a\\jna-4.4.0.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.java.dev.jna\\platform\\3.4.0\\e3f70017be8100d3d6923f50b3d2ee17714e9c13\\platform-3.4.0.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.ibm.icu\\icu4j\\66.1\\72c7519b6d91f7a1f993bd44a99fe95d67211b27\\icu4j-66.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.mojang\\javabridge\\1.0.22\\6aa6453aa99a52a5cd91749da1af6ab70e082ab3\\javabridge-1.0.22.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\io.netty\\netty-all\\4.1.25.Final\\d0626cd3108294d1d58c05859add27b4ef21f83b\\netty-all-4.1.25.Final.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.google.guava\\guava\\21.0\\3a3d111be1be1b745edfa7d91678a12d7ed38709\\guava-21.0.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.commons\\commons-lang3\\3.8.1\\6505a72a097d9270f7a9e7bf42c4238283247755\\commons-lang3-3.8.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\commons-io\\commons-io\\2.5\\2852e6e05fbb95076fc091f6d1780f1f8fe35e0f\\commons-io-2.5.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.httpcomponents\\httpclient\\4.3.3\\18f4247ff4572a074444572cee34647c43e7c9c7\\httpclient-4.3.3.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\commons-codec\\commons-codec\\1.10\\4b95f4897fa13f2cd904aee711aeafc0c5295cd8\\commons-codec-1.10.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.java.jinput\\jinput\\2.0.5\\39c7796b469a600f72380316f6b1f11db6c2c7c4\\jinput-2.0.5.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.java.jutils\\jutils\\1.0.0\\e12fe1fda814bd348c1579329c86943d2cd3c6a6\\jutils-1.0.0.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.mojang\\brigadier\\1.0.17\\c6b7dc51dd44379cc751b7504816006e9be4b1e6\\brigadier-1.0.17.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.mojang\\datafixerupper\\4.0.26\\ebd6690f33871ccee9b6132c6480668ee2e35020\\datafixerupper-4.0.26.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.google.code.gson\\gson\\2.8.0\\c4ba5371a29ac9b2ad6129b1d39ea38750043eff\\gson-2.8.0.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.mojang\\authlib\\2.1.28\\ad54da276bf59983d02d5ed16fc14541354c71fd\\authlib-2.1.28.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\commons-logging\\commons-logging\\1.1.3\\f6f66e966c70a83ffbdb6f17a0919eaf7c8aca7f\\commons-logging-1.1.3.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.httpcomponents\\httpcore\\4.3.2\\31fbbff1ddbf98f3aa7377c94d33b0447c646b6e\\httpcore-4.3.2.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\it.unimi.dsi\\fastutil\\8.2.1\\5ad88f325e424f8dbc2be5459e21ea5cab3864e9\\fastutil-8.2.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-jemalloc\\3.2.2\\ee8e57a79300f78294576d87c4a587f8c99402e2\\lwjgl-jemalloc-3.2.2.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-jemalloc\\3.2.2\\338b25b99da3ba5f441f6492f2ce2a9c608860ed\\lwjgl-jemalloc-3.2.2-natives-windows.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-openal\\3.2.2\\2b772a102b0a11ee5f2109a5b136f4dc7c630827\\lwjgl-openal-3.2.2.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-openal\\3.2.2\\ec20a7d42a2438528fca87e60b1705f1e2339ddb\\lwjgl-openal-3.2.2-natives-windows.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-opengl\\3.2.2\\6ac5bb88b44c43ea195a570aab059f63da004cd8\\lwjgl-opengl-3.2.2.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-opengl\\3.2.2\\d8dcdc91066cae2d2d8279cb4a9f9f05d9525826\\lwjgl-opengl-3.2.2-natives-windows.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-glfw\\3.2.2\\d3ad4df38e400b8afba1de63f84338809399df5b\\lwjgl-glfw-3.2.2.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-glfw\\3.2.2\\dc6826d636bf796b33a49038c354210e661bfc17\\lwjgl-glfw-3.2.2-natives-windows.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-stb\\3.2.2\\3b8e6ebc5851dd3d17e37e5cadce2eff2a429f0f\\lwjgl-stb-3.2.2.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-stb\\3.2.2\\811f705cbb29e8ae8d60bdf8fdd38c0c123ad3ef\\lwjgl-stb-3.2.2-natives-windows.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-tinyfd\\3.2.2\\fcbe606c8f8da6f8f9a05e2c540eb1ee8632b0e9\\lwjgl-tinyfd-3.2.2.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-tinyfd\\3.2.2\\e9115958773644e863332a6a06488d26f9e1fc9f\\lwjgl-tinyfd-3.2.2-natives-windows.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl\\3.2.2\\8ad6294407e15780b43e84929c40e4c5e997972e\\lwjgl-3.2.2.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl\\3.2.2\\5359f3aa50d36352815fc662ea73e1c00d22170\\lwjgl-3.2.2-natives-windows.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.mojang\\text2speech\\1.11.3\\f378f889797edd7df8d32272c06ca80a1b6b0f58\\text2speech-1.11.3.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.mojang\\text2speech\\1.11.3\\c0b242c0091be5acbf303263c7eeeaedd70544c7\\text2speech-1.11.3-natives-windows.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.codehaus.plexus\\plexus-utils\\3.2.1\\13b015768e0d04849d2794e4c47eb02d01a0de32\\plexus-utils-3.2.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.jline\\jline-reader\\3.12.1\\4382ab1382c7b6f379377ed5f665dc2f6e1218bc\\jline-reader-3.12.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.java.jinput\\jinput-platform\\2.0.5\\7ff832a6eb9ab6a767f1ade2b548092d0fa64795\\jinput-platform-2.0.5-natives-linux.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.java.jinput\\jinput-platform\\2.0.5\\385ee093e01f587f30ee1c8a2ee7d408fd732e16\\jinput-platform-2.0.5-natives-windows.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.java.jinput\\jinput-platform\\2.0.5\\53f9c919f34d2ca9de8c51fc4e1e8282029a9232\\jinput-platform-2.0.5-natives-osx.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.jline\\jline-terminal\\3.12.1\\c777448314e050d980a6b697c140f3bfe9eb7416\\jline-terminal-3.12.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.google.code.findbugs\\jsr305\\3.0.1\\f7be08ec23c21485b9b5a1cf1654c2ec8c58168d\\jsr305-3.0.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\grossjava9hacks\\1.3.0\\1a922de964d0c19d864fbcba2678c1a1c4602c35\\grossjava9hacks-1.3.0.jar\" net.minecraftforge.userdev.LaunchTesting -mixin.config=lod.mixins.json",
- "environment": [
- {
- "separator": "Platform style",
- "type": "Set",
- "value": "C:\\Users\\James Seibel\\.gradle\\caches\\forge_gradle\\assets",
- "variable": "assetDirectory"
- },
- {
- "separator": "Platform style",
- "type": "Set",
- "value": "1.16",
- "variable": "assetIndex"
- },
- {
- "separator": "Platform style",
- "type": "Set",
- "value": "net.minecraftforge",
- "variable": "FORGE_GROUP"
- },
- {
- "separator": "Platform style",
- "type": "Set",
- "value": "36.1.0",
- "variable": "FORGE_VERSION"
- },
- {
- "separator": "Platform style",
- "type": "Set",
- "value": "1.16.5",
- "variable": "MC_VERSION"
- },
- {
- "separator": "Platform style",
- "type": "Set",
- "value": "official_1.16.5",
- "variable": "MCP_MAPPINGS"
- },
- {
- "separator": "Platform style",
- "type": "Set",
- "value": "20210115.111550",
- "variable": "MCP_VERSION"
- },
- {
- "separator": "Platform style",
- "type": "Set",
- "value": "examplemod%%C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\bin\\main;examplemod%%C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\bin\\main",
- "variable": "MOD_CLASSES"
- },
- {
- "separator": "Platform style",
- "type": "Set",
- "value": "C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\build\\natives",
- "variable": "nativesDirectory"
- },
- {
- "separator": "Platform style",
- "type": "Set",
- "value": "fmluserdevclient",
- "variable": "target"
- }
- ],
- "executable": "C:\\Program Files (x86)\\Java\\jdk1.8.0_251\\bin\\javaw.exe",
- "inject": false,
- "numQueuedFrames": 0,
- "options": {
- "allowFullscreen": true,
- "allowVSync": true,
- "apiValidation": false,
- "captureAllCmdLists": false,
- "captureCallstacks": false,
- "captureCallstacksOnlyDraws": false,
- "debugOutputMute": true,
- "delayForDebugger": 0,
- "hookIntoChildren": false,
- "refAllResources": false,
- "verifyBufferAccess": false
- },
- "queuedFrameCap": 0,
- "workingDir": "C:/Users/James Seibel/Documents/Eclipse/workspaces/personal-projects/minecraft-lod-mod/run"
- }
-}
diff --git a/_Misc Files/IDE files/renderDocMcDistantHorizonsSettings.cap b/_Misc Files/IDE files/renderDocMcDistantHorizonsSettings.cap
deleted file mode 100644
index 10afa9434..000000000
--- a/_Misc Files/IDE files/renderDocMcDistantHorizonsSettings.cap
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "rdocCaptureSettings": 1,
- "settings": {
- "autoStart": false,
- "commandLine": "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000 -Dforge.logging.console.level=debug -Dforge.logging.markers=REGISTRIES \"-DlegacyClassPath.file=C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\build\\classpath\\runClient_minecraftClasspath.txt\" \"-Dnet.minecraftforge.gradle.GradleStart.srg.srg-mcp=C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\build\\createSrgToMcp\\output.srg\" -Dmixin.env.remapRefMap=true \"-Dmixin.env.refMapRemappingFile=C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\build\\createSrgToMcp\\output.srg\" -DignoreList=bootstraplauncher,securejarhandler,asm-commons,asm-util,asm-analysis,asm-tree,asm,client-extra,fmlcore,javafmllanguage,mclanguage,forge- \"-DnativesDirectory=C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\build\\natives\" -DmergeModules=jna-5.8.0.jar,jna-platform-58.0.jar,java-objc-bridge-1.0.0.jar -p \"C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\bootstraplauncher\\0.1.17\\899fb8e3912bb7d14a6f9611de117f77db710ec3\\bootstraplauncher-0.1.17.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\securejarhandler\\0.9.54\\24b670f2c026ec9777e64a2c2126ebc8635dbe8d\\securejarhandler-0.9.54.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-commons\\9.1\\8b971b182eb5cf100b9e8d4119152d83e00e0fdd\\asm-commons-9.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-util\\9.1\\36464a45d871779f3383a8a9aba2b26562a86729\\asm-util-9.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-analysis\\9.1\\4f61b83b81d8b659958f4bcc48907e93ecea55a0\\asm-analysis-9.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-tree\\9.1\\c333f2a855069cb8eb17a40a3eb8b1b67755d0eb\\asm-tree-9.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm\\9.1\\a99500cf6eea30535eeac6be73899d048f8d12a8\\asm-9.1.jar\" --add-modules ALL-MODULE-PATH --add-opens java.base/java.util.jar=cpw.mods.securejarhandler --add-exports java.base/sun.security.util=cpw.mods.securejarhandler --add-exports jdk.naming.dns/com.sun.jndi.dns=java.naming -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump \"-Dos.name=Windows 10\" -Dos.version=10.0 \"-Djava.library.path=C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\build\\natives;C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\build\\natives;C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\build\\natives;C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\build\\natives;C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\build\\natives\" -Dfile.encoding=Cp1252 -classpath \"C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\bin\\main;C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\bin\\test;C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\bin\\default;C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\build\\fg_cache\\net\\minecraftforge\\forge\\1.17.1-37.0.103_mapped_official_1.17.1\\forge-1.17.1-37.0.103_mapped_official_1.17.1-recomp.jar;C:\\Users\\James Seibel\\.gradle\\caches\\forge_gradle\\minecraft_repo\\versions\\1.17.1\\client-extra.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.google.code.findbugs\\jsr305\\3.0.1\\f7be08ec23c21485b9b5a1cf1654c2ec8c58168d\\jsr305-3.0.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\ca.weblite\\java-objc-bridge\\1.0.0\\6ef160c3133a78de015830860197602ca1c855d3\\java-objc-bridge-1.0.0.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\mergetool\\1.1.3\\d7d4b6eac7f49c59255c8ac25190802c29ac9a4a\\mergetool-1.1.3-api.jar;C:\\Users\\James Seibel\\.gradle\\caches\\forge_gradle\\mcp_repo\\net\\minecraft\\mapping\\1.17.1\\mapping-1.17.1-mapping.zip;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\securejarhandler\\0.9.54\\24b670f2c026ec9777e64a2c2126ebc8635dbe8d\\securejarhandler-0.9.54.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\fmlloader\\1.17.1-37.0.103\\ac18a665e5cbf23223ae33f4d215fccc9a50b613\\fmlloader-1.17.1-37.0.103.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\modlauncher\\9.0.7\\ebe8650527b513823874449e054db053b686b494\\modlauncher-9.0.7.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.openjdk.nashorn\\nashorn-core\\15.3\\43977e804697048fc8d81d333a36c17d07a5b3dd\\nashorn-core-15.3.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-commons\\9.1\\8b971b182eb5cf100b9e8d4119152d83e00e0fdd\\asm-commons-9.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-util\\9.1\\36464a45d871779f3383a8a9aba2b26562a86729\\asm-util-9.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-analysis\\9.1\\4f61b83b81d8b659958f4bcc48907e93ecea55a0\\asm-analysis-9.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-tree\\9.1\\c333f2a855069cb8eb17a40a3eb8b1b67755d0eb\\asm-tree-9.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm\\9.1\\a99500cf6eea30535eeac6be73899d048f8d12a8\\asm-9.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\accesstransformers\\8.0.4\\272d240aa73f42195b2a68e2ebd8b701ecf41f63\\accesstransformers-8.0.4.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.antlr\\antlr4\\4.9.1\\e92af8ab33e428461927b484e90bb155a4f3a052\\antlr4-4.9.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.antlr\\antlr4-runtime\\4.9.1\\428664f05d2b7f7b7610204b5aa7c1763f62011a\\antlr4-runtime-4.9.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\fmlcore\\1.17.1-37.0.103\\1b5f4eb66012e07d68713935b2baec3fc8101451\\fmlcore-1.17.1-37.0.103.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\eventbus\\5.0.3\\f2317ed9d19271be8727a71ae3e5dfeb62715594\\eventbus-5.0.3.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\forgespi\\4.0.10\\e08fb9a9e485abbbd380516c222e2b502eb0718e\\forgespi-4.0.10.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\coremods\\5.0.1\\386b00279628b105b2d507539c46e134e96f6237\\coremods-5.0.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\unsafe\\0.2.0\\54d7a0a5e8fdb71b973025caa46f341ae5904f39\\unsafe-0.2.0.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.electronwill.night-config\\toml\\3.6.3\\2b05b4d606c517da4d1a7b6d2b97d751c92887d7\\toml-3.6.3.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.electronwill.night-config\\core\\3.6.3\\c601bfeaeb2c0abe7aaa901b0bbe6d1beff49281\\core-3.6.3.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.maven\\maven-artifact\\3.8.1\\114a2dd16c4c568bf0ca57719b83f2685dcc5734\\maven-artifact-3.8.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.commons\\commons-lang3\\3.8.1\\6505a72a097d9270f7a9e7bf42c4238283247755\\commons-lang3-3.8.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.jodah\\typetools\\0.8.3\\98f84f353457629e81cc6827224871b1a8faa7af\\typetools-0.8.3.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.minecrell\\terminalconsoleappender\\1.2.0\\96d02cd3b384ff015a8fef4223bcb4ccf1717c95\\terminalconsoleappender-1.2.0.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.logging.log4j\\log4j-core\\2.14.1\\9141212b8507ab50a45525b545b39d224614528b\\log4j-core-2.14.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.logging.log4j\\log4j-slf4j18-impl\\2.14.1\\312b4d91b21160b9fab43600fa787f31e8cab930\\log4j-slf4j18-impl-2.14.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.logging.log4j\\log4j-api\\2.14.1\\cd8858fbbde69f46bce8db1152c18a43328aae78\\log4j-api-2.14.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.jline\\jline-reader\\3.12.1\\4382ab1382c7b6f379377ed5f665dc2f6e1218bc\\jline-reader-3.12.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.jline\\jline-terminal\\3.12.1\\c777448314e050d980a6b697c140f3bfe9eb7416\\jline-terminal-3.12.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.sf.jopt-simple\\jopt-simple\\5.0.4\\4fdac2fbe92dfad86aa6e9301736f6b4342a3f5c\\jopt-simple-5.0.4.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.spongepowered\\mixin\\0.8.4\\4ec7d77d9ab32596ca0b78bb123956734767e3a\\mixin-0.8.4.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.google.guava\\guava\\21.0\\3a3d111be1be1b745edfa7d91678a12d7ed38709\\guava-21.0.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.google.code.gson\\gson\\2.8.0\\c4ba5371a29ac9b2ad6129b1d39ea38750043eff\\gson-2.8.0.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\bootstraplauncher\\0.1.17\\899fb8e3912bb7d14a6f9611de117f77db710ec3\\bootstraplauncher-0.1.17.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\javafmllanguage\\1.17.1-37.0.103\\9d4407369a3f55a7b316757044fb43f3f7e1582d\\javafmllanguage-1.17.1-37.0.103.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\mclanguage\\1.17.1-37.0.103\\22d3f7b559e885b2928dd95802e793d06c0be058\\mclanguage-1.17.1-37.0.103.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.mojang\\blocklist\\1.0.5\\9da540f21c9a8d5ed7c029e1f88d1a6dabb0d6ad\\blocklist-1.0.5.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.mojang\\patchy\\2.1.6\\ce112c16c6275fdfff2d30208533ec906a191f71\\patchy-2.1.6.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.github.oshi\\oshi-core\\5.7.5\\725374463734aacde70a3b20f018aca3f922655f\\oshi-core-5.7.5.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.java.dev.jna\\jna-platform\\5.8.0\\2f12f6d7f7652270d13624cef1b82d8cd9a5398e\\jna-platform-5.8.0.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.java.dev.jna\\jna\\5.8.0\\3551d8d827e54858214107541d3aff9c615cb615\\jna-5.8.0.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.slf4j\\slf4j-api\\1.8.0-beta4\\83b0359d847ee053d745be7ec0d8e9e8a44304b4\\slf4j-api-1.8.0-beta4.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.ibm.icu\\icu4j\\66.1\\72c7519b6d91f7a1f993bd44a99fe95d67211b27\\icu4j-66.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.mojang\\javabridge\\1.1.23\\3e5084d916ba393dfd82928ec97663aeb10b2e2c\\javabridge-1.1.23.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\io.netty\\netty-all\\4.1.25.Final\\d0626cd3108294d1d58c05859add27b4ef21f83b\\netty-all-4.1.25.Final.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\commons-io\\commons-io\\2.5\\2852e6e05fbb95076fc091f6d1780f1f8fe35e0f\\commons-io-2.5.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.httpcomponents\\httpclient\\4.3.3\\18f4247ff4572a074444572cee34647c43e7c9c7\\httpclient-4.3.3.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\commons-codec\\commons-codec\\1.10\\4b95f4897fa13f2cd904aee711aeafc0c5295cd8\\commons-codec-1.10.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.java.jinput\\jinput\\2.0.5\\39c7796b469a600f72380316f6b1f11db6c2c7c4\\jinput-2.0.5.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.java.jutils\\jutils\\1.0.0\\e12fe1fda814bd348c1579329c86943d2cd3c6a6\\jutils-1.0.0.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.mojang\\brigadier\\1.0.18\\c1ef1234282716483c92183f49bef47b1a89bfa9\\brigadier-1.0.18.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.mojang\\datafixerupper\\4.0.26\\ebd6690f33871ccee9b6132c6480668ee2e35020\\datafixerupper-4.0.26.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.mojang\\authlib\\2.3.31\\bbd00ca33b052f73a6312254780fc580d2da3535\\authlib-2.3.31.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.commons\\commons-compress\\1.8.1\\a698750c16740fd5b3871425f4cb3bbaa87f529d\\commons-compress-1.8.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\commons-logging\\commons-logging\\1.1.3\\f6f66e966c70a83ffbdb6f17a0919eaf7c8aca7f\\commons-logging-1.1.3.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.httpcomponents\\httpcore\\4.3.2\\31fbbff1ddbf98f3aa7377c94d33b0447c646b6e\\httpcore-4.3.2.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\it.unimi.dsi\\fastutil\\8.2.1\\5ad88f325e424f8dbc2be5459e21ea5cab3864e9\\fastutil-8.2.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-jemalloc\\3.2.2\\ee8e57a79300f78294576d87c4a587f8c99402e2\\lwjgl-jemalloc-3.2.2.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-openal\\3.2.2\\2b772a102b0a11ee5f2109a5b136f4dc7c630827\\lwjgl-openal-3.2.2.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-opengl\\3.2.2\\6ac5bb88b44c43ea195a570aab059f63da004cd8\\lwjgl-opengl-3.2.2.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-glfw\\3.2.2\\d3ad4df38e400b8afba1de63f84338809399df5b\\lwjgl-glfw-3.2.2.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-stb\\3.2.2\\3b8e6ebc5851dd3d17e37e5cadce2eff2a429f0f\\lwjgl-stb-3.2.2.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-tinyfd\\3.2.2\\fcbe606c8f8da6f8f9a05e2c540eb1ee8632b0e9\\lwjgl-tinyfd-3.2.2.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl\\3.2.2\\8ad6294407e15780b43e84929c40e4c5e997972e\\lwjgl-3.2.2.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.mojang\\text2speech\\1.11.3\\f378f889797edd7df8d32272c06ca80a1b6b0f58\\text2speech-1.11.3.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.codehaus.plexus\\plexus-utils\\3.2.1\\13b015768e0d04849d2794e4c47eb02d01a0de32\\plexus-utils-3.2.1.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.antlr\\ST4\\4.3\\92f2c1ad8d84abcbeead6cf7f2c53a04166293c2\\ST4-4.3.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.antlr\\antlr-runtime\\3.5.2\\cd9cd41361c155f3af0f653009dcecb08d8b4afd\\antlr-runtime-3.5.2.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.abego.treelayout\\org.abego.treelayout.core\\1.0.3\\457216e8e6578099ae63667bb1e4439235892028\\org.abego.treelayout.core-1.0.3.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.glassfish\\javax.json\\1.0.4\\3178f73569fd7a1e5ffc464e680f7a8cc784b85a\\javax.json-1.0.4.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-jemalloc\\3.2.2\\338b25b99da3ba5f441f6492f2ce2a9c608860ed\\lwjgl-jemalloc-3.2.2-natives-windows.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-openal\\3.2.2\\ec20a7d42a2438528fca87e60b1705f1e2339ddb\\lwjgl-openal-3.2.2-natives-windows.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-opengl\\3.2.2\\d8dcdc91066cae2d2d8279cb4a9f9f05d9525826\\lwjgl-opengl-3.2.2-natives-windows.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-glfw\\3.2.2\\dc6826d636bf796b33a49038c354210e661bfc17\\lwjgl-glfw-3.2.2-natives-windows.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-stb\\3.2.2\\811f705cbb29e8ae8d60bdf8fdd38c0c123ad3ef\\lwjgl-stb-3.2.2-natives-windows.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl-tinyfd\\3.2.2\\e9115958773644e863332a6a06488d26f9e1fc9f\\lwjgl-tinyfd-3.2.2-natives-windows.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.lwjgl\\lwjgl\\3.2.2\\5359f3aa50d36352815fc662ea73e1c00d22170\\lwjgl-3.2.2-natives-windows.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\com.mojang\\text2speech\\1.11.3\\c0b242c0091be5acbf303263c7eeeaedd70544c7\\text2speech-1.11.3-natives-windows.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\srgutils\\0.4.3\\84aecb8fc78bd0dd7299bd9963ac9eb83bd00aad\\srgutils-0.4.3.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.java.jinput\\jinput-platform\\2.0.5\\7ff832a6eb9ab6a767f1ade2b548092d0fa64795\\jinput-platform-2.0.5-natives-linux.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.java.jinput\\jinput-platform\\2.0.5\\385ee093e01f587f30ee1c8a2ee7d408fd732e16\\jinput-platform-2.0.5-natives-windows.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\net.java.jinput\\jinput-platform\\2.0.5\\53f9c919f34d2ca9de8c51fc4e1e8282029a9232\\jinput-platform-2.0.5-natives-osx.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.tukaani\\xz\\1.9\\1ea4bec1a921180164852c65006d928617bd2caf\\xz-1.9.jar;C:\\Users\\James Seibel\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.commons\\commons-compress\\1.21\\4ec95b60d4e86b5c95a0e919cb172a0af98011ef\\commons-compress-1.21.jar\" -XX:+ShowCodeDetailsInExceptionMessages cpw.mods.bootstraplauncher.BootstrapLauncher --launchTarget forgeclientuserdev --version MOD_DEV --assetIndex 1.17 --assetsDir \"C:\\Users\\James Seibel\\.gradle\\caches\\forge_gradle\\assets\" --gameDir . --fml.forgeVersion 37.0.103 --fml.mcVersion 1.17.1 --fml.forgeGroup net.minecraftforge --fml.mcpVersion 20210706.113038 -mixin.config=lod.mixins.json",
- "environment": [
- {
- "separator": "Platform style",
- "type": "Set",
- "value": "official_1.17.1",
- "variable": "MCP_MAPPINGS"
- },
- {
- "separator": "Platform style",
- "type": "Set",
- "value": "examplemod%%C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\bin\\main;examplemod%%C:\\Users\\James Seibel\\Documents\\Eclipse\\workspaces\\personal-projects\\minecraft-lod-mod\\bin\\main",
- "variable": "MOD_CLASSES"
- }
- ],
- "executable": "C:\\Program Files (x86)\\Java\\jdk-17.0.1\\bin\\javaw.exe",
- "inject": false,
- "numQueuedFrames": 0,
- "options": {
- "allowFullscreen": true,
- "allowVSync": true,
- "apiValidation": false,
- "captureAllCmdLists": false,
- "captureCallstacks": false,
- "captureCallstacksOnlyDraws": false,
- "debugOutputMute": true,
- "delayForDebugger": 0,
- "hookIntoChildren": false,
- "refAllResources": false,
- "verifyBufferAccess": false
- },
- "queuedFrameCap": 0,
- "workingDir": "C:/Users/James Seibel/Documents/Eclipse/workspaces/personal-projects/minecraft-lod-mod/run"
- }
-}
diff --git a/_Misc Files/IDE files/Gitlab Docker Container Setup.txt b/_Misc Files/setup documentation/Gitlab Docker Container Setup.txt
similarity index 94%
rename from _Misc Files/IDE files/Gitlab Docker Container Setup.txt
rename to _Misc Files/setup documentation/Gitlab Docker Container Setup.txt
index e339cd2ba..2ec91c357 100644
--- a/_Misc Files/IDE files/Gitlab Docker Container Setup.txt
+++ b/_Misc Files/setup documentation/Gitlab Docker Container Setup.txt
@@ -1,6 +1,6 @@
The following is short tutorial to setup and register a gitlab runner in a docker container on windows.
-Docker can be installed via a installer from their website and these instructions assume that has already been done.
+Docker can be installed via an installer from their website and these instructions assume that has already been done.
longer tutorials can be found at the following links:
https://faun.pub/gitlab-runner-setup-run-in-docker-container-on-windows-44fee102d02e
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/DhApi.java b/api/src/main/java/com/seibel/distanthorizons/api/DhApi.java
index 527f93ada..3cabd3b6b 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/DhApi.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/DhApi.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api;
import com.seibel.distanthorizons.api.interfaces.events.IDhApiEventInjector;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/EDhApiDetailLevel.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/EDhApiDetailLevel.java
index 6a1e53bf7..46a68b531 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/EDhApiDetailLevel.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/EDhApiDetailLevel.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.enums;
/**
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/DisallowSelectingViaConfigGui.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/DisallowSelectingViaConfigGui.java
index 4b609801e..cbed0451b 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/DisallowSelectingViaConfigGui.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/DisallowSelectingViaConfigGui.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.enums.config;
import java.lang.annotation.Retention;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EBlocksToAvoid.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EBlocksToAvoid.java
index df9bcff19..2f26d3d71 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EBlocksToAvoid.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EBlocksToAvoid.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EBufferRebuildTimes.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EBufferRebuildTimes.java
index dc8d71a93..b34c005c7 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EBufferRebuildTimes.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EBufferRebuildTimes.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGLErrorHandlingMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGLErrorHandlingMode.java
index 6fb4c7d99..00719a140 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGLErrorHandlingMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGLErrorHandlingMode.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGenerationPriority.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGenerationPriority.java
index 1bcdb313a..39271c3ee 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGenerationPriority.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGenerationPriority.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGpuUploadMethod.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGpuUploadMethod.java
index 05fb10b4a..d87d8738d 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGpuUploadMethod.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGpuUploadMethod.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EHorizontalQuality.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EHorizontalQuality.java
index 820c5e2eb..3fdcddd83 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EHorizontalQuality.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EHorizontalQuality.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/ELightGenerationMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/ELightGenerationMode.java
index c521a1f99..cc57d08b7 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/ELightGenerationMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/ELightGenerationMode.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/ELodShading.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/ELodShading.java
index 0ef8e17b5..1a2a1d95f 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/ELodShading.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/ELodShading.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/ELoggerMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/ELoggerMode.java
index 1b3a53253..3a16c88ed 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/ELoggerMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/ELoggerMode.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EMaxHorizontalResolution.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EMaxHorizontalResolution.java
index 50e40d3f0..e9139c20b 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EMaxHorizontalResolution.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EMaxHorizontalResolution.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EOverdrawPrevention.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EOverdrawPrevention.java
index 5a9cbc0c0..c00df2790 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EOverdrawPrevention.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EOverdrawPrevention.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EServerFolderNameMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EServerFolderNameMode.java
index d06ceb577..944e61457 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EServerFolderNameMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EServerFolderNameMode.java
@@ -1,9 +1,9 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
* Copyright (C) 2022 Tom Lee (TomTheFurry)
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EVanillaOverdraw.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EVanillaOverdraw.java
index 683a76cb5..c9f9124ab 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EVanillaOverdraw.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EVanillaOverdraw.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EVerticalQuality.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EVerticalQuality.java
index 21e25517e..c20b86b70 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EVerticalQuality.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EVerticalQuality.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EQualityPreset.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EQualityPreset.java
index 0dc2fe139..7936f3176 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EQualityPreset.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EQualityPreset.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EThreadPreset.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EThreadPreset.java
index baf06b4d7..cbc098db7 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EThreadPreset.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EThreadPreset.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDebugRendering.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDebugRendering.java
index 7f4678e6c..163c06267 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDebugRendering.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDebugRendering.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogColorMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogColorMode.java
index 94b423a5d..ab0831d49 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogColorMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogColorMode.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogDistance.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogDistance.java
index be26bf87d..5196ad696 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogDistance.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogDistance.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogDrawMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogDrawMode.java
index 18f0d35d1..83c732142 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogDrawMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogDrawMode.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogFalloff.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogFalloff.java
index 782e9645b..c1de07ece 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogFalloff.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogFalloff.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.enums.rendering;
/**
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EHeightFogMixMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EHeightFogMixMode.java
index 0098a85c5..b688ebda8 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EHeightFogMixMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EHeightFogMixMode.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EHeightFogMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EHeightFogMode.java
index 8d3a8df68..5aebcc8cd 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EHeightFogMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EHeightFogMode.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/ERendererMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/ERendererMode.java
index f9fe686d0..a6a9c6c85 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/ERendererMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/ERendererMode.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/ETransparency.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/ETransparency.java
index e77a74ef9..aefc14473 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/ETransparency.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/ETransparency.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/worldGeneration/EDhApiDistantGeneratorMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/worldGeneration/EDhApiDistantGeneratorMode.java
index e52f0bfb4..e1f7e61a2 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/worldGeneration/EDhApiDistantGeneratorMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/worldGeneration/EDhApiDistantGeneratorMode.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/worldGeneration/EDhApiLevelType.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/worldGeneration/EDhApiLevelType.java
index 59f51d195..e147c6a8d 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/worldGeneration/EDhApiLevelType.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/worldGeneration/EDhApiLevelType.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.enums.worldGeneration;
/**
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/worldGeneration/EDhApiWorldGenerationStep.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/worldGeneration/EDhApiWorldGenerationStep.java
index fcfb08d3a..546844250 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/worldGeneration/EDhApiWorldGenerationStep.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/worldGeneration/EDhApiWorldGenerationStep.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.enums.worldGeneration;
/**
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/IDhApiUnsafeWrapper.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/IDhApiUnsafeWrapper.java
index 7e9cc1a76..c47226a92 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/IDhApiUnsafeWrapper.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/IDhApiUnsafeWrapper.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.interfaces;
/**
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/block/IDhApiBiomeWrapper.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/block/IDhApiBiomeWrapper.java
index 44bcfa498..6ac142f76 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/block/IDhApiBiomeWrapper.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/block/IDhApiBiomeWrapper.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/block/IDhApiBlockStateWrapper.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/block/IDhApiBlockStateWrapper.java
index db84e6485..682b04f06 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/block/IDhApiBlockStateWrapper.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/block/IDhApiBlockStateWrapper.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.interfaces.block;
import com.seibel.distanthorizons.api.interfaces.IDhApiUnsafeWrapper;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/IDhApiConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/IDhApiConfig.java
index 2744a50ad..a0f81b499 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/IDhApiConfig.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/IDhApiConfig.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.interfaces.config;
import com.seibel.distanthorizons.api.interfaces.config.both.IDhApiWorldGenerationConfig;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/IDhApiConfigGroup.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/IDhApiConfigGroup.java
index e032c13c1..8a5a9b953 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/IDhApiConfigGroup.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/IDhApiConfigGroup.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.interfaces.config;
import com.seibel.distanthorizons.coreapi.interfaces.dependencyInjection.IBindable;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/IDhApiConfigValue.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/IDhApiConfigValue.java
index b5ac00375..ecb7079be 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/IDhApiConfigValue.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/IDhApiConfigValue.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.interfaces.config;
import java.util.function.Consumer;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/both/IDhApiWorldGenerationConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/both/IDhApiWorldGenerationConfig.java
index ffffc07e1..d52733634 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/both/IDhApiWorldGenerationConfig.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/both/IDhApiWorldGenerationConfig.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiAmbientOcclusionConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiAmbientOcclusionConfig.java
new file mode 100644
index 000000000..d20bac76e
--- /dev/null
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiAmbientOcclusionConfig.java
@@ -0,0 +1,68 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+package com.seibel.distanthorizons.api.interfaces.config.client;
+
+import com.seibel.distanthorizons.api.enums.rendering.EFogColorMode;
+import com.seibel.distanthorizons.api.enums.rendering.EFogDistance;
+import com.seibel.distanthorizons.api.enums.rendering.EFogDrawMode;
+import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigGroup;
+import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue;
+
+/**
+ * Distant Horizons' fog configuration.
+ *
+ * @author James Seibel
+ * @version 2022-9-6
+ * @since API 1.0.0
+ */
+public interface IDhApiAmbientOcclusionConfig extends IDhApiConfigGroup
+{
+ /** Determines if Ambient Occlusion is rendered */
+ IDhApiConfigValue enabled();
+
+ /**
+ * Determines how many points in space are sampled for the occlusion test.
+ * Higher numbers will improve quality and reduce banding, but will increase GPU load.
+ */
+ IDhApiConfigValue sampleCount();
+
+ /** Determines the radius Screen Space Ambient Occlusion is applied, measured in blocks. */
+ IDhApiConfigValue radius();
+
+ /** Determines how dark the Screen Space Ambient Occlusion effect will be. */
+ IDhApiConfigValue strength();
+
+ /** Increasing the value can reduce banding at the cost of reducing the strength of the effect. */
+ IDhApiConfigValue bias();
+
+ /**
+ * Determines how dark the occlusion shadows can be.
+ * 0 = totally black at the corners
+ * 1 = no shadow
+ */
+ IDhApiConfigValue minLight();
+
+ /**
+ * The radius, measured in pixels, that blurring is calculated.
+ * Higher numbers will reduce banding at the cost of GPU performance.
+ */
+ IDhApiConfigValue blurRadius();
+
+}
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiDebuggingConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiDebuggingConfig.java
index 39bd433ce..18f2aea84 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiDebuggingConfig.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiDebuggingConfig.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiFarFogConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiFarFogConfig.java
index 01af00ba7..95f0d0a3d 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiFarFogConfig.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiFarFogConfig.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiFogConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiFogConfig.java
index fc92bfcba..849c3b184 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiFogConfig.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiFogConfig.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiGpuBuffersConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiGpuBuffersConfig.java
index a4419338b..56f6febc7 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiGpuBuffersConfig.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiGpuBuffersConfig.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiGraphicsConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiGraphicsConfig.java
index c42e31bae..d09fed095 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiGraphicsConfig.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiGraphicsConfig.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -40,6 +40,7 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup
//===============//
IDhApiFogConfig fog();
+ IDhApiAmbientOcclusionConfig ambientOcclusion();
IDhApiNoiseTextureConfig noiseTexture();
@@ -84,8 +85,6 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup
/** Modifies the quadratic function fake chunks use for horizontal quality drop-off. */
IDhApiConfigValue horizontalQuality();
- IDhApiConfigValue ambientOcclusion();
-
IDhApiConfigValue transparency();
/** Defines what blocks won't be rendered as LODs. */
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiHeightFogConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiHeightFogConfig.java
index 5879813a8..4e1c98753 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiHeightFogConfig.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiHeightFogConfig.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiLoggingConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiLoggingConfig.java
index 509aeff70..27b2f43f7 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiLoggingConfig.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiLoggingConfig.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiMultiThreadingConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiMultiThreadingConfig.java
index 2cbbf1741..c43428908 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiMultiThreadingConfig.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiMultiThreadingConfig.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiMultiplayerConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiMultiplayerConfig.java
index 3690c3f61..39edf49a5 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiMultiplayerConfig.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiMultiplayerConfig.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiNoiseTextureConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiNoiseTextureConfig.java
index e5954d36f..6f9099b9b 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiNoiseTextureConfig.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiNoiseTextureConfig.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/data/IDhApiTerrainDataRepo.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/data/IDhApiTerrainDataRepo.java
index f2e9aaaf8..2a4f81e24 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/data/IDhApiTerrainDataRepo.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/data/IDhApiTerrainDataRepo.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.interfaces.data;
import com.seibel.distanthorizons.api.enums.EDhApiDetailLevel;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/events/IDhApiEventInjector.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/events/IDhApiEventInjector.java
index 9be0d8559..75f11f2b0 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/events/IDhApiEventInjector.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/events/IDhApiEventInjector.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/IDhApiOverrideable.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/IDhApiOverrideable.java
index 493ceaada..b0d7d3246 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/IDhApiOverrideable.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/IDhApiOverrideable.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.interfaces.override;
import com.seibel.distanthorizons.coreapi.interfaces.dependencyInjection.IBindable;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/worldGenerator/AbstractDhApiChunkWorldGenerator.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/worldGenerator/AbstractDhApiChunkWorldGenerator.java
index 32892ae9e..e34fe2ecb 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/worldGenerator/AbstractDhApiChunkWorldGenerator.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/worldGenerator/AbstractDhApiChunkWorldGenerator.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.interfaces.override.worldGenerator;
import com.seibel.distanthorizons.api.enums.EDhApiDetailLevel;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/worldGenerator/IDhApiWorldGenerator.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/worldGenerator/IDhApiWorldGenerator.java
index 3c412e96b..3070c8511 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/worldGenerator/IDhApiWorldGenerator.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/worldGenerator/IDhApiWorldGenerator.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.interfaces.override.worldGenerator;
import com.seibel.distanthorizons.api.interfaces.override.IDhApiOverrideable;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/worldGenerator/IDhApiWorldGeneratorOverrideRegister.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/worldGenerator/IDhApiWorldGeneratorOverrideRegister.java
index 5067b1fbf..e9c56e839 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/worldGenerator/IDhApiWorldGeneratorOverrideRegister.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/worldGenerator/IDhApiWorldGeneratorOverrideRegister.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.interfaces.override.worldGenerator;
import com.seibel.distanthorizons.api.interfaces.world.IDhApiLevelWrapper;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/render/IDhApiRenderProxy.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/render/IDhApiRenderProxy.java
index 9bec3e19c..c5aa440c4 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/render/IDhApiRenderProxy.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/render/IDhApiRenderProxy.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/world/IDhApiDimensionTypeWrapper.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/world/IDhApiDimensionTypeWrapper.java
index 4910d68fc..226ed77a4 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/world/IDhApiDimensionTypeWrapper.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/world/IDhApiDimensionTypeWrapper.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/world/IDhApiLevelWrapper.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/world/IDhApiLevelWrapper.java
index 8bd6d075f..2583dfb4a 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/world/IDhApiLevelWrapper.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/world/IDhApiLevelWrapper.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/world/IDhApiWorldProxy.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/world/IDhApiWorldProxy.java
index f3f7885be..8daba387a 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/world/IDhApiWorldProxy.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/world/IDhApiWorldProxy.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/DhApiEventRegister.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/DhApiEventRegister.java
index 32a8d9b4e..313110506 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/DhApiEventRegister.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/DhApiEventRegister.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.methods.events;
import com.seibel.distanthorizons.api.objects.DhApiResult;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiAfterDhInitEvent.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiAfterDhInitEvent.java
index 197908e31..ba90abf19 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiAfterDhInitEvent.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiAfterDhInitEvent.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.methods.events.abstractEvents;
import com.seibel.distanthorizons.api.methods.events.interfaces.IDhApiEvent;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiAfterRenderEvent.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiAfterRenderEvent.java
index b40d9d8f9..af5e84323 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiAfterRenderEvent.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiAfterRenderEvent.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.methods.events.abstractEvents;
import com.seibel.distanthorizons.api.methods.events.interfaces.IDhApiEvent;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeDhInitEvent.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeDhInitEvent.java
index 985b4198e..d5635935a 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeDhInitEvent.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeDhInitEvent.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.methods.events.abstractEvents;
import com.seibel.distanthorizons.api.methods.events.interfaces.IDhApiEvent;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeRenderEvent.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeRenderEvent.java
index 176e02094..5aac32845 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeRenderEvent.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeRenderEvent.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.methods.events.abstractEvents;
import com.seibel.distanthorizons.api.methods.events.interfaces.IDhApiCancelableEvent;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiChunkModifiedEvent.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiChunkModifiedEvent.java
index 2b8e2d85c..6afe312cf 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiChunkModifiedEvent.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiChunkModifiedEvent.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.methods.events.abstractEvents;
import com.seibel.distanthorizons.api.interfaces.data.IDhApiTerrainDataRepo;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiLevelLoadEvent.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiLevelLoadEvent.java
index 163af3932..1663a77ff 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiLevelLoadEvent.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiLevelLoadEvent.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.methods.events.abstractEvents;
import com.seibel.distanthorizons.api.interfaces.world.IDhApiLevelWrapper;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiLevelUnloadEvent.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiLevelUnloadEvent.java
index 479b8c16c..d7955f736 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiLevelUnloadEvent.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiLevelUnloadEvent.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.methods.events.abstractEvents;
import com.seibel.distanthorizons.api.DhApi;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/interfaces/IDhApiCancelableEvent.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/interfaces/IDhApiCancelableEvent.java
index b9f5737b2..99b7a913d 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/interfaces/IDhApiCancelableEvent.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/interfaces/IDhApiCancelableEvent.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.methods.events.interfaces;
import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhApiCancelableEventParam;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/interfaces/IDhApiEvent.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/interfaces/IDhApiEvent.java
index 85ac64787..93d1ba46f 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/interfaces/IDhApiEvent.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/interfaces/IDhApiEvent.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.methods.events.interfaces;
import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhApiEventParam;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/interfaces/IDhApiOneTimeEvent.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/interfaces/IDhApiOneTimeEvent.java
index 983e67719..ced1a772e 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/interfaces/IDhApiOneTimeEvent.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/interfaces/IDhApiOneTimeEvent.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.methods.events.interfaces;
/**
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/interfaces/IDhServerMessageReceived.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/interfaces/IDhServerMessageReceived.java
index 88f49f425..5fc3fba40 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/interfaces/IDhServerMessageReceived.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/interfaces/IDhServerMessageReceived.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.methods.events.interfaces;
/**
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/sharedParameterObjects/DhApiCancelableEventParam.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/sharedParameterObjects/DhApiCancelableEventParam.java
index a7459d46f..843e21597 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/sharedParameterObjects/DhApiCancelableEventParam.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/sharedParameterObjects/DhApiCancelableEventParam.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.methods.events.sharedParameterObjects;
/**
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/sharedParameterObjects/DhApiEventParam.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/sharedParameterObjects/DhApiEventParam.java
index e1e64a229..fc5093839 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/sharedParameterObjects/DhApiEventParam.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/sharedParameterObjects/DhApiEventParam.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.methods.events.sharedParameterObjects;
import com.seibel.distanthorizons.api.methods.events.interfaces.IDhApiEvent;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/sharedParameterObjects/DhApiRenderParam.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/sharedParameterObjects/DhApiRenderParam.java
index 34814e1f8..218067ab0 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/sharedParameterObjects/DhApiRenderParam.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/sharedParameterObjects/DhApiRenderParam.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.methods.events.sharedParameterObjects;
import com.seibel.distanthorizons.coreapi.util.math.Mat4f;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/override/DhApiWorldGeneratorOverrideRegister.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/override/DhApiWorldGeneratorOverrideRegister.java
index aa4a6a5a3..9869a7861 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/override/DhApiWorldGeneratorOverrideRegister.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/override/DhApiWorldGeneratorOverrideRegister.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.methods.override;
import com.seibel.distanthorizons.api.interfaces.override.worldGenerator.IDhApiWorldGenerator;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/objects/DhApiResult.java b/api/src/main/java/com/seibel/distanthorizons/api/objects/DhApiResult.java
index eb81bf263..da33f23a4 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/objects/DhApiResult.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/objects/DhApiResult.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.objects;
/**
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/objects/config/DhApiConfigValue.java b/api/src/main/java/com/seibel/distanthorizons/api/objects/config/DhApiConfigValue.java
index 2931cb9fa..eba9463f4 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/objects/config/DhApiConfigValue.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/objects/config/DhApiConfigValue.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.objects.config;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/objects/data/DhApiRaycastResult.java b/api/src/main/java/com/seibel/distanthorizons/api/objects/data/DhApiRaycastResult.java
index c2042ffd7..c54866bf0 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/objects/data/DhApiRaycastResult.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/objects/data/DhApiRaycastResult.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.objects.data;
import com.seibel.distanthorizons.api.objects.math.DhApiVec3i;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/objects/data/DhApiTerrainDataPoint.java b/api/src/main/java/com/seibel/distanthorizons/api/objects/data/DhApiTerrainDataPoint.java
index 776626e5b..d78ca58e2 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/objects/data/DhApiTerrainDataPoint.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/objects/data/DhApiTerrainDataPoint.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.api.objects.data;
import com.seibel.distanthorizons.api.interfaces.block.IDhApiBiomeWrapper;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/objects/math/DhApiVec3i.java b/api/src/main/java/com/seibel/distanthorizons/api/objects/math/DhApiVec3i.java
index 9d9589dd0..e907c0061 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/objects/math/DhApiVec3i.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/objects/math/DhApiVec3i.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/DependencyInjection/ApiEventInjector.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/DependencyInjection/ApiEventInjector.java
index e268c7c2d..e6d49f611 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/DependencyInjection/ApiEventInjector.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/DependencyInjection/ApiEventInjector.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/DependencyInjection/DependencyInjector.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/DependencyInjection/DependencyInjector.java
index a8686111a..ab3aa09fe 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/DependencyInjection/DependencyInjector.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/DependencyInjection/DependencyInjector.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/DependencyInjection/OverrideInjector.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/DependencyInjection/OverrideInjector.java
index 1947e75e1..e87368089 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/DependencyInjection/OverrideInjector.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/DependencyInjection/OverrideInjector.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/DependencyInjection/OverridePriorityListContainer.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/DependencyInjection/OverridePriorityListContainer.java
index cc31021df..46084accb 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/DependencyInjection/OverridePriorityListContainer.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/DependencyInjection/OverridePriorityListContainer.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.coreapi.DependencyInjection;
import com.seibel.distanthorizons.api.interfaces.override.IDhApiOverrideable;
diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/DependencyInjection/WorldGeneratorInjector.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/DependencyInjection/WorldGeneratorInjector.java
index da0751996..335a17efe 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/DependencyInjection/WorldGeneratorInjector.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/DependencyInjection/WorldGeneratorInjector.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
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 ff0eb7d14..f2f0e2c7c 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/ModInfo.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/ModInfo.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/interfaces/config/IConfigEntry.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/interfaces/config/IConfigEntry.java
index afb6dad1e..a31745a8e 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/interfaces/config/IConfigEntry.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/interfaces/config/IConfigEntry.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.coreapi.interfaces.config;
diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/interfaces/config/IConverter.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/interfaces/config/IConverter.java
index 96b35c528..e4af92479 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/interfaces/config/IConverter.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/interfaces/config/IConverter.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.coreapi.interfaces.config;
diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/interfaces/dependencyInjection/IBindable.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/interfaces/dependencyInjection/IBindable.java
index 80b70c14c..304ba1d7e 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/interfaces/dependencyInjection/IBindable.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/interfaces/dependencyInjection/IBindable.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/interfaces/dependencyInjection/IDependencyInjector.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/interfaces/dependencyInjection/IDependencyInjector.java
index 3024405b1..3855a6557 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/interfaces/dependencyInjection/IDependencyInjector.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/interfaces/dependencyInjection/IDependencyInjector.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.coreapi.interfaces.dependencyInjection;
diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/interfaces/dependencyInjection/IOverrideInjector.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/interfaces/dependencyInjection/IOverrideInjector.java
index bf1d3d6ce..b37883b59 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/interfaces/dependencyInjection/IOverrideInjector.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/interfaces/dependencyInjection/IOverrideInjector.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.coreapi.interfaces.dependencyInjection;
diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/util/BitShiftUtil.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/util/BitShiftUtil.java
index cd900a2d7..9ad2e34f8 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/util/BitShiftUtil.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/util/BitShiftUtil.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.coreapi.util;
/**
diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/util/MathUtil.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/util/MathUtil.java
index a2c1ba9c5..bea95adf7 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/util/MathUtil.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/util/MathUtil.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.coreapi.util;
public class MathUtil
diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/util/StringUtil.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/util/StringUtil.java
index 76ab1beff..edb554245 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/util/StringUtil.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/util/StringUtil.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/util/converters/DefaultConverter.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/util/converters/DefaultConverter.java
index 4179e068e..d8afca939 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/util/converters/DefaultConverter.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/util/converters/DefaultConverter.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.coreapi.util.converters;
import com.seibel.distanthorizons.coreapi.interfaces.config.IConverter;
diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/util/converters/RenderModeEnabledConverter.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/util/converters/RenderModeEnabledConverter.java
index 151be4ded..2bb47acfe 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/util/converters/RenderModeEnabledConverter.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/util/converters/RenderModeEnabledConverter.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.coreapi.util.converters;
import com.seibel.distanthorizons.api.enums.rendering.ERendererMode;
diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/util/math/Mat4f.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/util/math/Mat4f.java
index 6523ddf62..74e2c5d99 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/util/math/Mat4f.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/util/math/Mat4f.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -287,17 +287,18 @@ public class Mat4f
this.m23 = f;
}
- public boolean invert()
+ public boolean canInvert()
+ {
+ float det = this.adjudicateAndDet();
+ return (Math.abs(det) > 1.0E-6F);
+ }
+
+ public void invert()
{
float det = this.adjudicateAndDet();
if (Math.abs(det) > 1.0E-6F)
{
this.multiply(det);
- return true;
- }
- else
- {
- return false;
}
}
diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/util/math/Vec3d.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/util/math/Vec3d.java
index ab83283d1..a1374d8de 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/util/math/Vec3d.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/util/math/Vec3d.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/util/math/Vec3f.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/util/math/Vec3f.java
index 1ec4988e5..b45ba98be 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/util/math/Vec3f.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/util/math/Vec3f.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/util/math/Vec3i.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/util/math/Vec3i.java
index 4aa624b0e..c85fdea51 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/util/math/Vec3i.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/util/math/Vec3i.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/api/src/test/java/testItems/events/abstractObjects/AbstractDhApiCancelableOneTimeTestEvent.java b/api/src/test/java/testItems/events/abstractObjects/AbstractDhApiCancelableOneTimeTestEvent.java
index 09c7d0d25..b217a0044 100644
--- a/api/src/test/java/testItems/events/abstractObjects/AbstractDhApiCancelableOneTimeTestEvent.java
+++ b/api/src/test/java/testItems/events/abstractObjects/AbstractDhApiCancelableOneTimeTestEvent.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package testItems.events.abstractObjects;
import com.seibel.distanthorizons.api.methods.events.interfaces.IDhApiCancelableEvent;
diff --git a/api/src/test/java/testItems/events/abstractObjects/AbstractDhApiRemoveAfterFireTestEvent.java b/api/src/test/java/testItems/events/abstractObjects/AbstractDhApiRemoveAfterFireTestEvent.java
index 6d164c3a1..56e43b6a9 100644
--- a/api/src/test/java/testItems/events/abstractObjects/AbstractDhApiRemoveAfterFireTestEvent.java
+++ b/api/src/test/java/testItems/events/abstractObjects/AbstractDhApiRemoveAfterFireTestEvent.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package testItems.events.abstractObjects;
import com.seibel.distanthorizons.api.methods.events.interfaces.IDhApiEvent;
diff --git a/api/src/test/java/testItems/events/abstractObjects/AbstractDhApiTestEvent.java b/api/src/test/java/testItems/events/abstractObjects/AbstractDhApiTestEvent.java
index a912a3ef1..1f4ba2896 100644
--- a/api/src/test/java/testItems/events/abstractObjects/AbstractDhApiTestEvent.java
+++ b/api/src/test/java/testItems/events/abstractObjects/AbstractDhApiTestEvent.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package testItems.events.abstractObjects;
import com.seibel.distanthorizons.api.methods.events.interfaces.IDhApiEvent;
diff --git a/api/src/test/java/testItems/events/objects/DhCancelableOneTimeTestEventHandler.java b/api/src/test/java/testItems/events/objects/DhCancelableOneTimeTestEventHandler.java
index 3aed71ef9..ff1cbd357 100644
--- a/api/src/test/java/testItems/events/objects/DhCancelableOneTimeTestEventHandler.java
+++ b/api/src/test/java/testItems/events/objects/DhCancelableOneTimeTestEventHandler.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package testItems.events.objects;
import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhApiCancelableEventParam;
diff --git a/api/src/test/java/testItems/events/objects/DhCancelableOneTimeTestEventHandlerAlt.java b/api/src/test/java/testItems/events/objects/DhCancelableOneTimeTestEventHandlerAlt.java
index 6a3aaddeb..532152087 100644
--- a/api/src/test/java/testItems/events/objects/DhCancelableOneTimeTestEventHandlerAlt.java
+++ b/api/src/test/java/testItems/events/objects/DhCancelableOneTimeTestEventHandlerAlt.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package testItems.events.objects;
/**
diff --git a/api/src/test/java/testItems/events/objects/DhRemoveAfterFireTestEventHandler.java b/api/src/test/java/testItems/events/objects/DhRemoveAfterFireTestEventHandler.java
index a91e4fa11..06157f3fb 100644
--- a/api/src/test/java/testItems/events/objects/DhRemoveAfterFireTestEventHandler.java
+++ b/api/src/test/java/testItems/events/objects/DhRemoveAfterFireTestEventHandler.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package testItems.events.objects;
import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhApiEventParam;
diff --git a/api/src/test/java/testItems/events/objects/DhTestEventHandler.java b/api/src/test/java/testItems/events/objects/DhTestEventHandler.java
index b8ae86244..9606cd59a 100644
--- a/api/src/test/java/testItems/events/objects/DhTestEventHandler.java
+++ b/api/src/test/java/testItems/events/objects/DhTestEventHandler.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package testItems.events.objects;
import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhApiEventParam;
diff --git a/api/src/test/java/testItems/events/objects/DhTestEventHandlerAlt.java b/api/src/test/java/testItems/events/objects/DhTestEventHandlerAlt.java
index 0fa87436d..41f42d6f2 100644
--- a/api/src/test/java/testItems/events/objects/DhTestEventHandlerAlt.java
+++ b/api/src/test/java/testItems/events/objects/DhTestEventHandlerAlt.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package testItems.events.objects;
import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhApiEventParam;
diff --git a/api/src/test/java/tests/EventInjectorTest.java b/api/src/test/java/tests/EventInjectorTest.java
index 67fb480cb..b17d6d3d9 100644
--- a/api/src/test/java/tests/EventInjectorTest.java
+++ b/api/src/test/java/tests/EventInjectorTest.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package tests;
import com.seibel.distanthorizons.coreapi.DependencyInjection.ApiEventInjector;
diff --git a/api/src/test/java/tests/ExampleTest.java b/api/src/test/java/tests/ExampleTest.java
index 150f77422..63e1ecf89 100644
--- a/api/src/test/java/tests/ExampleTest.java
+++ b/api/src/test/java/tests/ExampleTest.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/IReflectionHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/IReflectionHandler.java
index 9755811e4..0f2bb9127 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/IReflectionHandler.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/IReflectionHandler.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/Initializer.java b/core/src/main/java/com/seibel/distanthorizons/core/Initializer.java
index 22483c81b..87d6db72f 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/Initializer.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/Initializer.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core;
import com.seibel.distanthorizons.coreapi.ModInfo;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/ReflectionHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/ReflectionHandler.java
index 2690144b7..317ba14f5 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/ReflectionHandler.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/ReflectionHandler.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/DhApiConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/DhApiConfig.java
index 46c9bc022..5197f7b46 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/DhApiConfig.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/DhApiConfig.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.api.external.methods.config;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfig;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiAmbientOcclusionConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiAmbientOcclusionConfig.java
new file mode 100644
index 000000000..4afc661f8
--- /dev/null
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiAmbientOcclusionConfig.java
@@ -0,0 +1,64 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+package com.seibel.distanthorizons.core.api.external.methods.config.client;
+
+import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue;
+import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiAmbientOcclusionConfig;
+import com.seibel.distanthorizons.api.objects.config.DhApiConfigValue;
+import com.seibel.distanthorizons.core.config.Config;
+
+public class DhApiAmbientOcclusionConfig implements IDhApiAmbientOcclusionConfig
+{
+ public static DhApiAmbientOcclusionConfig INSTANCE = new DhApiAmbientOcclusionConfig();
+
+ private DhApiAmbientOcclusionConfig() { }
+
+
+
+
+ @Override
+ public IDhApiConfigValue enabled()
+ { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Ssao.enabled); }
+
+ @Override
+ public IDhApiConfigValue sampleCount()
+ { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Ssao.sampleCount); }
+
+ @Override
+ public IDhApiConfigValue radius()
+ { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Ssao.radius); }
+
+ @Override
+ public IDhApiConfigValue strength()
+ { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Ssao.strength); }
+
+ @Override
+ public IDhApiConfigValue bias()
+ { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Ssao.bias); }
+
+ @Override
+ public IDhApiConfigValue minLight()
+ { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Ssao.minLight); }
+
+ @Override
+ public IDhApiConfigValue blurRadius()
+ { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Ssao.blurRadius); }
+
+}
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiDebuggingConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiDebuggingConfig.java
index 26de8957f..b9dab4d9d 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiDebuggingConfig.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiDebuggingConfig.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiFarFogConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiFarFogConfig.java
index c78a812de..1bacc727c 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiFarFogConfig.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiFarFogConfig.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiFogConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiFogConfig.java
index d188f839f..79dc571ec 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiFogConfig.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiFogConfig.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGpuBuffersConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGpuBuffersConfig.java
index 7833b7e67..7069e5df4 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGpuBuffersConfig.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGpuBuffersConfig.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGraphicsConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGraphicsConfig.java
index c07bb82cf..df8f8d280 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGraphicsConfig.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGraphicsConfig.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -22,6 +22,7 @@ package com.seibel.distanthorizons.core.api.external.methods.config.client;
import com.seibel.distanthorizons.api.enums.config.*;
import com.seibel.distanthorizons.api.enums.rendering.ETransparency;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue;
+import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiAmbientOcclusionConfig;
import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiFogConfig;
import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiGraphicsConfig;
import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiNoiseTextureConfig;
@@ -42,6 +43,7 @@ public class DhApiGraphicsConfig implements IDhApiGraphicsConfig
//==============//
public IDhApiFogConfig fog() { return DhApiFogConfig.INSTANCE; }
+ public IDhApiAmbientOcclusionConfig ambientOcclusion() { return DhApiAmbientOcclusionConfig.INSTANCE; }
public IDhApiNoiseTextureConfig noiseTexture() { return DhApiNoiseTextureConfig.INSTANCE; }
@@ -80,10 +82,6 @@ public class DhApiGraphicsConfig implements IDhApiGraphicsConfig
public IDhApiConfigValue horizontalQuality()
{ return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.horizontalQuality); }
- @Override
- public IDhApiConfigValue ambientOcclusion()
- { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.ssao); }
-
@Override
public IDhApiConfigValue transparency()
{ return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.transparency); }
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiHeightFogConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiHeightFogConfig.java
index 79d09d6b5..866137bc0 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiHeightFogConfig.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiHeightFogConfig.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiMultiThreadingConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiMultiThreadingConfig.java
index 0f38b0f59..da80be1ba 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiMultiThreadingConfig.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiMultiThreadingConfig.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiMultiplayerConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiMultiplayerConfig.java
index 61e232e37..e09d70244 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiMultiplayerConfig.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiMultiplayerConfig.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiNoiseTextureConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiNoiseTextureConfig.java
index a29637de8..1b344e292 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiNoiseTextureConfig.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiNoiseTextureConfig.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/common/DhApiWorldGenerationConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/common/DhApiWorldGenerationConfig.java
index a35799c8f..121909395 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/common/DhApiWorldGenerationConfig.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/common/DhApiWorldGenerationConfig.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/data/DhApiTerrainDataRepo.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/data/DhApiTerrainDataRepo.java
index 1968658ee..63b2f074a 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/data/DhApiTerrainDataRepo.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/data/DhApiTerrainDataRepo.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.api.external.methods.data;
import com.seibel.distanthorizons.api.interfaces.world.IDhApiLevelWrapper;
@@ -193,7 +212,7 @@ public class DhApiTerrainDataRepo implements IDhApiTerrainDataRepo
try
{
// attempt to get/generate the data source for this section
- IFullDataSource dataSource = level.getFileHandler().read(sectionPos).get();
+ IFullDataSource dataSource = level.getFileHandler().readAsync(sectionPos).get();
if (dataSource == null)
{
return DhApiResult.createFail("Unable to find/generate any data at the " + DhSectionPos.class.getSimpleName() + " [" + sectionPos + "].");
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 5066e2517..320d21028 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
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ServerApi.java b/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ServerApi.java
index 4d682de71..bfe5cfeee 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ServerApi.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ServerApi.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/internal/SharedApi.java b/core/src/main/java/com/seibel/distanthorizons/core/api/internal/SharedApi.java
index 8abbd0609..aeb9951d1 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/internal/SharedApi.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/internal/SharedApi.java
@@ -1,9 +1,28 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.api.internal;
import com.seibel.distanthorizons.core.Initializer;
import com.seibel.distanthorizons.core.dataObjects.render.bufferBuilding.ColumnRenderBufferBuilder;
import com.seibel.distanthorizons.core.dataObjects.transformers.ChunkToLodBuilder;
-import com.seibel.distanthorizons.core.dataObjects.transformers.DataRenderTransformer;
+import com.seibel.distanthorizons.core.dataObjects.transformers.FullDataToRenderDataTransformer;
import com.seibel.distanthorizons.core.file.fullDatafile.FullDataFileHandler;
import com.seibel.distanthorizons.core.generation.WorldGenerationQueue;
import com.seibel.distanthorizons.core.world.*;
@@ -33,7 +52,7 @@ public class SharedApi
if (currentWorld != null)
{
// static thread pool setup
- DataRenderTransformer.setupExecutorService();
+ FullDataToRenderDataTransformer.setupExecutorService();
FullDataFileHandler.setupExecutorService();
ColumnRenderBufferBuilder.setupExecutorService();
WorldGenerationQueue.setupWorldGenThreadPool();
@@ -42,7 +61,7 @@ public class SharedApi
else
{
// static thread pool shutdown
- DataRenderTransformer.shutdownExecutorService();
+ FullDataToRenderDataTransformer.shutdownExecutorService();
FullDataFileHandler.shutdownExecutorService();
ColumnRenderBufferBuilder.shutdownExecutorService();
WorldGenerationQueue.shutdownWorldGenThreadPool();
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/AppliedConfigState.java b/core/src/main/java/com/seibel/distanthorizons/core/config/AppliedConfigState.java
index badbb60d0..1cf63b89c 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/AppliedConfigState.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/AppliedConfigState.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config;
import com.seibel.distanthorizons.core.config.types.ConfigEntry;
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 3731c5a75..1f4f92eb0 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
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -132,6 +132,7 @@ public class Config
{
public static ConfigCategory quality = new ConfigCategory.Builder().set(Quality.class).build();
public static ConfigCategory fog = new ConfigCategory.Builder().set(Fog.class).build();
+ public static ConfigCategory ssao = new ConfigCategory.Builder().set(Ssao.class).build();
public static ConfigCategory noiseTextureSettings = new ConfigCategory.Builder().set(NoiseTextureSettings.class).build();
public static ConfigCategory advancedGraphics = new ConfigCategory.Builder().set(AdvancedGraphics.class).build();
@@ -174,11 +175,6 @@ public class Config
.setPerformance(EConfigEntryPerformance.VERY_HIGH)
.build();
- public static ConfigEntry ssao = new ConfigEntry.Builder()
- .set(true)
- .comment("Enable Screen Space Ambient Occlusion")
- .build();
-
public static ConfigEntry horizontalQuality = new ConfigEntry.Builder()
.set(EHorizontalQuality.MEDIUM)
.comment(""
@@ -443,6 +439,68 @@ public class Config
}
+ public static class Ssao
+ {
+ public static ConfigEntry enabled = new ConfigEntry.Builder()
+ .set(true)
+ .comment("Enable Screen Space Ambient Occlusion")
+ .setPerformance(EConfigEntryPerformance.MEDIUM)
+ .build();
+
+ public static ConfigEntry sampleCount = new ConfigEntry.Builder()
+ .set(6)
+ .comment("" +
+ "Determines how many points in space are sampled for the occlusion test. \n" +
+ "Higher numbers will improve quality and reduce banding, but will increase GPU load." +
+ "")
+ .setPerformance(EConfigEntryPerformance.MEDIUM)
+ .build();
+
+ public static ConfigEntry radius = new ConfigEntry.Builder()
+ .set(4.0)
+ .comment("" +
+ "Determines the radius Screen Space Ambient Occlusion is applied, measured in blocks." +
+ "")
+ .setPerformance(EConfigEntryPerformance.NONE)
+ .build();
+
+ public static ConfigEntry strength = new ConfigEntry.Builder()
+ .set(0.2)
+ .comment("" +
+ "Determines how dark the Screen Space Ambient Occlusion effect will be." +
+ "")
+ .setPerformance(EConfigEntryPerformance.NONE)
+ .build();
+
+ public static ConfigEntry bias = new ConfigEntry.Builder()
+ .set(0.02)
+ .comment("" +
+ "Increasing the value can reduce banding at the cost of reducing the strength of the effect." +
+ "")
+ .setPerformance(EConfigEntryPerformance.NONE)
+ .build();
+
+ public static ConfigEntry minLight = new ConfigEntry.Builder()
+ .set(0.25)
+ .comment("" +
+ "Determines how dark the occlusion shadows can be. \n" +
+ "0 = totally black at the corners \n" +
+ "1 = no shadow" +
+ "")
+ .setPerformance(EConfigEntryPerformance.NONE)
+ .build();
+
+ public static ConfigEntry blurRadius = new ConfigEntry.Builder()
+ .set(2)
+ .comment("" +
+ "The radius, measured in pixels, that blurring is calculated for the SSAO. \n" +
+ "Higher numbers will reduce banding at the cost of GPU performance." +
+ "")
+ .setPerformance(EConfigEntryPerformance.HIGH)
+ .build();
+
+ }
+
public static class NoiseTextureSettings
{
public static ConfigEntry noiseEnabled = new ConfigEntry.Builder()
@@ -519,6 +577,7 @@ public class Config
.setPerformance(EConfigEntryPerformance.NONE)
.build();
+ // move into "shader compatibility"
public static ConfigEntry brightnessMultiplier = new ConfigEntry.Builder() // TODO: Make this a float (the ClassicConfigGUI doesnt support floats)
.set(1.0)
.comment(""
@@ -1122,6 +1181,7 @@ public class Config
.set(ExampleConfigScreen.class)
.build();
+
/** This class is used to debug the different features of the config GUI */
// FIXME: WARNING: Some of the options in this class dont get show n in the default UI
// This will throw a warning when opened in the default ui to tell you about it not showing
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/ConfigBase.java b/core/src/main/java/com/seibel/distanthorizons/core/config/ConfigBase.java
index eb0f54305..f466ab1d2 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/ConfigBase.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/ConfigBase.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config;
import com.seibel.distanthorizons.core.config.file.ConfigFileHandling;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/ConfigEntryWithPresetOptions.java b/core/src/main/java/com/seibel/distanthorizons/core/config/ConfigEntryWithPresetOptions.java
index 175dead64..18630108b 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/ConfigEntryWithPresetOptions.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/ConfigEntryWithPresetOptions.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config;
import com.seibel.distanthorizons.core.config.types.ConfigEntry;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/NumberUtil.java b/core/src/main/java/com/seibel/distanthorizons/core/config/NumberUtil.java
index b09954a0b..b23bcb450 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/NumberUtil.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/NumberUtil.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config;
import java.util.HashMap;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/QuickRenderToggleConfigEventHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/QuickRenderToggleConfigEventHandler.java
index d3b8811c5..1991603e3 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/QuickRenderToggleConfigEventHandler.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/QuickRenderToggleConfigEventHandler.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.eventHandlers;
import com.seibel.distanthorizons.api.enums.rendering.ERendererMode;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/RenderCacheConfigEventHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/RenderCacheConfigEventHandler.java
index ac3eb4cb1..86c2d74a3 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/RenderCacheConfigEventHandler.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/RenderCacheConfigEventHandler.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.eventHandlers;
import com.seibel.distanthorizons.api.DhApi;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/ResetConfigEventHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/ResetConfigEventHandler.java
index a2fd1a48e..05b14eca9 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/ResetConfigEventHandler.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/ResetConfigEventHandler.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.eventHandlers;
import com.seibel.distanthorizons.core.config.listeners.ConfigChangeListener;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/UnsafeValuesConfigListener.java b/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/UnsafeValuesConfigListener.java
index af7f1f19c..61c16c658 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/UnsafeValuesConfigListener.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/UnsafeValuesConfigListener.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.eventHandlers;
import com.seibel.distanthorizons.core.config.Config;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/WorldCurvatureConfigEventHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/WorldCurvatureConfigEventHandler.java
index 0fdea7e48..a8c75134a 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/WorldCurvatureConfigEventHandler.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/WorldCurvatureConfigEventHandler.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.eventHandlers;
import com.seibel.distanthorizons.api.DhApi;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/presets/AbstractPresetConfigEventHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/presets/AbstractPresetConfigEventHandler.java
index 4c42da829..6069072ab 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/presets/AbstractPresetConfigEventHandler.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/presets/AbstractPresetConfigEventHandler.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.eventHandlers.presets;
import com.seibel.distanthorizons.core.config.Config;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/presets/RenderQualityPresetConfigEventHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/presets/RenderQualityPresetConfigEventHandler.java
index 5ae270f1d..3ac0f6f78 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/presets/RenderQualityPresetConfigEventHandler.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/presets/RenderQualityPresetConfigEventHandler.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.eventHandlers.presets;
import com.seibel.distanthorizons.api.enums.config.EHorizontalQuality;
@@ -57,7 +76,7 @@ public class RenderQualityPresetConfigEventHandler extends AbstractPresetConfigE
this.put(EQualityPreset.HIGH, ETransparency.COMPLETE);
this.put(EQualityPreset.EXTREME, ETransparency.COMPLETE);
}});
- private final ConfigEntryWithPresetOptions ssao = new ConfigEntryWithPresetOptions<>(Config.Client.Advanced.Graphics.Quality.ssao,
+ private final ConfigEntryWithPresetOptions ssaoEnabled = new ConfigEntryWithPresetOptions<>(Config.Client.Advanced.Graphics.Ssao.enabled,
new HashMap()
{{
this.put(EQualityPreset.MINIMUM, false);
@@ -66,7 +85,7 @@ public class RenderQualityPresetConfigEventHandler extends AbstractPresetConfigE
this.put(EQualityPreset.HIGH, true);
this.put(EQualityPreset.EXTREME, true);
}});
-
+
//==============//
@@ -81,7 +100,7 @@ public class RenderQualityPresetConfigEventHandler extends AbstractPresetConfigE
this.configList.add(this.verticalQuality);
this.configList.add(this.horizontalQuality);
this.configList.add(this.transparency);
- this.configList.add(this.ssao);
+ this.configList.add(this.ssaoEnabled);
for (ConfigEntryWithPresetOptions config : this.configList)
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/presets/ThreadPresetConfigEventHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/presets/ThreadPresetConfigEventHandler.java
index a01c697ff..2f0e21cf0 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/presets/ThreadPresetConfigEventHandler.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/presets/ThreadPresetConfigEventHandler.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.eventHandlers.presets;
import com.seibel.distanthorizons.api.enums.config.quickOptions.EThreadPreset;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/file/ConfigFileHandling.java b/core/src/main/java/com/seibel/distanthorizons/core/config/file/ConfigFileHandling.java
index 8fc4fa631..e9c403212 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/file/ConfigFileHandling.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/file/ConfigFileHandling.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.file;
import com.electronwill.nightconfig.core.file.CommentedFileConfig;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/file/ConfigTypeConverters.java b/core/src/main/java/com/seibel/distanthorizons/core/config/file/ConfigTypeConverters.java
index e35359770..3b8ba9711 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/file/ConfigTypeConverters.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/file/ConfigTypeConverters.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.file;
import com.electronwill.nightconfig.core.Config;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/gui/AbstractScreen.java b/core/src/main/java/com/seibel/distanthorizons/core/config/gui/AbstractScreen.java
index 704b2ed4f..b8dbf3cab 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/gui/AbstractScreen.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/gui/AbstractScreen.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.gui;
import java.net.URI;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/gui/ConfigScreen.java b/core/src/main/java/com/seibel/distanthorizons/core/config/gui/ConfigScreen.java
index a43f4891f..6c5c7a821 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/gui/ConfigScreen.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/gui/ConfigScreen.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.gui;
import javax.swing.*;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/gui/EmbeddedFrameUtil.java b/core/src/main/java/com/seibel/distanthorizons/core/config/gui/EmbeddedFrameUtil.java
index efa1e189b..a271cb7c7 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/gui/EmbeddedFrameUtil.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/gui/EmbeddedFrameUtil.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.gui;
import com.seibel.distanthorizons.core.jar.Platform;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/gui/JavaScreenHandlerScreen.java b/core/src/main/java/com/seibel/distanthorizons/core/config/gui/JavaScreenHandlerScreen.java
index 2985ffb6d..7ba1bcaf1 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/gui/JavaScreenHandlerScreen.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/gui/JavaScreenHandlerScreen.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.gui;
import org.jetbrains.annotations.NotNull;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/gui/OpenGLConfigScreen.java b/core/src/main/java/com/seibel/distanthorizons/core/config/gui/OpenGLConfigScreen.java
index 5035a4726..0ff87833e 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/gui/OpenGLConfigScreen.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/gui/OpenGLConfigScreen.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.gui;
import com.seibel.distanthorizons.api.enums.config.EGpuUploadMethod;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/listeners/ConfigChangeListener.java b/core/src/main/java/com/seibel/distanthorizons/core/config/listeners/ConfigChangeListener.java
index 048b343f7..d05fd938d 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/listeners/ConfigChangeListener.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/listeners/ConfigChangeListener.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.listeners;
import com.seibel.distanthorizons.core.config.types.ConfigEntry;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/listeners/IConfigListener.java b/core/src/main/java/com/seibel/distanthorizons/core/config/listeners/IConfigListener.java
index 79ea44005..39afb0144 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/listeners/IConfigListener.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/listeners/IConfigListener.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.listeners;
public interface IConfigListener
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/types/AbstractConfigType.java b/core/src/main/java/com/seibel/distanthorizons/core/config/types/AbstractConfigType.java
index f7aaa3b15..d1b903f11 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/types/AbstractConfigType.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/types/AbstractConfigType.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.types;
import com.seibel.distanthorizons.core.config.ConfigBase;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigCategory.java b/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigCategory.java
index 0e25ff232..032c6b8d2 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigCategory.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigCategory.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.types;
import com.seibel.distanthorizons.core.config.types.enums.EConfigEntryAppearance;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigEntry.java b/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigEntry.java
index 92b6d26a1..12bb99e36 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigEntry.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigEntry.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.types;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigLinkedEntry.java b/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigLinkedEntry.java
index f7fbdcb47..bac72896c 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigLinkedEntry.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigLinkedEntry.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.types;
import com.seibel.distanthorizons.core.config.types.enums.EConfigEntryAppearance;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigUIButton.java b/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigUIButton.java
index e60fbb680..41c5d3415 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigUIButton.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigUIButton.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.types;
import com.seibel.distanthorizons.core.config.types.enums.EConfigEntryAppearance;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigUIComment.java b/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigUIComment.java
index 991258db3..ce543f721 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigUIComment.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigUIComment.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.types;
import com.seibel.distanthorizons.core.config.types.enums.EConfigEntryAppearance;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/types/enums/EConfigEntryAppearance.java b/core/src/main/java/com/seibel/distanthorizons/core/config/types/enums/EConfigEntryAppearance.java
index f05384ff3..06b367832 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/types/enums/EConfigEntryAppearance.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/types/enums/EConfigEntryAppearance.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.types.enums;
/**
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/types/enums/EConfigEntryPerformance.java b/core/src/main/java/com/seibel/distanthorizons/core/config/types/enums/EConfigEntryPerformance.java
index f9253bee4..25f3c50f9 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/types/enums/EConfigEntryPerformance.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/types/enums/EConfigEntryPerformance.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.config.types.enums;
/**
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/FullDataDownSampler.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/FullDataDownSampler.java
index 4a2bdff8e..513f2594c 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/FullDataDownSampler.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/FullDataDownSampler.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.fullData;
import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.SingleColumnFullDataAccessor;
@@ -35,7 +54,7 @@ public class FullDataDownSampler
{
for (int oz = 0; oz < sectionSizeNeeded; oz++)
{
- CompletableFuture future = provider.read(new DhSectionPos(
+ CompletableFuture future = provider.readAsync(new DhSectionPos(
CompleteFullDataSource.SECTION_SIZE_OFFSET, basePos.x + ox, basePos.z + oz));
future = future.whenComplete((source, ex) -> {
if (ex == null && source != null && source instanceof CompleteFullDataSource)
@@ -59,7 +78,7 @@ public class FullDataDownSampler
{
for (int oz = 0; oz < CompleteFullDataSource.WIDTH; oz++)
{
- CompletableFuture future = provider.read(new DhSectionPos(
+ CompletableFuture future = provider.readAsync(new DhSectionPos(
CompleteFullDataSource.SECTION_SIZE_OFFSET, basePos.x + ox * multiplier, basePos.z + oz * multiplier));
future = future.whenComplete((source, ex) -> {
if (ex == null && source != null && source instanceof CompleteFullDataSource)
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/FullDataPointIdMap.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/FullDataPointIdMap.java
index a12e9a8ee..bb7f69b3a 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/FullDataPointIdMap.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/FullDataPointIdMap.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.fullData;
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/accessor/ChunkSizedFullDataAccessor.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/accessor/ChunkSizedFullDataAccessor.java
index a846ad42e..4c1135e44 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/accessor/ChunkSizedFullDataAccessor.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/accessor/ChunkSizedFullDataAccessor.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.fullData.accessor;
import com.seibel.distanthorizons.core.dataObjects.fullData.FullDataPointIdMap;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/accessor/FullDataArrayAccessor.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/accessor/FullDataArrayAccessor.java
index 48f79492c..f2bfa5ad1 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/accessor/FullDataArrayAccessor.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/accessor/FullDataArrayAccessor.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.fullData.accessor;
import com.seibel.distanthorizons.core.dataObjects.fullData.FullDataPointIdMap;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/accessor/IFullDataAccessor.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/accessor/IFullDataAccessor.java
index 82f2ad8db..6f45e1707 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/accessor/IFullDataAccessor.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/accessor/IFullDataAccessor.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.fullData.accessor;
import com.seibel.distanthorizons.core.dataObjects.fullData.sources.interfaces.IFullDataSource;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/accessor/SingleColumnFullDataAccessor.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/accessor/SingleColumnFullDataAccessor.java
index f23056a8d..6a418034c 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/accessor/SingleColumnFullDataAccessor.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/accessor/SingleColumnFullDataAccessor.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.fullData.accessor;
import com.seibel.distanthorizons.core.dataObjects.fullData.FullDataPointIdMap;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/loader/AbstractFullDataSourceLoader.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/loader/AbstractFullDataSourceLoader.java
index da45c77d7..32eb41f19 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/loader/AbstractFullDataSourceLoader.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/loader/AbstractFullDataSourceLoader.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.fullData.loader;
import com.google.common.collect.HashMultimap;
@@ -13,7 +32,7 @@ public abstract class AbstractFullDataSourceLoader
{
public static final HashMultimap, AbstractFullDataSourceLoader> loaderRegistry = HashMultimap.create();
- public final Class extends IFullDataSource> clazz;
+ public final Class extends IFullDataSource> fullDataSourceClass;
public static final HashMap> datatypeIdRegistry = new HashMap<>();
public final long datatypeId;
@@ -21,18 +40,18 @@ public abstract class AbstractFullDataSourceLoader
- public AbstractFullDataSourceLoader(Class extends IFullDataSource> clazz, long datatypeId, byte[] loaderSupportedVersions)
+ public AbstractFullDataSourceLoader(Class extends IFullDataSource> fullDataSourceClass, long datatypeId, byte[] loaderSupportedVersions)
{
this.datatypeId = datatypeId;
this.loaderSupportedVersions = loaderSupportedVersions;
Arrays.sort(loaderSupportedVersions); // sort to allow fast access
- this.clazz = clazz;
- if (datatypeIdRegistry.containsKey(datatypeId) && datatypeIdRegistry.get(datatypeId) != clazz)
+ this.fullDataSourceClass = fullDataSourceClass;
+ if (datatypeIdRegistry.containsKey(datatypeId) && datatypeIdRegistry.get(datatypeId) != fullDataSourceClass)
{
throw new IllegalArgumentException("Loader for datatypeId " + datatypeId + " already registered with different class: "
- + datatypeIdRegistry.get(datatypeId) + " != " + clazz);
+ + datatypeIdRegistry.get(datatypeId) + " != " + fullDataSourceClass);
}
- Set loaders = loaderRegistry.get(clazz);
+ Set loaders = loaderRegistry.get(fullDataSourceClass);
if (loaders.stream().anyMatch(other ->
{
// see if any loaderSupportsVersion conflicts with this one
@@ -46,11 +65,11 @@ public abstract class AbstractFullDataSourceLoader
return false;
}))
{
- throw new IllegalArgumentException("Loader for class " + clazz + " that supports one of the version in "
+ throw new IllegalArgumentException("Loader for class " + fullDataSourceClass + " that supports one of the version in "
+ Arrays.toString(loaderSupportedVersions) + " already registered!");
}
- datatypeIdRegistry.put(datatypeId, clazz);
- loaderRegistry.put(clazz, this);
+ datatypeIdRegistry.put(datatypeId, fullDataSourceClass);
+ loaderRegistry.put(fullDataSourceClass, this);
}
/**
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/loader/CompleteFullDataSourceLoader.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/loader/CompleteFullDataSourceLoader.java
index 37b1001bf..7be126d92 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/loader/CompleteFullDataSourceLoader.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/loader/CompleteFullDataSourceLoader.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.fullData.loader;
import com.seibel.distanthorizons.core.dataObjects.fullData.sources.interfaces.IFullDataSource;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/loader/HighDetailIncompleteFullDataSourceLoader.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/loader/HighDetailIncompleteFullDataSourceLoader.java
index b56211e65..cb1ce495e 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/loader/HighDetailIncompleteFullDataSourceLoader.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/loader/HighDetailIncompleteFullDataSourceLoader.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.fullData.loader;
import com.seibel.distanthorizons.core.dataObjects.fullData.sources.interfaces.IFullDataSource;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/loader/LowDetailIncompleteFullDataSourceLoader.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/loader/LowDetailIncompleteFullDataSourceLoader.java
index 572c1eed3..aeec53396 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/loader/LowDetailIncompleteFullDataSourceLoader.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/loader/LowDetailIncompleteFullDataSourceLoader.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.fullData.loader;
import com.seibel.distanthorizons.core.dataObjects.fullData.sources.interfaces.IFullDataSource;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/CompleteFullDataSource.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/CompleteFullDataSource.java
index 762ed4c1c..4e151fe15 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/CompleteFullDataSource.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/CompleteFullDataSource.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.fullData.sources;
import com.seibel.distanthorizons.api.enums.worldGeneration.EDhApiWorldGenerationStep;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/HighDetailIncompleteFullDataSource.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/HighDetailIncompleteFullDataSource.java
index c717ac67a..aac0d0b13 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/HighDetailIncompleteFullDataSource.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/HighDetailIncompleteFullDataSource.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.fullData.sources;
import com.seibel.distanthorizons.api.enums.worldGeneration.EDhApiWorldGenerationStep;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/LowDetailIncompleteFullDataSource.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/LowDetailIncompleteFullDataSource.java
index 03cb238c2..8b3c327fa 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/LowDetailIncompleteFullDataSource.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/LowDetailIncompleteFullDataSource.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.fullData.sources;
import com.seibel.distanthorizons.api.enums.worldGeneration.EDhApiWorldGenerationStep;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/interfaces/IFullDataSource.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/interfaces/IFullDataSource.java
index 67b1ece8c..bcf456b07 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/interfaces/IFullDataSource.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/interfaces/IFullDataSource.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.fullData.sources.interfaces;
import com.seibel.distanthorizons.api.enums.worldGeneration.EDhApiWorldGenerationStep;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/interfaces/IIncompleteFullDataSource.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/interfaces/IIncompleteFullDataSource.java
index 5c00c7be4..76e6cb606 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/interfaces/IIncompleteFullDataSource.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/interfaces/IIncompleteFullDataSource.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.fullData.sources.interfaces;
import com.seibel.distanthorizons.core.dataObjects.fullData.sources.CompleteFullDataSource;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/interfaces/IStreamableFullDataSource.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/interfaces/IStreamableFullDataSource.java
index 147ad5b06..dde6b657b 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/interfaces/IStreamableFullDataSource.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/interfaces/IStreamableFullDataSource.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.fullData.sources.interfaces;
import com.seibel.distanthorizons.api.enums.worldGeneration.EDhApiWorldGenerationStep;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/ColumnRenderLoader.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/ColumnRenderLoader.java
index 3efe0effd..013f964dc 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/ColumnRenderLoader.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/ColumnRenderLoader.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.render;
import com.seibel.distanthorizons.api.enums.worldGeneration.EDhApiWorldGenerationStep;
@@ -56,22 +75,6 @@ public class ColumnRenderLoader
}
}
- /** @throws InterruptedException see {@link FullDataToRenderDataTransformer#transformFullDataToColumnData(IDhClientLevel, CompleteFullDataSource) FullDataToRenderDataTransformer#transformFullDataToColumnData} for documentation */
- public ColumnRenderSource createRenderSource(IFullDataSource fullDataSource, IDhClientLevel level) throws InterruptedException
- {
- if (fullDataSource instanceof CompleteFullDataSource)
- {
- return FullDataToRenderDataTransformer.transformFullDataToColumnData(level, (CompleteFullDataSource) fullDataSource);
- }
- else if (fullDataSource instanceof IIncompleteFullDataSource)
- {
- return FullDataToRenderDataTransformer.transformIncompleteDataToColumnData(level, (IIncompleteFullDataSource) fullDataSource);
- }
-
- LodUtil.assertNotReach();
- return null;
- }
-
//========================//
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/ColumnRenderSource.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/ColumnRenderSource.java
index eb4c0ac08..0fc4ea570 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/ColumnRenderSource.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/ColumnRenderSource.java
@@ -1,9 +1,30 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.render;
import com.seibel.distanthorizons.api.enums.worldGeneration.EDhApiWorldGenerationStep;
import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.ChunkSizedFullDataAccessor;
+import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.SingleColumnFullDataAccessor;
import com.seibel.distanthorizons.core.level.IDhLevel;
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
+import com.seibel.distanthorizons.core.pos.DhLodPos;
import com.seibel.distanthorizons.core.pos.DhSectionPos;
import com.seibel.distanthorizons.core.dataObjects.transformers.FullDataToRenderDataTransformer;
import com.seibel.distanthorizons.core.util.objects.dataStreams.DhDataOutputStream;
@@ -277,35 +298,128 @@ public class ColumnRenderSource
{
this.verticalDataCount = newVerticalSize;
this.renderDataContainer = new long[SECTION_SIZE * SECTION_SIZE * this.verticalDataCount];
- localVersion.incrementAndGet();
+ this.localVersion.incrementAndGet();
}
}
- public boolean fastWrite(ChunkSizedFullDataAccessor chunkData, IDhClientLevel level)
+ /**
+ * Doesn't write anything to file.
+ * @return true if any data was changed, false otherwise
+ */
+ public boolean updateWithChunkData(ChunkSizedFullDataAccessor chunkDataView, IDhClientLevel level)
{
- try
+ final String errorMessagePrefix = "Unable to complete fastWrite for RenderSource pos: [" + this.sectionPos + "] and chunk pos: [" + chunkDataView.pos + "]. Error:";
+
+ final DhSectionPos renderSourcePos = this.getSectionPos();
+
+ final int sourceBlockX = renderSourcePos.getCorner().getCornerBlockPos().x;
+ final int sourceBlockZ = renderSourcePos.getCorner().getCornerBlockPos().z;
+
+ // offset between the incoming chunk data and this render source
+ final int blockOffsetX = (chunkDataView.pos.x * LodUtil.CHUNK_WIDTH) - sourceBlockX;
+ final int blockOffsetZ = (chunkDataView.pos.z * LodUtil.CHUNK_WIDTH) - sourceBlockZ;
+
+ final int sourceDataPointBlockWidth = BitShiftUtil.powerOfTwo(this.getDataDetail());
+
+ boolean dataChanged = false;
+
+ if (chunkDataView.detailLevel == this.getDataDetail())
{
- if (FullDataToRenderDataTransformer.writeFullDataChunkToColumnData(this, level, chunkData))
- {
- localVersion.incrementAndGet();
- return true;
- }
- else
+ this.markNotEmpty();
+ // confirm the render source contains this chunk
+ if (blockOffsetX < 0
+ || blockOffsetX + LodUtil.CHUNK_WIDTH > this.getWidthInDataPoints()
+ || blockOffsetZ < 0
+ || blockOffsetZ + LodUtil.CHUNK_WIDTH > this.getWidthInDataPoints())
{
+ LOGGER.warn(errorMessagePrefix+"Data offset is out of bounds.");
return false;
}
+
+
+ if (Thread.interrupted())
+ {
+ LOGGER.warn(errorMessagePrefix+"write interrupted.");
+ return false;
+ }
+
+
+ for (int x = 0; x < LodUtil.CHUNK_WIDTH; x++)
+ {
+ for (int z = 0; z < LodUtil.CHUNK_WIDTH; z++)
+ {
+ ColumnArrayView columnArrayView = this.getVerticalDataPointView(blockOffsetX + x, blockOffsetZ + z);
+ int hash = columnArrayView.getDataHash();
+ SingleColumnFullDataAccessor fullArrayView = chunkDataView.get(x, z);
+ FullDataToRenderDataTransformer.convertColumnData(level,
+ sourceBlockX + sourceDataPointBlockWidth * (blockOffsetX + x),
+ sourceBlockZ + sourceDataPointBlockWidth * (blockOffsetZ + z),
+ columnArrayView, fullArrayView, 2);
+ dataChanged |= hash != columnArrayView.getDataHash();
+ }
+ }
+ this.fillDebugFlag(blockOffsetX, blockOffsetZ, LodUtil.CHUNK_WIDTH, LodUtil.CHUNK_WIDTH, ColumnRenderSource.DebugSourceFlag.DIRECT);
}
- catch (InterruptedException e)
+ else if (chunkDataView.detailLevel < this.getDataDetail() && this.getDataDetail() <= chunkDataView.getLodPos().detailLevel)
{
- // expected if the transformer is shut down, the exception can be ignored
- LOGGER.warn(ColumnRenderSource.class.getSimpleName() + " fast write interrupted.");
+ this.markNotEmpty();
+ // multiple chunk data points converting to 1 column data point
+ DhLodPos dataCornerPos = chunkDataView.getLodPos().getCornerLodPos(chunkDataView.detailLevel);
+ DhLodPos sourceCornerPos = renderSourcePos.getCorner(this.getDataDetail());
+ DhLodPos sourceStartingChangePos = dataCornerPos.convertToDetailLevel(this.getDataDetail());
+ int relStartX = Math.floorMod(sourceStartingChangePos.x, this.getWidthInDataPoints());
+ int relStartZ = Math.floorMod(sourceStartingChangePos.z, this.getWidthInDataPoints());
+ int dataToSourceScale = sourceCornerPos.getWidthAtDetail(chunkDataView.detailLevel);
+ int columnsInChunk = chunkDataView.getLodPos().getWidthAtDetail(this.getDataDetail());
+
+ for (int ox = 0; ox < columnsInChunk; ox++)
+ {
+ for (int oz = 0; oz < columnsInChunk; oz++)
+ {
+ int relSourceX = relStartX + ox;
+ int relSourceZ = relStartZ + oz;
+ ColumnArrayView columnArrayView = this.getVerticalDataPointView(relSourceX, relSourceZ);
+ int hash = columnArrayView.getDataHash();
+ SingleColumnFullDataAccessor fullArrayView = chunkDataView.get(ox * dataToSourceScale, oz * dataToSourceScale);
+ FullDataToRenderDataTransformer.convertColumnData(level,
+ sourceBlockX + sourceDataPointBlockWidth * relSourceX,
+ sourceBlockZ + sourceDataPointBlockWidth * relSourceZ,
+ columnArrayView, fullArrayView, 2);
+ dataChanged |= hash != columnArrayView.getDataHash();
+ }
+ }
+ this.fillDebugFlag(relStartX, relStartZ, columnsInChunk, columnsInChunk, ColumnRenderSource.DebugSourceFlag.DIRECT);
}
- catch (Throwable e)
+ else if (chunkDataView.getLodPos().detailLevel < this.getDataDetail())
{
- // shouldn't happen, but just in case
- LOGGER.warn("Unable to complete fastWrite for RenderSource pos: [" + this.sectionPos + "] and chunk pos: [" + chunkData.pos + "].", e);
+ // The entire chunk is being converted to a single column data point, possibly.
+ DhLodPos dataCornerPos = chunkDataView.getLodPos().getCornerLodPos(chunkDataView.detailLevel);
+ DhLodPos sourceCornerPos = renderSourcePos.getCorner(this.getDataDetail());
+ DhLodPos sourceStartingChangePos = dataCornerPos.convertToDetailLevel(this.getDataDetail());
+ int chunksPerColumn = sourceStartingChangePos.getWidthAtDetail(chunkDataView.getLodPos().detailLevel);
+ if (chunkDataView.getLodPos().x % chunksPerColumn != 0 || chunkDataView.getLodPos().z % chunksPerColumn != 0)
+ {
+ return false; // not a multiple of the column size, so no change
+ }
+ int relStartX = Math.floorMod(sourceStartingChangePos.x, this.getWidthInDataPoints());
+ int relStartZ = Math.floorMod(sourceStartingChangePos.z, this.getWidthInDataPoints());
+ ColumnArrayView columnArrayView = this.getVerticalDataPointView(relStartX, relStartZ);
+ int hash = columnArrayView.getDataHash();
+ SingleColumnFullDataAccessor fullArrayView = chunkDataView.get(0, 0);
+ FullDataToRenderDataTransformer.convertColumnData(level, dataCornerPos.x * sourceDataPointBlockWidth,
+ dataCornerPos.z * sourceDataPointBlockWidth,
+ columnArrayView, fullArrayView, 2);
+ dataChanged = hash != columnArrayView.getDataHash();
+ this.fillDebugFlag(relStartX, relStartZ, 1, 1, ColumnRenderSource.DebugSourceFlag.DIRECT);
}
- return false;
+
+
+ if (dataChanged)
+ {
+ this.localVersion.incrementAndGet();
+ }
+
+ return dataChanged;
}
@@ -346,6 +460,34 @@ public class ColumnRenderSource
public boolean isEmpty() { return this.isEmpty; }
public void markNotEmpty() { this.isEmpty = false; }
+ /** can be used when debugging */
+ public boolean hasNonVoidDataPoints()
+ {
+ if (this.isEmpty)
+ {
+ return false;
+ }
+
+
+ for (int x = 0; x < SECTION_SIZE; x++)
+ {
+ for (int z = 0; z < SECTION_SIZE; z++)
+ {
+ ColumnArrayView columnArrayView = this.getVerticalDataPointView(x,z);
+ for (int i = 0; i < columnArrayView.size; i++)
+ {
+ long dataPoint = columnArrayView.get(i);
+ if (!RenderDataPointUtil.isVoid(dataPoint))
+ {
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+
//=======//
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/BufferMergeDirectionEnum.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/BufferMergeDirectionEnum.java
index 9710448ee..d31da1ee4 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/BufferMergeDirectionEnum.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/BufferMergeDirectionEnum.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/BufferQuad.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/BufferQuad.java
index 555dc8fdc..3c82291cb 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/BufferQuad.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/BufferQuad.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnBox.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnBox.java
index ca0ffe467..fc799d477 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnBox.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnBox.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnRenderBuffer.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnRenderBuffer.java
index 91a659936..3a70a7bc7 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnRenderBuffer.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnRenderBuffer.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.render.bufferBuilding;
import com.seibel.distanthorizons.core.config.Config;
@@ -260,6 +279,20 @@ public class ColumnRenderBuffer extends AbstractRenderBuffer implements IDebugRe
// misc methods //
//==============//
+ /** can be used when debugging */
+ public boolean hasNonEmptyBuffers()
+ {
+ for (GLVertexBuffer vertexBuffer : this.vbos)
+ {
+ if (vertexBuffer != null && vertexBuffer.getSize() != 0)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
@Override
public void debugDumpStats(StatsMap statsMap)
{
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnRenderBufferBuilder.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnRenderBufferBuilder.java
index 060be4c62..d0709934e 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnRenderBufferBuilder.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnRenderBufferBuilder.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.render.bufferBuilding;
import com.seibel.distanthorizons.api.enums.config.EGpuUploadMethod;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/CubicLodTemplate.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/CubicLodTemplate.java
index 1782a0ebf..791f609b3 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/CubicLodTemplate.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/CubicLodTemplate.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/LodQuadBuilder.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/LodQuadBuilder.java
index 78862959d..6cf16c1aa 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/LodQuadBuilder.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/LodQuadBuilder.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/columnViews/ColumnArrayView.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/columnViews/ColumnArrayView.java
index 8cd2e2ea4..dad170788 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/columnViews/ColumnArrayView.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/columnViews/ColumnArrayView.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.render.columnViews;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/columnViews/ColumnQuadView.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/columnViews/ColumnQuadView.java
index 99b192760..7c798dcb0 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/columnViews/ColumnQuadView.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/columnViews/ColumnQuadView.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.render.columnViews;
public class ColumnQuadView implements IColumnDataView
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/columnViews/IColumnDataView.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/columnViews/IColumnDataView.java
index 19b2e079a..f0214991d 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/columnViews/IColumnDataView.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/columnViews/IColumnDataView.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.render.columnViews;
import java.util.Iterator;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/ChunkToLodBuilder.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/ChunkToLodBuilder.java
index aec487e74..ecc0a5398 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/ChunkToLodBuilder.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/ChunkToLodBuilder.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.transformers;
import java.util.concurrent.*;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/DataRenderTransformer.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/DataRenderTransformer.java
deleted file mode 100644
index 99d1c2120..000000000
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/DataRenderTransformer.java
+++ /dev/null
@@ -1,115 +0,0 @@
-package com.seibel.distanthorizons.core.dataObjects.transformers;
-
-import com.seibel.distanthorizons.core.config.Config;
-import com.seibel.distanthorizons.core.config.listeners.ConfigChangeListener;
-import com.seibel.distanthorizons.core.dataObjects.fullData.sources.interfaces.IFullDataSource;
-import com.seibel.distanthorizons.core.dataObjects.render.ColumnRenderLoader;
-import com.seibel.distanthorizons.core.dataObjects.render.ColumnRenderSource;
-import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
-import com.seibel.distanthorizons.core.level.IDhClientLevel;
-import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
-import com.seibel.distanthorizons.core.util.ThreadUtil;
-import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftClientWrapper;
-import org.apache.logging.log4j.Logger;
-
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutorService;
-
-/** TODO: Merge this with {@link FullDataToRenderDataTransformer} */
-public class DataRenderTransformer
-{
- private static final Logger LOGGER = DhLoggerBuilder.getLogger();
- private static final IMinecraftClientWrapper MC = SingletonInjector.INSTANCE.get(IMinecraftClientWrapper.class);
-
- private static ExecutorService transformerThreadPool = null;
- private static ConfigChangeListener configListener;
-
-
-
- //==============//
- // transformers //
- //==============//
-
- public static CompletableFuture transformDataSourceAsync(IFullDataSource fullDataSource, IDhClientLevel level)
- {
- return CompletableFuture.supplyAsync(() -> transform(fullDataSource, level), transformerThreadPool);
- }
-
- public static CompletableFuture transformDataSourceAsync(CompletableFuture fullDataSourceFuture, IDhClientLevel level)
- {
- return fullDataSourceFuture.thenApplyAsync((fullDataSource) -> transform(fullDataSource, level), transformerThreadPool);
- }
-
- private static ColumnRenderSource transform(IFullDataSource fullDataSource, IDhClientLevel level)
- {
- if (fullDataSource == null)
- {
- return null;
- }
- else if (MC.getWrappedClientWorld() == null)
- {
- // if the client is no longer loaded in the world, render sources cannot be created
- return null;
- }
-
- try
- {
- return ColumnRenderLoader.INSTANCE.createRenderSource(fullDataSource, level);
- }
- catch (InterruptedException e)
- {
- return null;
- }
- }
-
-
-
- //==========================//
- // executor handler methods //
- //==========================//
-
- /**
- * Creates a new executor.
- * Does nothing if an executor already exists.
- */
- public static void setupExecutorService()
- {
- // static setup
- if (configListener == null)
- {
- configListener = new ConfigChangeListener<>(Config.Client.Advanced.MultiThreading.numberOfDataTransformerThreads, (threadCount) -> { setThreadPoolSize(threadCount); });
- }
-
-
- // TODO this didn't seem to be re-sizing when changed via the config
- if (transformerThreadPool == null || transformerThreadPool.isTerminated())
- {
- LOGGER.info("Starting " + DataRenderTransformer.class.getSimpleName());
- setThreadPoolSize(Config.Client.Advanced.MultiThreading.numberOfDataTransformerThreads.get());
- }
- }
- public static void setThreadPoolSize(int threadPoolSize)
- {
- if (transformerThreadPool != null)
- {
- // close the previous thread pool if one exists
- transformerThreadPool.shutdown();
- }
-
- transformerThreadPool = ThreadUtil.makeRateLimitedThreadPool(threadPoolSize, "Full/Render Data Transformer", Config.Client.Advanced.MultiThreading.runTimeRatioForDataTransformerThreads);
- }
-
- /**
- * Stops any executing tasks and destroys the executor.
- * Does nothing if the executor isn't running.
- */
- public static void shutdownExecutorService()
- {
- if (transformerThreadPool != null)
- {
- LOGGER.info("Stopping " + DataRenderTransformer.class.getSimpleName());
- transformerThreadPool.shutdownNow();
- }
- }
-
-}
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/FullDataToRenderDataTransformer.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/FullDataToRenderDataTransformer.java
index 12e99b60b..40e707746 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/FullDataToRenderDataTransformer.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/FullDataToRenderDataTransformer.java
@@ -1,7 +1,27 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.transformers;
import com.seibel.distanthorizons.api.enums.config.EBlocksToAvoid;
import com.seibel.distanthorizons.core.config.Config;
+import com.seibel.distanthorizons.core.config.listeners.ConfigChangeListener;
import com.seibel.distanthorizons.core.dataObjects.fullData.FullDataPointIdMap;
import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.ChunkSizedFullDataAccessor;
import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.SingleColumnFullDataAccessor;
@@ -12,18 +32,22 @@ import com.seibel.distanthorizons.core.dataObjects.render.ColumnRenderSource;
import com.seibel.distanthorizons.core.dataObjects.render.columnViews.ColumnArrayView;
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
import com.seibel.distanthorizons.core.level.IDhClientLevel;
+import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
import com.seibel.distanthorizons.core.pos.DhBlockPos;
-import com.seibel.distanthorizons.core.pos.DhLodPos;
import com.seibel.distanthorizons.core.pos.DhSectionPos;
import com.seibel.distanthorizons.core.util.FullDataPointUtil;
import com.seibel.distanthorizons.core.util.LodUtil;
import com.seibel.distanthorizons.core.util.RenderDataPointUtil;
+import com.seibel.distanthorizons.core.util.ThreadUtil;
import com.seibel.distanthorizons.core.wrapperInterfaces.IWrapperFactory;
import com.seibel.distanthorizons.core.wrapperInterfaces.block.IBlockStateWrapper;
+import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftClientWrapper;
import com.seibel.distanthorizons.core.wrapperInterfaces.world.IBiomeWrapper;
-import com.seibel.distanthorizons.coreapi.util.BitShiftUtil;
+import org.apache.logging.log4j.Logger;
import java.util.HashSet;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutorService;
/**
* Handles converting {@link ChunkSizedFullDataAccessor}, {@link IIncompleteFullDataSource},
@@ -31,24 +55,57 @@ import java.util.HashSet;
*/
public class FullDataToRenderDataTransformer
{
+ private static final Logger LOGGER = DhLoggerBuilder.getLogger();
+
private static final IWrapperFactory WRAPPER_FACTORY = SingletonInjector.INSTANCE.get(IWrapperFactory.class);
+ private static final IMinecraftClientWrapper MC = SingletonInjector.INSTANCE.get(IMinecraftClientWrapper.class);
+
+ private static ExecutorService transformerThreadPool = null;
+ private static ConfigChangeListener configListener;
- /**
- * Called in loops that may run for an extended period of time.
- * This is necessary to allow canceling these transformers since running
- * them after the client has left a given world will throw exceptions here.
- */
- private static void throwIfThreadInterrupted() throws InterruptedException
+ //==============================//
+ // public transformer interface //
+ //==============================//
+
+ public static CompletableFuture transformFullDataToRenderSourceAsync(IFullDataSource fullDataSource, IDhClientLevel level) { return CompletableFuture.supplyAsync(() -> transformFullDataToRenderSource(fullDataSource, level), transformerThreadPool); }
+ public static CompletableFuture transformFullDataToRenderSourceAsync(CompletableFuture fullDataSourceFuture, IDhClientLevel level) { return fullDataSourceFuture.thenApplyAsync((fullDataSource) -> transformFullDataToRenderSource(fullDataSource, level), transformerThreadPool); }
+ private static ColumnRenderSource transformFullDataToRenderSource(IFullDataSource fullDataSource, IDhClientLevel level)
{
- if (Thread.interrupted())
+ if (fullDataSource == null)
{
- throw new InterruptedException(FullDataToRenderDataTransformer.class.getSimpleName() + " task interrupted.");
+ return null;
+ }
+ else if (MC.getWrappedClientWorld() == null)
+ {
+ // if the client is no longer loaded in the world, render sources cannot be created
+ return null;
+ }
+
+
+ try
+ {
+ if (fullDataSource instanceof CompleteFullDataSource)
+ {
+ return transformCompleteFullDataToColumnData(level, (CompleteFullDataSource) fullDataSource);
+ }
+ else if (fullDataSource instanceof IIncompleteFullDataSource)
+ {
+ return transformIncompleteFullDataToColumnData(level, (IIncompleteFullDataSource) fullDataSource);
+ }
+
+ LodUtil.assertNotReach("Unimplemented Full Data transformer for "+IFullDataSource.class.getSimpleName()+" of type ["+fullDataSource.getClass().getSimpleName()+"].");
+ return null;
+ }
+ catch (InterruptedException e)
+ {
+ return null;
}
}
+
//==============//
// transformers //
//==============//
@@ -60,7 +117,7 @@ public class FullDataToRenderDataTransformer
* @throws InterruptedException Can be caused by interrupting the thread upstream.
* Generally thrown if the method is running after the client leaves the current world.
*/
- public static ColumnRenderSource transformFullDataToColumnData(IDhClientLevel level, CompleteFullDataSource fullDataSource) throws InterruptedException
+ private static ColumnRenderSource transformCompleteFullDataToColumnData(IDhClientLevel level, CompleteFullDataSource fullDataSource) throws InterruptedException
{
final DhSectionPos pos = fullDataSource.getSectionPos();
final byte dataDetail = fullDataSource.getDataDetailLevel();
@@ -110,7 +167,7 @@ public class FullDataToRenderDataTransformer
* @throws InterruptedException Can be caused by interrupting the thread upstream.
* Generally thrown if the method is running after the client leaves the current world.
*/
- public static ColumnRenderSource transformIncompleteDataToColumnData(IDhClientLevel level, IIncompleteFullDataSource data) throws InterruptedException
+ private static ColumnRenderSource transformIncompleteFullDataToColumnData(IDhClientLevel level, IIncompleteFullDataSource data) throws InterruptedException
{
final DhSectionPos pos = data.getSectionPos();
final byte dataDetail = data.getDataDetailLevel();
@@ -156,135 +213,27 @@ public class FullDataToRenderDataTransformer
return columnSource;
}
+
+
+ //================//
+ // helper methods //
+ //================//
+
/**
- * @throws InterruptedException Can be caused by interrupting the thread upstream.
- * Generally thrown if the method is running after the client leaves the current world.
+ * Called in loops that may run for an extended period of time.
+ * This is necessary to allow canceling these transformers since running
+ * them after the client has left a given world will throw exceptions.
*/
- public static boolean writeFullDataChunkToColumnData(ColumnRenderSource renderSource, IDhClientLevel level, ChunkSizedFullDataAccessor chunkDataView) throws InterruptedException, IllegalArgumentException
+ private static void throwIfThreadInterrupted() throws InterruptedException
{
- final DhSectionPos renderSourcePos = renderSource.getSectionPos();
-
- final int sourceBlockX = renderSourcePos.getCorner().getCornerBlockPos().x;
- final int sourceBlockZ = renderSourcePos.getCorner().getCornerBlockPos().z;
-
- // offset between the incoming chunk data and this render source
- final int blockOffsetX = (chunkDataView.pos.x * LodUtil.CHUNK_WIDTH) - sourceBlockX;
- final int blockOffsetZ = (chunkDataView.pos.z * LodUtil.CHUNK_WIDTH) - sourceBlockZ;
-
- final int sourceDataPointBlockWidth = BitShiftUtil.powerOfTwo(renderSource.getDataDetail());
-
- boolean changed = false;
-
- if (chunkDataView.detailLevel == renderSource.getDataDetail())
+ if (Thread.interrupted())
{
- renderSource.markNotEmpty();
- // confirm the render source contains this chunk
- if (blockOffsetX < 0
- || blockOffsetX + LodUtil.CHUNK_WIDTH > renderSource.getWidthInDataPoints()
- || blockOffsetZ < 0
- || blockOffsetZ + LodUtil.CHUNK_WIDTH > renderSource.getWidthInDataPoints())
- {
- throw new IllegalArgumentException("Data offset is out of bounds");
- }
-
- throwIfThreadInterrupted();
-
- for (int x = 0; x < LodUtil.CHUNK_WIDTH; x++)
- {
- for (int z = 0; z < LodUtil.CHUNK_WIDTH; z++)
- {
- ColumnArrayView columnArrayView = renderSource.getVerticalDataPointView(blockOffsetX + x, blockOffsetZ + z);
- int hash = columnArrayView.getDataHash();
- SingleColumnFullDataAccessor fullArrayView = chunkDataView.get(x, z);
- convertColumnData(level,
- sourceBlockX + sourceDataPointBlockWidth * (blockOffsetX + x),
- sourceBlockZ + sourceDataPointBlockWidth * (blockOffsetZ + z),
- columnArrayView, fullArrayView, 2);
- changed |= hash != columnArrayView.getDataHash();
- }
- }
- renderSource.fillDebugFlag(blockOffsetX, blockOffsetZ, LodUtil.CHUNK_WIDTH, LodUtil.CHUNK_WIDTH, ColumnRenderSource.DebugSourceFlag.DIRECT);
- }
- else if (chunkDataView.detailLevel < renderSource.getDataDetail() && renderSource.getDataDetail() <= chunkDataView.getLodPos().detailLevel)
- {
- renderSource.markNotEmpty();
- // multiple chunk data points converting to 1 column data point
- DhLodPos dataCornerPos = chunkDataView.getLodPos().getCornerLodPos(chunkDataView.detailLevel);
- DhLodPos sourceCornerPos = renderSourcePos.getCorner(renderSource.getDataDetail());
- DhLodPos sourceStartingChangePos = dataCornerPos.convertToDetailLevel(renderSource.getDataDetail());
- int relStartX = Math.floorMod(sourceStartingChangePos.x, renderSource.getWidthInDataPoints());
- int relStartZ = Math.floorMod(sourceStartingChangePos.z, renderSource.getWidthInDataPoints());
- int dataToSourceScale = sourceCornerPos.getWidthAtDetail(chunkDataView.detailLevel);
- int columnsInChunk = chunkDataView.getLodPos().getWidthAtDetail(renderSource.getDataDetail());
-
- for (int ox = 0; ox < columnsInChunk; ox++)
- {
- for (int oz = 0; oz < columnsInChunk; oz++)
- {
- int relSourceX = relStartX + ox;
- int relSourceZ = relStartZ + oz;
- ColumnArrayView columnArrayView = renderSource.getVerticalDataPointView(relSourceX, relSourceZ);
- int hash = columnArrayView.getDataHash();
- SingleColumnFullDataAccessor fullArrayView = chunkDataView.get(ox * dataToSourceScale, oz * dataToSourceScale);
- convertColumnData(level,
- sourceBlockX + sourceDataPointBlockWidth * relSourceX,
- sourceBlockZ + sourceDataPointBlockWidth * relSourceZ,
- columnArrayView, fullArrayView, 2);
- changed |= hash != columnArrayView.getDataHash();
- }
- }
- renderSource.fillDebugFlag(relStartX, relStartZ, columnsInChunk, columnsInChunk, ColumnRenderSource.DebugSourceFlag.DIRECT);
- }
- else if (chunkDataView.getLodPos().detailLevel < renderSource.getDataDetail())
- {
- // The entire chunk is being converted to a single column data point, possibly.
- DhLodPos dataCornerPos = chunkDataView.getLodPos().getCornerLodPos(chunkDataView.detailLevel);
- DhLodPos sourceCornerPos = renderSourcePos.getCorner(renderSource.getDataDetail());
- DhLodPos sourceStartingChangePos = dataCornerPos.convertToDetailLevel(renderSource.getDataDetail());
- int chunksPerColumn = sourceStartingChangePos.getWidthAtDetail(chunkDataView.getLodPos().detailLevel);
- if (chunkDataView.getLodPos().x % chunksPerColumn != 0 || chunkDataView.getLodPos().z % chunksPerColumn != 0)
- {
- return false; // not a multiple of the column size, so no change
- }
- int relStartX = Math.floorMod(sourceStartingChangePos.x, renderSource.getWidthInDataPoints());
- int relStartZ = Math.floorMod(sourceStartingChangePos.z, renderSource.getWidthInDataPoints());
- ColumnArrayView columnArrayView = renderSource.getVerticalDataPointView(relStartX, relStartZ);
- int hash = columnArrayView.getDataHash();
- SingleColumnFullDataAccessor fullArrayView = chunkDataView.get(0, 0);
- convertColumnData(level, dataCornerPos.x * sourceDataPointBlockWidth,
- dataCornerPos.z * sourceDataPointBlockWidth,
- columnArrayView, fullArrayView, 2);
- changed = hash != columnArrayView.getDataHash();
- renderSource.fillDebugFlag(relStartX, relStartZ, 1, 1, ColumnRenderSource.DebugSourceFlag.DIRECT);
- }
- return changed;
- }
-
- private static void convertColumnData(IDhClientLevel level, int blockX, int blockZ, ColumnArrayView columnArrayView, SingleColumnFullDataAccessor fullArrayView, int genMode)
- {
- if (!fullArrayView.doesColumnExist())
- {
- return;
- }
-
- int dataTotalLength = fullArrayView.getSingleLength();
- if (dataTotalLength == 0)
- {
- return;
- }
-
- if (dataTotalLength > columnArrayView.verticalSize())
- {
- ColumnArrayView totalColumnData = new ColumnArrayView(new long[dataTotalLength], dataTotalLength, 0, dataTotalLength);
- iterateAndConvert(level, blockX, blockZ, genMode, totalColumnData, fullArrayView);
- columnArrayView.changeVerticalSizeFrom(totalColumnData);
- }
- else
- {
- iterateAndConvert(level, blockX, blockZ, genMode, columnArrayView, fullArrayView); //Directly use the arrayView since it fits.
+ throw new InterruptedException(FullDataToRenderDataTransformer.class.getSimpleName() + " task interrupted.");
}
}
+
+ // TODO what does this mean?
private static void iterateAndConvert(IDhClientLevel level, int blockX, int blockZ, int genMode, ColumnArrayView column, SingleColumnFullDataAccessor data)
{
boolean avoidSolidBlocks = (Config.Client.Advanced.Graphics.Quality.blocksToIgnore.get() == EBlocksToAvoid.NON_COLLIDING);
@@ -355,255 +304,81 @@ public class FullDataToRenderDataTransformer
column.set(0, RenderDataPointUtil.createVoidDataPoint((byte) genMode));
}
}
-
-
-
-// /** creates a vertical DataPoint */
-// private void writeVerticalData(long[] data, int dataOffset, int maxVerticalData,
-// IChunkWrapper chunk, LodBuilderConfig config, int chunkSubPosX, int chunkSubPosZ)
-// {
-//
-// int totalVerticalData = (chunk.getHeight());
-// long[] dataToMerge = new long[totalVerticalData];
-//
-// boolean hasCeiling = MC.getWrappedClientWorld().getDimensionType().hasCeiling();
-// boolean hasSkyLight = MC.getWrappedClientWorld().getDimensionType().hasSkyLight();
-// byte generation = config.distanceGenerationMode.complexity;
-// int count = 0;
-// // FIXME: This yAbs is just messy!
-// int x = chunk.getMinX() + chunkSubPosX;
-// int z = chunk.getMinZ() + chunkSubPosZ;
-// int y = chunk.getMaxY(x, z);
-//
-// boolean topBlock = true;
-// if (y < chunk.getMinBuildHeight())
-// dataToMerge[0] = DataPointUtil.createVoidDataPoint(generation);
-// int maxConnectedLods = Config.Client.Graphics.Quality.verticalQuality.get().maxVerticalData[0];
-// while (y >= chunk.getMinBuildHeight()) {
-// int height = determineHeightPointFrom(chunk, config, x, y, z);
-// // If the lod is at the default height, it must be void data
-// if (height < chunk.getMinBuildHeight()) {
-// if (topBlock) dataToMerge[0] = DataPointUtil.createVoidDataPoint(generation);
-// break;
-// }
-// y = height - 1;
-// // We search light on above air block
-// int depth = determineBottomPointFrom(chunk, config, x, y, z,
-// count < maxConnectedLods && (!hasCeiling || !topBlock));
-// if (hasCeiling && topBlock)
-// y = depth;
-// int light = getLightValue(chunk, x, y, z, hasCeiling, hasSkyLight, topBlock);
-// int color = generateLodColor(chunk, config, x, y, z);
-// int lightBlock = light & 0b1111;
-// int lightSky = (light >> 4) & 0b1111;
-// dataToMerge[count] = DataPointUtil.createDataPoint(height-chunk.getMinBuildHeight(), depth-chunk.getMinBuildHeight(),
-// color, lightSky, lightBlock, generation);
-// topBlock = false;
-// y = depth - 1;
-// count++;
-// }
-// long[] result = DataPointUtil.mergeMultiData(dataToMerge, totalVerticalData, maxVerticalData);
-// if (result.length != maxVerticalData) throw new ArrayIndexOutOfBoundsException();
-// System.arraycopy(result, 0, data, dataOffset, maxVerticalData);
-// }
-//
-// public static final EDhDirection[] DIRECTIONS = new EDhDirection[] {
-// EDhDirection.UP,
-// EDhDirection.DOWN,
-// EDhDirection.WEST,
-// EDhDirection.EAST,
-// EDhDirection.NORTH,
-// EDhDirection.SOUTH };
-//
-// private boolean hasCliffFace(IChunkWrapper chunk, int x, int y, int z) {
-// for (EDhDirection dir : DIRECTIONS) {
-// IBlockDetailWrapper block = chunk.getBlockDetailAtFace(x, y, z, dir);
-// if (block == null || !block.hasFaceCullingFor(EDhDirection.OPPOSITE_DIRECTIONS[dir.ordinal()]))
-// return true;
-// }
-// return false;
-// }
-//
-// /**
-// * Find the lowest valid point from the bottom.
-// * Used when creating a vertical LOD.
-// */
-// private int determineBottomPointFrom(IChunkWrapper chunk, LodBuilderConfig builderConfig, int xAbs, int yAbs, int zAbs, boolean strictEdge)
-// {
-// int depth = chunk.getMinBuildHeight();
-// IBlockDetailWrapper currentBlockDetail = null;
-// if (strictEdge)
-// {
-// IBlockDetailWrapper blockAbove = chunk.getBlockDetail(xAbs, yAbs + 1, zAbs);
-// if (blockAbove != null && Config.Client.WorldGenerator.tintWithAvoidedBlocks.get() && !blockAbove.shouldRender(Config.Client.WorldGenerator.blocksToAvoid.get()))
-// { // The above block is skipped. Lets use its skipped color for current block
-// currentBlockDetail = blockAbove;
-// }
-// if (currentBlockDetail == null) currentBlockDetail = chunk.getBlockDetail(xAbs, yAbs, zAbs);
-// }
-//
-// for (int y = yAbs - 1; y >= chunk.getMinBuildHeight(); y--)
-// {
-// IBlockDetailWrapper nextBlock = chunk.getBlockDetail(xAbs, y, zAbs);
-// if (isLayerValidLodPoint(nextBlock)) {
-// if (!strictEdge) continue;
-// if (currentBlockDetail.equals(nextBlock)) continue;
-// if (!hasCliffFace(chunk, xAbs, y, zAbs)) continue;
-// }
-// depth = (y + 1);
-// break;
-// }
-// return depth;
-// }
-//
-// /** Find the highest valid point from the Top */
-// private int determineHeightPointFrom(IChunkWrapper chunk, LodBuilderConfig config, int xAbs, int yAbs, int zAbs)
-// {
-// //TODO find a way to skip bottom of the world
-// int height = chunk.getMinBuildHeight()-1;
-// for (int y = yAbs; y >= chunk.getMinBuildHeight(); y--)
-// {
-// if (isLayerValidLodPoint(chunk, xAbs, y, zAbs))
-// {
-// height = (y + 1);
-// break;
-// }
-// }
-// return height;
-// }
-//
-//
-//
-// // =====================//
-// // constructor helpers //
-// // =====================//
-//
-// /**
-// * Generate the color for the given chunk using biome water color, foliage
-// * color, and grass color.
-// */
-// private int generateLodColor(IChunkWrapper chunk, LodBuilderConfig builderConfig, int x, int y, int z)
-// {
-// int colorInt;
-// if (builderConfig.useBiomeColors)
-// {
-// // I have no idea why I need to bit shift to the right, but
-// // if I don't the biomes don't show up correctly.
-// colorInt = chunk.getBiome(x, y, z).getColorForBiome(x, z);
-// }
-// else
-// {
-// // if we are skipping non-full and non-solid blocks that means we ignore
-// // snow, flowers, etc. Get the above block so we can still get the color
-// // of the snow, flower, etc. that may be above this block
-// colorInt = 0;
-// if (chunk.blockPosInsideChunk(x, y+1, z)) {
-// IBlockDetailWrapper blockAbove = chunk.getBlockDetail(x, y+1, z);
-// if (blockAbove != null && Config.Client.WorldGenerator.tintWithAvoidedBlocks.get() && !blockAbove.shouldRender(Config.Client.WorldGenerator.blocksToAvoid.get()))
-// { // The above block is skipped. Lets use its skipped color for current block
-// colorInt = blockAbove.getAndResolveFaceColor(null, chunk, new DHBlockPos(x, y+1, z));
-// }
-// }
-//
-// // override this block's color if there was a block above this
-// // and we were avoiding non-full/non-solid blocks
-// if (colorInt == 0) {
-// IBlockDetailWrapper detail = chunk.getBlockDetail(x, y, z);
-// colorInt = detail.getAndResolveFaceColor(null, chunk, new DHBlockPos(x, y, z));
-// }
-// }
-//
-// return colorInt;
-// }
-//
-// /** Gets the light value for the given block position */
-// private int getLightValue(IChunkWrapper chunk, int x, int y, int z, boolean hasCeiling, boolean hasSkyLight, boolean topBlock)
-// {
-// int skyLight;
-// int blockLight;
-//
-// int blockBrightness = chunk.getEmittedBrightness(x, y, z);
-// // get the air block above or below this block
-// if (hasCeiling && topBlock)
-// y--;
-// else
-// y++;
-//
-// blockLight = chunk.getBlockLight(x, y, z);
-// skyLight = hasSkyLight ? chunk.getSkyLight(x, y, z) : 0;
-//
-// if (blockLight == -1 || skyLight == -1)
-// {
-//
-// ILevelWrapper world = MC.getWrappedServerWorld();
-//
-// if (world != null)
-// {
-// // server world sky light (always accurate)
-// blockLight = world.getBlockLight(x, y, z);
-//
-// if (topBlock && !hasCeiling && hasSkyLight)
-// skyLight = DEFAULT_MAX_LIGHT;
-// else
-// skyLight = hasSkyLight ? world.getSkyLight(x, y, z) : 0;
-//
-// if (!topBlock && skyLight == 15)
-// {
-// // we are on predicted terrain, and we don't know what the light here is,
-// // lets just take a guess
-// skyLight = 12;
-// }
-// }
-// else
-// {
-// world = MC.getWrappedClientWorld();
-// if (world == null)
-// {
-// blockLight = 0;
-// skyLight = 12;
-// }
-// else
-// {
-// // client world sky light (almost never accurate)
-// blockLight = world.getBlockLight(x, y, z);
-// // estimate what the lighting should be
-// if (hasSkyLight || !hasCeiling)
-// {
-// if (topBlock)
-// skyLight = DEFAULT_MAX_LIGHT;
-// else
-// {
-// if (hasSkyLight)
-// skyLight = world.getSkyLight(x, y, z);
-// //else
-// // skyLight = 0;
-// if (!chunk.isLightCorrect() && (skyLight == 0 || skyLight == 15))
-// {
-// // we don't know what the light here is,
-// // lets just take a guess
-// skyLight = 12;
-// }
-// }
-// }
-// }
-// }
-// }
-//
-// blockLight = LodUtil.clamp(0, Math.max(blockLight, blockBrightness), DEFAULT_MAX_LIGHT);
-// return blockLight + (skyLight << 4);
-// }
-//
-// /** Is the block at the given blockPos a valid LOD point? */
-// private boolean isLayerValidLodPoint(IBlockDetailWrapper blockDetail)
-// {
-// EBlocksToAvoid avoid = Config.Client.WorldGenerator.blocksToAvoid.get();
-// return blockDetail != null && blockDetail.shouldRender(avoid);
-// }
-//
-// /** Is the block at the given blockPos a valid LOD point? */
-// private boolean isLayerValidLodPoint(IChunkWrapper chunk, int x, int y, int z) {
-// EBlocksToAvoid avoid = Config.Client.WorldGenerator.blocksToAvoid.get();
-// IBlockDetailWrapper block = chunk.getBlockDetail(x, y, z);
-// return block != null && block.shouldRender(avoid);
-// }
+
+ // TODO what does this mean?
+ public static void convertColumnData(IDhClientLevel level, int blockX, int blockZ, ColumnArrayView columnArrayView, SingleColumnFullDataAccessor fullArrayView, int genMode)
+ {
+ if (!fullArrayView.doesColumnExist())
+ {
+ return;
+ }
+
+ int dataTotalLength = fullArrayView.getSingleLength();
+ if (dataTotalLength == 0)
+ {
+ return;
+ }
+
+ if (dataTotalLength > columnArrayView.verticalSize())
+ {
+ ColumnArrayView totalColumnData = new ColumnArrayView(new long[dataTotalLength], dataTotalLength, 0, dataTotalLength);
+ iterateAndConvert(level, blockX, blockZ, genMode, totalColumnData, fullArrayView);
+ columnArrayView.changeVerticalSizeFrom(totalColumnData);
+ }
+ else
+ {
+ iterateAndConvert(level, blockX, blockZ, genMode, columnArrayView, fullArrayView); //Directly use the arrayView since it fits.
+ }
+ }
+
+
+
+ //==========================//
+ // executor handler methods //
+ //==========================//
+
+ /**
+ * Creates a new executor.
+ * Does nothing if an executor already exists.
+ */
+ public static void setupExecutorService()
+ {
+ // static setup
+ if (configListener == null)
+ {
+ configListener = new ConfigChangeListener<>(Config.Client.Advanced.MultiThreading.numberOfDataTransformerThreads, (threadCount) -> { setThreadPoolSize(threadCount); });
+ }
+
+
+ // TODO this didn't seem to be re-sizing when changed via the config
+ if (transformerThreadPool == null || transformerThreadPool.isTerminated())
+ {
+ LOGGER.info("Starting " + FullDataToRenderDataTransformer.class.getSimpleName());
+ setThreadPoolSize(Config.Client.Advanced.MultiThreading.numberOfDataTransformerThreads.get());
+ }
+ }
+ public static void setThreadPoolSize(int threadPoolSize)
+ {
+ if (transformerThreadPool != null)
+ {
+ // close the previous thread pool if one exists
+ transformerThreadPool.shutdown();
+ }
+
+ transformerThreadPool = ThreadUtil.makeRateLimitedThreadPool(threadPoolSize, "Full/Render Data Transformer", Config.Client.Advanced.MultiThreading.runTimeRatioForDataTransformerThreads);
+ }
+
+ /**
+ * Stops any executing tasks and destroys the executor.
+ * Does nothing if the executor isn't running.
+ */
+ public static void shutdownExecutorService()
+ {
+ if (transformerThreadPool != null)
+ {
+ LOGGER.info("Stopping " + FullDataToRenderDataTransformer.class.getSimpleName());
+ transformerThreadPool.shutdownNow();
+ }
+ }
+
}
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/LodBuilderConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/LodBuilderConfig.java
index 4c8dbf426..d2be311ae 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/LodBuilderConfig.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/LodBuilderConfig.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/LodDataBuilder.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/LodDataBuilder.java
index cafafa6b5..361d1d1fc 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/LodDataBuilder.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/LodDataBuilder.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.dataObjects.transformers;
import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.ChunkSizedFullDataAccessor;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dependencyInjection/ModAccessorInjector.java b/core/src/main/java/com/seibel/distanthorizons/core/dependencyInjection/ModAccessorInjector.java
index e0e86c34a..0d8e666af 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dependencyInjection/ModAccessorInjector.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dependencyInjection/ModAccessorInjector.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dependencyInjection/SingletonInjector.java b/core/src/main/java/com/seibel/distanthorizons/core/dependencyInjection/SingletonInjector.java
index 9a82e17fe..34132d316 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dependencyInjection/SingletonInjector.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dependencyInjection/SingletonInjector.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/enums/EDhDirection.java b/core/src/main/java/com/seibel/distanthorizons/core/enums/EDhDirection.java
index 2104bc13b..46446cf10 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/enums/EDhDirection.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/enums/EDhDirection.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/enums/EGLProxyContext.java b/core/src/main/java/com/seibel/distanthorizons/core/enums/EGLProxyContext.java
index f3bdaf01e..f069507a1 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/enums/EGLProxyContext.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/enums/EGLProxyContext.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/enums/ELevelType.java b/core/src/main/java/com/seibel/distanthorizons/core/enums/ELevelType.java
index b9acb0602..a2dda983c 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/enums/ELevelType.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/enums/ELevelType.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/enums/worldGeneration/EWorldGenThreadMode.java b/core/src/main/java/com/seibel/distanthorizons/core/enums/worldGeneration/EWorldGenThreadMode.java
index 8f5dfac3c..2405c504e 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/enums/worldGeneration/EWorldGenThreadMode.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/enums/worldGeneration/EWorldGenThreadMode.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.enums.worldGeneration;
/**
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataFileHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataFileHandler.java
index d0592aaee..9a19d41ce 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataFileHandler.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataFileHandler.java
@@ -1,9 +1,28 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.file.fullDatafile;
-import com.google.common.collect.HashMultimap;
import com.seibel.distanthorizons.core.config.Config;
import com.seibel.distanthorizons.core.config.listeners.ConfigChangeListener;
import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.ChunkSizedFullDataAccessor;
+import com.seibel.distanthorizons.core.dataObjects.fullData.sources.CompleteFullDataSource;
import com.seibel.distanthorizons.core.dataObjects.fullData.sources.HighDetailIncompleteFullDataSource;
import com.seibel.distanthorizons.core.dataObjects.fullData.sources.LowDetailIncompleteFullDataSource;
import com.seibel.distanthorizons.core.dataObjects.fullData.sources.interfaces.IFullDataSource;
@@ -13,23 +32,23 @@ import com.seibel.distanthorizons.core.level.IDhLevel;
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
import com.seibel.distanthorizons.core.pos.DhLodPos;
import com.seibel.distanthorizons.core.pos.DhSectionPos;
-import com.seibel.distanthorizons.core.dataObjects.fullData.sources.CompleteFullDataSource;
-import com.seibel.distanthorizons.core.util.FileScanUtil;
import com.seibel.distanthorizons.core.util.FileUtil;
import com.seibel.distanthorizons.core.util.LodUtil;
+import com.seibel.distanthorizons.core.util.MetaFileScanUtil;
import com.seibel.distanthorizons.core.util.ThreadUtil;
import org.apache.logging.log4j.Logger;
-import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.IOException;
-import java.util.*;
-import java.util.concurrent.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutorService;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;
-import java.util.function.Function;
-
-import static com.seibel.distanthorizons.core.util.FileScanUtil.LOD_FILE_POSTFIX;
public class FullDataFileHandler implements IFullDataSourceProvider
{
@@ -40,31 +59,31 @@ public class FullDataFileHandler implements IFullDataSourceProvider
protected static ExecutorService fileHandlerThreadPool;
protected static ConfigChangeListener configListener;
- private final ConcurrentHashMap unloadedFiles = new ConcurrentHashMap<>();
- private final ConcurrentHashMap fileBySectionPos = new ConcurrentHashMap<>();
- public void ForEachFile(Consumer consumer) { this.fileBySectionPos.values().forEach(consumer); }
+ private final ConcurrentHashMap unloadedFileBySectionPos = new ConcurrentHashMap<>();
+ /** contains the loaded {@link FullDataMetaFile}'s */
+ private final ConcurrentHashMap metaFileBySectionPos = new ConcurrentHashMap<>();
+
public Map getLoadStates(Iterable posList)
{
HashMap map = new HashMap<>();
for (DhSectionPos pos : posList)
{
map.put(pos,
- fileBySectionPos.containsKey(pos) ? 3 // Loaded
- : this.isFileUnloaded(pos) ? 2 // Unloaded
- : 1); // Not generated
+ metaFileBySectionPos.containsKey(pos) ? 3 // Loaded
+ : this.isFileUnloaded(pos) ? 2 // Unloaded
+ : 1); // Not generated
}
return map;
}
- protected boolean isFileUnloaded(DhSectionPos pos) { return unloadedFiles.containsKey(pos); }
-
- private LinkedList> onUpdatedListeners = new LinkedList<>();
+ protected boolean isFileUnloaded(DhSectionPos pos) { return unloadedFileBySectionPos.containsKey(pos); }
protected final IDhLevel level;
protected final File saveDir;
- protected final AtomicInteger topDetailLevel = new AtomicInteger(0);
+ protected final AtomicInteger topDetailLevelRef = new AtomicInteger(0);
protected final int minDetailLevel = CompleteFullDataSource.SECTION_SIZE_OFFSET;
+
//=============//
// constructor //
//=============//
@@ -77,133 +96,85 @@ public class FullDataFileHandler implements IFullDataSourceProvider
{
LOGGER.warn("Unable to create full data folder, file saving may fail.");
}
- FileScanUtil.scanFiles(saveStructure, level.getLevelWrapper(), this, null);
+ MetaFileScanUtil.scanFullDataFiles(saveStructure, level.getLevelWrapper(), this);
}
- // constructor helpers //
+ @Override
+ public void addScannedFiles(Collection detectedFiles)
+ {
+ MetaFileScanUtil.ICreateMetadataFunc createMetadataFunc = (file) -> FullDataMetaFile.createFromExistingFile(this, this.level, file);
+
+ MetaFileScanUtil.IAddUnloadedFileFunc addUnloadedFileFunc = (pos, file) ->
+ {
+ this.unloadedFileBySectionPos.put(pos, file);
+ this.topDetailLevelRef.updateAndGet(oldDetailLevel -> Math.max(oldDetailLevel, pos.sectionDetailLevel));
+ };
+ MetaFileScanUtil.IAddLoadedMetaFileFunc addLoadedMetaFileFunc = (pos, loadedMetaFile) ->
+ {
+ this.topDetailLevelRef.updateAndGet(oldDetailLevel -> Math.max(oldDetailLevel, pos.sectionDetailLevel));
+ this.metaFileBySectionPos.put(pos, (FullDataMetaFile) loadedMetaFile);
+ };
+
+
+ MetaFileScanUtil.addScannedFiles(detectedFiles, USE_LAZY_LOADING, FullDataMetaFile.FILE_SUFFIX,
+ createMetadataFunc,
+ addUnloadedFileFunc, addLoadedMetaFileFunc);
+ }
+
+
+
+ //===============//
+ // file handling //
+ //===============//
/**
- * Caller must ensure that this method is called only once,
- * and that the {@link FullDataFileHandler} is not used before this method is called.
+ * Returns the {@link IFullDataSource} for the given section position.
+ * The returned data source may be null.
+ *
+ * For now, if result is null, it prob means error has occurred when loading or creating the file object.
+ *
+ * This call is concurrent. I.e. it supports being called by multiple threads at the same time.
*/
@Override
- public void addScannedFile(Collection detectedFiles)
+ public CompletableFuture readAsync(DhSectionPos pos)
{
- if (USE_LAZY_LOADING)
+ this.topDetailLevelRef.updateAndGet(oldDetailLevel -> Math.max(oldDetailLevel, pos.sectionDetailLevel));
+ FullDataMetaFile metaFile = this.getLoadOrMakeFile(pos, true);
+ if (metaFile == null)
{
- lazyAddScannedFile(detectedFiles);
- }
- else
- {
- immediateAddScannedFile(detectedFiles);
- }
- }
-
- private void lazyAddScannedFile(Collection detectedFiles)
- {
- for (File file : detectedFiles)
- {
- try
- {
- DhSectionPos pos = decodePositionByFile(file);
- if (pos != null)
- {
- unloadedFiles.put(pos, file);
- this.topDetailLevel.updateAndGet(oldDetailLevel -> Math.max(oldDetailLevel, pos.sectionDetailLevel));
- }
- }
- catch (Exception e)
- {
- LOGGER.error("Failed to read data meta file at " + file + ": ", e);
- FileUtil.renameCorruptedFile(file);
- }
- }
- }
-
- private void immediateAddScannedFile(Collection detectedFiles)
- {
- HashMultimap filesByPos = HashMultimap.create();
- { // Sort files by pos.
- for (File file : detectedFiles)
- {
- try
- {
- FullDataMetaFile metaFile = new FullDataMetaFile(this, this.level, file);
- filesByPos.put(metaFile.pos, metaFile);
- }
- catch (IOException e)
- {
- LOGGER.error("Failed to read data meta file at " + file + ": ", e);
- FileUtil.renameCorruptedFile(file);
- }
- }
+ return CompletableFuture.completedFuture(null);
}
- // Warn for multiple files with the same pos, and then select the one with the latest timestamp.
- for (DhSectionPos pos : filesByPos.keySet())
- {
- Collection metaFiles = filesByPos.get(pos);
- FullDataMetaFile fileToUse;
- if (metaFiles.size() > 1)
- {
-// fileToUse = Collections.max(metaFiles, Comparator.comparingLong(a -> a.metaData.dataVersion.get()));
-
- fileToUse = Collections.max(metaFiles, Comparator.comparingLong(fullDataMetaFile -> fullDataMetaFile.file.lastModified()));
+
+ // future wrapper necessary in order to handle file read errors
+ CompletableFuture futureWrapper = new CompletableFuture<>();
+ metaFile.getOrLoadCachedDataSourceAsync().exceptionally((e) ->
{
- StringBuilder sb = new StringBuilder();
- sb.append("Multiple files with the same pos: ");
- sb.append(pos);
- sb.append("\n");
- for (FullDataMetaFile metaFile : metaFiles)
- {
- sb.append("\t");
- sb.append(metaFile.file);
- sb.append("\n");
- }
- sb.append("\tUsing: ");
- sb.append(fileToUse.file);
- sb.append("\n");
- sb.append("(Other files will be renamed by appending \".old\" to their name.)");
- LOGGER.warn(sb.toString());
+ FullDataMetaFile newMetaFile = this.removeCorruptedFile(pos, metaFile, e);
- // Rename all other files with the same pos to .old
- for (FullDataMetaFile metaFile : metaFiles)
- {
- if (metaFile == fileToUse)
- {
- continue;
- }
- File oldFile = new File(metaFile.file + ".old");
- try
- {
- if (!metaFile.file.renameTo(oldFile))
- {
- throw new RuntimeException("Renaming failed");
- }
- }
- catch (Exception e)
- {
- LOGGER.error("Failed to rename file: " + metaFile.file + " to " + oldFile, e);
- }
- }
- }
- }
- else
- {
- fileToUse = metaFiles.iterator().next();
- }
- // Add file to the list of files.
- this.topDetailLevel.updateAndGet(oldDetailLevel -> Math.max(oldDetailLevel, fileToUse.pos.sectionDetailLevel));
- this.fileBySectionPos.put(pos, fileToUse);
- }
+ futureWrapper.completeExceptionally(e);
+ return null; // return value doesn't matter
+ })
+ .whenComplete((dataSource, e) ->
+ {
+ futureWrapper.complete(dataSource);
+ });
+
+ return futureWrapper;
}
+ @Override
+ public FullDataMetaFile getFileIfExist(DhSectionPos pos) { return this.getLoadOrMakeFile(pos, false); }
protected FullDataMetaFile getLoadOrMakeFile(DhSectionPos pos, boolean allowCreateFile)
{
- FullDataMetaFile metaFile = this.fileBySectionPos.get(pos);
- if (metaFile != null) return metaFile;
+ FullDataMetaFile metaFile = this.metaFileBySectionPos.get(pos);
+ if (metaFile != null)
+ {
+ return metaFile;
+ }
- File fileToLoad = this.unloadedFiles.get(pos);
+
+ File fileToLoad = this.unloadedFileBySectionPos.get(pos);
// File does exist, but not loaded yet.
if (fileToLoad != null)
{
@@ -212,7 +183,7 @@ public class FullDataFileHandler implements IFullDataSourceProvider
// Double check locking for loading file, as loading file means also loading the metadata, which
// while not... Very expensive, is still better to avoid multiple threads doing it, and dumping the
// duplicated work to the trash. Therefore, eating the overhead of 'synchronized' is worth it.
- metaFile = this.fileBySectionPos.get(pos);
+ metaFile = this.metaFileBySectionPos.get(pos);
if (metaFile != null)
{
return metaFile; // someone else loaded it already.
@@ -220,9 +191,9 @@ public class FullDataFileHandler implements IFullDataSourceProvider
try
{
- metaFile = new FullDataMetaFile(this, this.level, fileToLoad);
- this.topDetailLevel.updateAndGet(oldDetailLevel -> Math.max(oldDetailLevel, pos.sectionDetailLevel));
- this.fileBySectionPos.put(pos, metaFile);
+ metaFile = FullDataMetaFile.createFromExistingFile(this, this.level, fileToLoad);
+ this.topDetailLevelRef.updateAndGet(oldDetailLevel -> Math.max(oldDetailLevel, pos.sectionDetailLevel));
+ this.metaFileBySectionPos.put(pos, metaFile);
return metaFile;
}
catch (IOException e)
@@ -232,7 +203,7 @@ public class FullDataFileHandler implements IFullDataSourceProvider
}
finally
{
- this.unloadedFiles.remove(pos);
+ this.unloadedFileBySectionPos.remove(pos);
}
}
}
@@ -248,7 +219,7 @@ public class FullDataFileHandler implements IFullDataSourceProvider
// to avoid overhead of 'synchronized', and eat the mini-overhead of possibly creating duplicate objects.
try
{
- metaFile = new FullDataMetaFile(this, this.level, pos);
+ metaFile = FullDataMetaFile.createNewFileForPos(this, this.level, pos);
}
catch (IOException e)
{
@@ -256,10 +227,10 @@ public class FullDataFileHandler implements IFullDataSourceProvider
return null;
}
- this.topDetailLevel.updateAndGet(oldDetailLevel -> Math.max(oldDetailLevel, pos.sectionDetailLevel));
+ this.topDetailLevelRef.updateAndGet(oldDetailLevel -> Math.max(oldDetailLevel, pos.sectionDetailLevel));
// This is a CAS with expected null value.
- FullDataMetaFile metaFileCas = this.fileBySectionPos.putIfAbsent(pos, metaFile);
+ FullDataMetaFile metaFileCas = this.metaFileBySectionPos.putIfAbsent(pos, metaFile);
return metaFileCas == null ? metaFile : metaFileCas;
}
@@ -298,7 +269,7 @@ public class FullDataFileHandler implements IFullDataSourceProvider
}
// check if a file for this pos exists, either loaded and unloaded
- if (this.fileBySectionPos.containsKey(subPos) || this.unloadedFiles.containsKey(subPos))
+ if (this.metaFileBySectionPos.containsKey(subPos) || this.unloadedFileBySectionPos.containsKey(subPos))
{
allEmpty = false;
break outerLoop;
@@ -328,13 +299,13 @@ public class FullDataFileHandler implements IFullDataSourceProvider
if (CompleteFullDataSource.firstDataPosCanAffectSecond(basePos, childPos))
{
// load the file if it isn't already
- if (this.unloadedFiles.containsKey(childPos))
+ if (this.unloadedFileBySectionPos.containsKey(childPos))
{
this.getLoadOrMakeFile(childPos, true);
}
- FullDataMetaFile metaFile = this.fileBySectionPos.get(childPos);
+ FullDataMetaFile metaFile = this.metaFileBySectionPos.get(childPos);
if (metaFile != null)
{
// we have reached a populated leaf node in the quad tree
@@ -353,46 +324,18 @@ public class FullDataFileHandler implements IFullDataSourceProvider
}
}
+ public void ForEachFile(Consumer consumer) { this.metaFileBySectionPos.values().forEach(consumer); }
+
- /**
- * Returns the {@link IFullDataSource} for the given section position.
- * The returned data source may be null.
- *
- * For now, if result is null, it prob means error has occurred when loading or creating the file object.
- *
- * This call is concurrent. I.e. it supports being called by multiple threads at the same time.
- */
- @Override
- public CompletableFuture read(DhSectionPos pos)
- {
- this.topDetailLevel.updateAndGet(oldDetailLevel -> Math.max(oldDetailLevel, pos.sectionDetailLevel));
- FullDataMetaFile metaFile = this.getLoadOrMakeFile(pos, true);
- if (metaFile == null)
- {
- return CompletableFuture.completedFuture(null);
- }
-
- // future wrapper necessary in order to handle file read errors
- CompletableFuture futureWrapper = new CompletableFuture<>();
- metaFile.loadOrGetCachedDataSourceAsync().exceptionally((e) ->
- {
- FullDataMetaFile newMetaFile = this.removeCorruptedFile(pos, metaFile, e);
-
- futureWrapper.completeExceptionally(e);
- return null; // return value doesn't matter
- })
- .whenComplete((dataSource, e) ->
- {
- futureWrapper.complete(dataSource);
- });
-
- return futureWrapper;
- }
+
+ //=============//
+ // data saving //
+ //=============//
/** This call is concurrent. I.e. it supports being called by multiple threads at the same time. */
@Override
- public void write(DhSectionPos sectionPos, ChunkSizedFullDataAccessor chunkDataView)
+ public void writeChunkDataToFile(DhSectionPos sectionPos, ChunkSizedFullDataAccessor chunkDataView)
{
DhLodPos chunkPos = chunkDataView.getLodPos();
LodUtil.assertTrue(chunkPos.overlapsExactly(sectionPos.getSectionBBoxPos()), "Chunk " + chunkPos + " does not overlap section " + sectionPos);
@@ -402,14 +345,14 @@ public class FullDataFileHandler implements IFullDataSourceProvider
}
private void writeChunkDataToMetaFile(DhSectionPos sectionPos, ChunkSizedFullDataAccessor chunkData)
{
- FullDataMetaFile metaFile = this.fileBySectionPos.get(sectionPos);
+ FullDataMetaFile metaFile = this.metaFileBySectionPos.get(sectionPos);
if (metaFile != null)
{
// there is a file for this position
metaFile.addToWriteQueue(chunkData);
}
- if (sectionPos.sectionDetailLevel <= this.topDetailLevel.get())
+ if (sectionPos.sectionDetailLevel <= this.topDetailLevelRef.get())
{
// recursively attempt to get the meta file for this position
this.writeChunkDataToMetaFile(sectionPos.getParentPos(), chunkData);
@@ -421,7 +364,7 @@ public class FullDataFileHandler implements IFullDataSourceProvider
public CompletableFuture flushAndSave()
{
ArrayList> futures = new ArrayList<>();
- for (FullDataMetaFile metaFile : this.fileBySectionPos.values())
+ for (FullDataMetaFile metaFile : this.metaFileBySectionPos.values())
{
futures.add(metaFile.flushAndSaveAsync());
}
@@ -431,7 +374,7 @@ public class FullDataFileHandler implements IFullDataSourceProvider
@Override
public CompletableFuture flushAndSave(DhSectionPos sectionPos)
{
- FullDataMetaFile metaFile = this.fileBySectionPos.get(sectionPos);
+ FullDataMetaFile metaFile = this.metaFileBySectionPos.get(sectionPos);
if (metaFile == null)
{
return CompletableFuture.completedFuture(null);
@@ -440,11 +383,7 @@ public class FullDataFileHandler implements IFullDataSourceProvider
}
- @Override
- public synchronized void addOnUpdatedListener(Consumer listener)
- {
- this.onUpdatedListeners.add(listener);
- }
+
protected IIncompleteFullDataSource makeEmptyDataSource(DhSectionPos pos)
{
@@ -460,7 +399,7 @@ public class FullDataFileHandler implements IFullDataSourceProvider
final ArrayList> loadDataFutures = new ArrayList<>(existingFiles.size());
for (FullDataMetaFile existingFile : existingFiles)
{
- loadDataFutures.add(existingFile.loadOrGetCachedDataSourceAsync()
+ loadDataFutures.add(existingFile.getOrLoadCachedDataSourceAsync()
.exceptionally((ex) -> /*Ignore file read errors*/null)
.thenAccept((existingFullDataSource) ->
{
@@ -490,7 +429,7 @@ public class FullDataFileHandler implements IFullDataSourceProvider
}
@Override
- public CompletableFuture onCreateDataFile(FullDataMetaFile file)
+ public CompletableFuture onDataFileCreatedAsync(FullDataMetaFile file)
{
DhSectionPos pos = file.pos;
IIncompleteFullDataSource source = this.makeEmptyDataSource(pos);
@@ -520,47 +459,11 @@ public class FullDataFileHandler implements IFullDataSourceProvider
FileUtil.renameCorruptedFile(metaFile.file);
// remove the FullDataMetaFile since the old one was corrupted
- this.fileBySectionPos.remove(pos);
+ this.metaFileBySectionPos.remove(pos);
// create a new FullDataMetaFile to write new data to
return this.getLoadOrMakeFile(pos, true);
}
- @Override
- public CompletableFuture onDataFileUpdate(
- IFullDataSource source, FullDataMetaFile file,
- Consumer onUpdated, Function updater)
- {
- boolean changed = updater.apply(source);
-// if (changed)
-// {
-// metaData.dataVersion.incrementAndGet();
-// }
-
- if (source instanceof IIncompleteFullDataSource)
- {
- IFullDataSource newSource = ((IIncompleteFullDataSource) source).tryPromotingToCompleteDataSource();
- changed |= newSource != source;
- source = newSource;
- }
-
- if (changed)
- {
- onUpdated.accept(source);
- }
- return CompletableFuture.completedFuture(source);
- }
-
- @Override
- public File computeDataFilePath(DhSectionPos pos) { return new File(this.saveDir, pos.serialize() + LOD_FILE_POSTFIX); }
-
- @Nullable
- public DhSectionPos decodePositionByFile(File file)
- {
- String fileName = file.getName();
- if (!fileName.endsWith(LOD_FILE_POSTFIX)) return null;
- fileName = fileName.substring(0, fileName.length() - 4);
- return DhSectionPos.deserialize(fileName);
- }
//==========================//
@@ -613,12 +516,6 @@ public class FullDataFileHandler implements IFullDataSourceProvider
@Override
public ExecutorService getIOExecutor() { return fileHandlerThreadPool; }
- @Override
- public FullDataMetaFile getFileIfExist(DhSectionPos pos)
- {
- return getLoadOrMakeFile(pos, false);
- }
-
//=========//
@@ -626,9 +523,15 @@ public class FullDataFileHandler implements IFullDataSourceProvider
//=========//
@Override
- public void close()
- {
- FullDataMetaFile.debugPhantomLifeCycleCheck();
- }
+ public void close() { FullDataMetaFile.checkAndLogPhantomDataSourceLifeCycles(); }
+
+
+
+ //================//
+ // helper methods //
+ //================//
+
+ @Override
+ public File computeDataFilePath(DhSectionPos pos) { return new File(this.saveDir, pos.serialize() + FullDataMetaFile.FILE_SUFFIX); }
}
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataMetaFile.java b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataMetaFile.java
index 0480386f3..d9278e32a 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataMetaFile.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataMetaFile.java
@@ -1,10 +1,28 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.file.fullDatafile;
import java.awt.*;
import java.io.*;
import java.lang.ref.*;
import java.nio.channels.ClosedByInterruptException;
-import java.nio.file.FileAlreadyExistsException;
import java.util.Set;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicReference;
@@ -13,6 +31,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
import com.seibel.distanthorizons.core.dataObjects.fullData.sources.CompleteFullDataSource;
import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.ChunkSizedFullDataAccessor;
import com.seibel.distanthorizons.core.dataObjects.fullData.sources.interfaces.IFullDataSource;
+import com.seibel.distanthorizons.core.dataObjects.fullData.sources.interfaces.IIncompleteFullDataSource;
import com.seibel.distanthorizons.core.file.metaData.AbstractMetaDataContainerFile;
import com.seibel.distanthorizons.core.file.metaData.BaseMetaData;
import com.seibel.distanthorizons.core.level.IDhLevel;
@@ -27,131 +46,51 @@ import com.seibel.distanthorizons.core.render.renderer.DebugRenderer;
import com.seibel.distanthorizons.core.render.renderer.IDebugRenderable;
import org.apache.logging.log4j.Logger;
-/**
- * Represents a File that contains a {@link IFullDataSource}.
- */
+/** Represents a File that contains a {@link IFullDataSource}. */
public class FullDataMetaFile extends AbstractMetaDataContainerFile implements IDebugRenderable
{
+ public static final String FILE_SUFFIX = ".lod";
+
private static final Logger LOGGER = DhLoggerBuilder.getLogger(FullDataMetaFile.class.getSimpleName());
- private final IDhLevel level;
- private final IFullDataSourceProvider fullDataSourceProvider;
- public boolean doesFileExist;
+ // === Object lifetime tracking ===
+ /** if true both data source creation and garbage collection will be logged */
+ private static final boolean LOG_DATA_SOURCE_LIVES = false;
+ private static final ReferenceQueue LIFE_CYCLE_DEBUG_QUEUE = new ReferenceQueue<>();
+ private static final ReferenceQueue SOFT_REF_DEBUG_QUEUE = new ReferenceQueue<>();
+ private static final Set LIFE_CYCLE_DEBUG_SET = ConcurrentHashMap.newKeySet();
+ private static final Set SOFT_REF_DEBUG_SET = ConcurrentHashMap.newKeySet();
+ // ===========================
+
+
+ public boolean doesFileExist;
//TODO: Atm can't find a better way to store when genQueue is checked.
public boolean genQueueChecked = false;
- private volatile boolean markedNeedUpdate = false;
-
public AbstractFullDataSourceLoader fullDataSourceLoader;
- public Class extends IFullDataSource> dataType;
+ public Class extends IFullDataSource> fullDataSourceClass;
+
+
+ private volatile boolean needsUpdate = false;
+
+ private final IDhLevel level;
+ private final IFullDataSourceProvider fullDataSourceProvider;
/**
* Can be cleared if the garbage collector determines there isn't enough space.
*
* When clearing, don't set to null, instead create a SoftReference containing null.
- * This will make null checks simpler.
+ * This makes null checks simpler.
*/
- private SoftReference cachedFullDataSource = new SoftReference<>(null);
+ private SoftReference cachedFullDataSourceRef = new SoftReference<>(null);
private final AtomicReference> dataSourceLoadFutureRef = new AtomicReference<>(null);
- private static final class CacheQueryResult
- {
- public final CompletableFuture future;
- public final boolean needsLoad;
- public CacheQueryResult(CompletableFuture future, boolean needsLoad)
- {
- this.future = future;
- this.needsLoad = needsLoad;
- }
-
- }
-
- @Override
- public void debugRender(DebugRenderer r)
- {
- if (pos.sectionDetailLevel > DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL) return;
-
- IFullDataSource cached = cachedFullDataSource.get();
- if (markedNeedUpdate)
- r.renderBox(new DebugRenderer.Box(pos, 80f, 96f, 0.05f, Color.red));
-
- Color c = Color.black;
- if (cached != null)
- {
- if (cached instanceof CompleteFullDataSource)
- {
- c = Color.GREEN;
- }
- else
- {
- c = Color.YELLOW;
- }
-
- }
- else if (dataSourceLoadFutureRef.get() != null)
- {
- c = Color.BLUE;
- }
- else if (doesFileExist)
- {
- c = Color.RED;
- }
- boolean needUpdate = !this.writeQueueRef.get().queue.isEmpty() || markedNeedUpdate;
- if (needUpdate) c = c.darker().darker();
- r.renderBox(new DebugRenderer.Box(pos, 80f, 96f, 0.05f, c));
- }
-
- //TODO: use ConcurrentAppendSingleSwapContainer instead of below:
- private static class GuardedMultiAppendQueue
- {
- ReentrantReadWriteLock appendLock = new ReentrantReadWriteLock();
- ConcurrentLinkedQueue queue = new ConcurrentLinkedQueue<>();
-
- }
-
-
- // ===Concurrent Write stuff===
+ // === Concurrent Write tracking ===
private final AtomicReference writeQueueRef = new AtomicReference<>(new GuardedMultiAppendQueue());
private GuardedMultiAppendQueue backWriteQueue = new GuardedMultiAppendQueue();
// ===========================
- // ===Object lifetime stuff===
- private static final ReferenceQueue lifeCycleDebugQueue = new ReferenceQueue<>();
- private static final ReferenceQueue softRefDebugQueue = new ReferenceQueue<>();
- private static final Set lifeCycleDebugSet = ConcurrentHashMap.newKeySet();
- private static final Set softRefDebugSet = ConcurrentHashMap.newKeySet();
-
- private static class DataObjTracker extends PhantomReference implements Closeable
- {
- public final DhSectionPos pos;
- DataObjTracker(IFullDataSource data)
- {
- super(data, lifeCycleDebugQueue);
- //LOGGER.info("Phantom created on {}! count: {}", data.getSectionPos(), lifeCycleDebugSet.size());
- lifeCycleDebugSet.add(this);
- this.pos = data.getSectionPos();
- }
- @Override
- public void close() { lifeCycleDebugSet.remove(this); }
-
- }
-
- private static class DataObjSoftTracker extends SoftReference implements Closeable
- {
- public final FullDataMetaFile file;
- DataObjSoftTracker(FullDataMetaFile file, IFullDataSource data)
- {
- super(data, softRefDebugQueue);
- softRefDebugSet.add(this);
- this.file = file;
- }
- @Override
- public void close() { softRefDebugSet.remove(this); }
-
- }
- // ===========================
-
//==============//
@@ -159,14 +98,14 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I
//==============//
/**
- * Creates a new file.
- *
- * @throws FileAlreadyExistsException if a file already exists.
+ * NOTE: should only be used if there is NOT an existing file.
+ * @throws IOException if a file already exists for this position
*/
- public FullDataMetaFile(IFullDataSourceProvider fullDataSourceProvider, IDhLevel level, DhSectionPos pos) throws FileAlreadyExistsException
+ public static FullDataMetaFile createNewFileForPos(IFullDataSourceProvider fullDataSourceProvider, IDhLevel clientLevel, DhSectionPos pos) throws IOException { return new FullDataMetaFile(fullDataSourceProvider, clientLevel, pos); }
+ private FullDataMetaFile(IFullDataSourceProvider fullDataSourceProvider, IDhLevel level, DhSectionPos pos) throws IOException
{
super(fullDataSourceProvider.computeDataFilePath(pos), pos);
- debugPhantomLifeCycleCheck();
+ checkAndLogPhantomDataSourceLifeCycles();
this.fullDataSourceProvider = fullDataSourceProvider;
this.level = level;
@@ -175,16 +114,17 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I
DebugRenderer.register(this);
}
+
/**
- * Uses an existing file.
- *
+ * NOTE: should only be used if there IS an existing file.
* @throws IOException if the file was formatted incorrectly
* @throws FileNotFoundException if no file exists for the given path
*/
- public FullDataMetaFile(IFullDataSourceProvider fullDataSourceProvider, IDhLevel level, File file) throws IOException, FileNotFoundException
+ public static FullDataMetaFile createFromExistingFile(IFullDataSourceProvider fullDataSourceProvider, IDhLevel level, File file) throws IOException { return new FullDataMetaFile(fullDataSourceProvider, level, file); }
+ private FullDataMetaFile(IFullDataSourceProvider fullDataSourceProvider, IDhLevel level, File file) throws IOException, FileNotFoundException
{
super(file);
- debugPhantomLifeCycleCheck();
+ checkAndLogPhantomDataSourceLifeCycles();
this.fullDataSourceProvider = fullDataSourceProvider;
this.level = level;
@@ -198,240 +138,191 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I
throw new IOException("Invalid file: Data type loader not found: " + this.baseMetaData.dataTypeId + "(v" + this.baseMetaData.binaryDataFormatVersion + ")");
}
- this.dataType = this.fullDataSourceLoader.clazz;
+ this.fullDataSourceClass = this.fullDataSourceLoader.fullDataSourceClass;
DebugRenderer.register(this);
}
- public void markNeedUpdate() { this.markedNeedUpdate = true; }
+
//==========//
// get data //
//==========//
- // Try get cached data source. Used for temp impl for re-queueing world gen tasks.
- // (Read-only access! As writes should always be done async)
- public IFullDataSource getCachedDataSourceNowOrNull()
- {
- debugPhantomLifeCycleCheck();
- return this.cachedFullDataSource.get();
+ /**
+ * Try get cached data source. Used for temp impl of re-queueing world gen tasks.
+ * (Read-only access! As writes should always be done async)
+ */
+ public IFullDataSource getCachedDataSourceNowOrNull()
+ {
+ checkAndLogPhantomDataSourceLifeCycles();
+ return this.cachedFullDataSourceRef.get();
}
- private void makeUpdateCompletionStage(CompletableFuture completer, CompletableFuture currentStage)
- {
- currentStage.thenCompose(
- (fullDataSource) -> {
- markedNeedUpdate = false;
- return this.fullDataSourceProvider.onDataFileUpdate(fullDataSource, this, this::_updateAndWriteDataSource, this::_applyWriteQueueToFullDataSource);
- })
- .whenComplete((fullDataSource, ex) ->
- {
- if (ex != null && !LodUtil.isInterruptOrReject(ex))
- {
- LOGGER.error("Error updating file [" + this.file + "]: ", ex);
- }
-
- if (fullDataSource != null)
- {
- new DataObjTracker(fullDataSource);
- new DataObjSoftTracker(this, fullDataSource);
- }
- //LOGGER.info("Updated file "+this.file);
- if (pos.sectionDetailLevel == DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL)
- DebugRenderer.makeParticle(
- new DebugRenderer.BoxParticle(
- new DebugRenderer.Box(this.pos, 64f, 72f, 0.03f, Color.green.darker()),
- 0.2, 32f
- )
- );
-
- this.cachedFullDataSource = new SoftReference<>(fullDataSource);
- inCrit = false;
- dataSourceLoadFutureRef.set(null);
- completer.complete(fullDataSource);
-
- if (this.markedNeedUpdate)
- {
- // trigger another update
- this.loadOrGetCachedDataSourceAsync();
- }
- });
- }
- private void makeLoadCompletionStage(ExecutorService executorService, CompletableFuture completer)
+ public CompletableFuture getOrLoadCachedDataSourceAsync()
{
- makeUpdateCompletionStage(completer, CompletableFuture.supplyAsync(() -> {
- // Load the file.
- IFullDataSource fullDataSource;
- try (FileInputStream fileInputStream = this.getFileInputStream();
- DhDataInputStream compressedStream = new DhDataInputStream(fileInputStream))
- {
- fullDataSource = this.fullDataSourceLoader.loadData(this, compressedStream, this.level);
- }
- catch (Exception ex)
- {
- // can happen if there is a missing file or the file was incorrectly formatted, or terminated early
- throw new CompletionException(ex);
- }
- return fullDataSource;
- }, executorService));
- }
-
- private void makeCreateCompletionStage(CompletableFuture completer)
- {
- this.makeUpdateCompletionStage(completer, this.fullDataSourceProvider.onCreateDataFile(this)
- .thenApply((fullDataSource) ->
- {
- this.baseMetaData = this._makeBaseMetaData(fullDataSource);
- return fullDataSource;
- }));
- }
-
- private volatile boolean inCrit = false;
- // Cause: Generic Type runtime casting cannot safety check it.
- // However, the Union type ensures the 'data' should only contain the listed type.
- public CompletableFuture loadOrGetCachedDataSourceAsync()
- {
- debugPhantomLifeCycleCheck();
+ checkAndLogPhantomDataSourceLifeCycles();
- CacheQueryResult result = this.getCachedDataSourceAsync();
-
- if (result.needsLoad)
+ CompletableFuture potentialLoadFuture = this.getCachedDataSourceAsync();
+ if (potentialLoadFuture != null)
{
- LodUtil.assertTrue(!this.inCrit);
- this.inCrit = true;
+ // return the in-process future
+ return potentialLoadFuture;
+ }
+ else
+ {
+ // there is no cached data, we'll have to load it
- CompletableFuture future = result.future;
- // don't continue if the provider has been shut down
- ExecutorService executorService = this.fullDataSourceProvider.getIOExecutor();
- if (executorService.isTerminated())
+ potentialLoadFuture = new CompletableFuture<>();
+ if (!this.dataSourceLoadFutureRef.compareAndSet(null, potentialLoadFuture))
{
- this.inCrit = false;
- this.dataSourceLoadFutureRef.set(null);
- future.complete(null);
- return future;
+ // two threads attempted to start this job at the same time, only use the first future
+ potentialLoadFuture = this.dataSourceLoadFutureRef.get();
+ }
+ }
+
+
+
+ CompletableFuture dataSourceLoadFuture = potentialLoadFuture;
+ if (!this.doesFileExist)
+ {
+ // create a new Meta file and data source
+
+ this.fullDataSourceProvider.onDataFileCreatedAsync(this)
+ .thenApply((fullDataSource) ->
+ {
+ AbstractFullDataSourceLoader dataSourceLoader = AbstractFullDataSourceLoader.getLoader(fullDataSource.getClass(), fullDataSource.getBinaryDataFormatVersion());
+
+ this.baseMetaData = new BaseMetaData(
+ fullDataSource.getSectionPos(), -1,
+ fullDataSource.getDataDetailLevel(), fullDataSource.getWorldGenStep(),
+ (dataSourceLoader == null ? 0 : dataSourceLoader.datatypeId), fullDataSource.getBinaryDataFormatVersion(), Long.MAX_VALUE);
+
+ return fullDataSource;
+ })
+ .thenCompose((fullDataSource) -> this.applyWriteQueueAndSaveAsync(fullDataSource))
+ .thenAccept((fullDataSource) ->
+ {
+ dataSourceLoadFuture.complete(fullDataSource);
+ this.dataSourceLoadFutureRef.set(null);
+ });
+ }
+ else
+ {
+ // load the existing Meta file and data source
+
+ if (this.baseMetaData == null)
+ {
+ throw new IllegalStateException("Meta data not loaded!");
}
- // create a new Meta file
- if (!this.doesFileExist)
+
+ ExecutorService executorService = this.fullDataSourceProvider.getIOExecutor();
+ if (!executorService.isTerminated())
{
- this.makeCreateCompletionStage(future);
+ // load the data source
+
+ CompletableFuture.supplyAsync(() ->
+ {
+ // Load the file.
+ IFullDataSource fullDataSource;
+ try (FileInputStream fileInputStream = this.getFileInputStream();
+ DhDataInputStream compressedStream = new DhDataInputStream(fileInputStream))
+ {
+ fullDataSource = this.fullDataSourceLoader.loadData(this, compressedStream, this.level);
+ }
+ catch (Exception ex)
+ {
+ // can happen if there is a missing file or the file was incorrectly formatted, or terminated early
+ throw new CompletionException(ex);
+ }
+ return fullDataSource;
+ }, executorService)
+ .thenCompose((fullDataSource) -> this.applyWriteQueueAndSaveAsync(fullDataSource))
+ .thenAccept((fullDataSource) ->
+ {
+ dataSourceLoadFuture.complete(fullDataSource);
+ this.dataSourceLoadFutureRef.set(null);
+ });
}
else
{
- // Otherwise, load and update file
- if (this.baseMetaData == null)
- {
- throw new IllegalStateException("Meta data not loaded!");
- }
-
- this.makeLoadCompletionStage(executorService, future);
+ // don't load anything if the provider has been shut down
+ dataSourceLoadFuture.complete(null);
+ this.dataSourceLoadFutureRef.set(null);
+ return dataSourceLoadFuture;
}
}
- return result.future;
+ return dataSourceLoadFuture;
}
- /** @return a stream for the data contained in this file, skips the metadata from {@link AbstractMetaDataContainerFile}. */
- private FileInputStream getFileInputStream() throws IOException
- {
- FileInputStream fileInputStream = new FileInputStream(this.file);
-
- // skip the meta-data bytes
- int bytesToSkip = AbstractMetaDataContainerFile.METADATA_SIZE_IN_BYTES;
- while (bytesToSkip > 0)
- {
- long skippedByteCount = fileInputStream.skip(bytesToSkip);
- if (skippedByteCount == 0)
- {
- throw new IOException("Invalid file: Failed to skip metadata.");
- }
- bytesToSkip -= skippedByteCount;
- }
-
- if (bytesToSkip != 0)
- {
- throw new IOException("File IO Error: Failed to skip metadata.");
- }
- return fileInputStream;
- }
- private BaseMetaData _makeBaseMetaData(IFullDataSource data)
- {
- AbstractFullDataSourceLoader loader = AbstractFullDataSourceLoader.getLoader(data.getClass(), data.getBinaryDataFormatVersion());
- return new BaseMetaData(data.getSectionPos(), -1,
- data.getDataDetailLevel(), data.getWorldGenStep(), (loader == null ? 0 : loader.datatypeId), data.getBinaryDataFormatVersion(), Long.MAX_VALUE);
- }
- /**
- * @return one of the following:
- * the cached {@link IFullDataSource},
- * a future that will complete once the {@link FullDataMetaFile#writeQueueRef} has been written,
- * or null if nothing has been cached and nothing is being loaded
- */
- private CacheQueryResult getCachedDataSourceAsync()
+
+ /** @return returns null if {@link FullDataMetaFile#cachedFullDataSourceRef} is empty and no cached {@link IFullDataSource} exists. */
+ private CompletableFuture getCachedDataSourceAsync()
{
// this data source is being written to, use the existing future
CompletableFuture dataSourceLoadFuture = this.dataSourceLoadFutureRef.get();
if (dataSourceLoadFuture != null)
{
- return new CacheQueryResult(dataSourceLoadFuture, false);
+ return dataSourceLoadFuture;
}
+
+
// attempt to get the cached data source
- IFullDataSource cachedFullDataSource = this.cachedFullDataSource.get();
+ IFullDataSource cachedFullDataSource = this.cachedFullDataSourceRef.get();
if (cachedFullDataSource == null)
{
- // Make a new future, and CAS it into the dataSourceLoadFutureRef, or return the existing future
- CompletableFuture newFuture = new CompletableFuture<>();
- CompletableFuture cas = AtomicsUtil.compareAndExchange(dataSourceLoadFutureRef, null, newFuture);
- if (cas == null)
- {
- return new CacheQueryResult(newFuture, true);
- }
- else
- {
- return new CacheQueryResult(cas, false);
- }
+ // no cached data exists and no one is trying to load it
+ return null;
}
else
{
- // The file is cached in RAM
- boolean needUpdate = !this.writeQueueRef.get().queue.isEmpty() || markedNeedUpdate;
+ // cached data exists
- if (!needUpdate)
+ boolean dataNeedsUpdating = !this.writeQueueRef.get().queue.isEmpty() || this.needsUpdate;
+ if (!dataNeedsUpdating)
{
// return the cached data
- return new CacheQueryResult(CompletableFuture.completedFuture(cachedFullDataSource), false);
+ return CompletableFuture.completedFuture(cachedFullDataSource);
}
else
{
- // either write the queue or return the future that is waiting for the queue write
+ // update the data using the write queue, wait for the update to finish, then return the data source
- // Do a CAS on inCacheWriteLock to ensure that we are the only thread that is writing to the cache,
- // or if we fail, then that means someone else is already doing it, and we can just return the future
- CompletableFuture future = new CompletableFuture<>();
- CompletableFuture compareAndSwapFuture = AtomicsUtil.compareAndExchange(dataSourceLoadFutureRef, null, future);
- if (compareAndSwapFuture != null)
+ // Create a new future if one doesn't already exist
+ CompletableFuture newFuture = new CompletableFuture<>();
+ CompletableFuture oldFuture = AtomicsUtil.compareAndExchange(this.dataSourceLoadFutureRef, null, newFuture);
+
+ if (oldFuture != null)
{
- // a write is already in progress, return its future.
- return new CacheQueryResult(compareAndSwapFuture, false);
+ // An update is already in progress, return its future.
+ return oldFuture;
}
else
{
- LodUtil.assertTrue(!inCrit);
- inCrit = true;
- // don't continue if the provider has been shut down
ExecutorService executorService = this.fullDataSourceProvider.getIOExecutor();
- if (executorService.isTerminated())
+ if (!executorService.isTerminated())
{
- inCrit = false;
- dataSourceLoadFutureRef.set(null);
- future.complete(null);
+ // wait for the update to finish before returning the data source
+
+ CompletableFuture.supplyAsync(() -> cachedFullDataSource, executorService)
+ .thenCompose((fullDataSource) -> this.applyWriteQueueAndSaveAsync(fullDataSource))
+ .thenAccept((fullDataSource) ->
+ {
+ newFuture.complete(fullDataSource);
+ this.dataSourceLoadFutureRef.set(null);
+ });
}
else
{
- // write the queue to the data source by triggering an update
- makeUpdateCompletionStage(future, CompletableFuture.supplyAsync(() -> cachedFullDataSource, executorService));
+ // don't update anything if the provider has been shut down
+ this.dataSourceLoadFutureRef.set(null);
+ newFuture.complete(null);
}
- return new CacheQueryResult(future, false);
+
+ return newFuture;
}
}
}
@@ -449,7 +340,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I
*/
public void addToWriteQueue(ChunkSizedFullDataAccessor chunkAccessor)
{
- debugPhantomLifeCycleCheck();
+ checkAndLogPhantomDataSourceLifeCycles();
DhLodPos chunkLodPos = new DhLodPos(LodUtil.CHUNK_DETAIL_LEVEL, chunkAccessor.pos.x, chunkAccessor.pos.z);
@@ -479,12 +370,12 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I
/** Applies any queued {@link ChunkSizedFullDataAccessor} to this metadata's {@link IFullDataSource} and writes the data to file. */
public CompletableFuture flushAndSaveAsync()
{
- debugPhantomLifeCycleCheck();
- boolean isEmpty = this.writeQueueRef.get().queue.isEmpty() && !markedNeedUpdate;
+ checkAndLogPhantomDataSourceLifeCycles();
+ boolean isEmpty = this.writeQueueRef.get().queue.isEmpty() && !needsUpdate;
if (!isEmpty)
{
// This will flush the data to disk.
- return this.loadOrGetCachedDataSourceAsync().thenApply((fullDataSource) -> null /* ignore the result, just wait for the load to finish*/ );
+ return this.getOrLoadCachedDataSourceAsync().thenApply((fullDataSource) -> null /* ignore the result, just wait for the load to finish*/ );
}
else
{
@@ -493,8 +384,232 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I
}
- /** updates this object to match the given {@link IFullDataSource} and then writes the new data to file. */
- private void _updateAndWriteDataSource(IFullDataSource fullDataSource)
+
+
+
+
+ public void markNeedsUpdate() { this.needsUpdate = true; }
+
+
+
+ //===========//
+ // debugging //
+ //===========//
+
+ /** can be used to log when data sources have been garbage collected */
+ public static void checkAndLogPhantomDataSourceLifeCycles()
+ {
+ DataObjTracker phantomRef = (DataObjTracker) LIFE_CYCLE_DEBUG_QUEUE.poll();
+ // wait for the tracker to be garbage collected(?)
+ while (phantomRef != null)
+ {
+ if (LOG_DATA_SOURCE_LIVES)
+ {
+ LOGGER.info("Full Data at pos: " + phantomRef.pos + " has been freed. [" + LIFE_CYCLE_DEBUG_SET.size() + "] Full Data sources remaining.");
+ }
+
+ phantomRef.close();
+ phantomRef = (DataObjTracker) LIFE_CYCLE_DEBUG_QUEUE.poll();
+ }
+
+
+ DataObjSoftTracker softRef = (DataObjSoftTracker) SOFT_REF_DEBUG_QUEUE.poll();
+ while (softRef != null)
+ {
+ if (LOG_DATA_SOURCE_LIVES)
+ {
+ LOGGER.info("Full Data at pos: " + softRef.file.pos + " has been soft released.");
+ }
+
+ softRef.close();
+ softRef = (DataObjSoftTracker) SOFT_REF_DEBUG_QUEUE.poll();
+ }
+ }
+
+ @Override
+ public void debugRender(DebugRenderer debugRenderer)
+ {
+ if (this.pos.sectionDetailLevel > DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL)
+ {
+ return;
+ }
+
+ IFullDataSource cached = this.cachedFullDataSourceRef.get();
+ if (this.needsUpdate)
+ {
+ debugRenderer.renderBox(new DebugRenderer.Box(this.pos, 80f, 96f, 0.05f, Color.red));
+ }
+
+ Color color = Color.black;
+ if (cached != null)
+ {
+ if (cached instanceof CompleteFullDataSource)
+ {
+ color = Color.GREEN;
+ }
+ else
+ {
+ color = Color.YELLOW;
+ }
+
+ }
+ else if (this.dataSourceLoadFutureRef.get() != null)
+ {
+ color = Color.BLUE;
+ }
+ else if (this.doesFileExist)
+ {
+ color = Color.RED;
+ }
+
+ boolean needsUpdate = !this.writeQueueRef.get().queue.isEmpty() || this.needsUpdate;
+ if (needsUpdate)
+ {
+ color = color.darker().darker();
+ }
+
+ debugRenderer.renderBox(new DebugRenderer.Box(this.pos, 80f, 96f, 0.05f, color));
+ }
+
+
+
+ //================//
+ // helper methods //
+ //================//
+
+ /** @return a stream for the data contained in this file, skips the metadata from {@link AbstractMetaDataContainerFile}. */
+ private FileInputStream getFileInputStream() throws IOException
+ {
+ FileInputStream fileInputStream = new FileInputStream(this.file);
+
+ // skip the meta-data bytes
+ int bytesToSkip = AbstractMetaDataContainerFile.METADATA_SIZE_IN_BYTES;
+ while (bytesToSkip > 0)
+ {
+ long skippedByteCount = fileInputStream.skip(bytesToSkip);
+ if (skippedByteCount == 0)
+ {
+ throw new IOException("Invalid file: Failed to skip metadata.");
+ }
+ bytesToSkip -= skippedByteCount;
+ }
+
+ if (bytesToSkip != 0)
+ {
+ throw new IOException("File IO Error: Failed to skip metadata.");
+ }
+ return fileInputStream;
+ }
+
+ /**
+ * Applies the {@link FullDataMetaFile#writeQueueRef} to the current {@link IFullDataSource}
+ * and stores the result in {@link FullDataMetaFile#cachedFullDataSourceRef}.
+ */
+ @SuppressWarnings("resource") // due to DataObjTracker and DataObjSoftTracker being created outside a try-catch block
+ private CompletableFuture applyWriteQueueAndSaveAsync(IFullDataSource fullDataSourceToUpdate)
+ {
+ CompletableFuture completionFuture = new CompletableFuture<>();
+
+
+ boolean dataChanged = this.applyWriteQueueToFullDataSource(fullDataSourceToUpdate);
+ this.needsUpdate = false;
+
+ // attempt to promote the data source
+ if (fullDataSourceToUpdate instanceof IIncompleteFullDataSource)
+ {
+ IFullDataSource newSource = ((IIncompleteFullDataSource) fullDataSourceToUpdate).tryPromotingToCompleteDataSource();
+ dataChanged |= (newSource != fullDataSourceToUpdate);
+ fullDataSourceToUpdate = newSource;
+ }
+
+ // the provider may need to modify other files based on this data source changing
+ this.fullDataSourceProvider.onDataFileUpdateAsync(fullDataSourceToUpdate, this, dataChanged)
+ .whenComplete((dataFileUpdateResult, ex) ->
+ {
+ if (ex != null && !LodUtil.isInterruptOrReject(ex))
+ {
+ LOGGER.error("Error updating file [" + this.file + "]: ", ex);
+ }
+
+ IFullDataSource fullDataSource = dataFileUpdateResult.fullDataSource;
+ boolean dataSourceChanged = dataFileUpdateResult.dataSourceChanged;
+
+
+ // only save to file if something was changed
+ if (dataSourceChanged)
+ {
+ this.writeDataSource(fullDataSource);
+ }
+
+ // keep track of non-null data sources
+ if (fullDataSource != null)
+ {
+ new DataObjTracker(fullDataSource);
+ new DataObjSoftTracker(this, fullDataSource);
+ }
+
+ if (this.pos.sectionDetailLevel == DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL)
+ {
+ DebugRenderer.makeParticle(new DebugRenderer.BoxParticle(
+ new DebugRenderer.Box(this.pos, 64f, 72f, 0.03f, Color.green.darker()),
+ 0.2, 32f));
+ }
+
+
+ // save the updated data source
+ this.cachedFullDataSourceRef = new SoftReference<>(fullDataSource);
+
+ // the task is complete
+ completionFuture.complete(fullDataSource);
+
+
+ if (this.needsUpdate)
+ {
+ // another update was requested while this update was being processed
+ this.getOrLoadCachedDataSourceAsync();
+ }
+ });
+
+ return completionFuture;
+ }
+
+ /** @return true if the queue was not empty and chunk data was applied to this meta file's {@link IFullDataSource}. */
+ private boolean applyWriteQueueToFullDataSource(IFullDataSource fullDataSource)
+ {
+ // swap the write queue if it has queued chunks.
+ // Must be done in this order to ensure IWorldGenTaskTracker.isMemoryAddressValid() work properly. See IWorldGenTaskTracker.isMemoryAddressValid() for details.
+ boolean isEmpty = this.writeQueueRef.get().queue.isEmpty();
+ if (!isEmpty)
+ {
+ this.swapWriteQueues();
+ for (ChunkSizedFullDataAccessor chunk : this.backWriteQueue.queue)
+ {
+ fullDataSource.update(chunk);
+ }
+
+ this.backWriteQueue.queue.clear();
+ //LOGGER.info("Updated Data file at {} for sect {} with {} chunk writes.", path, pos, count);
+ }
+
+ return !isEmpty || !this.doesFileExist;
+ }
+ private void swapWriteQueues()
+ {
+ GuardedMultiAppendQueue writeQueue = this.writeQueueRef.getAndSet(this.backWriteQueue);
+
+ // Acquire write lock and then release it again as we only need to ensure that the queue
+ // is not being appended to by another thread. Note that the above atomic swap &
+ // the guarantee that all append first acquire the appendLock means after the locK() call,
+ // there will be no other threads able to or is currently appending to the queue.
+ // Note: The above needs the getAndSet() to have at least Release Memory order.
+ // (not that java supports anything non volatile for getAndSet()...)
+ writeQueue.appendLock.writeLock().lock();
+ writeQueue.appendLock.writeLock().unlock();
+
+ this.backWriteQueue = writeQueue;
+ }
+
+ private void writeDataSource(IFullDataSource fullDataSource)
{
if (fullDataSource.isEmpty())
{
@@ -519,7 +634,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I
this.fullDataSourceLoader = AbstractFullDataSourceLoader.getLoader(fullDataSource.getClass(), fullDataSource.getBinaryDataFormatVersion());
LodUtil.assertTrue(this.fullDataSourceLoader != null, "No loader for " + fullDataSource.getClass() + " (v" + fullDataSource.getBinaryDataFormatVersion() + ")");
- this.dataType = fullDataSource.getClass();
+ this.fullDataSourceClass = fullDataSource.getClass();
this.baseMetaData.dataTypeId = (this.fullDataSourceLoader == null) ? 0 : this.fullDataSourceLoader.datatypeId;
this.baseMetaData.binaryDataFormatVersion = fullDataSource.getBinaryDataFormatVersion();
@@ -529,7 +644,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I
catch (ClosedByInterruptException e) // thrown by buffers that are interrupted
{
// expected if the file handler is shut down, the exception can be ignored
-// LOGGER.warn("FullData file writing interrupted.", e);
+ //LOGGER.warn("FullData file writing interrupted.", e);
}
catch (IOException e)
{
@@ -538,64 +653,60 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I
}
}
- /** @return true if the queue was not empty and data was applied to the {@link IFullDataSource}. */
- private boolean _applyWriteQueueToFullDataSource(IFullDataSource fullDataSource)
+
+
+ //================//
+ // helper classes //
+ //================//
+
+ //TODO: use ConcurrentAppendSingleSwapContainer instead of below:
+ private static class GuardedMultiAppendQueue
{
- // Poll the write queue
- // First check if write queue is empty, then swap the write queue.
- // Must be done in this order to ensure isMemoryAddressValid work properly. See isMemoryAddressValid() for details.
- boolean isEmpty = this.writeQueueRef.get().queue.isEmpty();
- if (!isEmpty)
+ ReentrantReadWriteLock appendLock = new ReentrantReadWriteLock();
+ ConcurrentLinkedQueue queue = new ConcurrentLinkedQueue<>();
+
+ }
+
+ /** used to debug data source soft reference garbage collection */
+ private static class DataObjTracker extends PhantomReference implements Closeable
+ {
+ public final DhSectionPos pos;
+
+
+ DataObjTracker(IFullDataSource data)
{
- this._swapWriteQueue();
- for (ChunkSizedFullDataAccessor chunk : this.backWriteQueue.queue)
+ super(data, LIFE_CYCLE_DEBUG_QUEUE);
+
+ if (LOG_DATA_SOURCE_LIVES)
{
- fullDataSource.update(chunk);
+ LOGGER.info("Phantom created on {}! count: {}", data.getSectionPos(), LIFE_CYCLE_DEBUG_SET.size());
}
- this.backWriteQueue.queue.clear();
- //LOGGER.info("Updated Data file at {} for sect {} with {} chunk writes.", path, pos, count);
- }
- return !isEmpty || !doesFileExist;
- }
- private void _swapWriteQueue()
- {
- GuardedMultiAppendQueue writeQueue = this.writeQueueRef.getAndSet(this.backWriteQueue);
- // Acquire write lock and then release it again as we only need to ensure that the queue
- // is not being appended to by another thread. Note that the above atomic swap &
- // the guarantee that all append first acquire the appendLock means after the locK() call,
- // there will be no other threads able to or is currently appending to the queue.
- // Note: The above needs the getAndSet() to have at least Release Memory order.
- // (not that java supports anything non volatile for getAndSet()...)
- writeQueue.appendLock.writeLock().lock();
- writeQueue.appendLock.writeLock().unlock();
- this.backWriteQueue = writeQueue;
- }
-
-
-
- //===========//
- // debugging //
- //===========//
-
- public static void debugPhantomLifeCycleCheck()
- {
- DataObjTracker phantom = (DataObjTracker) lifeCycleDebugQueue.poll();
-
- // wait for the tracker to be garbage collected(?)
- while (phantom != null)
- {
- //LOGGER.info("Full Data at pos: "+phantom.pos+" has been freed. "+lifeCycleDebugSet.size()+" Full Data files remaining.");
- phantom.close();
- phantom = (DataObjTracker) lifeCycleDebugQueue.poll();
+
+ LIFE_CYCLE_DEBUG_SET.add(this);
+ this.pos = data.getSectionPos();
}
- DataObjSoftTracker soft = (DataObjSoftTracker) softRefDebugQueue.poll();
- while (soft != null)
+ @Override
+ public void close() { LIFE_CYCLE_DEBUG_SET.remove(this); }
+
+ }
+
+ /** used to debug data source soft reference garbage collection */
+ private static class DataObjSoftTracker extends SoftReference implements Closeable
+ {
+ public final FullDataMetaFile file;
+
+
+ DataObjSoftTracker(FullDataMetaFile file, IFullDataSource data)
{
- //LOGGER.info("Full Data at pos: "+soft.file.pos+" has been soft released.");
- soft.close();
- soft = (DataObjSoftTracker) softRefDebugQueue.poll();
+ super(data, SOFT_REF_DEBUG_QUEUE);
+ SOFT_REF_DEBUG_SET.add(this);
+ this.file = file;
}
+
+ @Override
+ public void close() { SOFT_REF_DEBUG_SET.remove(this); }
+
}
}
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/GeneratedFullDataFileHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/GeneratedFullDataFileHandler.java
index c8e37ad51..242e36217 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/GeneratedFullDataFileHandler.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/GeneratedFullDataFileHandler.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.file.fullDatafile;
import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.ChunkSizedFullDataAccessor;
@@ -11,7 +30,6 @@ import com.seibel.distanthorizons.core.generation.tasks.WorldGenResult;
import com.seibel.distanthorizons.core.level.DhLevel;
import com.seibel.distanthorizons.core.level.IDhLevel;
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
-import com.seibel.distanthorizons.core.pos.DhLodPos;
import com.seibel.distanthorizons.core.pos.DhSectionPos;
import com.seibel.distanthorizons.core.util.LodUtil;
import org.apache.logging.log4j.Logger;
@@ -39,18 +57,6 @@ public class GeneratedFullDataFileHandler extends FullDataFileHandler
- //======//
- // data //
- //======//
-
- @Override
- public CompletableFuture read(DhSectionPos pos)
- {
- return super.read(pos);
- }
-
-
-
//==================//
// generation queue //
//==================//
@@ -67,7 +73,7 @@ public class GeneratedFullDataFileHandler extends FullDataFileHandler
metaFile.genQueueChecked = false; // unset it so it can be checked again
if (data != null)
{
- metaFile.markNeedUpdate();
+ metaFile.markNeedsUpdate();
}
});
flushAndSave(); // Trigger an update to the meta files
@@ -169,7 +175,7 @@ public class GeneratedFullDataFileHandler extends FullDataFileHandler
// Try update the gen queue on this data source. If null, then nothing was done.
@Nullable
- private CompletableFuture updateFromExistingDataSources(FullDataMetaFile file, IIncompleteFullDataSource data)
+ private CompletableFuture updateFromExistingDataSourcesAsync(FullDataMetaFile file, IIncompleteFullDataSource data)
{
DhSectionPos pos = file.pos;
ArrayList existingFiles = new ArrayList<>();
@@ -195,58 +201,43 @@ public class GeneratedFullDataFileHandler extends FullDataFileHandler
}
@Override
- public CompletableFuture onCreateDataFile(FullDataMetaFile file)
+ public CompletableFuture onDataFileCreatedAsync(FullDataMetaFile file)
{
DhSectionPos pos = file.pos;
- IIncompleteFullDataSource data = makeEmptyDataSource(pos);
- CompletableFuture future = updateFromExistingDataSources(file, data);
+ IIncompleteFullDataSource data = this.makeEmptyDataSource(pos);
+ CompletableFuture future = this.updateFromExistingDataSourcesAsync(file, data);
// Cant start gen task, so return the data
return future == null ? CompletableFuture.completedFuture(data) : future;
}
@Override
- public CompletableFuture onDataFileUpdate(
- IFullDataSource source, FullDataMetaFile file,
- Consumer onUpdated, Function updater)
+ public CompletableFuture onDataFileUpdateAsync(IFullDataSource fullDataSource, FullDataMetaFile file, boolean dataChanged)
{
- boolean changed = updater.apply(source);
- LodUtil.assertTrue(file.doesFileExist || changed);
+ LodUtil.assertTrue(file.doesFileExist || dataChanged);
- if (source instanceof IIncompleteFullDataSource)
+
+ if (fullDataSource instanceof CompleteFullDataSource)
{
- IFullDataSource newSource = tryPromoteDataSource((IIncompleteFullDataSource) source);
- changed |= newSource != source;
- source = newSource;
+ this.incompleteDataSources.remove(fullDataSource.getSectionPos());
}
+ this.fireOnGenPosSuccessListeners(fullDataSource.getSectionPos());
- if (source instanceof CompleteFullDataSource)
- {
- this.fireOnGenPosSuccessListeners(source.getSectionPos());
- }
- this.fireOnGenPosSuccessListeners(source.getSectionPos());
- if (source instanceof IIncompleteFullDataSource && !file.genQueueChecked)
+ if (fullDataSource instanceof IIncompleteFullDataSource && !file.genQueueChecked)
{
IWorldGenerationQueue worldGenQueue = this.worldGenQueueRef.get();
if (worldGenQueue != null)
{
- CompletableFuture future = this.updateFromExistingDataSources(file, (IIncompleteFullDataSource) source);
+ CompletableFuture future = this.updateFromExistingDataSourcesAsync(file, (IIncompleteFullDataSource) fullDataSource);
if (future != null)
{
- return future.thenApply((newSource) ->
- {
- onUpdated.accept(newSource);
- return newSource;
- });
+ final boolean finalDataChanged = dataChanged;
+ return future.thenApply((newSource) -> new DataFileUpdateResult(newSource, finalDataChanged));
}
}
}
- if (changed)
- {
- onUpdated.accept(source);
- }
- return CompletableFuture.completedFuture(source);
+ return CompletableFuture.completedFuture(new DataFileUpdateResult(fullDataSource, dataChanged));
}
private void onWorldGenTaskComplete(WorldGenResult genTaskResult, Throwable exception, GenTask genTask, DhSectionPos pos)
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/IFullDataSourceProvider.java b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/IFullDataSourceProvider.java
index 6f993cb96..b6b242cd8 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/IFullDataSourceProvider.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/IFullDataSourceProvider.java
@@ -1,8 +1,26 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.file.fullDatafile;
import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.ChunkSizedFullDataAccessor;
import com.seibel.distanthorizons.core.dataObjects.fullData.sources.interfaces.IFullDataSource;
-import com.seibel.distanthorizons.core.file.metaData.BaseMetaData;
import com.seibel.distanthorizons.core.pos.DhSectionPos;
import org.jetbrains.annotations.Nullable;
@@ -10,28 +28,47 @@ import java.io.File;
import java.util.Collection;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
-import java.util.function.Consumer;
-import java.util.function.Function;
public interface IFullDataSourceProvider extends AutoCloseable
{
- void addScannedFile(Collection detectedFiles);
+ void addScannedFiles(Collection detectedFiles);
- CompletableFuture read(DhSectionPos pos);
- void write(DhSectionPos sectionPos, ChunkSizedFullDataAccessor chunkData);
+ CompletableFuture readAsync(DhSectionPos pos);
+ void writeChunkDataToFile(DhSectionPos sectionPos, ChunkSizedFullDataAccessor chunkData);
CompletableFuture flushAndSave();
CompletableFuture flushAndSave(DhSectionPos sectionPos);
- void addOnUpdatedListener(Consumer listener);
-
//long getCacheVersion(DhSectionPos sectionPos);
//boolean isCacheVersionValid(DhSectionPos sectionPos, long cacheVersion);
- CompletableFuture onCreateDataFile(FullDataMetaFile file);
- CompletableFuture onDataFileUpdate(IFullDataSource source, FullDataMetaFile file, Consumer onUpdated, Function updater);
+ CompletableFuture onDataFileCreatedAsync(FullDataMetaFile file);
+ default CompletableFuture onDataFileUpdateAsync(IFullDataSource fullDataSource, FullDataMetaFile file, boolean dataChanged) { return CompletableFuture.completedFuture(new DataFileUpdateResult(fullDataSource, dataChanged)); }
File computeDataFilePath(DhSectionPos pos);
ExecutorService getIOExecutor();
@Nullable
FullDataMetaFile getFileIfExist(DhSectionPos pos);
+
+
+
+ //================//
+ // helper classes //
+ //================//
+
+ /**
+ * After a {@link FullDataMetaFile} has been updated the {@link IFullDataSourceProvider} may also need to modify it.
+ * This specifically happens during world generation.
+ */
+ class DataFileUpdateResult
+ {
+ IFullDataSource fullDataSource;
+ boolean dataSourceChanged;
+
+ public DataFileUpdateResult(IFullDataSource fullDataSource, boolean dataSourceChanged)
+ {
+ this.fullDataSource = fullDataSource;
+ this.dataSourceChanged = dataSourceChanged;
+ }
+ }
+
}
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/RemoteFullDataFileHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/RemoteFullDataFileHandler.java
index a5206b2c9..6798ffb7f 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/RemoteFullDataFileHandler.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/RemoteFullDataFileHandler.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.file.fullDatafile;
import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.ChunkSizedFullDataAccessor;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/metaData/AbstractMetaDataContainerFile.java b/core/src/main/java/com/seibel/distanthorizons/core/file/metaData/AbstractMetaDataContainerFile.java
index bf50944cf..168bae813 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/file/metaData/AbstractMetaDataContainerFile.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/file/metaData/AbstractMetaDataContainerFile.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.file.metaData;
import java.io.*;
@@ -6,6 +25,7 @@ import java.nio.channels.Channels;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.FileChannel;
import java.nio.file.*;
+import java.util.concurrent.locks.ReentrantLock;
import java.util.zip.Adler32;
import java.util.zip.CheckedOutputStream;
@@ -33,7 +53,7 @@ import org.apache.logging.log4j.Logger;
* 4 bytes: section Y position (Unused, for future proofing)
* 4 bytes: section Z position
*
- * 4 bytes: data checksum //TODO: Implement checksum
+ * 4 bytes: data checksum
* 1 byte: section detail level
* 1 byte: data detail level // Note: not sure if this is needed
* 1 byte: loader version
@@ -165,41 +185,22 @@ public abstract class AbstractMetaDataContainerFile
- //================//
- // helper methods //
- //================//
-
- /** Throws an {@link IOException} if the given file isn't valid */
- private static void validateMetaDataFile(File file) throws IOException
- {
- if (!file.exists()) throw new IOException("File missing");
- if (!file.isFile()) throw new IOException("Not a file");
- if (!file.canRead()) throw new IOException("File not readable");
- if (!file.canWrite()) throw new IOException("File not writable");
- }
-
- /** Sets this object's {@link AbstractMetaDataContainerFile#baseMetaData} using the set {@link AbstractMetaDataContainerFile#file} */
- protected void loadMetaData() throws IOException
- {
- validateMetaDataFile(this.file);
- this.baseMetaData = readMetaDataFromFile(this.file);
- if (!this.baseMetaData.pos.equals(this.pos))
- {
- LOGGER.warn("The file is from a different location than expected! Expected: [" + this.pos + "] but got [" + this.baseMetaData.pos + "]. Ignoring file tag.");
- this.baseMetaData.pos = this.pos;
- }
- }
+ //==============//
+ // file writing //
+ //==============//
protected void writeData(IMetaDataWriterFunc dataWriterFunc) throws IOException
{
- LodUtil.assertTrue(!DebugThreadCheck);
- DebugThreadCheck = true;
+ LodUtil.assertTrue(!this.DebugThreadCheck);
+ this.DebugThreadCheck = true;
LodUtil.assertTrue(this.baseMetaData != null);
if (this.file.exists())
{
validateMetaDataFile(this.file);
}
+
+
File tempFile;
if (USE_ATOMIC_MOVE_REPLACE)
{
@@ -262,7 +263,7 @@ public abstract class AbstractMetaDataContainerFile
catch (ClosedChannelException e) // includes ClosedByInterruptException
{
// expected if the file handler is shut down, the exception can be ignored
-// LOGGER.warn(AbstractMetaDataContainerFile.class.getSimpleName()+" file writing interrupted. Error: "+e.getMessage());
+ //LOGGER.warn(AbstractMetaDataContainerFile.class.getSimpleName()+" file writing interrupted. Error: "+e.getMessage());
}
finally
{
@@ -294,15 +295,38 @@ public abstract class AbstractMetaDataContainerFile
+ //================//
+ // helper methods //
+ //================//
+
+ /** Throws an {@link IOException} if the given file isn't valid */
+ private static void validateMetaDataFile(File file) throws IOException
+ {
+ if (!file.exists()) throw new IOException("File missing");
+ if (!file.isFile()) throw new IOException("Not a file");
+ if (!file.canRead()) throw new IOException("File not readable");
+ if (!file.canWrite()) throw new IOException("File not writable");
+ }
+
+ /** Sets this object's {@link AbstractMetaDataContainerFile#baseMetaData} using the set {@link AbstractMetaDataContainerFile#file} */
+ protected void loadMetaData() throws IOException
+ {
+ validateMetaDataFile(this.file);
+ this.baseMetaData = readMetaDataFromFile(this.file);
+ if (!this.baseMetaData.pos.equals(this.pos))
+ {
+ LOGGER.warn("The file is from a different location than expected! Expected: [" + this.pos + "] but got [" + this.baseMetaData.pos + "]. Ignoring file tag.");
+ this.baseMetaData.pos = this.pos;
+ }
+ }
+
+
+
//================//
// helper classes //
//================//
@FunctionalInterface
- public interface IMetaDataWriterFunc
- {
- void writeBufferToFile(T t) throws IOException;
-
- }
+ public interface IMetaDataWriterFunc { void writeBufferToFile(T t) throws IOException; }
}
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/metaData/BaseMetaData.java b/core/src/main/java/com/seibel/distanthorizons/core/file/metaData/BaseMetaData.java
index be595b5d2..2685c7771 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/file/metaData/BaseMetaData.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/file/metaData/BaseMetaData.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.file.metaData;
import com.seibel.distanthorizons.api.enums.worldGeneration.EDhApiWorldGenerationStep;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/renderfile/ILodRenderSourceProvider.java b/core/src/main/java/com/seibel/distanthorizons/core/file/renderfile/ILodRenderSourceProvider.java
index f2aa0a5a2..db6e5fb3c 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/file/renderfile/ILodRenderSourceProvider.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/file/renderfile/ILodRenderSourceProvider.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.file.renderfile;
import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.ChunkSizedFullDataAccessor;
@@ -16,14 +35,13 @@ import java.util.concurrent.CompletableFuture;
*/
public interface ILodRenderSourceProvider extends AutoCloseable
{
+ void addScannedFiles(Collection detectedFiles);
+
CompletableFuture readAsync(DhSectionPos pos);
- void addScannedFile(Collection detectedFiles);
+
void writeChunkDataToFile(DhSectionPos sectionPos, ChunkSizedFullDataAccessor chunkData);
CompletableFuture flushAndSaveAsync();
- /** Returns true if the data was refreshed, false otherwise */
- //boolean refreshRenderSource(ColumnRenderSource source);
-
/** Deletes any data stored in the render cache so it can be re-created */
void deleteRenderCache();
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/renderfile/RenderMetaDataFile.java b/core/src/main/java/com/seibel/distanthorizons/core/file/renderfile/RenderMetaDataFile.java
index f2ce48abf..d5e739570 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/file/renderfile/RenderMetaDataFile.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/file/renderfile/RenderMetaDataFile.java
@@ -1,6 +1,30 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.file.renderfile;
+import com.seibel.distanthorizons.core.config.Config;
import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.ChunkSizedFullDataAccessor;
+import com.seibel.distanthorizons.core.dataObjects.fullData.sources.interfaces.IFullDataSource;
+import com.seibel.distanthorizons.core.dataObjects.transformers.FullDataToRenderDataTransformer;
+import com.seibel.distanthorizons.core.file.fullDatafile.FullDataMetaFile;
+import com.seibel.distanthorizons.core.file.fullDatafile.IFullDataSourceProvider;
import com.seibel.distanthorizons.core.file.metaData.AbstractMetaDataContainerFile;
import com.seibel.distanthorizons.core.file.metaData.BaseMetaData;
import com.seibel.distanthorizons.core.level.IDhLevel;
@@ -14,7 +38,7 @@ import com.seibel.distanthorizons.core.level.IDhClientLevel;
import com.seibel.distanthorizons.core.render.renderer.IDebugRenderable;
import com.seibel.distanthorizons.core.util.AtomicsUtil;
import com.seibel.distanthorizons.core.util.LodUtil;
-import com.seibel.distanthorizons.core.util.objects.UncheckedInterruptedException;
+import com.seibel.distanthorizons.core.util.objects.Reference;
import com.seibel.distanthorizons.core.util.objects.dataStreams.DhDataInputStream;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.Nullable;
@@ -28,53 +52,30 @@ import java.util.Random;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicReference;
+/** Represents a File that contains a {@link ColumnRenderSource}. */
public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements IDebugRenderable
{
private static final Logger LOGGER = DhLoggerBuilder.getLogger();
+ public static final String FILE_SUFFIX = ".rlod";
+ public static final boolean ALWAYS_INVALIDATE_CACHE = false;
+ public static final long RENDER_SOURCE_TYPE_ID = ColumnRenderSource.TYPE_ID;
+
+
/**
* Can be cleared if the garbage collector determines there isn't enough space.
*
* When clearing, don't set to null, instead create a SoftReference containing null.
- * This will make null checks simpler.
+ * This makes null checks simpler.
*/
private SoftReference cachedRenderDataSource = new SoftReference<>(null);
private final AtomicReference> renderSourceLoadFutureRef = new AtomicReference<>(null);
- private final RenderSourceFileHandler fileHandler;
+ private final IDhClientLevel clientLevel;
+ private final IFullDataSourceProvider fullDataSourceProvider;
private boolean doesFileExist;
- private static final class CacheQueryResult
- {
- public final CompletableFuture future;
- public final boolean needsLoad;
- public CacheQueryResult(CompletableFuture future, boolean needsLoad)
- {
- this.future = future;
- this.needsLoad = needsLoad;
- }
-
- }
- @Override
- public void debugRender(DebugRenderer r)
- {
- ColumnRenderSource cached = cachedRenderDataSource.get();
- Color c = Color.black;
- if (cached != null)
- {
- c = Color.GREEN;
- }
- else if (renderSourceLoadFutureRef.get() != null)
- {
- c = Color.BLUE;
- }
- else if (doesFileExist)
- {
- c = Color.RED;
- }
- r.renderBox(new DebugRenderer.Box(pos, 64, 72, 0.05f, c));
- }
//=============//
// constructor //
@@ -84,211 +85,141 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements
* Can be used instead of {@link RenderMetaDataFile#createFromExistingFile} or {@link RenderMetaDataFile#createNewFileForPos},
* if we are uncertain whether a file exists or not.
*/
- public static RenderMetaDataFile createFromExistingOrNewFile(RenderSourceFileHandler fileHandler, DhSectionPos pos) throws IOException
+ public static RenderMetaDataFile createFromExistingOrNewFile(IDhClientLevel clientLevel, IFullDataSourceProvider fullDataSourceProvider, DhSectionPos pos, File file) throws IOException
{
- File file = fileHandler.computeRenderFilePath(pos);
if (file.exists())
{
- return createFromExistingFile(fileHandler, file);
+ return createFromExistingFile(fullDataSourceProvider, clientLevel, file);
}
else
{
- return createNewFileForPos(fileHandler, pos);
+ return createNewFileForPos(fullDataSourceProvider, clientLevel, pos, file);
}
}
/**
* NOTE: should only be used if there is NOT an existing file.
- *
* @throws IOException if a file already exists for this position
*/
- public static RenderMetaDataFile createNewFileForPos(RenderSourceFileHandler fileHandler, DhSectionPos pos) throws IOException
+ public static RenderMetaDataFile createNewFileForPos(IFullDataSourceProvider fullDataSourceProvider, IDhClientLevel clientLevel, DhSectionPos pos, File file) throws IOException { return new RenderMetaDataFile(fullDataSourceProvider, clientLevel, pos, file); }
+ private RenderMetaDataFile(IFullDataSourceProvider fullDataSourceProvider, IDhClientLevel clientLevel, DhSectionPos pos, File file) throws IOException
{
- return new RenderMetaDataFile(fileHandler, pos);
- }
- private RenderMetaDataFile(RenderSourceFileHandler fileHandler, DhSectionPos pos) throws IOException
- {
- super(fileHandler.computeRenderFilePath(pos), pos);
- this.fileHandler = fileHandler;
+ super(file, pos);
+ this.fullDataSourceProvider = fullDataSourceProvider;
+ this.clientLevel = clientLevel;
LodUtil.assertTrue(this.baseMetaData == null);
this.doesFileExist = this.file.exists();
DebugRenderer.register(this);
}
+
/**
* NOTE: should only be used if there IS an existing file.
- *
* @throws IOException if no file exists for this position
*/
- public static RenderMetaDataFile createFromExistingFile(RenderSourceFileHandler fileHandler, File path) throws IOException
+ public static RenderMetaDataFile createFromExistingFile(IFullDataSourceProvider fullDataSourceProvider, IDhClientLevel clientLevel, File file) throws IOException { return new RenderMetaDataFile(fullDataSourceProvider, clientLevel, file); }
+ private RenderMetaDataFile(IFullDataSourceProvider fullDataSourceProvider, IDhClientLevel clientLevel, File file) throws IOException
{
- return new RenderMetaDataFile(fileHandler, path);
- }
-
- private RenderMetaDataFile(RenderSourceFileHandler fileHandler, File path) throws IOException
- {
- super(path);
- this.fileHandler = fileHandler;
+ super(file);
+ this.fullDataSourceProvider = fullDataSourceProvider;
+ this.clientLevel = clientLevel;
LodUtil.assertTrue(this.baseMetaData != null);
-
this.doesFileExist = this.file.exists();
-
DebugRenderer.register(this);
}
- public void updateChunkIfSourceExists(ChunkSizedFullDataAccessor chunkDataView, IDhClientLevel level)
+
+
+ //=============//
+ // data update //
+ //=============//
+
+ public void updateChunkIfSourceExistsAsync(ChunkSizedFullDataAccessor chunkDataView)
{
DhLodPos chunkPos = chunkDataView.getLodPos();
LodUtil.assertTrue(this.pos.getSectionBBoxPos().overlapsExactly(chunkPos), "Chunk pos " + chunkPos + " doesn't overlap with section " + this.pos);
// update the render source if one exists
- CompletableFuture renderSourceLoadFuture = getCachedDataSourceAsync(false);
- if (renderSourceLoadFuture == null) return;
+ CompletableFuture renderSourceLoadFuture = this.getCachedDataSourceAsync(false);
+ if (renderSourceLoadFuture == null)
+ {
+ return;
+ }
- renderSourceLoadFuture.thenAccept((renderSource) -> {
- boolean worked = renderSource.fastWrite(chunkDataView, level);
+
+ renderSourceLoadFuture.thenAccept((renderSource) ->
+ {
+ boolean dataUpdated = renderSource.updateWithChunkData(chunkDataView, clientLevel);
- //if (pos.sectionDetailLevel == DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL+5) {
+ // add a debug renderer
float offset = new Random(System.nanoTime() ^ Thread.currentThread().getId()).nextFloat() * 16f;
- Color c = worked ? Color.blue : Color.red;
+ Color debugColor = dataUpdated ? Color.blue : Color.red;
DebugRenderer.makeParticle(
new DebugRenderer.BoxParticle(
- new DebugRenderer.Box(chunkDataView.getLodPos(), 32f, 64f + offset, 0.07f, c),
+ new DebugRenderer.Box(chunkDataView.getLodPos(), 32f, 64f + offset, 0.07f, debugColor),
2.0, 16f
)
);
- //}
});
}
- public CompletableFuture flushAndSaveAsync(ExecutorService renderCacheThread)
- {
- if (!this.file.exists())
- {
- return CompletableFuture.completedFuture(null); // No need to save if the file doesn't exist.
- }
- // FIXME: TODO: Change doTriggerUpdate to true. Currently is false cause a dead future making render handler hang,
- // and that render cache aren't actually used really yet due to missing versioning atm. So disabling for now.
- CompletableFuture source = getCachedDataSourceAsync(false);
- if (source == null)
- {
- return CompletableFuture.completedFuture(null); // If there is no cached data, there is no need to save.
- }
- return source.handle((columnRenderSource, ex) -> {
- if (ex != null && !LodUtil.isInterruptOrReject(ex))
- LOGGER.error("Failed to load render source for " + this.pos + " for flush and saving", ex);
- return null;
- }); // Otherwise, wait for the data to be read (which also flushes changes to the file).
- }
- private CacheQueryResult getOrStartCachedDataSourceAsync()
- {
- // use the existing future
- CompletableFuture renderSourceLoadFuture = getCachedDataSourceAsync(true);
- if (renderSourceLoadFuture == null)
- {
- // Make a new future, and CAS it, or return the existing future
- CompletableFuture newFuture = new CompletableFuture<>();
- CompletableFuture cas = AtomicsUtil.compareAndExchange(renderSourceLoadFutureRef, null, newFuture);
- if (cas == null)
- {
- return new CacheQueryResult(newFuture, true);
- }
- else
- {
- return new CacheQueryResult(cas, false);
- }
- }
- else
- {
- return new CacheQueryResult(renderSourceLoadFuture, false);
- }
- }
- @Nullable
- private CompletableFuture getCachedDataSourceAsync(boolean doTriggerUpdate)
+
+ //======================//
+ // render source getter //
+ //======================//
+
+ public CompletableFuture getOrLoadCachedDataSourceAsync(Executor fileReaderThreads)
{
- // use the existing future
- CompletableFuture renderSourceLoadFuture = renderSourceLoadFutureRef.get();
+ CompletableFuture renderSourceLoadFuture = this.getCachedDataSourceAsync(true);
if (renderSourceLoadFuture != null)
{
+ // return the in-process future
return renderSourceLoadFuture;
}
- // attempt to get the cached render source
- ColumnRenderSource cachedRenderDataSource = this.cachedRenderDataSource.get();
- if (cachedRenderDataSource == null)
- {
- return null;
- }
else
{
- if (!doTriggerUpdate) return CompletableFuture.completedFuture(cachedRenderDataSource);
+ // there is no cached data, we'll have to load it
- // Make a new future, and CAS it, or return the existing future
- CompletableFuture newFuture = new CompletableFuture<>();
- CompletableFuture cas = AtomicsUtil.compareAndExchange(renderSourceLoadFutureRef, null, newFuture);
- if (cas == null)
+ renderSourceLoadFuture = new CompletableFuture<>();
+ if (!this.renderSourceLoadFutureRef.compareAndSet(null, renderSourceLoadFuture))
{
- this.fileHandler.onReadRenderSourceLoadedFromCacheAsync(this, cachedRenderDataSource)
- // wait for the handler to finish before returning the renderSource
- .handle((voidObj, ex) -> {
- if (ex != null)
- {
- LOGGER.error("Error while updating render source from cache", ex);
- }
- newFuture.complete(cachedRenderDataSource);
- renderSourceLoadFutureRef.set(null);
- return null;
- });
- return newFuture;
+ // two threads attempted to start this job at the same time, only use the first future
+ renderSourceLoadFuture = this.renderSourceLoadFutureRef.get();
}
- else
- {
- return cas;
- }
- }
- }
-
- public CompletableFuture loadOrGetCachedDataSourceAsync(Executor fileReaderThreads, IDhLevel level)
- {
- CacheQueryResult getCachedFuture = this.getOrStartCachedDataSourceAsync();
- if (!getCachedFuture.needsLoad)
- {
- return getCachedFuture.future;
}
- CompletableFuture future = getCachedFuture.future;
- // load or create the render source
+
+
+ final CompletableFuture getSourceFuture = renderSourceLoadFuture;
if (!this.doesFileExist)
{
- // create a new Meta file
- this.fileHandler.onCreateRenderFileAsync(this)
- .thenApply((renderSource) ->
- {
- this.baseMetaData = this.makeMetaData(renderSource);
- return renderSource;
- })
- .thenCompose((renderSource) -> this.fileHandler.onRenderFileLoaded(renderSource, this))
- .whenComplete((renderSource, ex) ->
- {
- if (ex != null)
- {
- if (!LodUtil.isInterruptOrReject(ex))
- LOGGER.error("Uncaught error on creation {}: ", this.file, ex);
- cachedRenderDataSource = new SoftReference<>(null);
- renderSourceLoadFutureRef.set(null);
- future.complete(null);
- }
- else
- {
- cachedRenderDataSource = new SoftReference<>(renderSource);
- renderSourceLoadFutureRef.set(null);
- future.complete(renderSource);
- }
- });
+ // create a new Meta file and render source
+
+
+ // create an empty render source
+ byte dataDetailLevel = (byte) (this.pos.sectionDetailLevel - ColumnRenderSource.SECTION_SIZE_OFFSET);
+ int verticalSize = Config.Client.Advanced.Graphics.Quality.verticalQuality.get().calculateMaxVerticalData(dataDetailLevel);
+ ColumnRenderSource newColumnRenderSource = new ColumnRenderSource(this.pos, verticalSize, this.clientLevel.getMinY());
+
+ this.baseMetaData = new BaseMetaData(
+ newColumnRenderSource.getSectionPos(), -1, newColumnRenderSource.getDataDetail(),
+ newColumnRenderSource.worldGenStep, RENDER_SOURCE_TYPE_ID,
+ newColumnRenderSource.getRenderDataFormatVersion(), Long.MAX_VALUE);
+
+ this.updateRenderCacheAsync(newColumnRenderSource).whenComplete((voidObj, ex) ->
+ {
+ this.cachedRenderDataSource = new SoftReference<>(newColumnRenderSource);
+
+ this.renderSourceLoadFutureRef.set(null);
+ getSourceFuture.complete(newColumnRenderSource);
+ });
}
else
{
+ // load the existing Meta file and render source
+
CompletableFuture.supplyAsync(() ->
{
if (this.baseMetaData == null)
@@ -296,55 +227,51 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements
throw new IllegalStateException("Meta data not loaded!");
}
- // Load the file.
+ // Load the render source file.
ColumnRenderSource renderSource;
- try (FileInputStream fileInputStream = this.getFileInputStream();
- DhDataInputStream compressedStream = new DhDataInputStream(fileInputStream))
+ try (FileInputStream fileInputStream = this.getFileInputStream(); // throws IoException
+ DhDataInputStream compressedInputStream = new DhDataInputStream(fileInputStream))
{
- renderSource = ColumnRenderLoader.INSTANCE.loadRenderSource(this, compressedStream, level);
+ renderSource = ColumnRenderLoader.INSTANCE.loadRenderSource(this, compressedInputStream, this.clientLevel);
}
catch (IOException ex)
{
throw new CompletionException(ex);
}
+
return renderSource;
}, fileReaderThreads)
// TODO: Check for file version and only update if needed.
- .thenCompose((renderSource) -> this.fileHandler.onRenderFileLoaded(renderSource, this))
+ .thenCompose(renderSource -> this.updateRenderCacheAsync(renderSource))
.whenComplete((renderSource, ex) ->
{
if (ex != null)
{
if (!LodUtil.isInterruptOrReject(ex))
- LOGGER.error("Error loading file {}: ", this.file, ex);
- cachedRenderDataSource = new SoftReference<>(null);
- renderSourceLoadFutureRef.set(null);
- future.complete(null);
- }
- else
- {
- cachedRenderDataSource = new SoftReference<>(renderSource);
- renderSourceLoadFutureRef.set(null);
- future.complete(renderSource);
+ {
+ LOGGER.error("Error loading file "+this.file+": ", ex);
+ }
+
+ // set the render source to null to prevent instances where a corrupt or incomplete render source is returned
+ renderSource = null;
}
+
+ this.renderSourceLoadFutureRef.set(null);
+
+ this.cachedRenderDataSource = new SoftReference<>(renderSource);
+ getSourceFuture.complete(renderSource);
});
}
- return future;
+
+ return getSourceFuture;
}
-
- private BaseMetaData makeMetaData(ColumnRenderSource renderSource)
- {
- return new BaseMetaData(renderSource.getSectionPos(), -1,
- renderSource.getDataDetail(), renderSource.worldGenStep, RenderSourceFileHandler.RENDER_SOURCE_TYPE_ID, renderSource.getRenderDataFormatVersion(), Long.MAX_VALUE);
- }
-
private FileInputStream getFileInputStream() throws IOException
{
- FileInputStream fin = new FileInputStream(this.file);
+ FileInputStream inputStream = new FileInputStream(this.file);
int toSkip = METADATA_SIZE_IN_BYTES;
while (toSkip > 0)
{
- long skipped = fin.skip(toSkip);
+ long skipped = inputStream.skip(toSkip);
if (skipped == 0)
{
throw new IOException("Invalid file: Failed to skip metadata.");
@@ -358,21 +285,135 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements
}
else
{
- return fin;
+ return inputStream;
}
}
- public void save(ColumnRenderSource renderSource)
+
+
+ //===============//
+ // cache handler //
+ //===============//
+
+ // TODO
+ public CompletableFuture updateRenderCacheAsync(ColumnRenderSource renderSource)
+ {
+ DebugRenderer.BoxWithLife debugBox = new DebugRenderer.BoxWithLife(new DebugRenderer.Box(renderSource.sectionPos, 74f, 86f, 0.1f, Color.red), 1.0, 32f, Color.green.darker());
+
+
+ // Skip updating the cache if the data file is already up-to-date
+ FullDataMetaFile dataFile = this.fullDataSourceProvider.getFileIfExist(this.pos);
+ if (!ALWAYS_INVALIDATE_CACHE && dataFile != null && dataFile.baseMetaData != null && dataFile.baseMetaData.checksum == this.baseMetaData.dataVersion.get()) // TODO can we make it so the version comparisons either both use the checksum or the dataVersion? Comparing checksum and dataVersion is kinda confusing
+ {
+ LOGGER.debug("Skipping render cache update for " + this.pos);
+ renderSource.localVersion.incrementAndGet();
+ return CompletableFuture.completedFuture(renderSource);
+ }
+
+
+
+ final Reference renderDataVersionRef = new Reference<>(Integer.MAX_VALUE);
+
+ // get the full data source
+ CompletableFuture fullDataSourceFuture =
+ this.fullDataSourceProvider.readAsync(renderSource.getSectionPos())
+ .thenApply((fullDataSource) ->
+ {
+ debugBox.box.color = Color.yellow.darker();
+
+ // get the metaFile's version
+ FullDataMetaFile renderSourceMetaFile = this.fullDataSourceProvider.getFileIfExist(this.pos);
+ if (renderSourceMetaFile != null)
+ {
+ renderDataVersionRef.value = renderSourceMetaFile.baseMetaData.checksum;
+ }
+
+ return fullDataSource;
+ }).exceptionally((ex) ->
+ {
+ LOGGER.error("Exception when getting data for updateCache()", ex);
+ return null;
+ });
+
+
+
+ // convert the full data source into a render source
+ CompletableFuture transformFuture = FullDataToRenderDataTransformer.transformFullDataToRenderSourceAsync(fullDataSourceFuture, this.clientLevel)
+ .handle((newRenderSource, ex) ->
+ {
+ if (ex == null)
+ {
+ try
+ {
+ if (newRenderSource != null)
+ {
+ renderSource.updateFromRenderSource(newRenderSource);
+ }
+
+ // update the meta data
+ this.baseMetaData.dataVersion.set(renderDataVersionRef.value);
+ this.baseMetaData.dataLevel = renderSource.getDataDetail();
+ this.baseMetaData.dataTypeId = RENDER_SOURCE_TYPE_ID;
+ this.baseMetaData.binaryDataFormatVersion = renderSource.getRenderDataFormatVersion();
+
+ // save to file
+ this.save(renderSource);
+ }
+ catch (Throwable e)
+ {
+ LOGGER.error("Exception when writing render data to file: "+this.file, e);
+ }
+ }
+ else if (!LodUtil.isInterruptOrReject(ex))
+ {
+ LOGGER.error("Exception when updating render file using data source: ", ex);
+ }
+
+ debugBox.close();
+ return renderSource;
+ });
+ return transformFuture;
+ }
+
+
+
+ //===============//
+ // file handling //
+ //===============//
+
+ public CompletableFuture flushAndSaveAsync()
+ {
+ if (!this.file.exists())
+ {
+ return CompletableFuture.completedFuture(null); // No need to save if the file doesn't exist.
+ }
+
+ // FIXME: TODO: Change updateRenderSource to true. Currently is false cause a dead future making render handler hang,
+ // and that render cache aren't actually used really yet due to missing versioning atm. So disabling for now.
+ CompletableFuture getSourceFuture = this.getCachedDataSourceAsync(false);
+ if (getSourceFuture == null)
+ {
+ return CompletableFuture.completedFuture(null); // If there is no cached data, there is no need to save.
+ }
+
+ // Wait for the data to be read, which also flushes changes to the file.
+ return getSourceFuture.thenAccept((columnRenderSource) -> { /* discard the render source, it doesn't need to be returned */ });
+ }
+
+ /** writes the given {@link ColumnRenderSource} to file */
+ private void save(ColumnRenderSource renderSource)
{
if (renderSource.isEmpty())
{
if (this.file.exists())
{
+ // attempt to remove the empty render source
if (!this.file.delete())
{
- LOGGER.warn("Failed to delete render file at {}", this.file);
+ LOGGER.warn("Failed to delete render file at " + this.file);
}
}
+
this.doesFileExist = false;
}
else
@@ -380,7 +421,7 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements
//LOGGER.info("Saving updated render file v[{}] at sect {}", this.metaData.dataVersion.get(), this.pos);
try
{
- super.writeData((out) -> renderSource.writeData(out));
+ super.writeData((dhDataOutputStream) -> renderSource.writeData(dhDataOutputStream));
this.doesFileExist = true;
}
catch (IOException e)
@@ -390,4 +431,94 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements
}
}
+
+
+ //=======//
+ // debug //
+ //=======//
+
+ @Override
+ public void debugRender(DebugRenderer debugRenderer)
+ {
+ Color color = Color.black;
+
+ ColumnRenderSource cached = this.cachedRenderDataSource.get();
+ if (cached != null)
+ {
+ color = Color.GREEN;
+ }
+ else if (this.renderSourceLoadFutureRef.get() != null)
+ {
+ color = Color.BLUE;
+ }
+ else if (this.doesFileExist)
+ {
+ color = Color.RED;
+ }
+
+ debugRenderer.renderBox(new DebugRenderer.Box(this.pos, 64, 72, 0.05f, color));
+ }
+
+
+
+ //================//
+ // helper methods //
+ //================//
+
+ /** @return returns null if {@link RenderMetaDataFile#renderSourceLoadFutureRef} is empty and no cached {@link ColumnRenderSource} exists. */
+ @Nullable
+ private CompletableFuture getCachedDataSourceAsync(boolean updateRenderSourceCache)
+ {
+ // check if another thread is already loading the data source
+ CompletableFuture renderSourceLoadFuture = this.renderSourceLoadFutureRef.get();
+ if (renderSourceLoadFuture != null)
+ {
+ return renderSourceLoadFuture;
+ }
+
+
+ // attempt to get the cached render source
+ ColumnRenderSource cachedRenderDataSource = this.cachedRenderDataSource.get();
+ if (cachedRenderDataSource == null)
+ {
+ // no cached data exists and no one is trying to load it
+ return null;
+ }
+ else
+ {
+ // cached data exists
+
+ if (!updateRenderSourceCache)
+ {
+ // just return the render source
+ return CompletableFuture.completedFuture(cachedRenderDataSource);
+ }
+
+ // update the render cache, wait for the update to finish, then return the render source
+
+ // Create a new future if one doesn't already exist
+ CompletableFuture newFuture = new CompletableFuture<>();
+ CompletableFuture oldFuture = AtomicsUtil.compareAndExchange(this.renderSourceLoadFutureRef, null, newFuture);
+
+ if (oldFuture != null)
+ {
+ // An update is already in progress, return its future.
+ return oldFuture;
+ }
+ else
+ {
+ this.updateRenderCacheAsync(cachedRenderDataSource)
+ // wait for the handler to finish before returning the renderSource
+ .handle((ignoredRenderSource, ex) ->
+ {
+ newFuture.complete(cachedRenderDataSource);
+ this.renderSourceLoadFutureRef.set(null);
+
+ return null;
+ });
+ return newFuture;
+ }
+ }
+ }
+
}
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/renderfile/RenderSourceFileHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/file/renderfile/RenderSourceFileHandler.java
index 95db143bc..40cb1eae8 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/file/renderfile/RenderSourceFileHandler.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/file/renderfile/RenderSourceFileHandler.java
@@ -1,66 +1,65 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.file.renderfile;
-import com.google.common.collect.HashMultimap;
import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.ChunkSizedFullDataAccessor;
-import com.seibel.distanthorizons.core.dataObjects.fullData.sources.interfaces.IFullDataSource;
-import com.seibel.distanthorizons.core.file.fullDatafile.FullDataMetaFile;
import com.seibel.distanthorizons.core.file.structure.AbstractSaveStructure;
-import com.seibel.distanthorizons.core.level.ClientLevelModule;
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
import com.seibel.distanthorizons.core.logging.f3.F3Screen;
import com.seibel.distanthorizons.core.pos.DhLodPos;
import com.seibel.distanthorizons.core.pos.DhSectionPos;
import com.seibel.distanthorizons.core.dataObjects.render.ColumnRenderSource;
-import com.seibel.distanthorizons.core.dataObjects.transformers.DataRenderTransformer;
import com.seibel.distanthorizons.core.file.fullDatafile.IFullDataSourceProvider;
import com.seibel.distanthorizons.core.level.IDhClientLevel;
-import com.seibel.distanthorizons.core.render.renderer.DebugRenderer;
-import com.seibel.distanthorizons.core.util.FileScanUtil;
+import com.seibel.distanthorizons.core.util.MetaFileScanUtil;
import com.seibel.distanthorizons.core.util.FileUtil;
-import com.seibel.distanthorizons.core.util.LodUtil;
import com.seibel.distanthorizons.core.util.ThreadUtil;
-import com.seibel.distanthorizons.core.util.objects.Reference;
-import com.seibel.distanthorizons.core.util.objects.UncheckedInterruptedException;
-import com.seibel.distanthorizons.core.config.Config;
+import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper;
import org.apache.logging.log4j.Logger;
-import org.jetbrains.annotations.Nullable;
-import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
-import static com.seibel.distanthorizons.core.util.FileScanUtil.RENDER_FILE_POSTFIX;
-
public class RenderSourceFileHandler implements ILodRenderSourceProvider
{
public static final boolean USE_LAZY_LOADING = true;
- public static final boolean ALWAYS_INVALIDATE_CACHE = false;
-
- public static final long RENDER_SOURCE_TYPE_ID = ColumnRenderSource.TYPE_ID;
private static final Logger LOGGER = DhLoggerBuilder.getLogger();
private final ThreadPoolExecutor fileHandlerThreadPool;
private final F3Screen.NestedMessage threadPoolMsg;
- private final ConcurrentHashMap unloadedFiles = new ConcurrentHashMap<>();
- private final ConcurrentHashMap filesBySectionPos = new ConcurrentHashMap<>();
+ private final ConcurrentHashMap unloadedFileBySectionPos = new ConcurrentHashMap<>();
+ /** contains the loaded {@link RenderMetaDataFile}'s */
+ private final ConcurrentHashMap metaFileBySectionPos = new ConcurrentHashMap<>();
- private final IDhClientLevel level;
+ private final IDhClientLevel clientLevel;
private final File saveDir;
/** This is the lowest (highest numeric) detail level that this {@link RenderSourceFileHandler} is keeping track of. */
- AtomicInteger topDetailLevel = new AtomicInteger(DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL);
+ AtomicInteger topDetailLevelRef = new AtomicInteger(DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL);
private final IFullDataSourceProvider fullDataSourceProvider;
- enum TaskType
- {
- Read, UpdateReadData, Update, OnLoaded,
- }
-
- private final WeakHashMap, TaskType> taskTracker = new WeakHashMap<>();
+ private final WeakHashMap, ETaskType> taskTracker = new WeakHashMap<>();
@@ -68,43 +67,258 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider
// constructor //
//=============//
- public RenderSourceFileHandler(IFullDataSourceProvider sourceProvider, IDhClientLevel level, AbstractSaveStructure saveStructure)
+ public RenderSourceFileHandler(IFullDataSourceProvider sourceProvider, IDhClientLevel clientLevel, AbstractSaveStructure saveStructure)
{
this.fullDataSourceProvider = sourceProvider;
- this.level = level;
- this.saveDir = saveStructure.getRenderCacheFolder(level.getLevelWrapper());
+ this.clientLevel = clientLevel;
+ this.saveDir = saveStructure.getRenderCacheFolder(clientLevel.getLevelWrapper());
if (!this.saveDir.exists() && !this.saveDir.mkdirs())
{
LOGGER.warn("Unable to create render data folder, file saving may fail.");
}
- this.fileHandlerThreadPool = ThreadUtil.makeSingleThreadPool("Render Source File Handler [" + this.level.getLevelWrapper().getDimensionType().getDimensionName() + "]");
+ this.fileHandlerThreadPool = ThreadUtil.makeSingleThreadPool("Render Source File Handler [" + this.clientLevel.getLevelWrapper().getDimensionType().getDimensionName() + "]");
this.threadPoolMsg = new F3Screen.NestedMessage(this::f3Log);
- FileScanUtil.scanFiles(saveStructure, level.getLevelWrapper(), null, this);
+ MetaFileScanUtil.scanRenderFiles(saveStructure, clientLevel.getLevelWrapper(), this);
}
+ /**
+ * Caller must ensure that this method is called only once,
+ * and that the given files are not used before this method is called.
+ *
+ * Used by {@link MetaFileScanUtil#scanRenderFiles(AbstractSaveStructure, ILevelWrapper, ILodRenderSourceProvider)}
+ */
+ @Override
+ public void addScannedFiles(Collection detectedFiles)
+ {
+ MetaFileScanUtil.ICreateMetadataFunc createMetadataFunc = (file) -> RenderMetaDataFile.createFromExistingFile(this.fullDataSourceProvider, this.clientLevel, file);
+
+ MetaFileScanUtil.IAddUnloadedFileFunc addUnloadedFileFunc = (pos, file) ->
+ {
+ this.unloadedFileBySectionPos.put(pos, file);
+ this.topDetailLevelRef.updateAndGet(oldDetailLevel -> Math.max(oldDetailLevel, pos.sectionDetailLevel));
+ };
+ MetaFileScanUtil.IAddLoadedMetaFileFunc addLoadedMetaFileFunc = (pos, loadedMetaFile) ->
+ {
+ this.topDetailLevelRef.updateAndGet(oldDetailLevel -> Math.max(oldDetailLevel, pos.sectionDetailLevel));
+ this.metaFileBySectionPos.put(pos, (RenderMetaDataFile) loadedMetaFile);
+ };
+
+
+ MetaFileScanUtil.addScannedFiles(detectedFiles, USE_LAZY_LOADING, RenderMetaDataFile.FILE_SUFFIX,
+ createMetadataFunc,
+ addUnloadedFileFunc, addLoadedMetaFileFunc);
+ }
+
+
+
+ //===============//
+ // file handling //
+ //===============//
+
+ /** This call is thread safe and can be called concurrently from multiple threads. */
+ @Override
+ public CompletableFuture readAsync(DhSectionPos pos)
+ {
+ // don't continue if the handler has been shut down
+ if (this.fileHandlerThreadPool.isTerminated())
+ {
+ return CompletableFuture.completedFuture(null);
+ }
+
+
+
+ RenderMetaDataFile metaFile = this.getLoadOrMakeFile(pos);
+ if (metaFile == null)
+ {
+ return CompletableFuture.completedFuture(ColumnRenderSource.createEmptyRenderSource(pos));
+ }
+
+ CompletableFuture getDataSourceFuture = metaFile.getOrLoadCachedDataSourceAsync(this.fileHandlerThreadPool)
+ .handle((renderSource, exception) ->
+ {
+ if (exception != null)
+ {
+ LOGGER.error("Uncaught error in readAsync for pos: " + pos + ". Error:", exception);
+ }
+
+ return (renderSource != null) ? renderSource : ColumnRenderSource.createEmptyRenderSource(pos);
+ });
+
+ synchronized (this.taskTracker)
+ {
+ this.taskTracker.put(getDataSourceFuture, ETaskType.READ);
+ }
+ return getDataSourceFuture;
+ }
+ /** @return null if there was an issue */
+ private RenderMetaDataFile getLoadOrMakeFile(DhSectionPos pos)
+ {
+ RenderMetaDataFile metaFile = this.metaFileBySectionPos.get(pos);
+ if (metaFile != null)
+ {
+ // return the loaded file
+ return metaFile;
+ }
+
+
+ // we don't have a loaded file, for that pos,
+ // do we have an unloaded file for that pos?
+ File fileToLoad = this.unloadedFileBySectionPos.get(pos);
+ if (fileToLoad != null && !fileToLoad.exists())
+ {
+ fileToLoad = null;
+ this.unloadedFileBySectionPos.remove(pos);
+ }
+
+
+ if (fileToLoad != null)
+ {
+ // A file exists, but isn't loaded yet.
+
+ // Double check locking for loading file, as loading file means also loading the metadata, which
+ // while not... Very expensive, is still better to avoid multiple threads doing it, and dumping the
+ // duplicated work to the trash. Therefore, eating the overhead of 'synchronized' is worth it.
+ synchronized (this)
+ {
+ // check if another thread already finished loading this file
+ metaFile = this.metaFileBySectionPos.get(pos);
+ if (metaFile != null)
+ {
+ return metaFile;
+ }
+
+
+ // attempt to load the file
+ try
+ {
+ metaFile = RenderMetaDataFile.createFromExistingFile(this.fullDataSourceProvider, this.clientLevel, fileToLoad);
+ this.topDetailLevelRef.updateAndGet(currentTopDetailLevel -> Math.max(currentTopDetailLevel, pos.sectionDetailLevel));
+ this.metaFileBySectionPos.put(pos, metaFile);
+ return metaFile;
+ }
+ catch (IOException e)
+ {
+ LOGGER.error("Failed to read render meta file at " + fileToLoad + ": ", e);
+ FileUtil.renameCorruptedFile(fileToLoad);
+ }
+ finally
+ {
+ this.unloadedFileBySectionPos.remove(pos);
+ }
+ }
+ }
+
+
+ // Either no file exists for this position
+ // or the existing file was corrupted.
+ // Create a new file.
+ try
+ {
+ // createFromExistingOrNewFile() is used instead of createFromExistingFile()
+ // due to a rare issue where the file may already exist but isn't in the file list
+ metaFile = RenderMetaDataFile.createFromExistingOrNewFile(this.clientLevel, this.fullDataSourceProvider, pos, this.computeRenderFilePath(pos));
+
+ this.topDetailLevelRef.updateAndGet(newDetailLevel -> Math.max(newDetailLevel, pos.sectionDetailLevel));
+
+ // Compare And Swap to handle a concurrency issue where multiple threads created the same Meta File at the same time
+ RenderMetaDataFile metaFileCas = this.metaFileBySectionPos.putIfAbsent(pos, metaFile);
+ return (metaFileCas == null) ? metaFile : metaFileCas;
+ }
+ catch (IOException e)
+ {
+ LOGGER.error("IOException on creating new data file at "+pos, e);
+ return null;
+ }
+ }
+
+
+
+ //=============//
+ // data saving //
+ //=============//
+
+ /**
+ * This call is thread safe and can be called concurrently from multiple threads.
+ * This allows fast writes of new data to the render source, without having to wait for the data to be written to disk.
+ */
+ @Override
+ public void writeChunkDataToFile(DhSectionPos sectionPos, ChunkSizedFullDataAccessor chunkDataView)
+ {
+ // convert to the lowest detail level so all detail levels are updated
+ this.writeChunkDataToFileRecursively(chunkDataView, DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL);
+ this.fullDataSourceProvider.writeChunkDataToFile(sectionPos, chunkDataView);
+ }
+ private void writeChunkDataToFileRecursively(ChunkSizedFullDataAccessor chunk, byte sectionDetailLevel)
+ {
+ DhLodPos boundingPos = chunk.getLodPos();
+ DhLodPos minSectionPos = boundingPos.convertToDetailLevel(sectionDetailLevel);
+
+ int width = (sectionDetailLevel > boundingPos.detailLevel) ? 1 : boundingPos.getWidthAtDetail(sectionDetailLevel);
+ for (int xOffset = 0; xOffset < width; xOffset++)
+ {
+ for (int zOffset = 0; zOffset < width; zOffset++)
+ {
+ DhSectionPos sectionPos = new DhSectionPos(sectionDetailLevel, minSectionPos.x + xOffset, minSectionPos.z + zOffset);
+ RenderMetaDataFile metaFile = this.metaFileBySectionPos.get(sectionPos); // bypass the getLoadOrMakeFile() since we only want cached files.
+ if (metaFile != null)
+ {
+ metaFile.updateChunkIfSourceExistsAsync(chunk);
+ }
+ }
+ }
+
+ if (sectionDetailLevel < this.topDetailLevelRef.get())
+ {
+ this.writeChunkDataToFileRecursively(chunk, (byte) (sectionDetailLevel + 1));
+ }
+ }
+
+
+ /** This call is thread safe and can be called concurrently from multiple threads. */
+ @Override
+ public CompletableFuture flushAndSaveAsync()
+ {
+ LOGGER.info("Shutting down " + RenderSourceFileHandler.class.getSimpleName() + "...");
+
+ ArrayList> futures = new ArrayList<>();
+ for (RenderMetaDataFile metaFile : this.metaFileBySectionPos.values())
+ {
+ futures.add(metaFile.flushAndSaveAsync());
+ }
+
+ return CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]))
+ .whenComplete((voidObj, exception) -> LOGGER.info("Finished saving " + RenderSourceFileHandler.class.getSimpleName()));
+ }
+
+
+
+ //=========//
+ // F3 menu //
+ //=========//
+
/** Returns what should be displayed in Minecraft's F3 debug menu */
private String[] f3Log()
{
ArrayList lines = new ArrayList<>();
- lines.add("Render Source File Handler [" + this.level.getClientLevelWrapper().getDimensionType().getDimensionName() + "]");
- lines.add(" Loaded files: " + this.filesBySectionPos.size() + " / " + (this.unloadedFiles.size() + this.filesBySectionPos.size()));
- lines.add(" Thread pool tasks: " + fileHandlerThreadPool.getQueue().size() + " (completed: " + fileHandlerThreadPool.getCompletedTaskCount() + ")");
+ lines.add("Render Source File Handler [" + this.clientLevel.getClientLevelWrapper().getDimensionType().getDimensionName() + "]");
+ lines.add(" Loaded files: " + this.metaFileBySectionPos.size() + " / " + (this.unloadedFileBySectionPos.size() + this.metaFileBySectionPos.size()));
+ lines.add(" Thread pool tasks: " + this.fileHandlerThreadPool.getQueue().size() + " (completed: " + this.fileHandlerThreadPool.getCompletedTaskCount() + ")");
- int totalFutures = taskTracker.size();
- EnumMap tasksOutstanding = new EnumMap<>(TaskType.class);
- EnumMap tasksCompleted = new EnumMap<>(TaskType.class);
- for (TaskType type : TaskType.values())
+ int totalFutures = this.taskTracker.size();
+ EnumMap tasksOutstanding = new EnumMap<>(ETaskType.class);
+ EnumMap tasksCompleted = new EnumMap<>(ETaskType.class);
+ for (ETaskType type : ETaskType.values())
{
tasksOutstanding.put(type, 0);
tasksCompleted.put(type, 0);
}
- synchronized (taskTracker)
+ synchronized (this.taskTracker)
{
- for (Map.Entry, TaskType> entry : taskTracker.entrySet())
+ for (Map.Entry, ETaskType> entry : this.taskTracker.entrySet())
{
if (entry.getKey().isDone())
{
@@ -118,7 +332,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider
}
int totalOutstanding = tasksOutstanding.values().stream().mapToInt(Integer::intValue).sum();
lines.add(" Futures: " + totalFutures + " (outstanding: " + totalOutstanding + ")");
- for (TaskType type : TaskType.values())
+ for (ETaskType type : ETaskType.values())
{
lines.add(" " + type + ": " + tasksOutstanding.get(type) + " / " + (tasksOutstanding.get(type) + tasksCompleted.get(type)));
}
@@ -126,498 +340,19 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider
}
- //===============//
- // file handling //
- //===============//
-
- /**
- * Caller must ensure that this method is called only once,
- * and that the given files are not used before this method is called.
- */
- @Override
- public void addScannedFile(Collection detectedFiles)
- {
- if (USE_LAZY_LOADING)
- {
- this.lazyAddScannedFile(detectedFiles);
- }
- else
- {
- this.immediateAddScannedFile(detectedFiles);
- }
- }
-
- private void lazyAddScannedFile(Collection detectedFiles)
- {
- for (File file : detectedFiles)
- {
- if (file == null || !file.exists())
- {
- // can rarely happen if the user rapidly travels between dimensions
- LOGGER.warn("Null or non-existent render file: " + ((file != null) ? file.getPath() : "NULL"));
- continue;
- }
-
-
- try
- {
- DhSectionPos pos = this.decodePositionByFile(file);
- if (pos != null)
- {
- this.unloadedFiles.put(pos, file);
- this.topDetailLevel.updateAndGet(v -> Math.max(v, pos.sectionDetailLevel));
- }
- }
- catch (Exception e)
- {
- LOGGER.error("Failed to read data meta file at " + file + ": ", e);
- FileUtil.renameCorruptedFile(file);
- }
- }
- }
-
- private void immediateAddScannedFile(Collection newRenderFiles)
- {
- HashMultimap filesByPos = HashMultimap.create();
-
- // Sort files by pos.
- for (File file : newRenderFiles)
- {
- try
- {
- RenderMetaDataFile metaFile = RenderMetaDataFile.createFromExistingFile(this, file);
- filesByPos.put(metaFile.pos, metaFile);
- }
- catch (IOException e)
- {
- LOGGER.error("Failed to read render meta file at [" + file + "]. Error: ", e);
- FileUtil.renameCorruptedFile(file);
- }
- }
-
- // Warn for multiple files with the same pos, and then select the one with the latest timestamp.
- for (DhSectionPos pos : filesByPos.keySet())
- {
- Collection metaFiles = filesByPos.get(pos);
- RenderMetaDataFile fileToUse;
- if (metaFiles.size() > 1)
- {
- //fileToUse = metaFiles.stream().findFirst().orElse(null); // use the first file in the list
-
- // use the file's last modified date
- fileToUse = Collections.max(metaFiles, Comparator.comparingLong(renderMetaDataFile ->
- renderMetaDataFile.file.lastModified()));
-
-// fileToUse = Collections.max(metaFiles, Comparator.comparingLong(renderMetaDataFile ->
-// renderMetaDataFile.metaData.dataVersion.get()));
- {
- StringBuilder sb = new StringBuilder();
- sb.append("Multiple files with the same pos: ");
- sb.append(pos);
- sb.append("\n");
- for (RenderMetaDataFile metaFile : metaFiles)
- {
- sb.append("\t");
- sb.append(metaFile.file);
- sb.append("\n");
- }
- sb.append("\tUsing: ");
- sb.append(fileToUse.file);
- sb.append("\n");
- sb.append("(Other files will be renamed by appending \".old\" to their name.)");
- LOGGER.warn(sb.toString());
-
- // Rename all other files with the same pos to .old
- for (RenderMetaDataFile metaFile : metaFiles)
- {
- if (metaFile == fileToUse)
- {
- continue;
- }
-
- File oldFile = new File(metaFile.file + ".old");
- try
- {
- if (!metaFile.file.renameTo(oldFile))
- throw new RuntimeException("Renaming failed");
- }
- catch (Exception e)
- {
- LOGGER.error("Failed to rename file: [" + metaFile.file + "] to [" + oldFile + "]", e);
- }
- }
- }
- }
- else
- {
- fileToUse = metaFiles.iterator().next();
- }
- // Add this file to the list of files.
- this.filesBySectionPos.put(pos, fileToUse);
- // increase the lowest detail level if a new lower detail file is found
- this.topDetailLevel.updateAndGet(v -> Math.max(v, pos.sectionDetailLevel));
- }
- }
-
- protected RenderMetaDataFile getLoadOrMakeFile(DhSectionPos pos, boolean allowCreateFile)
- {
- RenderMetaDataFile metaFile = this.filesBySectionPos.get(pos);
- if (metaFile != null)
- {
- return metaFile;
- }
-
-
- File fileToLoad = this.unloadedFiles.get(pos);
- if (fileToLoad != null && !fileToLoad.exists())
- {
- fileToLoad = null;
- this.unloadedFiles.remove(pos);
- }
-
- // File does exist, but not loaded yet.
- if (fileToLoad != null)
- {
- synchronized (this)
- {
- // Double check locking for loading file, as loading file means also loading the metadata, which
- // while not... Very expensive, is still better to avoid multiple threads doing it, and dumping the
- // duplicated work to the trash. Therefore, eating the overhead of 'synchronized' is worth it.
- metaFile = this.filesBySectionPos.get(pos);
- if (metaFile != null)
- {
- return metaFile; // someone else loaded it already.
- }
-
- try
- {
- metaFile = RenderMetaDataFile.createFromExistingFile(this, fileToLoad);
- this.topDetailLevel.updateAndGet(newDetailLevel -> Math.max(newDetailLevel, pos.sectionDetailLevel));
- this.filesBySectionPos.put(pos, metaFile);
- return metaFile;
- }
- catch (IOException e)
- {
- LOGGER.error("Failed to read render meta file at " + fileToLoad + ": ", e);
- FileUtil.renameCorruptedFile(fileToLoad);
- }
- finally
- {
- this.unloadedFiles.remove(pos);
- }
- }
- }
-
-
- if (!allowCreateFile)
- {
- return null;
- }
-
- // File probably doesn't exist, try creating it.
- try
- {
- // createFromExistingOrNewFile is due to a rare issue where the file may already exist but isn't in the file list
- metaFile = RenderMetaDataFile.createFromExistingOrNewFile(this, pos);
- }
- catch (IOException e)
- {
- LOGGER.error("IOException on creating new data file at {}", pos, e);
- return null;
- }
-
- this.topDetailLevel.updateAndGet(newDetailLevel -> Math.max(newDetailLevel, pos.sectionDetailLevel));
- // This is a CAS with expected null value.
- RenderMetaDataFile metaFileCas = this.filesBySectionPos.putIfAbsent(pos, metaFile);
- return metaFileCas == null ? metaFile : metaFileCas;
- }
-
- /** This call is concurrent. I.e. it supports multiple threads calling this method at the same time. */
- @Override
- public CompletableFuture readAsync(DhSectionPos pos)
- {
- // don't continue if the handler has been shut down
- if (this.fileHandlerThreadPool.isTerminated())
- {
- return CompletableFuture.completedFuture(null);
- }
-
- RenderMetaDataFile metaFile = this.getLoadOrMakeFile(pos, true);
-
- // On error, (when it returns null,) return an empty render source
- if (metaFile == null)
- {
- return CompletableFuture.completedFuture(ColumnRenderSource.createEmptyRenderSource(pos));
- }
-
- CompletableFuture future = metaFile.loadOrGetCachedDataSourceAsync(this.fileHandlerThreadPool, this.level).handle(
- (renderSource, exception) ->
- {
- if (exception != null)
- {
- LOGGER.error("Uncaught error on " + pos + ":", exception);
- }
-
- return (renderSource != null) ? renderSource : ColumnRenderSource.createEmptyRenderSource(pos);
- });
-
- synchronized (this.taskTracker)
- {
- this.taskTracker.put(future, TaskType.Read);
- }
- return future;
- }
-
- public CompletableFuture onCreateRenderFileAsync(RenderMetaDataFile file)
- {
- final int verticalSize = Config.Client.Advanced.Graphics.Quality.verticalQuality.get()
- .calculateMaxVerticalData((byte) (file.pos.sectionDetailLevel - ColumnRenderSource.SECTION_SIZE_OFFSET));
-
- return CompletableFuture.completedFuture(
- new ColumnRenderSource(file.pos, verticalSize, this.level.getMinY()));
- }
-
-
-
- //=============//
- // data saving //
- //=============//
-
- /**
- * This call is concurrent. I.e. it supports multiple threads calling this method at the same time.
- * This allows fast writes of new data to the render source, without having to wait for the data to be written to disk.
- */
- @Override
- public void writeChunkDataToFile(DhSectionPos sectionPos, ChunkSizedFullDataAccessor chunkDataView)
- {
- // convert to the lowest detail level so all detail levels are updated
- this.fastWriteDataToSourceRecursively(chunkDataView, DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL);
- this.fullDataSourceProvider.write(sectionPos, chunkDataView);
- }
-
- private void fastWriteDataToSourceRecursively(ChunkSizedFullDataAccessor chunk, byte sectionDetailLevel)
- {
- DhLodPos boundingPos = chunk.getLodPos();
- DhLodPos sectPosMin = boundingPos.convertToDetailLevel(sectionDetailLevel);
- int width = sectionDetailLevel > boundingPos.detailLevel ? 1 : boundingPos.getWidthAtDetail(sectionDetailLevel);
- for (int ox = 0; ox < width; ox++)
- {
- for (int oz = 0; oz < width; oz++)
- {
- DhSectionPos sectPos = new DhSectionPos(sectionDetailLevel, sectPosMin.x + ox, sectPosMin.z + oz);
- RenderMetaDataFile metaFile = this.filesBySectionPos.get(sectPos); // bypass the getLoadOrMakeFile(), as we only want in-cache files.
- if (metaFile != null)
- {
- metaFile.updateChunkIfSourceExists(chunk, this.level);
- }
- }
- }
- if (sectionDetailLevel < topDetailLevel.get())
- {
- fastWriteDataToSourceRecursively(chunk, (byte) (sectionDetailLevel + 1));
- }
- }
-
-
- /** This call is concurrent. I.e. it supports multiple threads calling this method at the same time. */
- @Override
- public CompletableFuture flushAndSaveAsync()
- {
- LOGGER.info("Shutting down " + RenderSourceFileHandler.class.getSimpleName() + "...");
-
- ArrayList> futures = new ArrayList<>();
- for (RenderMetaDataFile metaFile : this.filesBySectionPos.values())
- {
- futures.add(metaFile.flushAndSaveAsync(this.fileHandlerThreadPool));
- }
-
- return CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]))
- .whenComplete((voidObj, exception) -> LOGGER.info("Finished shutting down " + RenderSourceFileHandler.class.getSimpleName()));
- }
-
-
-
- //================//
- // cache updating //
- //================//
-
- private CompletableFuture updateCacheAsync(ColumnRenderSource renderSource, RenderMetaDataFile file)
- {
- DebugRenderer.BoxWithLife box = new DebugRenderer.BoxWithLife(new DebugRenderer.Box(renderSource.sectionPos, 74f, 86f, 0.1f, Color.red), 1.0, 32f, Color.green.darker());
-
- // Skip updating the cache if the data file is already up-to-date
- FullDataMetaFile dataFile = this.fullDataSourceProvider.getFileIfExist(file.pos);
- if (!ALWAYS_INVALIDATE_CACHE && dataFile != null && dataFile.baseMetaData != null && dataFile.baseMetaData.checksum == file.baseMetaData.dataVersion.get()) {
- LOGGER.debug("Skipping render cache update for {}", file.pos);
- renderSource.localVersion.incrementAndGet();
- return CompletableFuture.completedFuture(null);
- }
-
- // get the full data source loading future
- final Reference targetChecksumVersion = new Reference<>(Long.MAX_VALUE);
- CompletableFuture fullDataSourceFuture =
- this.fullDataSourceProvider.read(renderSource.getSectionPos())
- .thenApply((fullDataSource) -> {
- // the fullDataSource can be null if the thread this was running on was interrupted
- box.box.color = Color.yellow.darker();
- FullDataMetaFile file2 = this.fullDataSourceProvider.getFileIfExist(file.pos);
- targetChecksumVersion.value = file2 == null ? Long.MAX_VALUE : file2.baseMetaData.checksum;
- return fullDataSource;
- }).exceptionally((ex) ->
- {
- LOGGER.error("Exception when getting data for updateCache()", ex);
- return null;
- });
-
- synchronized (taskTracker)
- {
- taskTracker.put(fullDataSourceFuture, TaskType.UpdateReadData);
- }
-
- // convert the full data source into a render source
- //LOGGER.info("Recreating cache for {}", data.getSectionPos());
- CompletableFuture transformFuture = DataRenderTransformer.transformDataSourceAsync(fullDataSourceFuture, this.level)
- .handle((newRenderSource, ex) ->
- {
- if (ex == null)
- {
- try
- {
- file.baseMetaData.dataVersion.set(targetChecksumVersion.value);
- this.writeRenderSourceToFile(renderSource, file, newRenderSource);
- }
- catch (Throwable e)
- {
- LOGGER.error("Exception when writing render data to file: ", e);
- }
- }
- else if (!LodUtil.isInterruptOrReject(ex))
- {
- LOGGER.error("Exception when updating render file using data source: ", ex);
- }
- else
- {
- //LOGGER.info("Interrupted update of render file using data source: ", ex);
- }
- box.close();
- return null;
- });
- synchronized (taskTracker)
- {
- taskTracker.put(transformFuture, TaskType.Update);
- }
- return transformFuture;
- }
-
- public CompletableFuture onRenderFileLoaded(ColumnRenderSource renderSource, RenderMetaDataFile file)
- {
- CompletableFuture future = this.updateCacheAsync(renderSource, file).handle((voidObj, ex) -> {
- if (ex != null && !LodUtil.isInterruptOrReject(ex))
- {
- LOGGER.error("Exception when updating render file using data source: ", ex);
- }
- return renderSource;
- });
- synchronized (taskTracker)
- {
- taskTracker.put(future, TaskType.OnLoaded);
- }
- return future;
- }
-
- public CompletableFuture onReadRenderSourceLoadedFromCacheAsync(RenderMetaDataFile file, ColumnRenderSource data)
- {
- return this.updateCacheAsync(data, file);
- }
-
- private void writeRenderSourceToFile(ColumnRenderSource currentRenderSource, RenderMetaDataFile file, ColumnRenderSource newRenderSource)
- {
- if (currentRenderSource == null || newRenderSource == null)
- {
- return;
- }
-
- currentRenderSource.updateFromRenderSource(newRenderSource);
-
- //file.metaData.dataVersion.set(newDataVersion);
- file.baseMetaData.dataLevel = currentRenderSource.getDataDetail();
- file.baseMetaData.dataTypeId = RENDER_SOURCE_TYPE_ID;
- file.baseMetaData.binaryDataFormatVersion = currentRenderSource.getRenderDataFormatVersion();
- file.save(currentRenderSource);
- }
-/*
- public boolean refreshRenderSource(ColumnRenderSource renderSource)
- {
- RenderMetaDataFile file = this.filesBySectionPos.get(renderSource.getSectionPos());
- if (renderSource.isEmpty())
- {
- if (file == null || file.baseMetaData == null)
- {
- return false;
- }
- }
-
- LodUtil.assertTrue(file != null);
- LodUtil.assertTrue(file.baseMetaData != null);
-// if (!this.fullDataSourceProvider.isCacheVersionValid(file.pos, file.metaData.dataVersion.get()))
-// {
- this.updateCacheAsync(renderSource, file).join();
- return true;
-// }
-
-// return false;
- }
-
- */
//=====================//
// clearing / shutdown //
//=====================//
- //private static CompletableFuture cleanupTask;
-
@Override
public void close()
{
- LOGGER.info("Closing " + this.getClass().getSimpleName() + " with [" + this.filesBySectionPos.size() + "] files...");
- /*
- // queue the file save futures
- ArrayList> futures = new ArrayList<>();
- for (RenderMetaDataFile metaFile : this.filesBySectionPos.values())
- {
- CompletableFuture saveFuture = metaFile.flushAndSaveAsync(fileHandlerThreadPool);
- if (!saveFuture.isDone())
- {
- futures.add(saveFuture);
- }
- }
-
-
- if (futures.size() != 0)
- {
- LOGGER.info("Waiting for ["+futures.size()+"] files to save...");
-
- // if the save futures didn't already complete, wait for them and then shut down the thread pool
- CompletableFuture combinedFuture = CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]));
- cleanupTask = combinedFuture.handle((result, ex) -> {
- if (ex != null && !LodUtil.isInterruptOrReject(ex)) {
- LOGGER.error("Exception when waiting for render source files to save", ex);
- }
- return null;
- }).thenRun(() ->
- {
- LOGGER.info("Finished closing "+this.getClass().getSimpleName()+", ["+futures.size()+"] files were saved out of ["+this.filesBySectionPos.size()+"] total files.");
- fileHandlerThreadPool.shutdown();
- threadPoolMsg.close();
- });
- }
- else {*/
- fileHandlerThreadPool.shutdown();
- threadPoolMsg.close();
- //}
+ LOGGER.info("Closing " + this.getClass().getSimpleName() + " with [" + this.metaFileBySectionPos.size() + "] files...");
+ this.fileHandlerThreadPool.shutdown();
+ this.threadPoolMsg.close();
}
-
public void deleteRenderCache()
{
// delete each file in the cache directory
@@ -634,7 +369,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider
}
// clear the cached files
- this.filesBySectionPos.clear();
+ this.metaFileBySectionPos.clear();
}
@@ -643,15 +378,23 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider
// helper methods //
//================//
- public File computeRenderFilePath(DhSectionPos pos) { return new File(this.saveDir, pos.serialize() + RENDER_FILE_POSTFIX); }
+ public File computeRenderFilePath(DhSectionPos pos) { return new File(this.saveDir, pos.serialize() + RenderMetaDataFile.FILE_SUFFIX); }
- @Nullable
- public DhSectionPos decodePositionByFile(File file)
+
+
+ //================//
+ // helper classes //
+ //================//
+
+ /**
+ * READ
+ * UPDATE_READ_DATA
+ * UPDATE
+ * ON_LOADED
+ */
+ private enum ETaskType
{
- String fileName = file.getName();
- if (!fileName.endsWith(RENDER_FILE_POSTFIX)) return null;
- fileName = fileName.substring(0, fileName.length() - RENDER_FILE_POSTFIX.length());
- return DhSectionPos.deserialize(fileName);
+ READ, UPDATE_READ_DATA, UPDATE, ON_LOADED,
}
}
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/structure/AbstractSaveStructure.java b/core/src/main/java/com/seibel/distanthorizons/core/file/structure/AbstractSaveStructure.java
index 7dd4df934..3ca2906e7 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/file/structure/AbstractSaveStructure.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/file/structure/AbstractSaveStructure.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.file.structure;
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/structure/ClientOnlySaveStructure.java b/core/src/main/java/com/seibel/distanthorizons/core/file/structure/ClientOnlySaveStructure.java
index 2b0ec913a..53a2cbf0f 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/file/structure/ClientOnlySaveStructure.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/file/structure/ClientOnlySaveStructure.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.file.structure;
import com.google.common.net.PercentEscaper;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/structure/LocalSaveStructure.java b/core/src/main/java/com/seibel/distanthorizons/core/file/structure/LocalSaveStructure.java
index 5ff366067..5ec3342ef 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/file/structure/LocalSaveStructure.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/file/structure/LocalSaveStructure.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.file.structure;
import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/subDimMatching/SubDimCompare.java b/core/src/main/java/com/seibel/distanthorizons/core/file/subDimMatching/SubDimCompare.java
index 83db53754..1688efd20 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/file/subDimMatching/SubDimCompare.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/file/subDimMatching/SubDimCompare.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/subDimMatching/SubDimensionLevelMatcher.java b/core/src/main/java/com/seibel/distanthorizons/core/file/subDimMatching/SubDimensionLevelMatcher.java
index 69321a724..2cb81f2fc 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/file/subDimMatching/SubDimensionLevelMatcher.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/file/subDimMatching/SubDimensionLevelMatcher.java
@@ -1,3 +1,22 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.file.subDimMatching;
import com.seibel.distanthorizons.core.config.Config;
@@ -223,7 +242,7 @@ public class SubDimensionLevelMatcher implements AutoCloseable
}
IDhLevel tempLevel = null; // new DhClientLevel(new ClientOnlySaveStructure(), clientLevelWrapper, ???);
IFullDataSourceProvider fileHandler = new FullDataFileHandler(tempLevel, tempLevel.getSaveStructure());
- CompletableFuture testDataSource = fileHandler.read(new DhSectionPos(playerChunkPos));
+ CompletableFuture testDataSource = fileHandler.readAsync(new DhSectionPos(playerChunkPos));
IFullDataSource lodDataSource = testDataSource.get();
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/subDimMatching/SubDimensionPlayerData.java b/core/src/main/java/com/seibel/distanthorizons/core/file/subDimMatching/SubDimensionPlayerData.java
index 00de5b236..9781e3439 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/file/subDimMatching/SubDimensionPlayerData.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/file/subDimMatching/SubDimensionPlayerData.java
@@ -1,8 +1,8 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
- * Copyright (C) 2020-2022 James Seibel
+ * Copyright (C) 2020-2023 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/generation/BatchGenerator.java b/core/src/main/java/com/seibel/distanthorizons/core/generation/BatchGenerator.java
index 5c848a19f..ec7cde3cc 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/generation/BatchGenerator.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/generation/BatchGenerator.java
@@ -1,5 +1,5 @@
/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
+ * This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
* Copyright (C) 2021 Tom Lee (TomTheFurry) & James Seibel (Original code)
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/generation/DhLightingEngine.java b/core/src/main/java/com/seibel/distanthorizons/core/generation/DhLightingEngine.java
index bbc035d04..ece655536 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/generation/DhLightingEngine.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/generation/DhLightingEngine.java
@@ -1,8 +1,27 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
package com.seibel.distanthorizons.core.generation;
+import com.seibel.distanthorizons.core.config.Config;
import com.seibel.distanthorizons.core.enums.EDhDirection;
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
-import com.seibel.distanthorizons.core.logging.SpamReducedLogger;
import com.seibel.distanthorizons.core.pos.DhBlockPos;
import com.seibel.distanthorizons.core.pos.DhChunkPos;
import com.seibel.distanthorizons.core.util.LodUtil;
@@ -11,6 +30,7 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.chunk.IChunkWrapper;
import org.apache.logging.log4j.Logger;
import java.util.*;
+import java.util.concurrent.locks.ReentrantLock;
/**
* This logic was roughly based on
@@ -39,137 +59,156 @@ public class DhLightingEngine
public void lightChunk(IChunkWrapper centerChunk, List nearbyChunkList, int maxSkyLight)
{
DhChunkPos centerChunkPos = centerChunk.getChunkPos();
-
- HashMap chunksByChunkPos = new HashMap<>(9);
-
- // from some quick testing on James' part,
- // these initial capacities should be big enough to fit most lighting jobs
- // with a bit of room to spare
- ArrayList blockLightPosQueue = new ArrayList<>(40_000); // when tested with a normal 1.20 world James saw a max of: 36_709
- ArrayList skyLightPosQueue = new ArrayList<>(3_000); // when tested with a normal 1.20 world James saw a max of: 2355
+ AdjacentChunkHolder adjacentChunkHolder = new AdjacentChunkHolder(centerChunk);
- // generate the list of chunk pos we need,
- // currently a 3x3 grid
- HashSet