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 clazz; + public final Class fullDataSourceClass; public static final HashMap> datatypeIdRegistry = new HashMap<>(); public final long datatypeId; @@ -21,18 +40,18 @@ public abstract class AbstractFullDataSourceLoader - public AbstractFullDataSourceLoader(Class clazz, long datatypeId, byte[] loaderSupportedVersions) + public AbstractFullDataSourceLoader(Class 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 dataType; + public Class 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 requestedAdjacentPositions = new HashSet<>(9); - for (int xOffset = -1; xOffset <= 1; xOffset++) + // try-finally to handle the stableArray resources + StableLightPosStack blockLightPosQueue = null; + StableLightPosStack skyLightPosQueue = null; + try { - for (int zOffset = -1; zOffset <= 1; zOffset++) + blockLightPosQueue = StableLightPosStack.borrowStableLightPosArray(); + skyLightPosQueue = StableLightPosStack.borrowStableLightPosArray(); + + + + // generate the list of chunk pos we need, + // currently a 3x3 grid + HashSet requestedAdjacentPositions = new HashSet<>(9); + for (int xOffset = -1; xOffset <= 1; xOffset++) { - DhChunkPos adjacentPos = new DhChunkPos(centerChunkPos.x + xOffset, centerChunkPos.z + zOffset); - requestedAdjacentPositions.add(adjacentPos); - } - } - - - // find all adjacent chunks - // and get any necessary info from them - boolean warningLogged = false; - for (IChunkWrapper chunk : nearbyChunkList) - { - if (chunk != null && requestedAdjacentPositions.contains(chunk.getChunkPos())) - { - // remove the newly found position - requestedAdjacentPositions.remove(chunk.getChunkPos()); - - // add the adjacent chunk - chunksByChunkPos.put(chunk.getChunkPos(), chunk); - - - - // get and set the adjacent chunk's initial block lights - List blockLightPosList = chunk.getBlockLightPosList(); - for (DhBlockPos blockLightPos : blockLightPosList) + for (int zOffset = -1; zOffset <= 1; zOffset++) { - // get the light - DhBlockPos relLightBlockPos = blockLightPos.convertToChunkRelativePos(); - IBlockStateWrapper blockState = chunk.getBlockState(relLightBlockPos); - int lightValue = blockState.getLightEmission(); - blockLightPosQueue.add(new LightPos(blockLightPos, lightValue)); - - // set the light - DhBlockPos relBlockPos = blockLightPos.convertToChunkRelativePos(); - chunk.setDhBlockLight(relBlockPos.x, relBlockPos.y, relBlockPos.z, lightValue); + DhChunkPos adjacentPos = new DhChunkPos(centerChunkPos.x + xOffset, centerChunkPos.z + zOffset); + requestedAdjacentPositions.add(adjacentPos); } - - - // get and set the adjacent chunk's initial skylights, - // if the dimension has skylights - if (maxSkyLight > 0) + } + + + // find all adjacent chunks + // and get any necessary info from them + boolean warningLogged = false; + for (IChunkWrapper chunk : nearbyChunkList) + { + if (chunk != null && requestedAdjacentPositions.contains(chunk.getChunkPos())) { - // get the adjacent chunk's sky lights - for (int relX = 0; relX < LodUtil.CHUNK_WIDTH; relX++) // relative block pos + // remove the newly found position + requestedAdjacentPositions.remove(chunk.getChunkPos()); + + // add the adjacent chunk + adjacentChunkHolder.add(chunk); + + + + // get and set the adjacent chunk's initial block lights + List blockLightPosList = chunk.getBlockLightPosList(); + for (DhBlockPos blockLightPos : blockLightPosList) { - for (int relZ = 0; relZ < LodUtil.CHUNK_WIDTH; relZ++) + // get the light + DhBlockPos relLightBlockPos = blockLightPos.convertToChunkRelativePos(); + IBlockStateWrapper blockState = chunk.getBlockState(relLightBlockPos); + int lightValue = blockState.getLightEmission(); + blockLightPosQueue.push(blockLightPos.x, blockLightPos.y, blockLightPos.z, lightValue); + + // set the light + DhBlockPos relBlockPos = blockLightPos.convertToChunkRelativePos(); + chunk.setDhBlockLight(relBlockPos.x, relBlockPos.y, relBlockPos.z, lightValue); + } + + + // get and set the adjacent chunk's initial skylights, + // if the dimension has skylights + if (maxSkyLight > 0) + { + // get the adjacent chunk's sky lights + for (int relX = 0; relX < LodUtil.CHUNK_WIDTH; relX++) // relative block pos { - // get the light - int maxY = chunk.getLightBlockingHeightMapValue(relX, relZ); - DhBlockPos skyLightPos = new DhBlockPos(chunk.getMinBlockX() + relX, maxY, chunk.getMinBlockZ() + relZ); - if (skyLightPos.y < chunk.getMinBuildHeight() || skyLightPos.y > chunk.getMaxBuildHeight()) + for (int relZ = 0; relZ < LodUtil.CHUNK_WIDTH; relZ++) { - // this shouldn't normally happen - if (!warningLogged) + // get the light + int maxY = chunk.getLightBlockingHeightMapValue(relX, relZ); + DhBlockPos skyLightPos = new DhBlockPos(chunk.getMinBlockX() + relX, maxY, chunk.getMinBlockZ() + relZ); + if (skyLightPos.y < chunk.getMinBuildHeight() || skyLightPos.y > chunk.getMaxBuildHeight()) { - warningLogged = true; - LOGGER.debug("Lighting chunk at pos " + chunk.getChunkPos() + " may have a missing or incomplete heightmap. Chunk min/max [" + chunk.getMinBuildHeight() + "/" + chunk.getMaxBuildHeight() + "], skylight pos: " + skyLightPos); + // this shouldn't normally happen + if (!warningLogged) + { + warningLogged = true; + LOGGER.debug("Lighting chunk at pos " + chunk.getChunkPos() + " may have a missing or incomplete heightmap. Chunk min/max [" + chunk.getMinBuildHeight() + "/" + chunk.getMaxBuildHeight() + "], skylight pos: " + skyLightPos); + } + continue; } - continue; + skyLightPosQueue.push(skyLightPos.x, skyLightPos.y, skyLightPos.z, maxSkyLight); + + + // set the light + DhBlockPos relBlockPos = skyLightPos.convertToChunkRelativePos(); + chunk.setDhSkyLight(relBlockPos.x, relBlockPos.y, relBlockPos.z, maxSkyLight); } - skyLightPosQueue.add(new LightPos(skyLightPos, maxSkyLight)); - - - // set the light - DhBlockPos relBlockPos = skyLightPos.convertToChunkRelativePos(); - chunk.setDhSkyLight(relBlockPos.x, relBlockPos.y, relBlockPos.z, maxSkyLight); } } } + + + if (requestedAdjacentPositions.isEmpty()) + { + // we found every chunk we needed, we don't need to keep iterating + break; + } } - - if (requestedAdjacentPositions.isEmpty()) + // validate that at least 1 chunk was found + if (adjacentChunkHolder.size() == 0) { - // we found every chunk we needed, we don't need to keep iterating - break; + LOGGER.warn("Attempted to generate lighting for position [" + centerChunkPos + "], but neither that chunk nor any adjacent chunks were found. No chunk lighting was performed."); + return; } + + + + // block light + this.propagateLightPosList(blockLightPosQueue, adjacentChunkHolder, + (neighbourChunk, relBlockPos) -> neighbourChunk.getDhBlockLight(relBlockPos.x, relBlockPos.y, relBlockPos.z), + (neighbourChunk, relBlockPos, newLightValue) -> neighbourChunk.setDhBlockLight(relBlockPos.x, relBlockPos.y, relBlockPos.z, newLightValue)); + + // sky light + this.propagateLightPosList(skyLightPosQueue, adjacentChunkHolder, + (neighbourChunk, relBlockPos) -> neighbourChunk.getDhSkyLight(relBlockPos.x, relBlockPos.y, relBlockPos.z), + (neighbourChunk, relBlockPos, newLightValue) -> neighbourChunk.setDhSkyLight(relBlockPos.x, relBlockPos.y, relBlockPos.z, newLightValue)); } - - // validate that at least 1 chunk was found - if (chunksByChunkPos.size() == 0) + catch (Exception e) { - LOGGER.warn("Attempted to generate lighting for position [" + centerChunkPos + "], but neither that chunk nor any adjacent chunks were found. No chunk lighting was performed."); - return; + LOGGER.error("Unexpected lighting issue for center chunk: "+centerChunkPos, e); + } + finally + { + StableLightPosStack.returnStableLightPosArray(blockLightPosQueue); + StableLightPosStack.returnStableLightPosArray(skyLightPosQueue); } - // block light - this.propagateLightPosList(blockLightPosQueue, chunksByChunkPos, - (neighbourChunk, relBlockPos) -> neighbourChunk.getDhBlockLight(relBlockPos.x, relBlockPos.y, relBlockPos.z), - (neighbourChunk, relBlockPos, newLightValue) -> neighbourChunk.setDhBlockLight(relBlockPos.x, relBlockPos.y, relBlockPos.z, newLightValue)); - - // sky light - this.propagateLightPosList(skyLightPosQueue, chunksByChunkPos, - (neighbourChunk, relBlockPos) -> neighbourChunk.getDhSkyLight(relBlockPos.x, relBlockPos.y, relBlockPos.z), - (neighbourChunk, relBlockPos, newLightValue) -> neighbourChunk.setDhSkyLight(relBlockPos.x, relBlockPos.y, relBlockPos.z, newLightValue)); - - centerChunk.setIsDhLightCorrect(true); LOGGER.trace("Finished generating lighting for chunk: [" + centerChunkPos + "]"); } /** Applies each {@link LightPos} from the queue to the given set of {@link IChunkWrapper}'s. */ private void propagateLightPosList( - ArrayList lightPosQueue, HashMap chunksByChunkPos, + StableLightPosStack lightPosQueue, AdjacentChunkHolder adjacentChunkHolder, IGetLightFunc getLightFunc, ISetLightFunc setLightFunc) { + // these objects are saved so they can be mutated throughout the method, + // this reduces the number of allocations necessary, reducing GC pressure + final DhBlockPos neighbourBlockPos = new DhBlockPos(); + final DhBlockPos relNeighbourBlockPos = new DhBlockPos(); + + // update each light position while (!lightPosQueue.isEmpty()) { // since we don't care about the order the positions are processed, // we can grab the last position instead of the first for a slight performance increase (this way the array doesn't need to be shifted over every loop) - int lastIndex = lightPosQueue.size() - 1; - LightPos lightPos = lightPosQueue.remove(lastIndex); + LightPos lightPos = lightPosQueue.pop(); DhBlockPos pos = lightPos.pos; int lightValue = lightPos.lightValue; @@ -178,14 +217,13 @@ public class DhLightingEngine // propagate the lighting in each cardinal direction, IE: -x, +x, -y, +y, -z, +z for (EDhDirection direction : EDhDirection.CARDINAL_DIRECTIONS) { - DhBlockPos neighbourBlockPos = pos.offset(direction); - DhChunkPos neighbourChunkPos = new DhChunkPos(neighbourBlockPos); + pos.offset(direction, neighbourBlockPos); // mutates neighbourBlockPos // converting the block pos into a relative position is necessary for accessing the light values in the chunk - DhBlockPos relNeighbourBlockPos = neighbourBlockPos.convertToChunkRelativePos(); + neighbourBlockPos.convertToChunkRelativePos(relNeighbourBlockPos); // mutates relNeighbourBlockPos // only continue if the light position is inside one of our chunks - IChunkWrapper neighbourChunk = chunksByChunkPos.get(neighbourChunkPos); + IChunkWrapper neighbourChunk = adjacentChunkHolder.getByBlockPos(neighbourBlockPos.x, neighbourBlockPos.z); if (neighbourChunk == null) { // the light pos is outside our generator's range, ignore it @@ -219,7 +257,7 @@ public class DhLightingEngine // now that light has been propagated to this blockPos // we need to queue it up so its neighbours can be propagated as well - lightPosQueue.add(new LightPos(neighbourBlockPos, targetLevel)); + lightPosQueue.push(neighbourBlockPos.x, neighbourBlockPos.y, neighbourBlockPos.z, targetLevel); } } } @@ -242,7 +280,7 @@ public class DhLightingEngine private static class LightPos { public final DhBlockPos pos; - public final int lightValue; + public int lightValue; public LightPos(DhBlockPos pos, int lightValue) { @@ -252,5 +290,136 @@ public class DhLightingEngine } + /** holds the adjacent chunks without having to create new Pos objects */ + private static class AdjacentChunkHolder + { + ArrayList chunkArray = new ArrayList<>(9); + + + public AdjacentChunkHolder(IChunkWrapper centerWrapper) + { + this.chunkArray.add(centerWrapper); + } + + + public int size() { return this.chunkArray.size(); } + + public void add(IChunkWrapper centerWrapper) { this.chunkArray.add(centerWrapper); } + + public IChunkWrapper getByBlockPos(int blockX, int blockZ) + { + // >> 4 is equivalent to dividing by 16 + int chunkX = blockX >> 4; + int chunkZ = blockZ >> 4; + + // since there will only ever be 9 items in the array, this sequential search should be fast enough + for (IChunkWrapper chunk : this.chunkArray) + { + if (chunk != null + && chunk.getChunkPos().x == chunkX && chunk.getChunkPos().z == chunkZ) + { + return chunk; + } + } + return null; + } + } + + /** + * Holds all potential {@link LightPos} objects a lighting task may need. + * This is done so existing {@link LightPos} objects can be repurposed instead of destroyed, + * reducing garbage collector load. + */ + private static class StableLightPosStack + { + /** necessary to prevent multiple threads from modifying the cache at once */ + private static final ReentrantLock cacheLock = new ReentrantLock(); + private static final Queue lightArrayCache = new ArrayDeque<>(); + + /** the index of the last item in the array, -1 if empty */ + private int index = -1; + + // when tested with a normal 1.20 world James saw a maximum of 36,709 block and 2,355 sky lights, + // so this should give us a good base that should be able to contain most lighting tasks + private final ArrayList arrayList = new ArrayList<>(40_000); + + + + //================// + // cache handling // + //================// + + private static StableLightPosStack borrowStableLightPosArray() + { + try + { + // prevent multiple threads modifying the cache at once + cacheLock.lock(); + + return lightArrayCache.isEmpty() ? new StableLightPosStack() : lightArrayCache.remove(); + } + finally + { + cacheLock.unlock(); + } + } + + private static void returnStableLightPosArray(StableLightPosStack stableArray) + { + try + { + // prevent multiple threads modifying the cache at once + cacheLock.lock(); + + if (stableArray != null) + { + lightArrayCache.add(stableArray); + } + } + finally + { + cacheLock.unlock(); + } + } + + + + //===============// + // stack methods // + //===============// + + public boolean isEmpty() { return this.index == -1; } + public int size() { return this.index+1; } + + public void push(int blockX, int blockY, int blockZ, int lightValue) + { + this.index++; + if (this.index < this.arrayList.size()) + { + // modify the existing pos in the array + LightPos lightPos = this.arrayList.get(this.index); + lightPos.pos.x = blockX; + lightPos.pos.y = blockY; + lightPos.pos.z = blockZ; + lightPos.lightValue = lightValue; + } + else + { + // add a new pos + this.arrayList.add(new LightPos(new DhBlockPos(blockX, blockY, blockZ), lightValue)); + } + } + + public LightPos pop() + { + LightPos pos = this.arrayList.get(this.index); + this.index--; + return pos; + } + + @Override + public String toString() { return this.index + "/" + this.arrayList.size(); } + + } } diff --git a/core/src/main/java/com/seibel/distanthorizons/core/generation/IWorldGenerationQueue.java b/core/src/main/java/com/seibel/distanthorizons/core/generation/IWorldGenerationQueue.java index 100c6d9fb..127669592 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/generation/IWorldGenerationQueue.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/generation/IWorldGenerationQueue.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.generation; import com.seibel.distanthorizons.core.generation.tasks.IWorldGenTaskTracker; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/generation/WorldGenerationQueue.java b/core/src/main/java/com/seibel/distanthorizons/core/generation/WorldGenerationQueue.java index 33e3f981b..b32426a42 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/generation/WorldGenerationQueue.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/generation/WorldGenerationQueue.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.generation; import com.seibel.distanthorizons.api.enums.worldGeneration.EDhApiDistantGeneratorMode; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/generation/tasks/IWorldGenTaskTracker.java b/core/src/main/java/com/seibel/distanthorizons/core/generation/tasks/IWorldGenTaskTracker.java index 76de08032..7ef157469 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/generation/tasks/IWorldGenTaskTracker.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/generation/tasks/IWorldGenTaskTracker.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.generation.tasks; import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.ChunkSizedFullDataAccessor; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/generation/tasks/InProgressWorldGenTaskGroup.java b/core/src/main/java/com/seibel/distanthorizons/core/generation/tasks/InProgressWorldGenTaskGroup.java index ee8e70cc5..5f3fe4cae 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/generation/tasks/InProgressWorldGenTaskGroup.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/generation/tasks/InProgressWorldGenTaskGroup.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.generation.tasks; import java.util.concurrent.CompletableFuture; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/generation/tasks/WorldGenResult.java b/core/src/main/java/com/seibel/distanthorizons/core/generation/tasks/WorldGenResult.java index ab69b8fec..27ffd37ef 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/generation/tasks/WorldGenResult.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/generation/tasks/WorldGenResult.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.generation.tasks; import com.seibel.distanthorizons.core.pos.DhSectionPos; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/generation/tasks/WorldGenTask.java b/core/src/main/java/com/seibel/distanthorizons/core/generation/tasks/WorldGenTask.java index 78fa9a24b..fbb12f4bc 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/generation/tasks/WorldGenTask.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/generation/tasks/WorldGenTask.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.generation.tasks; import com.seibel.distanthorizons.core.pos.DhLodPos; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/generation/tasks/WorldGenTaskGroup.java b/core/src/main/java/com/seibel/distanthorizons/core/generation/tasks/WorldGenTaskGroup.java index 209677419..fdc188d55 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/generation/tasks/WorldGenTaskGroup.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/generation/tasks/WorldGenTaskGroup.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.generation.tasks; import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.ChunkSizedFullDataAccessor; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/jar/DarkModeDetector.java b/core/src/main/java/com/seibel/distanthorizons/core/jar/DarkModeDetector.java index 5bddb1512..9f2cdb11e 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/jar/DarkModeDetector.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/jar/DarkModeDetector.java @@ -1,10 +1,29 @@ +/* + * 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.jar; import java.io.*; import java.util.regex.Pattern; /** - * A fork of iris'is dark mode detector (https://github.com/IrisShaders/Iris-Installer/blob/master/src/main/java/net/hypercubemc/iris_installer/DarkModeDetector.java) + * A fork of iris' dark mode detector (https://github.com/IrisShaders/Iris-Installer/blob/master/src/main/java/net/hypercubemc/iris_installer/DarkModeDetector.java) * Which is a fork of HanSolo's dark mode detector (https://gist.github.com/HanSolo/7cf10b86efff8ca2845bf5ec2dd0fe1d) * * This fork has better support for Linux diff --git a/core/src/main/java/com/seibel/distanthorizons/core/jar/JarDependencySetup.java b/core/src/main/java/com/seibel/distanthorizons/core/jar/JarDependencySetup.java index eb7afa46f..7b76a8d52 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/jar/JarDependencySetup.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/jar/JarDependencySetup.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.jar; import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/jar/JarMain.java b/core/src/main/java/com/seibel/distanthorizons/core/jar/JarMain.java index be95d2c29..a157073de 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/jar/JarMain.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/jar/JarMain.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.jar; import com.seibel.distanthorizons.coreapi.ModInfo; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/jar/JarUtils.java b/core/src/main/java/com/seibel/distanthorizons/core/jar/JarUtils.java index ccf6ecfb5..0d4cc63cc 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/jar/JarUtils.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/jar/JarUtils.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.jar; import java.io.*; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/jar/ModGitInfo.java b/core/src/main/java/com/seibel/distanthorizons/core/jar/ModGitInfo.java index d2ab0d5e3..3619a7170 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/jar/ModGitInfo.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/jar/ModGitInfo.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.jar; import com.electronwill.nightconfig.core.Config; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/jar/Platform.java b/core/src/main/java/com/seibel/distanthorizons/core/jar/Platform.java index 74820fe9d..d042b96c0 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/jar/Platform.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/jar/Platform.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.jar; /** diff --git a/core/src/main/java/com/seibel/distanthorizons/core/jar/gui/BaseJFrame.java b/core/src/main/java/com/seibel/distanthorizons/core/jar/gui/BaseJFrame.java index 8445c5d54..023ada081 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/jar/gui/BaseJFrame.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/jar/gui/BaseJFrame.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.jar.gui; import com.seibel.distanthorizons.core.jar.JarUtils; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/jar/gui/JSwitch.java b/core/src/main/java/com/seibel/distanthorizons/core/jar/gui/JSwitch.java index f04776fae..e59395c89 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/jar/gui/JSwitch.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/jar/gui/JSwitch.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.jar.gui; import java.awt.*; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/jar/gui/JSwitchBox.java b/core/src/main/java/com/seibel/distanthorizons/core/jar/gui/JSwitchBox.java index 0393f49f6..42152c0f7 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/jar/gui/JSwitchBox.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/jar/gui/JSwitchBox.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.jar.gui; import java.awt.Color; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/jar/gui/cusomJObject/JBox.java b/core/src/main/java/com/seibel/distanthorizons/core/jar/gui/cusomJObject/JBox.java index 107d97883..1ff86b21f 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/jar/gui/cusomJObject/JBox.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/jar/gui/cusomJObject/JBox.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.jar.gui.cusomJObject; import javax.swing.*; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/jar/installer/GitlabGetter.java b/core/src/main/java/com/seibel/distanthorizons/core/jar/installer/GitlabGetter.java index 9aa9f51c9..90a39805f 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/jar/installer/GitlabGetter.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/jar/installer/GitlabGetter.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.jar.installer; import java.net.URL; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/jar/installer/MarkdownFormatter.java b/core/src/main/java/com/seibel/distanthorizons/core/jar/installer/MarkdownFormatter.java index 4e12235f3..15129bad7 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/jar/installer/MarkdownFormatter.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/jar/installer/MarkdownFormatter.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.jar.installer; import java.util.Arrays; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/jar/installer/ModrinthGetter.java b/core/src/main/java/com/seibel/distanthorizons/core/jar/installer/ModrinthGetter.java index 704e922b3..8d2976a1c 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/jar/installer/ModrinthGetter.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/jar/installer/ModrinthGetter.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.jar.installer; import com.electronwill.nightconfig.core.Config; @@ -103,7 +122,14 @@ public class ModrinthGetter public static String getLatestIDForVersion(String mcVer) { - return mcVerToReleaseID.get(mcVer).get(0); + try + { + return mcVerToReleaseID.get(mcVer).get(0); + } + catch (Exception e) + { + return null; + } } public static String getLatestNameForVersion(String mcVer) { diff --git a/core/src/main/java/com/seibel/distanthorizons/core/jar/installer/WebDownloader.java b/core/src/main/java/com/seibel/distanthorizons/core/jar/installer/WebDownloader.java index 9f0094abc..3194ec9cf 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/jar/installer/WebDownloader.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/jar/installer/WebDownloader.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.jar.installer; import javax.net.ssl.HttpsURLConnection; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/jar/tui/BaseTUI.java b/core/src/main/java/com/seibel/distanthorizons/core/jar/tui/BaseTUI.java index 0bf8e2206..388a4006e 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/jar/tui/BaseTUI.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/jar/tui/BaseTUI.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.jar.tui; // TUI stands for terminal ui btw diff --git a/core/src/main/java/com/seibel/distanthorizons/core/jar/updater/SelfUpdater.java b/core/src/main/java/com/seibel/distanthorizons/core/jar/updater/SelfUpdater.java index 136573f85..615690a6a 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/jar/updater/SelfUpdater.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/jar/updater/SelfUpdater.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.jar.updater; import com.seibel.distanthorizons.core.jar.JarUtils; @@ -38,9 +57,11 @@ public class SelfUpdater */ public static boolean onStart() { + LOGGER.info("Checking for DH update"); // Some init stuff // We use sha1 to check the version as our versioning system is different to the one on modrinth - if (!ModrinthGetter.init()) return false; + if (!ModrinthGetter.init()) + return false; String jarSha = ""; try { @@ -52,6 +73,11 @@ public class SelfUpdater return false; } String mcVersion = SingletonInjector.INSTANCE.get(IVersionConstants.class).getMinecraftVersion(); + if (!ModrinthGetter.mcVersions.contains(mcVersion)) + { + LOGGER.warn("Minecraft version ["+ mcVersion +"] is not findable on Modrinth, only findable versions are ["+ ModrinthGetter.mcVersions.toString() +"]"); + return false; + } // Check the sha's of both our stuff if (jarSha.equals(ModrinthGetter.getLatestShaForVersion(mcVersion))) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/jar/wrapperInterfaces/config/LangWrapper.java b/core/src/main/java/com/seibel/distanthorizons/core/jar/wrapperInterfaces/config/LangWrapper.java index 9ac82b8e7..e19544eee 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/jar/wrapperInterfaces/config/LangWrapper.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/jar/wrapperInterfaces/config/LangWrapper.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.jar.wrapperInterfaces.config; import com.electronwill.nightconfig.core.Config; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/level/ClientLevelModule.java b/core/src/main/java/com/seibel/distanthorizons/core/level/ClientLevelModule.java index 34ab6ae82..ac3ec177c 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/level/ClientLevelModule.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/level/ClientLevelModule.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.level; import com.seibel.distanthorizons.api.enums.rendering.EDebugRendering; @@ -31,12 +50,12 @@ public class ClientLevelModule implements Closeable { private static final Logger LOGGER = DhLoggerBuilder.getLogger(); private static final IMinecraftClientWrapper MC_CLIENT = SingletonInjector.INSTANCE.get(IMinecraftClientWrapper.class); - private final IDhClientLevel parent; + private final IDhClientLevel parentClientLevel; public final AtomicReference ClientRenderStateRef = new AtomicReference<>(); public final F3Screen.NestedMessage f3Message; - public ClientLevelModule(IDhClientLevel parent) + public ClientLevelModule(IDhClientLevel parentClientLevel) { - this.parent = parent; + this.parentClientLevel = parentClientLevel; this.f3Message = new F3Screen.NestedMessage(this::f3Log); } @@ -69,7 +88,7 @@ public class ClientLevelModule implements Closeable } clientRenderState.close(); - clientRenderState = new ClientRenderState(parent, parent.getFileHandler(), parent.getSaveStructure()); + clientRenderState = new ClientRenderState(parentClientLevel, parentClientLevel.getFileHandler(), parentClientLevel.getSaveStructure()); if (!this.ClientRenderStateRef.compareAndSet(null, clientRenderState)) { //FIXME: How to handle this? @@ -101,7 +120,7 @@ public class ClientLevelModule implements Closeable /** @return if the {@link ClientRenderState} was successfully swapped */ public boolean startRenderer() { - ClientRenderState ClientRenderState = new ClientRenderState(parent, parent.getFileHandler(), parent.getSaveStructure()); + ClientRenderState ClientRenderState = new ClientRenderState(parentClientLevel, parentClientLevel.getFileHandler(), parentClientLevel.getSaveStructure()); if (!this.ClientRenderStateRef.compareAndSet(null, ClientRenderState)) { LOGGER.warn("Failed to start renderer due to concurrency"); @@ -154,17 +173,18 @@ public class ClientLevelModule implements Closeable //===============// // data handling // //===============// - public void saveWrites(ChunkSizedFullDataAccessor data) + public void writeChunkDataToFile(ChunkSizedFullDataAccessor data) { - ClientRenderState ClientRenderState = this.ClientRenderStateRef.get(); DhLodPos pos = data.getLodPos().convertToDetailLevel(CompleteFullDataSource.SECTION_SIZE_OFFSET); + + ClientRenderState ClientRenderState = this.ClientRenderStateRef.get(); if (ClientRenderState != null) { ClientRenderState.renderSourceFileHandler.writeChunkDataToFile(new DhSectionPos(pos.detailLevel, pos.x, pos.z), data); } else { - parent.getFileHandler().write(new DhSectionPos(pos.detailLevel, pos.x, pos.z), data); + this.parentClientLevel.getFileHandler().writeChunkDataToFile(new DhSectionPos(pos.detailLevel, pos.x, pos.z), data); } } @@ -221,7 +241,7 @@ public class ClientLevelModule implements Closeable /** Returns what should be displayed in Minecraft's F3 debug menu */ protected String[] f3Log() { - String dimName = parent.getClientLevelWrapper().getDimensionType().getDimensionName(); + String dimName = parentClientLevel.getClientLevelWrapper().getDimensionType().getDimensionName(); ClientRenderState renderState = this.ClientRenderStateRef.get(); if (renderState == null) { diff --git a/core/src/main/java/com/seibel/distanthorizons/core/level/DhClientLevel.java b/core/src/main/java/com/seibel/distanthorizons/core/level/DhClientLevel.java index bdad12290..3b324752a 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/level/DhClientLevel.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/level/DhClientLevel.java @@ -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.level; import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.ChunkSizedFullDataAccessor; @@ -173,10 +192,7 @@ public class DhClientLevel extends DhLevel implements IDhClientLevel } @Override - public void saveWrites(ChunkSizedFullDataAccessor data) - { - clientside.saveWrites(data); - } + public void saveWrites(ChunkSizedFullDataAccessor data) { this.clientside.writeChunkDataToFile(data); } @Override public int getMinY() { return levelWrapper.getMinHeight(); } diff --git a/core/src/main/java/com/seibel/distanthorizons/core/level/DhClientServerLevel.java b/core/src/main/java/com/seibel/distanthorizons/core/level/DhClientServerLevel.java index 8417a7f74..3156f0666 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/level/DhClientServerLevel.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/level/DhClientServerLevel.java @@ -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.level; import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.ChunkSizedFullDataAccessor; @@ -157,7 +176,7 @@ public class DhClientServerLevel extends DhLevel implements IDhClientLevel, IDhS @Override public void saveWrites(ChunkSizedFullDataAccessor data) { - clientside.saveWrites(data); + clientside.writeChunkDataToFile(data); } @Override diff --git a/core/src/main/java/com/seibel/distanthorizons/core/level/DhLevel.java b/core/src/main/java/com/seibel/distanthorizons/core/level/DhLevel.java index 5fb8d2d86..c77fe15df 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/level/DhLevel.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/level/DhLevel.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.level; import com.seibel.distanthorizons.api.methods.events.abstractEvents.DhApiChunkModifiedEvent; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/level/DhServerLevel.java b/core/src/main/java/com/seibel/distanthorizons/core/level/DhServerLevel.java index b51fe9bad..a8cb7b4e5 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/level/DhServerLevel.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/level/DhServerLevel.java @@ -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.level; import com.seibel.distanthorizons.core.config.AppliedConfigState; @@ -261,7 +280,7 @@ public class DhServerLevel extends DhLevel implements IDhServerLevel public void saveWrites(ChunkSizedFullDataAccessor data) { DhLodPos pos = data.getLodPos().convertToDetailLevel(CompleteFullDataSource.SECTION_SIZE_OFFSET); - getFileHandler().write(new DhSectionPos(pos.detailLevel, pos.x, pos.z), data); + getFileHandler().writeChunkDataToFile(new DhSectionPos(pos.detailLevel, pos.x, pos.z), data); } @Override diff --git a/core/src/main/java/com/seibel/distanthorizons/core/level/IDhClientLevel.java b/core/src/main/java/com/seibel/distanthorizons/core/level/IDhClientLevel.java index 8574faa0d..19bae3b7b 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/level/IDhClientLevel.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/level/IDhClientLevel.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.level; import com.seibel.distanthorizons.core.pos.DhBlockPos; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/level/IDhLevel.java b/core/src/main/java/com/seibel/distanthorizons/core/level/IDhLevel.java index 69ab18061..28e4ed3ea 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/level/IDhLevel.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/level/IDhLevel.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.level; import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.ChunkSizedFullDataAccessor; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/level/IDhServerLevel.java b/core/src/main/java/com/seibel/distanthorizons/core/level/IDhServerLevel.java index b6ed06b04..c34c19f7f 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/level/IDhServerLevel.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/level/IDhServerLevel.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.level; import com.seibel.distanthorizons.core.file.fullDatafile.GeneratedFullDataFileHandler; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/level/IDhWorldGenLevel.java b/core/src/main/java/com/seibel/distanthorizons/core/level/IDhWorldGenLevel.java index a97faaadd..94108b380 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/level/IDhWorldGenLevel.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/level/IDhWorldGenLevel.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.level; import com.seibel.distanthorizons.core.file.fullDatafile.GeneratedFullDataFileHandler; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/level/IKeyedClientLevelManager.java b/core/src/main/java/com/seibel/distanthorizons/core/level/IKeyedClientLevelManager.java index 4485d07f6..ac8654c82 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/level/IKeyedClientLevelManager.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/level/IKeyedClientLevelManager.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.level; import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/level/IServerKeyedClientLevel.java b/core/src/main/java/com/seibel/distanthorizons/core/level/IServerKeyedClientLevel.java index 9452f0d23..5959c2bca 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/level/IServerKeyedClientLevel.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/level/IServerKeyedClientLevel.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.level; import com.seibel.distanthorizons.core.wrapperInterfaces.world.IClientLevelWrapper; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/level/ServerLevelModule.java b/core/src/main/java/com/seibel/distanthorizons/core/level/ServerLevelModule.java index f3537f03c..e73deca38 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/level/ServerLevelModule.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/level/ServerLevelModule.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.level; import com.seibel.distanthorizons.api.interfaces.override.worldGenerator.IDhApiWorldGenerator; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/level/WorldGenModule.java b/core/src/main/java/com/seibel/distanthorizons/core/level/WorldGenModule.java index 1f3b26c1b..912f8bd6c 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/level/WorldGenModule.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/level/WorldGenModule.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.level; import com.seibel.distanthorizons.core.file.fullDatafile.GeneratedFullDataFileHandler; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/logging/ConfigBasedLogger.java b/core/src/main/java/com/seibel/distanthorizons/core/logging/ConfigBasedLogger.java index 272e60477..6b6e4d108 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/logging/ConfigBasedLogger.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/logging/ConfigBasedLogger.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/logging/ConfigBasedSpamLogger.java b/core/src/main/java/com/seibel/distanthorizons/core/logging/ConfigBasedSpamLogger.java index 59216fbed..4c2ba312c 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/logging/ConfigBasedSpamLogger.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/logging/ConfigBasedSpamLogger.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/logging/DhLoggerBuilder.java b/core/src/main/java/com/seibel/distanthorizons/core/logging/DhLoggerBuilder.java index 3587fce2a..9e8bd9be6 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/logging/DhLoggerBuilder.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/logging/DhLoggerBuilder.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.logging; import com.seibel.distanthorizons.coreapi.ModInfo; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/logging/SpamReducedLogger.java b/core/src/main/java/com/seibel/distanthorizons/core/logging/SpamReducedLogger.java index 6d452ef6d..8717016f4 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/logging/SpamReducedLogger.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/logging/SpamReducedLogger.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/logging/f3/F3Screen.java b/core/src/main/java/com/seibel/distanthorizons/core/logging/f3/F3Screen.java index 46658e578..e221f32ec 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/logging/f3/F3Screen.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/logging/f3/F3Screen.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.logging.f3; import com.seibel.distanthorizons.coreapi.ModInfo; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/NetworkClient.java b/core/src/main/java/com/seibel/distanthorizons/core/network/NetworkClient.java index 5dd6618da..3382f2d0e 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/NetworkClient.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/NetworkClient.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.network; import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/NetworkEventSource.java b/core/src/main/java/com/seibel/distanthorizons/core/network/NetworkEventSource.java index 8e15adaca..594ab7437 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/NetworkEventSource.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/NetworkEventSource.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.network; import com.google.common.collect.HashBasedTable; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/NetworkServer.java b/core/src/main/java/com/seibel/distanthorizons/core/network/NetworkServer.java index 4177a23d4..f163b378d 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/NetworkServer.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/NetworkServer.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.network; import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/ScopedNetworkEventSource.java b/core/src/main/java/com/seibel/distanthorizons/core/network/ScopedNetworkEventSource.java index 9f78171b2..2da4ab8fb 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/ScopedNetworkEventSource.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/ScopedNetworkEventSource.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.network; import com.seibel.distanthorizons.core.network.protocol.NetworkMessage; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/exceptions/InvalidLevelException.java b/core/src/main/java/com/seibel/distanthorizons/core/network/exceptions/InvalidLevelException.java index dca7295d8..58af21e89 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/exceptions/InvalidLevelException.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/exceptions/InvalidLevelException.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.network.exceptions; public class InvalidLevelException extends Exception diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/exceptions/InvalidSectionPosException.java b/core/src/main/java/com/seibel/distanthorizons/core/network/exceptions/InvalidSectionPosException.java index cd505c304..e56b0bd69 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/exceptions/InvalidSectionPosException.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/exceptions/InvalidSectionPosException.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.network.exceptions; public class InvalidSectionPosException extends Exception diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/exceptions/RateLimitedException.java b/core/src/main/java/com/seibel/distanthorizons/core/network/exceptions/RateLimitedException.java index df9a1e4ed..804e3d1c3 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/exceptions/RateLimitedException.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/exceptions/RateLimitedException.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.network.exceptions; public class RateLimitedException extends Exception diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/AckMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/AckMessage.java index fd0684e65..865e0999b 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/AckMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/AckMessage.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.network.messages.base; import com.seibel.distanthorizons.core.network.protocol.FutureTrackableNetworkMessage; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/CancelMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/CancelMessage.java index ee0118940..39e0a5ae8 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/CancelMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/CancelMessage.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.network.messages.base; import com.seibel.distanthorizons.core.network.protocol.FutureTrackableNetworkMessage; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/CloseEvent.java b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/CloseEvent.java index a25a47133..fdc81dc1a 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/CloseEvent.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/CloseEvent.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.network.messages.base; import com.seibel.distanthorizons.core.network.protocol.NetworkMessage; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/CloseReasonMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/CloseReasonMessage.java index 21c08989d..1dec83a67 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/CloseReasonMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/CloseReasonMessage.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.network.messages.base; import com.seibel.distanthorizons.core.network.protocol.NetworkMessage; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/ExceptionMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/ExceptionMessage.java index d4d4dc53b..3eb7091b3 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/ExceptionMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/ExceptionMessage.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.network.messages.base; import com.seibel.distanthorizons.core.network.exceptions.InvalidLevelException; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/HelloMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/HelloMessage.java index 6d9689226..232de07ad 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/HelloMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/base/HelloMessage.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.network.messages.base; import com.seibel.distanthorizons.core.network.protocol.NetworkMessage; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/generation/FullDataSourceRequestMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/generation/FullDataSourceRequestMessage.java index 0f6ff84b2..878471f36 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/generation/FullDataSourceRequestMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/generation/FullDataSourceRequestMessage.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.network.messages.fullData.generation; import com.seibel.distanthorizons.core.network.protocol.FutureTrackableNetworkMessage; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/generation/FullDataSourceResponseMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/generation/FullDataSourceResponseMessage.java index 025120380..f804619ec 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/generation/FullDataSourceResponseMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/generation/FullDataSourceResponseMessage.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.network.messages.fullData.generation; import com.seibel.distanthorizons.core.dataObjects.fullData.loader.AbstractFullDataSourceLoader; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/generation/priority/GenTaskPriorityRequestMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/generation/priority/GenTaskPriorityRequestMessage.java index aad805ae3..cb5e4b657 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/generation/priority/GenTaskPriorityRequestMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/generation/priority/GenTaskPriorityRequestMessage.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.network.messages.fullData.generation.priority; import com.seibel.distanthorizons.core.network.protocol.FutureTrackableNetworkMessage; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/generation/priority/GenTaskPriorityResponseMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/generation/priority/GenTaskPriorityResponseMessage.java index 81b95c064..6b0e267b2 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/generation/priority/GenTaskPriorityResponseMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/generation/priority/GenTaskPriorityResponseMessage.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.network.messages.fullData.generation.priority; import com.seibel.distanthorizons.core.network.protocol.FutureTrackableNetworkMessage; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/updates/FullDataChangeSummaryRequestMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/updates/FullDataChangeSummaryRequestMessage.java index 7eefe78f0..f60f3980a 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/updates/FullDataChangeSummaryRequestMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/updates/FullDataChangeSummaryRequestMessage.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.network.messages.fullData.updates; import com.seibel.distanthorizons.core.network.protocol.FutureTrackableNetworkMessage; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/updates/FullDataChangeSummaryResponseMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/updates/FullDataChangeSummaryResponseMessage.java index 24560cd59..8e5ab9bd5 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/updates/FullDataChangeSummaryResponseMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/updates/FullDataChangeSummaryResponseMessage.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.network.messages.fullData.updates; import com.seibel.distanthorizons.core.network.protocol.FutureTrackableNetworkMessage; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/updates/FullDataPartialUpdateMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/updates/FullDataPartialUpdateMessage.java index d1b66dbe8..601c5be7a 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/updates/FullDataPartialUpdateMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/fullData/updates/FullDataPartialUpdateMessage.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.network.messages.fullData.updates; import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.ChunkSizedFullDataAccessor; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/session/PlayerUUIDMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/session/PlayerUUIDMessage.java index 4ae1980ba..185a7f383 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/session/PlayerUUIDMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/session/PlayerUUIDMessage.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.network.messages.session; import com.seibel.distanthorizons.core.network.protocol.FutureTrackableNetworkMessage; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/session/RemotePlayerConfigMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/session/RemotePlayerConfigMessage.java index 9c7c82f0d..0b4bbebf5 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/session/RemotePlayerConfigMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/session/RemotePlayerConfigMessage.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.network.messages.session; import com.seibel.distanthorizons.core.multiplayer.MultiplayerConfig; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/FutureTrackableNetworkMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/FutureTrackableNetworkMessage.java index 16b60da99..881c8039f 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/FutureTrackableNetworkMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/FutureTrackableNetworkMessage.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.network.protocol; import com.seibel.distanthorizons.core.network.messages.base.ExceptionMessage; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/INetworkObject.java b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/INetworkObject.java index 6d2392325..eb4e2e38f 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/INetworkObject.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/INetworkObject.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.network.protocol; import io.netty.buffer.ByteBuf; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/MessageDecoder.java b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/MessageDecoder.java index 114c745d4..fa1f281ef 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/MessageDecoder.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/MessageDecoder.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.network.protocol; import io.netty.buffer.ByteBuf; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/MessageEncoder.java b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/MessageEncoder.java index 5f3c35f60..f42475639 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/MessageEncoder.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/MessageEncoder.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.network.protocol; import io.netty.buffer.ByteBuf; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/MessageHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/MessageHandler.java index 1d4b59a95..6803cc1a5 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/MessageHandler.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/MessageHandler.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.network.protocol; import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/MessageRegistry.java b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/MessageRegistry.java index cd2fd701e..c126ad808 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/MessageRegistry.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/MessageRegistry.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.network.protocol; import com.google.common.collect.BiMap; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/NetworkChannelInitializer.java b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/NetworkChannelInitializer.java index c1e284a4d..c72d8a1d4 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/NetworkChannelInitializer.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/NetworkChannelInitializer.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.network.protocol; import io.netty.channel.*; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/NetworkExceptionHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/NetworkExceptionHandler.java index 578bdc0af..3de51d35f 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/NetworkExceptionHandler.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/NetworkExceptionHandler.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.network.protocol; import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/NetworkMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/NetworkMessage.java index e5a07187b..fe06242da 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/NetworkMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/NetworkMessage.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.network.protocol; import io.netty.channel.ChannelHandlerContext; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/NetworkOutboundExceptionRouter.java b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/NetworkOutboundExceptionRouter.java index dee8614e8..592ce46e3 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/NetworkOutboundExceptionRouter.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/NetworkOutboundExceptionRouter.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.network.protocol; import io.netty.channel.ChannelFutureListener; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/pos/DhBlockPos.java b/core/src/main/java/com/seibel/distanthorizons/core/pos/DhBlockPos.java index 666a37267..1e915d335 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/pos/DhBlockPos.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/pos/DhBlockPos.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.pos; import com.seibel.distanthorizons.core.enums.EDhDirection; import com.seibel.distanthorizons.core.util.LodUtil; +import javax.annotation.Nullable; import java.util.Objects; public class DhBlockPos @@ -44,9 +45,9 @@ public class DhBlockPos public static final int PACKED_Z_OFFSET = PACKED_Y_LENGTH; public static final int PACKED_X_OFFSET = PACKED_Y_LENGTH + PACKED_Z_LENGTH; - public final int x; - public final int y; - public final int z; + public int x; + public int y; + public int z; public DhBlockPos(int x, int y, int z) { @@ -128,11 +129,39 @@ public class DhBlockPos return asLong(x, y, z); } - public DhBlockPos offset(EDhDirection direction) { return this.offset(direction.getNormal().x, direction.getNormal().y, direction.getNormal().z); } - public DhBlockPos offset(int x, int y, int z) { return new DhBlockPos(this.x + x, this.y + y, this.z + z); } + /** creates a new {@link DhBlockPos} with the given offset from the current pos. */ + public DhBlockPos offset(EDhDirection direction) { return this.offset(direction, null); } + /** if not null, mutates "mutablePos" so it matches the current pos after being offset. Otherwise creates a new {@link DhBlockPos}. */ + public DhBlockPos offset(EDhDirection direction, @Nullable DhBlockPos mutablePos) { return this.offset(direction.getNormal().x, direction.getNormal().y, direction.getNormal().z, mutablePos); } - /** Limits the block position to a value between 0 and 15 (inclusive) */ - public DhBlockPos convertToChunkRelativePos() + public DhBlockPos offset(int x, int y, int z) { return this.offset(x,y,z, null); } + public DhBlockPos offset(int x, int y, int z, @Nullable DhBlockPos mutablePos) + { + int newX = this.x + x; + int newY = this.y + y; + int newZ = this.z + z; + + if (mutablePos != null) + { + mutablePos.x = newX; + mutablePos.y = newY; + mutablePos.z = newZ; + + return mutablePos; + } + else + { + return new DhBlockPos(newX, newY, newZ); + } + } + + /** Returns a new {@link DhBlockPos} limits to a value between 0 and 15 (inclusive) */ + public DhBlockPos convertToChunkRelativePos() { return this.convertToChunkRelativePos(null); } + /** + * Limits the block position to a value between 0 and 15 (inclusive) + * If not null, mutates "mutableBlockPos" + */ + public DhBlockPos convertToChunkRelativePos(@Nullable DhBlockPos mutableBlockPos) { // move the position into the range -15 and +15 int relX = (this.x % LodUtil.CHUNK_WIDTH); @@ -143,7 +172,20 @@ public class DhBlockPos relZ = (relZ < 0) ? (relZ + LodUtil.CHUNK_WIDTH) : relZ; // the y value shouldn't need to be changed - return new DhBlockPos(relX, this.y, relZ); + + + if (mutableBlockPos != null) + { + mutableBlockPos.x = relX; + mutableBlockPos.y = this.y; + mutableBlockPos.z = relZ; + + return mutableBlockPos; + } + else + { + return new DhBlockPos(relX, this.y, relZ); + } } /** diff --git a/core/src/main/java/com/seibel/distanthorizons/core/pos/DhBlockPos2D.java b/core/src/main/java/com/seibel/distanthorizons/core/pos/DhBlockPos2D.java index 8cb9ec35d..7ea8b68e6 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/pos/DhBlockPos2D.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/pos/DhBlockPos2D.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.pos; import com.seibel.distanthorizons.coreapi.util.MathUtil; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/pos/DhChunkPos.java b/core/src/main/java/com/seibel/distanthorizons/core/pos/DhChunkPos.java index 0526c25dc..fea474574 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/pos/DhChunkPos.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/pos/DhChunkPos.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/pos/DhLodPos.java b/core/src/main/java/com/seibel/distanthorizons/core/pos/DhLodPos.java index 0e103f52b..f3aa7df76 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/pos/DhLodPos.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/pos/DhLodPos.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.pos; import com.seibel.distanthorizons.core.dataObjects.fullData.sources.interfaces.IFullDataSource; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/pos/DhLodUnit.java b/core/src/main/java/com/seibel/distanthorizons/core/pos/DhLodUnit.java index e2f5642ce..766740936 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/pos/DhLodUnit.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/pos/DhLodUnit.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.pos; import com.seibel.distanthorizons.coreapi.util.BitShiftUtil; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/pos/DhSectionPos.java b/core/src/main/java/com/seibel/distanthorizons/core/pos/DhSectionPos.java index f264a1ea6..fc744673c 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/pos/DhSectionPos.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/pos/DhSectionPos.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.pos; import com.seibel.distanthorizons.core.enums.EDhDirection; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/pos/Pos2D.java b/core/src/main/java/com/seibel/distanthorizons/core/pos/Pos2D.java index 485228474..09988fcee 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/pos/Pos2D.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/pos/Pos2D.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/render/AbstractRenderBuffer.java b/core/src/main/java/com/seibel/distanthorizons/core/render/AbstractRenderBuffer.java index a12b92260..4eb96e0b3 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/AbstractRenderBuffer.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/AbstractRenderBuffer.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/render/DhApiRenderProxy.java b/core/src/main/java/com/seibel/distanthorizons/core/render/DhApiRenderProxy.java index 03cfe56a5..2e5d2ac47 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/DhApiRenderProxy.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/DhApiRenderProxy.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.render; import com.seibel.distanthorizons.api.interfaces.render.IDhApiRenderProxy; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/render/LodQuadTree.java b/core/src/main/java/com/seibel/distanthorizons/core/render/LodQuadTree.java index 8774309f6..430a0ba32 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/LodQuadTree.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/LodQuadTree.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.render; import com.seibel.distanthorizons.api.enums.config.EHorizontalQuality; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/render/LodRenderSection.java b/core/src/main/java/com/seibel/distanthorizons/core/render/LodRenderSection.java index de9a89ca3..18e06d240 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/LodRenderSection.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/LodRenderSection.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.render; import com.seibel.distanthorizons.core.dataObjects.render.ColumnRenderSource; @@ -103,23 +122,7 @@ public class LodRenderSection implements IDebugRenderable // rendering // //===========// - public void enableRendering() - { - // FIXME this is a temporary fix for sections not building the first time, - // this may cause LODs to flash when first loading - // Problem reproduction steps: - // 1. connect to a multiplayer server - // 2. enter spectator - // 3. fly in one direction until section detail levels 7 and 8 appear - // 4. empty LODs should appear - if (!this.isRenderingEnabled) - { - // this only needs to be called when first enabling the section - //this.markBufferDirty(); - } - - this.isRenderingEnabled = true; - } + public void enableRendering() { this.isRenderingEnabled = true; } public void disableRendering() { this.isRenderingEnabled = false; } @@ -141,6 +144,13 @@ public class LodRenderSection implements IDebugRenderable // don't re-load or double load the render source if (this.renderSource != null || this.renderSourceLoadFuture != null) { + // since the render source has been loaded, make sure the render buffers are populated + // FIXME this is a duck tape solution, since the renderBufferRef should be populated elsewhere, but this does fix empty LODs when moving around the world + if (this.activeRenderBufferRef.get() == null) + { + this.markBufferDirty(); // empty LOD fix #3, all solutions revolve around markBufferDirty() + } + return; } @@ -154,7 +164,7 @@ public class LodRenderSection implements IDebugRenderable { DebugRenderer.makeParticle( new DebugRenderer.BoxParticle( - new DebugRenderer.Box(pos, 0, 256f, 0.03f, Color.cyan), + new DebugRenderer.Box(this.pos, 0, 256f, 0.03f, Color.cyan), 0.5, 512f ) ); @@ -223,16 +233,17 @@ public class LodRenderSection implements IDebugRenderable return this.renderSource != null && ( - ( - // if true; either this section represents empty chunks or un-generated chunks. - // Either way, there isn't any data to render, but this should be considered "loaded" - this.renderSource.isEmpty() - ) - || - ( - // check if the buffers have been loaded - this.activeRenderBufferRef.get() != null - ) + ( + // if true; either this section represents empty chunks or un-generated chunks. + // Either way, there isn't any data to render, but this should be considered "loaded" + this.renderSource.isEmpty() + ) + || + ( + // check if the buffers have been loaded + this.activeRenderBufferRef.get() != null // in the case of missing sections, this is probably null + && this.lastSwapLocalVersion != -1 + ) ); } @@ -283,7 +294,7 @@ public class LodRenderSection implements IDebugRenderable } /** @return true if this section is loaded and set to render */ - public boolean canBuildBuffer() { return this.renderSource != null && this.buildRenderBufferFuture == null && !this.renderSource.isEmpty() && this.isBufferOutdated(); } + public boolean canBuildBuffer() { return this.renderSourceLoadFuture == null && this.renderSource != null && this.buildRenderBufferFuture == null && !this.renderSource.isEmpty() && this.isBufferOutdated(); } private boolean isBufferOutdated() { return this.neighborUpdated || this.renderSource.localVersion.get() != this.lastSwapLocalVersion; } /** @return true if this section is loaded and set to render */ diff --git a/core/src/main/java/com/seibel/distanthorizons/core/render/RenderBufferHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/render/RenderBufferHandler.java index cfa5ce0f9..db50ae3fa 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/RenderBufferHandler.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/RenderBufferHandler.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.render; import com.seibel.distanthorizons.core.enums.EDhDirection; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/render/fog/FogSettings.java b/core/src/main/java/com/seibel/distanthorizons/core/render/fog/FogSettings.java index 2c9544f02..98fa739ca 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/fog/FogSettings.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/fog/FogSettings.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/render/fog/LodFogConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/render/fog/LodFogConfig.java index de38029f5..a67e992fe 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/fog/LodFogConfig.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/fog/LodFogConfig.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/render/glObject/GLEnums.java b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/GLEnums.java index 093f8137d..c55dd0d3f 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/GLEnums.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/GLEnums.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/render/glObject/GLProxy.java b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/GLProxy.java index b30b40894..74f79c21a 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/GLProxy.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/GLProxy.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 @@ -486,6 +486,13 @@ public class GLProxy GLMessage.ESeverity severity = msg.severity; RuntimeException ex = new RuntimeException("GL MESSAGE: " + msg); + + if (severity == null) + { + // just in case the message was malformed + severity = GLMessage.ESeverity.LOW; + } + switch (severity) { case HIGH: diff --git a/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/GLState.java b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/GLState.java index 6ccd3429d..2971ac581 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/GLState.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/GLState.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/render/glObject/LightmapTexture.java b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/LightmapTexture.java index 9c83f417a..674cb2e7b 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/LightmapTexture.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/LightmapTexture.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/render/glObject/buffer/GLBuffer.java b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/buffer/GLBuffer.java index 8e0d0ed26..8ba6fd245 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/buffer/GLBuffer.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/buffer/GLBuffer.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.render.glObject.buffer; import com.seibel.distanthorizons.api.enums.config.EGpuUploadMethod; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/buffer/GLElementBuffer.java b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/buffer/GLElementBuffer.java index 5a2adfc12..1dd5289ab 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/buffer/GLElementBuffer.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/buffer/GLElementBuffer.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/render/glObject/buffer/GLVertexBuffer.java b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/buffer/GLVertexBuffer.java index 5ec603bfd..adf087798 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/buffer/GLVertexBuffer.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/buffer/GLVertexBuffer.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/render/glObject/buffer/QuadElementBuffer.java b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/buffer/QuadElementBuffer.java index 5fcbe7677..900bf4f90 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/buffer/QuadElementBuffer.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/buffer/QuadElementBuffer.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.render.glObject.buffer; import com.seibel.distanthorizons.api.enums.config.EGpuUploadMethod; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/shader/Shader.java b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/shader/Shader.java index d2ce874c1..9fdc6b133 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/shader/Shader.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/shader/Shader.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/render/glObject/shader/ShaderProgram.java b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/shader/ShaderProgram.java index ec81ca757..8ade515eb 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/shader/ShaderProgram.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/shader/ShaderProgram.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/render/glObject/vertexAttribute/VertexAttribute.java b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/vertexAttribute/VertexAttribute.java index 37bc18b3a..ff8bbdd65 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/vertexAttribute/VertexAttribute.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/vertexAttribute/VertexAttribute.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/render/glObject/vertexAttribute/VertexAttributePostGL43.java b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/vertexAttribute/VertexAttributePostGL43.java index 140de644b..de2b06bb8 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/vertexAttribute/VertexAttributePostGL43.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/vertexAttribute/VertexAttributePostGL43.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/render/glObject/vertexAttribute/VertexAttributePreGL43.java b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/vertexAttribute/VertexAttributePreGL43.java index b68cb17f1..4e5c8a1f0 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/vertexAttribute/VertexAttributePreGL43.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/glObject/vertexAttribute/VertexAttributePreGL43.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/render/renderer/DebugRenderer.java b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/DebugRenderer.java index b8ad72317..87ad793e0 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/DebugRenderer.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/DebugRenderer.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.render.renderer; import com.seibel.distanthorizons.api.enums.config.EGpuUploadMethod; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/IDebugRenderable.java b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/IDebugRenderable.java index 2cdcda546..cd1d88598 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/IDebugRenderable.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/IDebugRenderable.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.render.renderer; public interface IDebugRenderable diff --git a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/LodRenderProgram.java b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/LodRenderProgram.java index b32469d15..d8e356070 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/LodRenderProgram.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/LodRenderProgram.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/render/renderer/LodRenderer.java b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/LodRenderer.java index dd6eafac6..5c201dcd1 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/LodRenderer.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/LodRenderer.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 @@ -44,7 +44,6 @@ import com.seibel.distanthorizons.coreapi.util.math.Mat4f; import com.seibel.distanthorizons.coreapi.util.math.Vec3d; import com.seibel.distanthorizons.coreapi.util.math.Vec3f; import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; import org.lwjgl.opengl.GL32; import java.awt.*; @@ -283,7 +282,7 @@ public class LodRenderer // TODO: Directional culling this.bufferHandler.renderOpaque(this); - if (Config.Client.Advanced.Graphics.Quality.ssao.get()) + if (Config.Client.Advanced.Graphics.Ssao.enabled.get()) { profiler.popPush("LOD SSAO"); SSAORenderer.INSTANCE.render(partialTicks); diff --git a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/TestRenderer.java b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/TestRenderer.java index 1cefef683..fd91d5dfa 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/TestRenderer.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/TestRenderer.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/render/renderer/shaders/AbstractShaderRenderer.java b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/shaders/AbstractShaderRenderer.java index 0cbf31ca4..4d1b7951d 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/shaders/AbstractShaderRenderer.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/shaders/AbstractShaderRenderer.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.render.renderer.shaders; import com.seibel.distanthorizons.api.enums.config.EGpuUploadMethod; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/shaders/DarkShader.java b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/shaders/DarkShader.java index 618cf2b00..b0eab9b78 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/shaders/DarkShader.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/shaders/DarkShader.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.render.renderer.shaders; import com.seibel.distanthorizons.core.render.glObject.shader.ShaderProgram; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/shaders/FogShader.java b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/shaders/FogShader.java index 4fe99dcc8..3b23611c9 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/shaders/FogShader.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/shaders/FogShader.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.render.renderer.shaders; import com.seibel.distanthorizons.api.enums.rendering.EFogColorMode; @@ -21,7 +40,7 @@ public class FogShader extends AbstractShaderRenderer private static final IVersionConstants VERSION_CONSTANTS = SingletonInjector.INSTANCE.get(IVersionConstants.class); - public final int gModelViewProjectionUniform; + public final int gInvertedModelViewProjectionUniform; public final int gDepthMapUniform; // Fog Uniforms @@ -48,7 +67,7 @@ public class FogShader extends AbstractShaderRenderer // because disabling fog can cause the GLSL to optimize out most (if not all) uniforms - this.gModelViewProjectionUniform = this.shader.tryGetUniformLocation("gMvmProj"); + this.gInvertedModelViewProjectionUniform = this.shader.tryGetUniformLocation("gInvMvmProj"); this.gDepthMapUniform = this.shader.tryGetUniformLocation("gDepthMap"); // Fog uniforms @@ -119,7 +138,11 @@ public class FogShader extends AbstractShaderRenderer public void setModelViewProjectionMatrix(Mat4f combinedModelViewProjectionMatrix) { this.shader.bind(); - this.shader.setUniform(this.gModelViewProjectionUniform, combinedModelViewProjectionMatrix); + + Mat4f inverseMvmProjMatrix = new Mat4f(combinedModelViewProjectionMatrix); + inverseMvmProjMatrix.invert(); + this.shader.setUniform(this.gInvertedModelViewProjectionUniform, inverseMvmProjMatrix); + this.shader.unbind(); } diff --git a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/shaders/SSAORenderer.java b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/shaders/SSAORenderer.java index 553150f8a..364b3ba78 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/shaders/SSAORenderer.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/shaders/SSAORenderer.java @@ -1,6 +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.render.renderer.shaders; import com.seibel.distanthorizons.api.enums.config.EGpuUploadMethod; +import com.seibel.distanthorizons.core.config.Config; import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector; import com.seibel.distanthorizons.core.render.glObject.GLState; import com.seibel.distanthorizons.core.render.glObject.buffer.GLVertexBuffer; @@ -22,7 +42,6 @@ public class SSAORenderer private static final IMinecraftRenderWrapper MC_RENDER = SingletonInjector.INSTANCE.get(IMinecraftRenderWrapper.class); - private static final int MAX_KERNEL_SIZE = 128; private static final float[] box_vertices = { -1, -1, 1, -1, @@ -33,15 +52,13 @@ public class SSAORenderer }; - private ShaderProgram ssaoShader; private ShaderProgram applyShader; + private GLVertexBuffer boxBuffer; private VertexAttribute va; private boolean init = false; - private float[] kernel = new float[MAX_KERNEL_SIZE * 3]; - private int width = -1; private int height = -1; private int ssaoFramebuffer = -1; @@ -53,10 +70,12 @@ public class SSAORenderer private static class SsaoShaderUniforms { public int gProjUniform; - public int gSampleRadUniform; - public int gFactorUniform; - public int gPowerUniform; - public int gKernelUniform; + public int gInvProjUniform; + public int gSampleCountUniform; + public int gRadiusUniform; + public int gStrengthUniform; + public int gMinLightUniform; + public int gBiasUniform; public int gDepthMapUniform; } @@ -66,10 +85,13 @@ public class SSAORenderer { public int gSSAOMapUniform; public int gDepthMapUniform; + public int gViewSizeUniform; + public int gBlurRadiusUniform; + public int gNearUniform; + public int gFarUniform; } - //=============// // constructor // //=============// @@ -78,42 +100,39 @@ public class SSAORenderer public void init() { - if (this.init) - { - return; - } - - + if (this.init) return; this.init = true; + this.va = VertexAttribute.create(); this.va.bind(); + // Pos this.va.setVertexAttribute(0, 0, VertexAttribute.VertexPointer.addVec2Pointer(false)); this.va.completeAndCheck(Float.BYTES * 2); this.ssaoShader = new ShaderProgram("shaders/normal.vert", "shaders/ssao/ao.frag", "fragColor", new String[]{"vPosition"}); - this.applyShader = new ShaderProgram("shaders/normal.vert", "shaders/ssao/apply-frag.frag", + this.applyShader = new ShaderProgram("shaders/normal.vert", "shaders/ssao/apply.frag", "fragColor", new String[]{"vPosition"}); - - // SSAO uniform setup this.ssaoShaderUniforms.gProjUniform = this.ssaoShader.getUniformLocation("gProj"); - this.ssaoShaderUniforms.gSampleRadUniform = this.ssaoShader.getUniformLocation("gSampleRad"); - this.ssaoShaderUniforms.gFactorUniform = this.ssaoShader.getUniformLocation("gFactor"); - this.ssaoShaderUniforms.gPowerUniform = this.ssaoShader.getUniformLocation("gPower"); - this.ssaoShaderUniforms.gKernelUniform = this.ssaoShader.getUniformLocation("gKernel"); + this.ssaoShaderUniforms.gInvProjUniform = this.ssaoShader.getUniformLocation("gInvProj"); + this.ssaoShaderUniforms.gSampleCountUniform = this.ssaoShader.getUniformLocation("gSampleCount"); + this.ssaoShaderUniforms.gRadiusUniform = this.ssaoShader.getUniformLocation("gRadius"); + this.ssaoShaderUniforms.gStrengthUniform = this.ssaoShader.getUniformLocation("gStrength"); + this.ssaoShaderUniforms.gMinLightUniform = this.ssaoShader.getUniformLocation("gMinLight"); + this.ssaoShaderUniforms.gBiasUniform = this.ssaoShader.getUniformLocation("gBias"); this.ssaoShaderUniforms.gDepthMapUniform = this.ssaoShader.getUniformLocation("gDepthMap"); // Apply uniform setup this.applyShaderUniforms.gSSAOMapUniform = this.applyShader.getUniformLocation("gSSAOMap"); this.applyShaderUniforms.gDepthMapUniform = this.applyShader.getUniformLocation("gDepthMap"); + this.applyShaderUniforms.gViewSizeUniform = tryGetUniformLocation(this.applyShader, "gViewSize"); + this.applyShaderUniforms.gBlurRadiusUniform = tryGetUniformLocation(this.applyShader, "gBlurRadius"); + this.applyShaderUniforms.gNearUniform = tryGetUniformLocation(this.applyShader, "gNear"); + this.applyShaderUniforms.gFarUniform = tryGetUniformLocation(this.applyShader, "gFar"); - - - // Generate kernel - this.kernel = genKernel(); // Framebuffer this.createBuffer(); } @@ -137,53 +156,24 @@ public class SSAORenderer this.ssaoTexture = GL32.glGenTextures(); GL32.glBindTexture(GL32.GL_TEXTURE_2D, this.ssaoTexture); - GL32.glTexImage2D(GL32.GL_TEXTURE_2D, 0, GL32.GL_RED, width, height, 0, GL32.GL_RED, GL32.GL_FLOAT, (ByteBuffer) null); - GL32.glTexParameteri(GL32.GL_TEXTURE_2D, GL32.GL_TEXTURE_MIN_FILTER, GL32.GL_NEAREST); - GL32.glTexParameteri(GL32.GL_TEXTURE_2D, GL32.GL_TEXTURE_MAG_FILTER, GL32.GL_NEAREST); + GL32.glTexImage2D(GL32.GL_TEXTURE_2D, 0, GL32.GL_R16F, width, height, 0, GL32.GL_RED, GL32.GL_HALF_FLOAT, (ByteBuffer) null); + GL32.glTexParameteri(GL32.GL_TEXTURE_2D, GL32.GL_TEXTURE_MIN_FILTER, GL32.GL_LINEAR); + GL32.glTexParameteri(GL32.GL_TEXTURE_2D, GL32.GL_TEXTURE_MAG_FILTER, GL32.GL_LINEAR); GL32.glFramebufferTexture2D(GL32.GL_FRAMEBUFFER, GL32.GL_COLOR_ATTACHMENT0, GL32.GL_TEXTURE_2D, this.ssaoTexture, 0); } - + private void createBuffer() { ByteBuffer buffer = ByteBuffer.allocateDirect(box_vertices.length * Float.BYTES); buffer.order(ByteOrder.nativeOrder()); buffer.asFloatBuffer().put(box_vertices); buffer.rewind(); + this.boxBuffer = new GLVertexBuffer(false); this.boxBuffer.bind(); this.boxBuffer.uploadBuffer(buffer, box_vertices.length, EGpuUploadMethod.DATA, box_vertices.length * Float.BYTES); } - private static float[] genKernel() - { - float[] kernel = new float[MAX_KERNEL_SIZE * 3]; - for (int i = 0; i < MAX_KERNEL_SIZE; i++) - { - float sampleX = (float) (Math.random() * 2.0 - 1.0); - float sampleY = (float) (Math.random() * 2.0 - 1.0); - float sampleZ = (float) Math.random(); - - - // Normalize - float magnitude = (float) Math.sqrt(Math.pow(sampleX, 2) + Math.pow(sampleY, 2) + Math.pow(sampleZ, 2)); - sampleX /= magnitude; - sampleY /= magnitude; - sampleZ /= magnitude; - - float scale = i / (float) MAX_KERNEL_SIZE; - float interpolatedScale = (float) (0.1 + (scale * scale) * (0.9)); - - sampleX *= interpolatedScale; - sampleY *= interpolatedScale; - sampleZ *= interpolatedScale; - kernel[i * 3] = sampleX; - kernel[i * 3 + 1] = sampleY; - kernel[i * 3 + 2] = sampleZ; - } - return kernel; - } - - //========// // render // @@ -192,7 +182,9 @@ public class SSAORenderer public void render(float partialTicks) { GLState state = new GLState(); + this.init(); + int width = MC_RENDER.getTargetFrameBufferViewportWidth(); int height = MC_RENDER.getTargetFrameBufferViewportHeight(); @@ -205,22 +197,36 @@ public class SSAORenderer GL32.glBindFramebuffer(GL32.GL_FRAMEBUFFER, this.ssaoFramebuffer); GL32.glViewport(0, 0, width, height); - GL32.glDisable(GL32.GL_DEPTH_TEST); - GL32.glDisable(GL32.GL_BLEND); GL32.glDisable(GL32.GL_SCISSOR_TEST); + GL32.glDisable(GL32.GL_DEPTH_TEST); + GL32.glDisable(GL11.GL_BLEND); + float near = RenderUtil.getNearClipPlaneDistanceInBlocks(partialTicks); + float far = (float) ((RenderUtil.getFarClipPlaneDistanceInBlocks() + LodUtil.REGION_WIDTH) * Math.sqrt(2)); Mat4f perspective = Mat4f.perspective( (float) MC_RENDER.getFov(partialTicks), - MC_RENDER.getTargetFrameBufferViewportWidth() / (float) MC_RENDER.getTargetFrameBufferViewportHeight(), - RenderUtil.getNearClipPlaneDistanceInBlocks(partialTicks), - (float) ((RenderUtil.getFarClipPlaneDistanceInBlocks() + LodUtil.REGION_WIDTH) * Math.sqrt(2))); + width / (float) height, + near, far); + + Mat4f invertedPerspective = new Mat4f(perspective); + invertedPerspective.invert(); + + int sampleCount = Config.Client.Advanced.Graphics.Ssao.sampleCount.get(); + int blurRadius = Config.Client.Advanced.Graphics.Ssao.blurRadius.get(); + float radius = Config.Client.Advanced.Graphics.Ssao.radius.get().floatValue(); + float strength = Config.Client.Advanced.Graphics.Ssao.strength.get().floatValue(); + float minLight = Config.Client.Advanced.Graphics.Ssao.minLight.get().floatValue(); + float bias = Config.Client.Advanced.Graphics.Ssao.bias.get().floatValue(); this.ssaoShader.bind(); this.ssaoShader.setUniform(this.ssaoShaderUniforms.gProjUniform, perspective); - this.ssaoShader.setUniform(this.ssaoShaderUniforms.gSampleRadUniform, 3.0f); - this.ssaoShader.setUniform(this.ssaoShaderUniforms.gFactorUniform, 0.8f); - this.ssaoShader.setUniform(this.ssaoShaderUniforms.gPowerUniform, 1.0f); + this.ssaoShader.setUniform(this.ssaoShaderUniforms.gInvProjUniform, invertedPerspective); + this.ssaoShader.setUniform(this.ssaoShaderUniforms.gSampleCountUniform, sampleCount); + this.ssaoShader.setUniform(this.ssaoShaderUniforms.gRadiusUniform, radius); + this.ssaoShader.setUniform(this.ssaoShaderUniforms.gStrengthUniform, strength); + this.ssaoShader.setUniform(this.ssaoShaderUniforms.gMinLightUniform, minLight); + this.ssaoShader.setUniform(this.ssaoShaderUniforms.gBiasUniform, bias); this.va.bind(); this.va.bindBufferToAllBindingPoint(this.boxBuffer.getId()); @@ -228,35 +234,52 @@ public class SSAORenderer GL32.glActiveTexture(GL32.GL_TEXTURE0); GL32.glBindTexture(GL32.GL_TEXTURE_2D, MC_RENDER.getDepthTextureId()); - GL32.glUniform3fv(this.ssaoShaderUniforms.gKernelUniform, this.kernel); GL32.glUniform1i(this.ssaoShaderUniforms.gDepthMapUniform, 0); GL32.glDrawArrays(GL32.GL_TRIANGLES, 0, 6); - - this.applyShader.bind(); - GL32.glEnable(GL11.GL_BLEND); - GL32.glBlendFunc(GL32.GL_SRC_ALPHA, GL32.GL_ONE_MINUS_SRC_ALPHA); GL32.glBindFramebuffer(GL32.GL_FRAMEBUFFER, MC_RENDER.getTargetFrameBuffer()); + GL32.glEnable(GL11.GL_BLEND); + GL32.glBlendEquation(GL32.GL_FUNC_ADD); + GL32.glBlendFuncSeparate(GL32.GL_ZERO, GL32.GL_SRC_ALPHA, GL32.GL_ZERO, GL32.GL_ONE); + GL32.glActiveTexture(GL32.GL_TEXTURE0); GL32.glBindTexture(GL32.GL_TEXTURE_2D, this.ssaoTexture); GL32.glUniform1i(this.applyShaderUniforms.gSSAOMapUniform, 0); GL32.glActiveTexture(GL32.GL_TEXTURE1); GL32.glBindTexture(GL32.GL_TEXTURE_2D, MC_RENDER.getDepthTextureId()); GL32.glUniform1i(this.applyShaderUniforms.gDepthMapUniform, 1); + GL32.glUniform1i(this.applyShaderUniforms.gBlurRadiusUniform, blurRadius); + + if (this.applyShaderUniforms.gViewSizeUniform >= 0) + GL32.glUniform2f(this.applyShaderUniforms.gViewSizeUniform, width, height); + + if (this.applyShaderUniforms.gNearUniform >= 0) + GL32.glUniform1f(this.applyShaderUniforms.gNearUniform, near); + + if (this.applyShaderUniforms.gFarUniform >= 0) + GL32.glUniform1f(this.applyShaderUniforms.gFarUniform, far); GL32.glDrawArrays(GL32.GL_TRIANGLES, 0, 6); - state.restore(); } + private int tryGetUniformLocation(ShaderProgram shader, String uniformName) + { + try { + return shader.getUniformLocation(uniformName); + } + catch (RuntimeException error) { + return -1; + } + } + public void free() { this.ssaoShader.free(); this.applyShader.free(); } - } diff --git a/core/src/main/java/com/seibel/distanthorizons/core/render/vertexFormat/DefaultLodVertexFormats.java b/core/src/main/java/com/seibel/distanthorizons/core/render/vertexFormat/DefaultLodVertexFormats.java index af8592955..54887840b 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/vertexFormat/DefaultLodVertexFormats.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/vertexFormat/DefaultLodVertexFormats.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/render/vertexFormat/LodVertexFormat.java b/core/src/main/java/com/seibel/distanthorizons/core/render/vertexFormat/LodVertexFormat.java index 952ead328..47c6a5043 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/vertexFormat/LodVertexFormat.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/vertexFormat/LodVertexFormat.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/render/vertexFormat/LodVertexFormatElement.java b/core/src/main/java/com/seibel/distanthorizons/core/render/vertexFormat/LodVertexFormatElement.java index 69aa584e6..6d506cef7 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/vertexFormat/LodVertexFormatElement.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/vertexFormat/LodVertexFormatElement.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/util/AnnotationUtil.java b/core/src/main/java/com/seibel/distanthorizons/core/util/AnnotationUtil.java index f0e4e4025..a139e574a 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/AnnotationUtil.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/AnnotationUtil.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.util; import org.apache.logging.log4j.LogManager; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/AtomicsUtil.java b/core/src/main/java/com/seibel/distanthorizons/core/util/AtomicsUtil.java index 3ce0bc955..99c3a6b59 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/AtomicsUtil.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/AtomicsUtil.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.util; import it.unimi.dsi.fastutil.booleans.BooleanObjectImmutablePair; @@ -36,13 +55,23 @@ public class AtomicsUtil } } + /** + * If the {@link AtomicReference}'s current value matches the expected value, the newValue will be swapped in and the expected value returned.
+ * If the {@link AtomicReference}'s current value DOESN'T match the expected value, the {@link AtomicReference}'s current value will be returned without modification. + */ public static T compareAndExchange(AtomicReference atomic, T expected, T newValue) { while (true) { T oldValue = atomic.get(); - if (oldValue != expected) return oldValue; - if (atomic.weakCompareAndSet(expected, newValue)) return expected; + if (oldValue != expected) + { + return oldValue; + } + else if (atomic.weakCompareAndSet(expected, newValue)) + { + return expected; + } } } diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/ColorUtil.java b/core/src/main/java/com/seibel/distanthorizons/core/util/ColorUtil.java index d75fc9bd6..f43e33c95 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/ColorUtil.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/ColorUtil.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/util/EnumUtil.java b/core/src/main/java/com/seibel/distanthorizons/core/util/EnumUtil.java index 65f954789..1b40f1643 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/EnumUtil.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/EnumUtil.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/util/FileScanUtil.java b/core/src/main/java/com/seibel/distanthorizons/core/util/FileScanUtil.java deleted file mode 100644 index fced83bda..000000000 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/FileScanUtil.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.seibel.distanthorizons.core.util; - -import com.seibel.distanthorizons.core.file.fullDatafile.IFullDataSourceProvider; -import com.seibel.distanthorizons.core.file.renderfile.ILodRenderSourceProvider; -import com.seibel.distanthorizons.core.file.renderfile.RenderSourceFileHandler; -import com.seibel.distanthorizons.core.file.structure.AbstractSaveStructure; -import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; -import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper; -import org.apache.logging.log4j.Logger; - -import javax.annotation.Nullable; -import java.io.File; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -// Static util class?? -public class FileScanUtil -{ - private static final Logger LOGGER = DhLoggerBuilder.getLogger(); - public static final int MAX_SCAN_DEPTH = 5; - public static final String LOD_FILE_POSTFIX = ".lod"; - public static final String RENDER_FILE_POSTFIX = ".rlod"; - - public static void scanFiles( - AbstractSaveStructure saveStructure, ILevelWrapper levelWrapper, - @Nullable IFullDataSourceProvider dataSourceProvider, - @Nullable ILodRenderSourceProvider renderSourceProvider) - { - if (dataSourceProvider != null) - { - try (Stream pathStream = Files.walk(saveStructure.getFullDataFolder(levelWrapper).toPath(), MAX_SCAN_DEPTH)) - { - List files = pathStream.filter( - path -> path.toFile().getName().endsWith(LOD_FILE_POSTFIX) && path.toFile().isFile() - ).map(Path::toFile).collect(Collectors.toList()); - LOGGER.info("Found " + files.size() + " full data files for " + levelWrapper + " in " + saveStructure); - dataSourceProvider.addScannedFile(files); - } - catch (Exception e) - { - LOGGER.error("Failed to scan and collect full data files for " + levelWrapper + " in " + saveStructure, e); - } - } - - if (renderSourceProvider != null) - { - try (Stream pathStream = Files.walk(saveStructure.getRenderCacheFolder(levelWrapper).toPath(), MAX_SCAN_DEPTH)) - { - List files = pathStream.filter( - path -> path.toFile().getName().endsWith(RENDER_FILE_POSTFIX) && path.toFile().isFile() - ).map(Path::toFile).collect(Collectors.toList()); - LOGGER.info("Found " + files.size() + " render cache files for " + levelWrapper + " in " + saveStructure); - renderSourceProvider.addScannedFile(files); - } - catch (Exception e) - { - LOGGER.error("Failed to scan and collect cache files for " + levelWrapper + " in " + saveStructure, e); - } - } - } - -} diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/FileUtil.java b/core/src/main/java/com/seibel/distanthorizons/core/util/FileUtil.java index a1d620f2d..d311e1432 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/FileUtil.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/FileUtil.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.util; import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/FullDataPointUtil.java b/core/src/main/java/com/seibel/distanthorizons/core/util/FullDataPointUtil.java index 9a82ad3cd..c02f567af 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/FullDataPointUtil.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/FullDataPointUtil.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.util; // diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/LodUtil.java b/core/src/main/java/com/seibel/distanthorizons/core/util/LodUtil.java index 407097569..bb0533fb3 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/LodUtil.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/LodUtil.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/util/MetaFileScanUtil.java b/core/src/main/java/com/seibel/distanthorizons/core/util/MetaFileScanUtil.java new file mode 100644 index 000000000..3b17c65f5 --- /dev/null +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/MetaFileScanUtil.java @@ -0,0 +1,257 @@ +/* + * 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.util; + +import com.google.common.collect.HashMultimap; +import com.seibel.distanthorizons.core.file.fullDatafile.FullDataFileHandler; +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.renderfile.ILodRenderSourceProvider; +import com.seibel.distanthorizons.core.file.renderfile.RenderMetaDataFile; +import com.seibel.distanthorizons.core.file.structure.AbstractSaveStructure; +import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; +import com.seibel.distanthorizons.core.pos.DhSectionPos; +import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper; +import org.apache.logging.log4j.Logger; +import org.jetbrains.annotations.Nullable; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** Used to pull in the initial files used by both {@link IFullDataSourceProvider} and {@link ILodRenderSourceProvider}s. */ +public class MetaFileScanUtil +{ + private static final Logger LOGGER = DhLoggerBuilder.getLogger(); + public static final int MAX_SCAN_DEPTH = 5; + + + + //===============// + // file scanning // + //===============// + + // file scanning means to find all File's in a given directory + + // TODO merge with the below method + public static void scanFullDataFiles(AbstractSaveStructure saveStructure, ILevelWrapper levelWrapper, IFullDataSourceProvider dataSourceProvider) + { + try (Stream pathStream = Files.walk(saveStructure.getFullDataFolder(levelWrapper).toPath(), MAX_SCAN_DEPTH)) + { + List files = pathStream.filter( + path -> path.toFile().getName().endsWith(FullDataMetaFile.FILE_SUFFIX) && path.toFile().isFile() + ).map(Path::toFile).collect(Collectors.toList()); + LOGGER.info("Found " + files.size() + " full data files for " + levelWrapper + " in " + saveStructure); + dataSourceProvider.addScannedFiles(files); + } + catch (Exception e) + { + LOGGER.error("Failed to scan and collect full data files for " + levelWrapper + " in " + saveStructure, e); + } + } + + // TODO merge with the above method + public static void scanRenderFiles(AbstractSaveStructure saveStructure, ILevelWrapper levelWrapper, ILodRenderSourceProvider renderSourceProvider) + { + try (Stream pathStream = Files.walk(saveStructure.getRenderCacheFolder(levelWrapper).toPath(), MAX_SCAN_DEPTH)) + { + List files = pathStream.filter( + path -> path.toFile().getName().endsWith(RenderMetaDataFile.FILE_SUFFIX) && path.toFile().isFile() + ).map(Path::toFile).collect(Collectors.toList()); + LOGGER.info("Found " + files.size() + " render cache files for " + levelWrapper + " in " + saveStructure); + renderSourceProvider.addScannedFiles(files); + } + catch (Exception e) + { + LOGGER.error("Failed to scan and collect cache files for " + levelWrapper + " in " + saveStructure, e); + } + } + + + + //======================// + // Adding scanned files // + //======================// + + /** + * Caller must ensure that this method is called only once, + * and that the {@link FullDataFileHandler} is not used before this method is called. + */ + public static void addScannedFiles( + Collection detectedFiles, boolean useLazyLoading, String fileSuffix, + ICreateMetadataFunc createMetadataFunc, + IAddUnloadedFileFunc addUnloadedFileFunc, IAddLoadedMetaFileFunc addLoadedMetaFileFunc) + { + if (useLazyLoading) + { + lazyAddScannedFile(detectedFiles, fileSuffix, addUnloadedFileFunc); + } + else + { + immediateAddScannedFile(detectedFiles, createMetadataFunc, addLoadedMetaFileFunc); + } + } + private static void lazyAddScannedFile(Collection detectedFiles, String fileSuffix, IAddUnloadedFileFunc addUnloadedFileFunc) + { + 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 file: " + ((file != null) ? file.getPath() : "NULL")); + continue; + } + + try + { + DhSectionPos pos = decodePositionFromFileName(file, fileSuffix); + if (pos != null) + { + addUnloadedFileFunc.addFile(pos, file); + } + } + catch (Exception e) + { + LOGGER.error("Failed to read data meta file at " + file + ": ", e); + FileUtil.renameCorruptedFile(file); + } + } + } + private static void immediateAddScannedFile( + Collection detectedFiles, + ICreateMetadataFunc createMetadataFunc, IAddLoadedMetaFileFunc addLoadedMetaFileFunc) + { + HashMultimap filesByPos = HashMultimap.create(); + { // Sort files by pos. + for (File file : detectedFiles) + { + try + { + AbstractMetaDataContainerFile metaFile = createMetadataFunc.createFile(file); + filesByPos.put(metaFile.pos, metaFile); + } + catch (IOException e) + { + LOGGER.error("Failed to read data meta file at " + file + ": ", 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); + AbstractMetaDataContainerFile metaFileToUse; + if (metaFiles.size() > 1) + { + // sort by the file's last modified date + metaFileToUse = Collections.max(metaFiles, Comparator.comparingLong(fullDataMetaFile -> fullDataMetaFile.file.lastModified())); + + // log the duplicate files + StringBuilder duplicateMessage = new StringBuilder(); + duplicateMessage.append("Multiple files with the same pos: ").append(pos).append("\n"); + for (AbstractMetaDataContainerFile metaFile : metaFiles) + { + duplicateMessage.append("\t").append(metaFile.file).append("\n"); + } + duplicateMessage.append("\tUsing: ").append(metaFileToUse.file).append("\n"); + duplicateMessage.append("(Other files will be renamed by appending \".old\" to their name.)"); + LOGGER.warn(duplicateMessage.toString()); + + + + // Rename all other files with the same pos to .old + for (AbstractMetaDataContainerFile metaFile : metaFiles) + { + if (metaFile == metaFileToUse) + { + 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 + { + metaFileToUse = metaFiles.iterator().next(); + } + + // Add file to the list of files. + addLoadedMetaFileFunc.addFile(pos, metaFileToUse); + } + } + + + + //================// + // helper methods // + //================// + + /** @return null if the file name can't be parsed into a {@link DhSectionPos} */ + @Nullable + public static DhSectionPos decodePositionFromFileName(File file, String fileSuffix) + { + String fileName = file.getName(); + if (!fileName.endsWith(fileSuffix)) + { + return null; + } + + fileName = fileName.substring(0, fileName.length() - 4); + return DhSectionPos.deserialize(fileName); + } + + + + //===================// + // helper interfaces // + //===================// + + @FunctionalInterface + public interface ICreateMetadataFunc { AbstractMetaDataContainerFile createFile(File file) throws IOException; } + + @FunctionalInterface + public interface IAddUnloadedFileFunc { void addFile(DhSectionPos pos, File file); } + @FunctionalInterface + public interface IAddLoadedMetaFileFunc { void addFile(DhSectionPos pos, AbstractMetaDataContainerFile metaFile); } + +} diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/RayCastUtil.java b/core/src/main/java/com/seibel/distanthorizons/core/util/RayCastUtil.java index eb3602962..140a8aed1 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/RayCastUtil.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/RayCastUtil.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/util/RenderDataPointUtil.java b/core/src/main/java/com/seibel/distanthorizons/core/util/RenderDataPointUtil.java index e2e58a077..4edca2d40 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/RenderDataPointUtil.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/RenderDataPointUtil.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/util/RenderUtil.java b/core/src/main/java/com/seibel/distanthorizons/core/util/RenderUtil.java index d0a5813db..ca92df301 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/RenderUtil.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/RenderUtil.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 @@ -264,7 +264,7 @@ public class RenderUtil return false; //Level is not ready yet. } - if (MC_RENDER.playerHasBlindnessEffect()) + if (MC_RENDER.playerHasBlindingEffect()) { // if the player is blind, don't render LODs, // and don't change minecraft's fog diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/ThreadUtil.java b/core/src/main/java/com/seibel/distanthorizons/core/util/ThreadUtil.java index 3045927fb..0febec134 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/ThreadUtil.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/ThreadUtil.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.util; import com.seibel.distanthorizons.core.config.listeners.ConfigChangeListener; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/gridList/ArrayGridList.java b/core/src/main/java/com/seibel/distanthorizons/core/util/gridList/ArrayGridList.java index bfb54ae65..1d0def119 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/gridList/ArrayGridList.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/gridList/ArrayGridList.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/util/gridList/EdgeDistanceBooleanGrid.java b/core/src/main/java/com/seibel/distanthorizons/core/util/gridList/EdgeDistanceBooleanGrid.java index 1a496bf74..c6f3dbcd5 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/gridList/EdgeDistanceBooleanGrid.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/gridList/EdgeDistanceBooleanGrid.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/util/gridList/MovableGridRingList.java b/core/src/main/java/com/seibel/distanthorizons/core/util/gridList/MovableGridRingList.java index ae61bb338..1c26d28b6 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/gridList/MovableGridRingList.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/gridList/MovableGridRingList.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/util/gridList/PosArrayGridList.java b/core/src/main/java/com/seibel/distanthorizons/core/util/gridList/PosArrayGridList.java index 11d4813d9..e780f33a8 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/gridList/PosArrayGridList.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/gridList/PosArrayGridList.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/util/math/UnitBytes.java b/core/src/main/java/com/seibel/distanthorizons/core/util/math/UnitBytes.java index 3b8bcd089..854b250f1 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/math/UnitBytes.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/math/UnitBytes.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/util/objects/BoolType.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/BoolType.java index 0efa0a8d0..38a0f297c 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/BoolType.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/BoolType.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/util/objects/DhThreadFactory.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/DhThreadFactory.java index 305f7c0fd..02e483b49 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/DhThreadFactory.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/DhThreadFactory.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/util/objects/DummyRunExecutorService.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/DummyRunExecutorService.java index b8e2d95e7..407cf3673 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/DummyRunExecutorService.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/DummyRunExecutorService.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/util/objects/EventLoop.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/EventLoop.java index 9d7f3b555..c13486b69 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/EventLoop.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/EventLoop.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.util.objects; import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/EventTimer.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/EventTimer.java index 6b8fa75bb..8b6b28b09 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/EventTimer.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/EventTimer.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.util.objects; import java.time.Duration; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/GLMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/GLMessage.java index 6f3ad7464..238e72fa9 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/GLMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/GLMessage.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/util/objects/GLMessageOutputStream.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/GLMessageOutputStream.java index 1368b4528..77eb96b19 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/GLMessageOutputStream.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/GLMessageOutputStream.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/util/objects/Pair.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/Pair.java index fc83e5921..73535e8cb 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/Pair.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/Pair.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.util.objects; import java.util.Objects; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/ParsedIp.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/ParsedIp.java index a8ce0ac95..f5baee3db 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/ParsedIp.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/ParsedIp.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/util/objects/RateLimitedThreadPoolExecutor.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/RateLimitedThreadPoolExecutor.java index ee77c442c..fbfb20c5a 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/RateLimitedThreadPoolExecutor.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/RateLimitedThreadPoolExecutor.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.util.objects; import java.util.concurrent.*; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/Reference.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/Reference.java index 6686cedd9..8f0cdd3cd 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/Reference.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/Reference.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.util.objects; public class Reference diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/SortedArraySet.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/SortedArraySet.java index 781d25076..4e388eb86 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/SortedArraySet.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/SortedArraySet.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.util.objects; import java.util.*; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/StatsMap.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/StatsMap.java index 510d1d98f..476c4f1e1 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/StatsMap.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/StatsMap.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/util/objects/UncheckedInterruptedException.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/UncheckedInterruptedException.java index 5cfe0833f..1177c4338 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/UncheckedInterruptedException.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/UncheckedInterruptedException.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.util.objects; import com.seibel.distanthorizons.core.util.LodUtil; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/dataStreams/DhDataInputStream.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/dataStreams/DhDataInputStream.java index 76f14256b..81ae64895 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/dataStreams/DhDataInputStream.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/dataStreams/DhDataInputStream.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.util.objects.dataStreams; import net.jpountz.lz4.LZ4FrameInputStream; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/dataStreams/DhDataOutputStream.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/dataStreams/DhDataOutputStream.java index ae1df8f24..650aab083 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/dataStreams/DhDataOutputStream.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/dataStreams/DhDataOutputStream.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.util.objects.dataStreams; import net.jpountz.lz4.LZ4FrameOutputStream; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/QuadNode.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/QuadNode.java index 254b2b6a8..e2b585c40 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/QuadNode.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/QuadNode.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.util.objects.quadTree; import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/QuadTree.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/QuadTree.java index 402aaa9da..82437dcc7 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/QuadTree.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/QuadTree.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.util.objects.quadTree; import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/iterators/QuadNodeChildIndexIterator.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/iterators/QuadNodeChildIndexIterator.java index 4a848a85a..77dda14d1 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/iterators/QuadNodeChildIndexIterator.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/iterators/QuadNodeChildIndexIterator.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.util.objects.quadTree.iterators; import com.seibel.distanthorizons.core.util.objects.quadTree.QuadNode; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/iterators/QuadNodeDirectChildIterator.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/iterators/QuadNodeDirectChildIterator.java index c30a89795..7e0d2a683 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/iterators/QuadNodeDirectChildIterator.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/iterators/QuadNodeDirectChildIterator.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.util.objects.quadTree.iterators; import com.seibel.distanthorizons.core.util.objects.quadTree.QuadNode; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/iterators/QuadNodeDirectChildPosIterator.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/iterators/QuadNodeDirectChildPosIterator.java index fc69cd958..87dba9afe 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/iterators/QuadNodeDirectChildPosIterator.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/iterators/QuadNodeDirectChildPosIterator.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.util.objects.quadTree.iterators; import com.seibel.distanthorizons.core.pos.DhSectionPos; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/iterators/QuadTreeNodeIterator.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/iterators/QuadTreeNodeIterator.java index 323fb3926..b36b4167f 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/iterators/QuadTreeNodeIterator.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/iterators/QuadTreeNodeIterator.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.util.objects.quadTree.iterators; import com.seibel.distanthorizons.core.util.objects.quadTree.QuadNode; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/world/AbstractDhWorld.java b/core/src/main/java/com/seibel/distanthorizons/core/world/AbstractDhWorld.java index 31351be5c..42bf5b06d 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/world/AbstractDhWorld.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/world/AbstractDhWorld.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.world; import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/world/DhApiWorldProxy.java b/core/src/main/java/com/seibel/distanthorizons/core/world/DhApiWorldProxy.java index 9e110ec43..0faf36b0b 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/world/DhApiWorldProxy.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/world/DhApiWorldProxy.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.world; import com.seibel.distanthorizons.api.interfaces.world.IDhApiDimensionTypeWrapper; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/world/DhClientServerWorld.java b/core/src/main/java/com/seibel/distanthorizons/core/world/DhClientServerWorld.java index 150983118..f1194bb13 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/world/DhClientServerWorld.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/world/DhClientServerWorld.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.world; import com.seibel.distanthorizons.core.file.structure.LocalSaveStructure; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/world/DhClientWorld.java b/core/src/main/java/com/seibel/distanthorizons/core/world/DhClientWorld.java index e0e343e02..aed0f25e0 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/world/DhClientWorld.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/world/DhClientWorld.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.world; import com.seibel.distanthorizons.core.config.Config; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/world/DhServerWorld.java b/core/src/main/java/com/seibel/distanthorizons/core/world/DhServerWorld.java index 3e30bec10..2f8856f04 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/world/DhServerWorld.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/world/DhServerWorld.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.world; import com.seibel.distanthorizons.core.config.AppliedConfigState; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/world/EWorldEnvironment.java b/core/src/main/java/com/seibel/distanthorizons/core/world/EWorldEnvironment.java index aadac8e6d..f96e29cb5 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/world/EWorldEnvironment.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/world/EWorldEnvironment.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.world; /** diff --git a/core/src/main/java/com/seibel/distanthorizons/core/world/IDhClientWorld.java b/core/src/main/java/com/seibel/distanthorizons/core/world/IDhClientWorld.java index 486b90afa..015b0609e 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/world/IDhClientWorld.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/world/IDhClientWorld.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.world; import com.seibel.distanthorizons.core.level.IDhClientLevel; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/world/IDhServerWorld.java b/core/src/main/java/com/seibel/distanthorizons/core/world/IDhServerWorld.java index c581f9540..9b74df4ff 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/world/IDhServerWorld.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/world/IDhServerWorld.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.world; import com.seibel.distanthorizons.core.level.IDhServerLevel; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/world/IDhWorld.java b/core/src/main/java/com/seibel/distanthorizons/core/world/IDhWorld.java index 9aa5a5c20..388929e89 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/world/IDhWorld.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/world/IDhWorld.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.world; import com.seibel.distanthorizons.core.level.IDhLevel; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/IVersionConstants.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/IVersionConstants.java index d84797b3a..1cc6ce924 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/IVersionConstants.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/IVersionConstants.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/wrapperInterfaces/IWrapperFactory.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/IWrapperFactory.java index f7e53aae9..6090d3dc0 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/IWrapperFactory.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/IWrapperFactory.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/wrapperInterfaces/block/IBlockStateWrapper.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/block/IBlockStateWrapper.java index ecf66e087..8858c240b 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/block/IBlockStateWrapper.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/block/IBlockStateWrapper.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.wrapperInterfaces.block; import com.seibel.distanthorizons.api.interfaces.block.IDhApiBlockStateWrapper; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/chunk/IChunkWrapper.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/chunk/IChunkWrapper.java index 06136d7b9..da6b8421e 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/chunk/IChunkWrapper.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/chunk/IChunkWrapper.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 @@ -19,6 +19,7 @@ package com.seibel.distanthorizons.core.wrapperInterfaces.chunk; +import com.seibel.distanthorizons.core.config.Config; import com.seibel.distanthorizons.core.pos.DhBlockPos; import com.seibel.distanthorizons.core.pos.DhBlockPos2D; import com.seibel.distanthorizons.core.pos.DhChunkPos; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/config/IConfigGui.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/config/IConfigGui.java index eafb58ac3..9d06bebcc 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/config/IConfigGui.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/config/IConfigGui.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.wrapperInterfaces.config; import com.seibel.distanthorizons.coreapi.interfaces.dependencyInjection.IBindable; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/config/ILangWrapper.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/config/ILangWrapper.java index 0b3ae9358..3d6ee967c 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/config/ILangWrapper.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/config/ILangWrapper.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.wrapperInterfaces.config; import com.seibel.distanthorizons.coreapi.interfaces.dependencyInjection.IBindable; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/minecraft/IMinecraftClientWrapper.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/minecraft/IMinecraftClientWrapper.java index c399f5624..1ce722925 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/minecraft/IMinecraftClientWrapper.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/minecraft/IMinecraftClientWrapper.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/wrapperInterfaces/minecraft/IMinecraftRenderWrapper.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/minecraft/IMinecraftRenderWrapper.java index d63af950a..142af61db 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/minecraft/IMinecraftRenderWrapper.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/minecraft/IMinecraftRenderWrapper.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 @@ -49,7 +49,7 @@ public interface IMinecraftRenderWrapper extends IBindable DhBlockPos getCameraBlockPosition(); - boolean playerHasBlindnessEffect(); + boolean playerHasBlindingEffect(); Vec3d getCameraExactPosition(); diff --git a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/minecraft/IMinecraftSharedWrapper.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/minecraft/IMinecraftSharedWrapper.java index 07f29c73c..7f7594c8b 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/minecraft/IMinecraftSharedWrapper.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/minecraft/IMinecraftSharedWrapper.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.wrapperInterfaces.minecraft; import com.seibel.distanthorizons.coreapi.interfaces.dependencyInjection.IBindable; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/minecraft/IProfilerWrapper.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/minecraft/IProfilerWrapper.java index e635c257b..601e3af4d 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/minecraft/IProfilerWrapper.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/minecraft/IProfilerWrapper.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/wrapperInterfaces/misc/ILightMapWrapper.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/misc/ILightMapWrapper.java index 048916008..d16cbfa44 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/misc/ILightMapWrapper.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/misc/ILightMapWrapper.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/wrapperInterfaces/misc/IServerPlayerWrapper.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/misc/IServerPlayerWrapper.java index 299394a89..3b65332e5 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/misc/IServerPlayerWrapper.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/misc/IServerPlayerWrapper.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.wrapperInterfaces.misc; import com.seibel.distanthorizons.api.interfaces.IDhApiUnsafeWrapper; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/AbstractOptifineAccessor.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/AbstractOptifineAccessor.java index 3f2c6eadf..d4427cc16 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/AbstractOptifineAccessor.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/AbstractOptifineAccessor.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.wrapperInterfaces.modAccessor; import com.seibel.distanthorizons.api.enums.rendering.EFogDrawMode; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/IBCLibAccessor.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/IBCLibAccessor.java index 80a14e6da..f49e37284 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/IBCLibAccessor.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/IBCLibAccessor.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.wrapperInterfaces.modAccessor; public interface IBCLibAccessor extends IModAccessor diff --git a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/IModAccessor.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/IModAccessor.java index 6a19178ff..5a1924360 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/IModAccessor.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/IModAccessor.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/wrapperInterfaces/modAccessor/IModChecker.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/IModChecker.java index e76c2af44..f06113b06 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/IModChecker.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/IModChecker.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/wrapperInterfaces/modAccessor/IOptifineAccessor.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/IOptifineAccessor.java index 6a3eb8779..35e6e8dbe 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/IOptifineAccessor.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/IOptifineAccessor.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/wrapperInterfaces/modAccessor/ISodiumAccessor.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/ISodiumAccessor.java index 7dac1d941..82ca5efc0 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/ISodiumAccessor.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/ISodiumAccessor.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/wrapperInterfaces/modAccessor/IStarlightAccessor.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/IStarlightAccessor.java index 017b8e712..651f6d550 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/IStarlightAccessor.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/modAccessor/IStarlightAccessor.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/wrapperInterfaces/world/IBiomeWrapper.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/world/IBiomeWrapper.java index 32f574f2f..b2f6ce424 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/world/IBiomeWrapper.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/world/IBiomeWrapper.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/wrapperInterfaces/world/IClientLevelWrapper.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/world/IClientLevelWrapper.java index b5347de57..7cc81720e 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/world/IClientLevelWrapper.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/world/IClientLevelWrapper.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.wrapperInterfaces.world; import com.seibel.distanthorizons.core.pos.DhBlockPos; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/world/IDimensionTypeWrapper.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/world/IDimensionTypeWrapper.java index d5ae1845a..0422e0ba9 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/world/IDimensionTypeWrapper.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/world/IDimensionTypeWrapper.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/wrapperInterfaces/world/ILevelWrapper.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/world/ILevelWrapper.java index 8c660fccd..e444c5465 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/world/ILevelWrapper.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/world/ILevelWrapper.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/wrapperInterfaces/world/IServerLevelWrapper.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/world/IServerLevelWrapper.java index 925821e2a..f2caec056 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/world/IServerLevelWrapper.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/world/IServerLevelWrapper.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.wrapperInterfaces.world; import javax.annotation.Nullable; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/worldGeneration/AbstractBatchGenerationEnvironmentWrapper.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/worldGeneration/AbstractBatchGenerationEnvironmentWrapper.java index 09a27bde8..656d4a3d8 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/worldGeneration/AbstractBatchGenerationEnvironmentWrapper.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/worldGeneration/AbstractBatchGenerationEnvironmentWrapper.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/resources/assets/distanthorizons/lang/en_us.json b/core/src/main/resources/assets/distanthorizons/lang/en_us.json index e8796c9f3..e1c78d4ea 100644 --- a/core/src/main/resources/assets/distanthorizons/lang/en_us.json +++ b/core/src/main/resources/assets/distanthorizons/lang/en_us.json @@ -94,10 +94,6 @@ "Horizontal Scale", "distanthorizons.config.client.advanced.graphics.quality.horizontalScale.@tooltip": "How quickly LODs drop off in quality.\n\nLarger numbers will improve how distant terrain looks\nbut will increase memory and GPU usage.", - "distanthorizons.config.client.advanced.graphics.quality.ssao": - "SSAO", - "distanthorizons.config.client.advanced.graphics.quality.ssao.@tooltip": - "Screen Space Ambient Occlusion adds depth to the lighting of blocks.", "distanthorizons.config.client.advanced.graphics.quality.horizontalQuality": "Horizontal Quality", "distanthorizons.config.client.advanced.graphics.quality.horizontalQuality.@tooltip": @@ -163,6 +159,39 @@ "Far Fog Density", "distanthorizons.config.client.advanced.graphics.fog.advancedFog.farFogDensity.@tooltip": "What is the fog density? ", + + + "distanthorizons.config.client.advanced.graphics.ssao": + "Ambient Occlusion", + + "distanthorizons.config.client.advanced.graphics.ssao.enabled": + "Enable Ambient Occlusion", + "distanthorizons.config.client.advanced.graphics.ssao.enabled.@tooltip": + "Ambient Occlusion adds depth to the lighting of blocks.", + "distanthorizons.config.client.advanced.graphics.ssao.sampleCount": + "Sample Count", + "distanthorizons.config.client.advanced.graphics.ssao.sampleCount.@tooltip": + "Determines how many points in space are sampled for the occlusion test. \nHigher numbers will improve quality and reduce banding, but will increase GPU load.", + "distanthorizons.config.client.advanced.graphics.ssao.radius": + "Radius", + "distanthorizons.config.client.advanced.graphics.ssao.radius.@tooltip": + "Determines the radius Screen Space Ambient Occlusion is applied, measured in blocks.", + "distanthorizons.config.client.advanced.graphics.ssao.strength": + "Strength", + "distanthorizons.config.client.advanced.graphics.ssao.strength.@tooltip": + "Determines how dark the Screen Space Ambient Occlusion effect will be.", + "distanthorizons.config.client.advanced.graphics.ssao.bias": + "Bias", + "distanthorizons.config.client.advanced.graphics.ssao.bias.@tooltip": + "Increasing the value can reduce banding at the cost of reducing the strength of the effect.", + "distanthorizons.config.client.advanced.graphics.ssao.minLight": + "Min Light", + "distanthorizons.config.client.advanced.graphics.ssao.minLight.@tooltip": + "Determines how dark the occlusion shadows can be. \n0 = totally black at the corners \n1 = no shadow", + "distanthorizons.config.client.advanced.graphics.ssao.blurRadius": + "Blur Radius", + "distanthorizons.config.client.advanced.graphics.ssao.blurRadius.@tooltip": + "The radius, measured in pixels, that blurring is calculated for the SSAO. \nHigher numbers will reduce banding at the cost of GPU performance.", "distanthorizons.config.client.advanced.graphics.fog.advancedFog.heightFog": @@ -391,7 +420,7 @@ "distanthorizons.config.client.advanced.debugging.allowUnsafeValues": "Allow Unsafe UI Values", "distanthorizons.config.client.advanced.debugging.allowUnsafeValues.@tooltip": - "If enabled, very limited config input validation will be performed. \n\nWarning: enabling this can cause instability or crashing, use at your own risk. \nNote: this is option isn't saved between sessions.", + "If enabled, very limited config input validation will be performed. \n\nWarning: enabling this can cause instability or crashing, use at your own risk. \nNote: this option isn't saved between sessions.", "distanthorizons.config.client.advanced.debugging.overrideVanillaGLLogger": "Override Vanilla OpenGL Logger", "distanthorizons.config.client.advanced.debugging.overrideVanillaGLLogger.@tooltip": diff --git a/core/src/main/resources/shaders/flat_shaded.frag b/core/src/main/resources/shaders/flat_shaded.frag index 28109a009..edcddbcca 100644 --- a/core/src/main/resources/shaders/flat_shaded.frag +++ b/core/src/main/resources/shaders/flat_shaded.frag @@ -2,7 +2,7 @@ in vec4 vertexColor; in vec3 vertexWorldPos; -in float vertexYPos; +//in float vertexYPos; in vec4 vPos; out vec4 fragColor; @@ -15,50 +15,19 @@ uniform float noiseIntensity; uniform int noiseDropoff; -// method definitions - -float fade(float value, float start, float end) { - return (clamp(value, start, end) - start) / (end - start); -} - // The random functions for diffrent dimentions float rand(float co) { return fract(sin(co*(91.3458)) * 47453.5453); } -float rand(vec2 co){ return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); } -float rand(vec3 co){ return rand(co.xy+rand(co.z)); } +float rand(vec2 co) { return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); } +float rand(vec3 co) { return rand(co.xy + rand(co.z)); } // Puts steps in a float // EG. setting stepSize to 4 then this would be the result of this function // In: 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, ..., 1.1, 1.2, 1.3 // Out: 0.0, 0.0, 0.0, 0.25, 0.25, 0.5, 0.5, ..., 1.0, 1.0, 1.25 -float quantize(float val, int stepSize) { - return floor(val*stepSize)/stepSize; +vec3 quantize(vec3 val, int stepSize) { + return floor(val * stepSize) / stepSize; } -// The modulus function dosnt exist in GLSL so I made my own -// To speed up the mod function, this only accepts full numbers for y -float mod(float x, int y) { - return x - y * floor(x/y); -} - - -// Some HSV functions I stole somewhere online -vec3 RGB2HSV(vec3 c) { - vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); - vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); - vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)); - - float d = q.x - min(q.w, q.y); - float e = 1.0e-10; - return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); -} - -vec3 HSV2RGB(vec3 c) { - vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); - vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); - return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); -} - - /** * Fragment Shader @@ -71,66 +40,31 @@ void main() { fragColor = vertexColor; - // TODO: Move into its own function instead of in an if statement if (noiseEnabled) { - vec3 vertexNormal = normalize(cross(dFdx(vPos.xyz), dFdy(vPos.xyz))); + vec3 vertexNormal = normalize(cross(dFdy(vPos.xyz), dFdx(vPos.xyz))); // This bit of code is required to fix the vertex position problem cus of floats in the verted world position varuable - vec3 fixedVPos = vPos.xyz - vertexNormal * 0.001; + vec3 fixedVPos = vPos.xyz + vertexNormal * 0.001; float noiseAmplification = noiseIntensity * 0.01; - noiseAmplification = (-1.0 * pow(2.0*((fragColor.x + fragColor.y + fragColor.z) / 3.0) - 1.0, 2.0) + 1.0) * noiseAmplification; // Lessen the effect on depending on how dark the object is, equasion for this is -(2x-1)^{2}+1 - noiseAmplification *= fragColor.w; // The effect would lessen on transparent objects + float lum = (fragColor.r + fragColor.g + fragColor.b) / 3.0; + noiseAmplification = (1.0 - pow(lum * 2.0 - 1.0, 2.0)) * noiseAmplification; // Lessen the effect on depending on how dark the object is, equasion for this is -(2x-1)^{2}+1 + noiseAmplification *= fragColor.a; // The effect would lessen on transparent objects // Random value for each position - float randomValue = rand(vec3( - quantize(fixedVPos.x, noiseSteps), - quantize(fixedVPos.y, noiseSteps), - quantize(fixedVPos.z, noiseSteps) - )) - * 2.0 * noiseAmplification - noiseAmplification; - - + float randomValue = rand(quantize(fixedVPos, noiseSteps)) + * 2.0 * noiseAmplification - noiseAmplification; + // Modifies the color // A value of 0 on the randomValue will result in the original color, while a value of 1 will result in a fully bright color vec3 newCol = fragColor.rgb + (1.0 - fragColor.rgb) * randomValue; + newCol = clamp(newCol, 0.0, 1.0); + + if (noiseDropoff != 0) { + float distF = min(length(vertexWorldPos) / noiseDropoff, 1.0); + newCol = mix(newCol, fragColor.rgb, distF); // The further away it gets, the less noise gets applied + } - // Clamps it and turns it back into a vec4 - if (noiseDropoff == 0) - fragColor = vec4(clamp(newCol.rgb, 0.0, 1.0), fragColor.w); - else - fragColor = mix( - vec4(clamp(newCol.rgb, 0.0, 1.0), fragColor.w), fragColor, - min(length(vertexWorldPos) / noiseDropoff, 1.0) // The further away it gets, the less noise gets applied - ); - - // For testing - // if (fragColor.r != 69420.) { - // fragColor = vec4( - // mod(fixedVPos.x, 1), - // mod(fixedVPos.y, 1), - // mod(fixedVPos.z, 1), - // fragColor.w); - // } + fragColor.rgb = newCol; } } - - - -// Are these still needed? -float linearFog(float x, float fogStart, float fogLength, float fogMin, float fogRange) { - x = clamp((x-fogStart)/fogLength, 0.0, 1.0); - return fogMin + fogRange * x; -} - -float exponentialFog(float x, float fogStart, float fogLength, -float fogMin, float fogRange, float fogDensity) { - x = max((x-fogStart)/fogLength, 0.0) * fogDensity; - return fogMin + fogRange - fogRange/exp(x); -} - -float exponentialSquaredFog(float x, float fogStart, float fogLength, -float fogMin, float fogRange, float fogDensity) { - x = max((x-fogStart)/fogLength, 0.0) * fogDensity; - return fogMin + fogRange - fogRange/exp(x*x); -} \ No newline at end of file diff --git a/core/src/main/resources/shaders/fog/fog.frag b/core/src/main/resources/shaders/fog/fog.frag index a9f317700..04eb3f7c1 100644 --- a/core/src/main/resources/shaders/fog/fog.frag +++ b/core/src/main/resources/shaders/fog/fog.frag @@ -4,8 +4,8 @@ in vec2 TexCoord; out vec4 fragColor; uniform sampler2D gDepthMap; -// model view matrix and projection matrix -uniform mat4 gMvmProj; +// inverted model view matrix and projection matrix +uniform mat4 gInvMvmProj; uniform float fogScale; uniform float fogVerticalScale; @@ -42,28 +42,18 @@ float mixFogThickness(float near, float far, float height); // ========================================================= -// Puts steps in a float -// EG. setting stepSize to 4 then this would be the result of this function -// In: 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, ..., 1.1, 1.2, 1.3 -// Out: 0.0, 0.0, 0.0, 0.25, 0.25, 0.5, 0.5, ..., 1.0, 1.0, 1.25 -float quantize(float val, int stepSize) { - return floor(val*stepSize)/stepSize; +const vec3 MAGIC = vec3(0.06711056, 0.00583715, 52.9829189); + +float InterleavedGradientNoise(const in vec2 pixel) { + float x = dot(pixel, MAGIC.xy); + return fract(MAGIC.z * fract(x)); } -// The modulus function dosnt exist in GLSL so I made my own -// To speed up the mod function, this only accepts full numbers for y -float mod(float x, int y) { - return x - y * floor(x/y); -} - - -vec3 calcViewPosition(float fragmentDepth) -{ +vec3 calcViewPosition(float fragmentDepth) { vec4 ndc = vec4(TexCoord.xy, fragmentDepth, 1.0); ndc.xyz = ndc.xyz * 2.0 - 1.0; - // TODO: This inverse() should be moved CPU side - vec4 eyeCoord = inverse(gMvmProj) * ndc; + vec4 eyeCoord = gInvMvmProj * ndc; return eyeCoord.xyz / eyeCoord.w; } @@ -77,13 +67,12 @@ void main() { float vertexYPos = 100.0f; float fragmentDepth = texture(gDepthMap, TexCoord).r; + fragColor = vec4(fogColor.rgb, 0.0); // a fragment depth of "1" means the fragment wasn't drawn to, // we only want to apply Fog to LODs, not to the sky outside the LODs - if (fragmentDepth < 1) - { - if (fullFogMode == 0) - { + if (fragmentDepth < 1.0) { + if (fullFogMode == 0) { // render fog based on distance from the camera vec3 vertexWorldPos = calcViewPosition(fragmentDepth); @@ -95,17 +84,16 @@ void main() float farFogThickness = getFarFogThickness(farDist); float heightFogThickness = getHeightFogThickness(heightDist); float mixedFogThickness = mixFogThickness(nearFogThickness, farFogThickness, heightFogThickness); - mixedFogThickness = clamp(mixedFogThickness, 0.0, 1.0); + fragColor.a = clamp(mixedFogThickness, 0.0, 1.0); - fragColor = vec4(fogColor.rgb, mixedFogThickness); + float dither = InterleavedGradientNoise(gl_FragCoord.xy) - 0.5; + fragColor.a += dither / 255.0; } - else if (fullFogMode == 1) - { + else if (fullFogMode == 1) { // render everything with the fog color - fragColor = vec4(fogColor.rgb, 1.0); + fragColor.a = 1.0; } - else - { + else { // test code. // this can be fired by manually changing the fullFogMode to a (normally) @@ -113,19 +101,13 @@ void main() // a uniform we don't have to worry about GLSL optimizing away different // options when testing, causing a bunch of headaches if we just want to render the screen red. - float depthValue = texture(gDepthMap, TexCoord).r; - fragColor = vec4(vec3(depthValue), 1.0); // Convert depth value to grayscale color + float depthValue = textureLod(gDepthMap, TexCoord, 0).r; + fragColor.rgb = vec3(depthValue); // Convert depth value to grayscale color + fragColor.a = 1.0; } } - else - { - // every pixel needs to be set to something, otherwise the pixel may be undefined by some drivers (specifically Intel) - fragColor = vec4(0.0, 0.0, 0.0, 0.0); - } } - - // Are these still needed? float linearFog(float x, float fogStart, float fogLength, float fogMin, float fogRange) { x = clamp((x-fogStart)/fogLength, 0.0, 1.0); @@ -133,13 +115,15 @@ float linearFog(float x, float fogStart, float fogLength, float fogMin, float fo } float exponentialFog(float x, float fogStart, float fogLength, -float fogMin, float fogRange, float fogDensity) { + float fogMin, float fogRange, float fogDensity) +{ x = max((x-fogStart)/fogLength, 0.0) * fogDensity; return fogMin + fogRange - fogRange/exp(x); } float exponentialSquaredFog(float x, float fogStart, float fogLength, -float fogMin, float fogRange, float fogDensity) { + float fogMin, float fogRange, float fogDensity) +{ x = max((x-fogStart)/fogLength, 0.0) * fogDensity; return fogMin + fogRange - fogRange/exp(x*x); -} \ No newline at end of file +} diff --git a/core/src/main/resources/shaders/noise/noise.frag b/core/src/main/resources/shaders/noise/noise.frag index 9ae668cbe..1156311fc 100644 --- a/core/src/main/resources/shaders/noise/noise.frag +++ b/core/src/main/resources/shaders/noise/noise.frag @@ -30,14 +30,6 @@ vec3 quantize(vec3 val, int stepSize) { return floor(val*stepSize)/stepSize; } -// The modulus function dosnt exist in GLSL so I made my own -// To speed up the mod function, this only accepts full numbers for y -float mod(float x, int y) { - return x - y * floor(x/y); -} - - - /** * Fragment shader for adding noise to lods. diff --git a/core/src/main/resources/shaders/ssao/ao.frag b/core/src/main/resources/shaders/ssao/ao.frag index 0e5501870..149736efb 100644 --- a/core/src/main/resources/shaders/ssao/ao.frag +++ b/core/src/main/resources/shaders/ssao/ao.frag @@ -1,64 +1,110 @@ #version 150 core +#extension GL_ARB_derivative_control : enable + +#define SAMPLE_MAX 64 + +#define saturate(x) (clamp((x), 0.0, 1.0)) in vec2 TexCoord; out vec4 fragColor; uniform sampler2D gDepthMap; -uniform float gSampleRad; -uniform float gFactor; -uniform float gPower; +uniform int gSampleCount; +uniform float gRadius; +uniform float gStrength; +uniform float gMinLight; +uniform float gBias; +uniform mat4 gInvProj; uniform mat4 gProj; -const int MAX_KERNEL_SIZE = 128; -const float INV_MAX_KERNEL_SIZE_F = 1.0 / float(MAX_KERNEL_SIZE); -const vec2 HALF_2 = vec2(0.5); -uniform vec3 gKernel[MAX_KERNEL_SIZE]; +const float EPSILON = 1.e-6; +const float GOLDEN_ANGLE = 2.39996323; +const vec3 MAGIC = vec3(0.06711056, 0.00583715, 52.9829189); +const float PI = 3.1415926538; +const float TAU = PI * 2.0; -vec3 calcViewPosition(vec2 coords) { - float fragmentDepth = texture(gDepthMap, coords).r; - vec4 ndc = vec4( - coords.x * 2.0 - 1.0, - coords.y * 2.0 - 1.0, - fragmentDepth * 2.0 - 1.0, - 1.0 - ); - - vec4 vs_pos = inverse(gProj) * ndc; - vs_pos.xyz = vs_pos.xyz / vs_pos.w; - return vs_pos.xyz; +vec3 unproject(vec4 pos) { + return pos.xyz / pos.w; } -void main() -{ - vec3 viewPos = calcViewPosition(TexCoord); - vec3 viewNormal = normalize(cross(dFdy(viewPos.xyz), dFdx(viewPos.xyz)) * -1.0); +float InterleavedGradientNoise(const in vec2 pixel) { + float x = dot(pixel, MAGIC.xy); + return fract(MAGIC.z * fract(x)); +} - vec3 randomVec = vec3(0.0, -1.0, 0.0); +vec3 calcViewPosition(const in vec3 clipPos) { + vec4 viewPos = gInvProj * vec4(clipPos * 2.0 - 1.0, 1.0); + return viewPos.xyz / viewPos.w; +} - vec3 tangent = normalize(randomVec - viewNormal * dot(randomVec, viewNormal)); - vec3 bitangent = cross(viewNormal, tangent); - mat3 TBN = mat3(tangent, bitangent, viewNormal); - float occlusion_factor = 0.0; - for (int i = 0; i < MAX_KERNEL_SIZE; i++) - { - vec3 samplePos = vec3(0.0) + (TBN * gKernel[i]); - samplePos = viewPos + samplePos * gSampleRad; - - vec4 offset = gProj * vec4(samplePos + viewPos, 1.0); - offset.xy /= offset.w; - offset.xy = offset.xy * HALF_2 + HALF_2; - - float geometryDepth = calcViewPosition(offset.xy).z; - - float rangeCheck = smoothstep(0.0, 1.0, gSampleRad / abs(viewPos.z - geometryDepth)); - // the number added to the samplePos.z can be used to reduce noise in the SSAO application at the cost of reducing the overall affect - occlusion_factor += float(geometryDepth >= samplePos.z + 0.1) * rangeCheck; +float GetSpiralOcclusion(const in vec2 uv, const in vec3 viewPos, const in vec3 viewNormal) { + float dither = InterleavedGradientNoise(gl_FragCoord.xy); + float rotatePhase = dither * TAU; + float rStep = gRadius / gSampleCount; + + vec2 offset; + + float ao = 0.0; + int sampleCount = 0; + float radius = rStep; + for (int i = 0; i < clamp(gSampleCount, 1, SAMPLE_MAX); i++) { + vec2 offset = vec2( + sin(rotatePhase), + cos(rotatePhase) + ) * radius; + radius += rStep; + rotatePhase += GOLDEN_ANGLE; + + vec3 sampleViewPos = viewPos + vec3(offset, -0.1); + vec3 sampleClipPos = unproject(gProj * vec4(sampleViewPos, 1.0)) * 0.5 + 0.5; + sampleClipPos = saturate(sampleClipPos); + + float sampleClipDepth = textureLod(gDepthMap, sampleClipPos.xy, 0.0).r; + if (sampleClipDepth >= 1.0 - EPSILON) continue; + + sampleClipPos.z = sampleClipDepth; + sampleViewPos = unproject(gInvProj * vec4(sampleClipPos * 2.0 - 1.0, 1.0)); + + vec3 diff = sampleViewPos - viewPos; + float sampleDist = length(diff); + vec3 sampleNormal = diff / sampleDist; + + float sampleNoLm = max(dot(viewNormal, sampleNormal) - gBias, 0.0); + float aoF = 1.0 - saturate(sampleDist / gRadius); + ao += sampleNoLm * aoF; + sampleCount++; } - float visibility_factor = 1.0 - (occlusion_factor / MAX_KERNEL_SIZE); - fragColor = vec4(clamp(1.0 - ((1.0 - pow(visibility_factor, gFactor)) * gPower), 0.1, 1.0)); -} \ No newline at end of file + ao /= max(sampleCount, 1); + ao = smoothstep(0.0, gStrength, ao); + + return ao * (1.0 - gMinLight); +} + + +void main() { + float fragmentDepth = textureLod(gDepthMap, TexCoord, 0).r; + float occlusion = 0.0; + + // Do not apply to sky + if (fragmentDepth < 1.0) { + vec3 viewPos = calcViewPosition(vec3(TexCoord, fragmentDepth)); + + #ifdef GL_ARB_derivative_control + // Get higher precision derivatives when available + vec3 viewNormal = cross(dFdxFine(viewPos.xyz), dFdyFine(viewPos.xyz)); + #else + vec3 viewNormal = cross(dFdx(viewPos.xyz), dFdy(viewPos.xyz)); + #endif + + viewNormal = normalize(viewNormal); + + occlusion = GetSpiralOcclusion(TexCoord, viewPos, viewNormal); + } + + fragColor = vec4(vec3(1.0 - occlusion), 1.0); +} diff --git a/core/src/main/resources/shaders/ssao/apply-frag.frag b/core/src/main/resources/shaders/ssao/apply-frag.frag deleted file mode 100644 index 534306c50..000000000 --- a/core/src/main/resources/shaders/ssao/apply-frag.frag +++ /dev/null @@ -1,25 +0,0 @@ -#version 150 core - -in vec2 TexCoord; -in vec2 ViewRay; - -out vec4 fragColor; - -uniform sampler2D gSSAOMap; -uniform sampler2D gDepthMap; - -void main() -{ - float fragmentDepth = texture(gDepthMap, TexCoord).r; - // a fragment depth of "1" means the fragment wasn't drawn to, - // we only want to apply SSAO to LODs, not to the sky outside the LODs - if (fragmentDepth < 1) - { - fragColor = vec4(0.0, 0.0, 0.0, 1-texture(gSSAOMap, TexCoord).r); - } - else - { - // every pixel needs to be set to something, otherwise the pixel may be undefined by some drivers (specifically Intel) - fragColor = vec4(0.0, 0.0, 0.0, 0.0); - } -} diff --git a/core/src/main/resources/shaders/ssao/apply.frag b/core/src/main/resources/shaders/ssao/apply.frag new file mode 100644 index 000000000..44026c96c --- /dev/null +++ b/core/src/main/resources/shaders/ssao/apply.frag @@ -0,0 +1,75 @@ +#version 150 core + +in vec2 TexCoord; + +out vec4 fragColor; + +uniform sampler2D gSSAOMap; +uniform sampler2D gDepthMap; +uniform vec2 gViewSize; +uniform int gBlurRadius; +uniform float gNear; +uniform float gFar; + + +float linearizeDepth(const in float depth) { + return (gNear * gFar) / (depth * (gNear - gFar) + gFar); +} + +float Gaussian(const in float sigma, const in float x) { + return exp(-(x*x) / (2.0 * (sigma*sigma))); +} + +float BilateralGaussianBlur(const in vec2 texcoord, const in float linearDepth, const in float g_sigmaV) { + float g_sigmaX = 1.6; + float g_sigmaY = 1.6; + + int radius = clamp(gBlurRadius, 1, 3); + + vec2 pixelSize = 1.0 / gViewSize; + + float accum = 0.0; + float total = 0.0; + for (int iy = -radius; iy <= radius; iy++) { + float fy = Gaussian(g_sigmaY, iy); + + for (int ix = -radius; ix <= radius; ix++) { + float fx = Gaussian(g_sigmaX, ix); + + vec2 sampleTex = texcoord + ivec2(ix, iy) * pixelSize; + float sampleValue = textureLod(gSSAOMap, sampleTex, 0).r; + float sampleDepth = textureLod(gDepthMap, sampleTex, 0).r; + float sampleLinearDepth = linearizeDepth(sampleDepth); + + float depthDiff = abs(sampleLinearDepth - linearDepth); + float fv = Gaussian(g_sigmaV, depthDiff); + + float weight = fx*fy*fv; + accum += weight * sampleValue; + total += weight; + } + } + + if (total <= 1.e-4) return 1.0; + return accum / total; +} + + +void main() +{ + fragColor = vec4(1.0); + + float fragmentDepth = textureLod(gDepthMap, TexCoord, 0).r; + + // a fragment depth of "1" means the fragment wasn't drawn to, + // we only want to apply SSAO to LODs, not to the sky outside the LODs + if (fragmentDepth < 1) { + if (gBlurRadius > 0) { + float fragmentDepthLinear = linearizeDepth(fragmentDepth); + fragColor.a = BilateralGaussianBlur(TexCoord, fragmentDepthLinear, 1.6); + } + else { + fragColor.a = texelFetch(gSSAOMap, ivec2(gl_FragCoord.xy), 0).r; + } + } +} diff --git a/core/src/test/java/testItems/overrideInjection/interfaces/IOverrideTest.java b/core/src/test/java/testItems/overrideInjection/interfaces/IOverrideTest.java index ff0d377be..169f6cda5 100644 --- a/core/src/test/java/testItems/overrideInjection/interfaces/IOverrideTest.java +++ b/core/src/test/java/testItems/overrideInjection/interfaces/IOverrideTest.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.overrideInjection.interfaces; import com.seibel.distanthorizons.api.interfaces.override.IDhApiOverrideable; diff --git a/core/src/test/java/testItems/overrideInjection/objects/OverrideTestAssembly.java b/core/src/test/java/testItems/overrideInjection/objects/OverrideTestAssembly.java index 7da74f522..ad40690a3 100644 --- a/core/src/test/java/testItems/overrideInjection/objects/OverrideTestAssembly.java +++ b/core/src/test/java/testItems/overrideInjection/objects/OverrideTestAssembly.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.overrideInjection.objects; import com.seibel.distanthorizons.coreapi.util.StringUtil; diff --git a/core/src/test/java/testItems/overrideInjection/objects/OverrideTestCore.java b/core/src/test/java/testItems/overrideInjection/objects/OverrideTestCore.java index f13a969e4..7b9c3d7ea 100644 --- a/core/src/test/java/testItems/overrideInjection/objects/OverrideTestCore.java +++ b/core/src/test/java/testItems/overrideInjection/objects/OverrideTestCore.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.overrideInjection.objects; import com.seibel.distanthorizons.coreapi.DependencyInjection.OverrideInjector; diff --git a/core/src/test/java/testItems/overrideInjection/objects/OverrideTestPrimary.java b/core/src/test/java/testItems/overrideInjection/objects/OverrideTestPrimary.java index d4ee85bdb..3698d2091 100644 --- a/core/src/test/java/testItems/overrideInjection/objects/OverrideTestPrimary.java +++ b/core/src/test/java/testItems/overrideInjection/objects/OverrideTestPrimary.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.overrideInjection.objects; import com.seibel.distanthorizons.coreapi.DependencyInjection.OverrideInjector; diff --git a/core/src/test/java/testItems/singletonInjection/interfaces/ISingletonTestOne.java b/core/src/test/java/testItems/singletonInjection/interfaces/ISingletonTestOne.java index 1402d3b0e..c8ce2b103 100644 --- a/core/src/test/java/testItems/singletonInjection/interfaces/ISingletonTestOne.java +++ b/core/src/test/java/testItems/singletonInjection/interfaces/ISingletonTestOne.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.singletonInjection.interfaces; import com.seibel.distanthorizons.coreapi.interfaces.dependencyInjection.IBindable; diff --git a/core/src/test/java/testItems/singletonInjection/interfaces/ISingletonTestTwo.java b/core/src/test/java/testItems/singletonInjection/interfaces/ISingletonTestTwo.java index 0755c0327..520d5c242 100644 --- a/core/src/test/java/testItems/singletonInjection/interfaces/ISingletonTestTwo.java +++ b/core/src/test/java/testItems/singletonInjection/interfaces/ISingletonTestTwo.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.singletonInjection.interfaces; import com.seibel.distanthorizons.coreapi.interfaces.dependencyInjection.IBindable; diff --git a/core/src/test/java/testItems/singletonInjection/objects/ConcreteSingletonTestBoth.java b/core/src/test/java/testItems/singletonInjection/objects/ConcreteSingletonTestBoth.java index 07e8878df..1d65cc9ea 100644 --- a/core/src/test/java/testItems/singletonInjection/objects/ConcreteSingletonTestBoth.java +++ b/core/src/test/java/testItems/singletonInjection/objects/ConcreteSingletonTestBoth.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.singletonInjection.objects; import com.seibel.distanthorizons.coreapi.interfaces.dependencyInjection.IBindable; diff --git a/core/src/test/java/testItems/singletonInjection/objects/ConcreteSingletonTestOne.java b/core/src/test/java/testItems/singletonInjection/objects/ConcreteSingletonTestOne.java index d79653bb1..3e1731dcf 100644 --- a/core/src/test/java/testItems/singletonInjection/objects/ConcreteSingletonTestOne.java +++ b/core/src/test/java/testItems/singletonInjection/objects/ConcreteSingletonTestOne.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.singletonInjection.objects; import com.seibel.distanthorizons.coreapi.DependencyInjection.DependencyInjector; diff --git a/core/src/test/java/testItems/singletonInjection/objects/ConcreteSingletonTestTwo.java b/core/src/test/java/testItems/singletonInjection/objects/ConcreteSingletonTestTwo.java index 9215bdd0f..981e1090c 100644 --- a/core/src/test/java/testItems/singletonInjection/objects/ConcreteSingletonTestTwo.java +++ b/core/src/test/java/testItems/singletonInjection/objects/ConcreteSingletonTestTwo.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.singletonInjection.objects; import com.seibel.distanthorizons.coreapi.DependencyInjection.DependencyInjector; diff --git a/core/src/test/java/testItems/worldGeneratorInjection/objects/LevelWrapperTest.java b/core/src/test/java/testItems/worldGeneratorInjection/objects/LevelWrapperTest.java index 646a97be9..187a86c41 100644 --- a/core/src/test/java/testItems/worldGeneratorInjection/objects/LevelWrapperTest.java +++ b/core/src/test/java/testItems/worldGeneratorInjection/objects/LevelWrapperTest.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.worldGeneratorInjection.objects; import com.seibel.distanthorizons.api.enums.worldGeneration.EDhApiLevelType; diff --git a/core/src/test/java/testItems/worldGeneratorInjection/objects/TestWorldGenerator.java b/core/src/test/java/testItems/worldGeneratorInjection/objects/TestWorldGenerator.java index b6e634981..6d73d394b 100644 --- a/core/src/test/java/testItems/worldGeneratorInjection/objects/TestWorldGenerator.java +++ b/core/src/test/java/testItems/worldGeneratorInjection/objects/TestWorldGenerator.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.worldGeneratorInjection.objects; import com.seibel.distanthorizons.api.enums.worldGeneration.EDhApiDistantGeneratorMode; diff --git a/core/src/test/java/testItems/worldGeneratorInjection/objects/WorldGeneratorTestAssembly.java b/core/src/test/java/testItems/worldGeneratorInjection/objects/WorldGeneratorTestAssembly.java index 3c1978e91..a6e393b06 100644 --- a/core/src/test/java/testItems/worldGeneratorInjection/objects/WorldGeneratorTestAssembly.java +++ b/core/src/test/java/testItems/worldGeneratorInjection/objects/WorldGeneratorTestAssembly.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.worldGeneratorInjection.objects; import com.seibel.distanthorizons.coreapi.util.StringUtil; diff --git a/core/src/test/java/testItems/worldGeneratorInjection/objects/WorldGeneratorTestCore.java b/core/src/test/java/testItems/worldGeneratorInjection/objects/WorldGeneratorTestCore.java index c415a05d0..dbc4ae301 100644 --- a/core/src/test/java/testItems/worldGeneratorInjection/objects/WorldGeneratorTestCore.java +++ b/core/src/test/java/testItems/worldGeneratorInjection/objects/WorldGeneratorTestCore.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.worldGeneratorInjection.objects; import com.seibel.distanthorizons.coreapi.DependencyInjection.OverrideInjector; diff --git a/core/src/test/java/testItems/worldGeneratorInjection/objects/WorldGeneratorTestPrimary.java b/core/src/test/java/testItems/worldGeneratorInjection/objects/WorldGeneratorTestPrimary.java index 22c6cd6a7..405661acd 100644 --- a/core/src/test/java/testItems/worldGeneratorInjection/objects/WorldGeneratorTestPrimary.java +++ b/core/src/test/java/testItems/worldGeneratorInjection/objects/WorldGeneratorTestPrimary.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.worldGeneratorInjection.objects; import com.seibel.distanthorizons.coreapi.DependencyInjection.OverrideInjector; diff --git a/core/src/test/java/testItems/worldGeneratorInjection/objects/WorldGeneratorTestSecondary.java b/core/src/test/java/testItems/worldGeneratorInjection/objects/WorldGeneratorTestSecondary.java index 0d103ae0c..58be9346a 100644 --- a/core/src/test/java/testItems/worldGeneratorInjection/objects/WorldGeneratorTestSecondary.java +++ b/core/src/test/java/testItems/worldGeneratorInjection/objects/WorldGeneratorTestSecondary.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.worldGeneratorInjection.objects; import com.seibel.distanthorizons.coreapi.DependencyInjection.OverrideInjector; diff --git a/core/src/test/java/tests/CompressionTest.java b/core/src/test/java/tests/CompressionTest.java index 631f68655..8eb54eda2 100644 --- a/core/src/test/java/tests/CompressionTest.java +++ b/core/src/test/java/tests/CompressionTest.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/test/java/tests/DependencyInjectorTest.java b/core/src/test/java/tests/DependencyInjectorTest.java index 9fc22e2c5..7a10e9215 100644 --- a/core/src/test/java/tests/DependencyInjectorTest.java +++ b/core/src/test/java/tests/DependencyInjectorTest.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.api.interfaces.override.worldGenerator.IDhApiWorldGenerator; diff --git a/core/src/test/java/tests/DhSectionPosTest.java b/core/src/test/java/tests/DhSectionPosTest.java index a837557f4..6728db56e 100644 --- a/core/src/test/java/tests/DhSectionPosTest.java +++ b/core/src/test/java/tests/DhSectionPosTest.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/test/java/tests/ExampleTest.java b/core/src/test/java/tests/ExampleTest.java index 150f77422..63e1ecf89 100644 --- a/core/src/test/java/tests/ExampleTest.java +++ b/core/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/test/java/tests/QuadTreeTest.java b/core/src/test/java/tests/QuadTreeTest.java index 35827b1e7..3e64be258 100644 --- a/core/src/test/java/tests/QuadTreeTest.java +++ b/core/src/test/java/tests/QuadTreeTest.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/test/java/tests/RaycastingTest.java b/core/src/test/java/tests/RaycastingTest.java index bad6a4f06..d107a3225 100644 --- a/core/src/test/java/tests/RaycastingTest.java +++ b/core/src/test/java/tests/RaycastingTest.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/test/java/tests/SquareIntersectTest.java b/core/src/test/java/tests/SquareIntersectTest.java index 4502ae7b8..d64bb69d3 100644 --- a/core/src/test/java/tests/SquareIntersectTest.java +++ b/core/src/test/java/tests/SquareIntersectTest.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