From fa93a22ab2c0650be7fc9d15e7777a420e48eef7 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Mon, 28 Aug 2023 21:14:19 -0500 Subject: [PATCH 01/49] temp --- .../seibel/distanthorizons/core/render/LodRenderSection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..6a3f3322a 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 @@ -154,7 +154,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 ) ); From 5c03d7446bede945c651d6c7410754a72c88da9a Mon Sep 17 00:00:00 2001 From: James Seibel Date: Wed, 30 Aug 2023 07:07:25 -0500 Subject: [PATCH 02/49] Add a temp debug option that disables the lighting engine and light baking --- .../distanthorizons/core/config/Config.java | 15 +++++++++++ .../core/generation/DhLightingEngine.java | 8 ++++++ .../chunk/IChunkWrapper.java | 26 +++++++++++-------- 3 files changed, 38 insertions(+), 11 deletions(-) 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 a64ef8789..5354cd921 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 @@ -1111,6 +1111,21 @@ public class Config .set(ExampleConfigScreen.class) .build(); + public static ConfigEntry disableDhLightingEngine = new ConfigEntry.Builder() + .set(false) + .comment("" + + "Temporary, only for testing." + + "") + .build(); + + public static ConfigEntry disableChunkWrapperLightBaking = new ConfigEntry.Builder() + .set(false) + .comment("" + + "Temporary, only for testing." + + "") + .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/generation/DhLightingEngine.java b/core/src/main/java/com/seibel/distanthorizons/core/generation/DhLightingEngine.java index bbc035d04..595a62fea 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,5 +1,6 @@ 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; @@ -38,6 +39,13 @@ public class DhLightingEngine */ public void lightChunk(IChunkWrapper centerChunk, List nearbyChunkList, int maxSkyLight) { + if (Config.Client.Advanced.Debugging.disableDhLightingEngine.get()) + { + centerChunk.setIsDhLightCorrect(true); + return; + } + + DhChunkPos centerChunkPos = centerChunk.getChunkPos(); HashMap chunksByChunkPos = new HashMap<>(9); 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..69557cd5b 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 @@ -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; @@ -74,20 +75,23 @@ public interface IChunkWrapper extends IBindable */ default void bakeDhLightingUsingMcLightingEngine() throws IllegalStateException { - if (!this.isLightCorrect()) + if (!Config.Client.Advanced.Debugging.disableChunkWrapperLightBaking.get()) { - throw new IllegalStateException("Unable to bake lighting for for chunk [" + this.getChunkPos() + "], Minecraft lighting not valid."); - } - - // get the lighting for every relative block pos - for (int relX = 0; relX < LodUtil.CHUNK_WIDTH; relX++) - { - for (int relZ = 0; relZ < LodUtil.CHUNK_WIDTH; relZ++) + if (!this.isLightCorrect()) { - for (int y = this.getMinBuildHeight(); y < this.getMaxBuildHeight(); y++) + throw new IllegalStateException("Unable to bake lighting for for chunk [" + this.getChunkPos() + "], Minecraft lighting not valid."); + } + + // get the lighting for every relative block pos + for (int relX = 0; relX < LodUtil.CHUNK_WIDTH; relX++) + { + for (int relZ = 0; relZ < LodUtil.CHUNK_WIDTH; relZ++) { - this.setDhSkyLight(relX, y, relZ, this.getSkyLight(relX, y, relZ)); - this.setDhBlockLight(relX, y, relZ, this.getBlockLight(relX, y, relZ)); + for (int y = this.getMinBuildHeight(); y < this.getMaxBuildHeight(); y++) + { + this.setDhSkyLight(relX, y, relZ, this.getSkyLight(relX, y, relZ)); + this.setDhBlockLight(relX, y, relZ, this.getBlockLight(relX, y, relZ)); + } } } } From d3a7bb7b9de5d22e91733bdd7b08944c29875bdd Mon Sep 17 00:00:00 2001 From: James Seibel Date: Wed, 30 Aug 2023 07:43:19 -0500 Subject: [PATCH 03/49] Add debug methods to ColRender Buffer/Source --- .../render/ColumnRenderSource.java | 28 +++++++++++++++++++ .../bufferBuilding/ColumnRenderBuffer.java | 14 ++++++++++ 2 files changed, 42 insertions(+) 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..472d3b1c9 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 @@ -346,6 +346,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/ColumnRenderBuffer.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnRenderBuffer.java index 91a659936..d9b7e3b7a 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 @@ -260,6 +260,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) { From 58378ffcbaa1a3bc5df51f877122c90f534e2b90 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Wed, 30 Aug 2023 07:43:59 -0500 Subject: [PATCH 04/49] Fix disappearing LOD sections Its still a bit of a duck tape solution, but should be good enough for now --- .../core/render/LodRenderSection.java | 48 ++++++++----------- 1 file changed, 20 insertions(+), 28 deletions(-) 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 6a3f3322a..2778e0286 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 @@ -103,23 +103,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 +125,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; } @@ -223,16 +214,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 +275,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 */ From f6df6e83a56343efcd9826e0a4453f08fbd93f70 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Wed, 30 Aug 2023 18:31:58 -0500 Subject: [PATCH 05/49] make DhBlockPos mutable --- .../com/seibel/distanthorizons/core/pos/DhBlockPos.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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..d7f9d650d 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 @@ -44,9 +44,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) { From 9f46dd13a672f40d39d9f40c629faf4a9ce8a746 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Wed, 30 Aug 2023 18:32:40 -0500 Subject: [PATCH 06/49] Create StableLightPosArrayList for DhLightingEngine --- .../core/generation/DhLightingEngine.java | 67 +++++++++++++++---- 1 file changed, 54 insertions(+), 13 deletions(-) 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 595a62fea..17d45e6af 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 @@ -3,7 +3,6 @@ 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; @@ -50,11 +49,9 @@ public class DhLightingEngine 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 + // TODO get from a cache instead of creating new each time + StableLightPosArrayList blockLightPosQueue = new StableLightPosArrayList(); + StableLightPosArrayList skyLightPosQueue = new StableLightPosArrayList(); // generate the list of chunk pos we need, @@ -93,7 +90,7 @@ public class DhLightingEngine DhBlockPos relLightBlockPos = blockLightPos.convertToChunkRelativePos(); IBlockStateWrapper blockState = chunk.getBlockState(relLightBlockPos); int lightValue = blockState.getLightEmission(); - blockLightPosQueue.add(new LightPos(blockLightPos, lightValue)); + blockLightPosQueue.add(blockLightPos.x, blockLightPos.y, blockLightPos.z, lightValue); // set the light DhBlockPos relBlockPos = blockLightPos.convertToChunkRelativePos(); @@ -123,7 +120,7 @@ public class DhLightingEngine } continue; } - skyLightPosQueue.add(new LightPos(skyLightPos, maxSkyLight)); + skyLightPosQueue.add(skyLightPos.x, skyLightPos.y, skyLightPos.z, maxSkyLight); // set the light @@ -168,7 +165,7 @@ public class DhLightingEngine /** Applies each {@link LightPos} from the queue to the given set of {@link IChunkWrapper}'s. */ private void propagateLightPosList( - ArrayList lightPosQueue, HashMap chunksByChunkPos, + StableLightPosArrayList lightPosQueue, HashMap chunksByChunkPos, IGetLightFunc getLightFunc, ISetLightFunc setLightFunc) { // update each light position @@ -176,8 +173,7 @@ public class DhLightingEngine { // 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; @@ -227,7 +223,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.add(neighbourBlockPos.x, neighbourBlockPos.y, neighbourBlockPos.z, targetLevel); } } } @@ -250,7 +246,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) { @@ -261,4 +257,49 @@ public class DhLightingEngine } + private static class StableLightPosArrayList + { + /** 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); + + + + public boolean isEmpty() { return this.index == -1; } + public int size() { return this.index+1; } + + public void add(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.size(); } + + } + } From d4a75eb73cfe680ab834d51a795bff4cb8eaa5ab Mon Sep 17 00:00:00 2001 From: James Seibel Date: Thu, 31 Aug 2023 07:21:15 -0500 Subject: [PATCH 07/49] Rename StableLightPosArray -> StableLightPosStack and add cache reusing --- .../core/generation/DhLightingEngine.java | 251 +++++++++++------- 1 file changed, 160 insertions(+), 91 deletions(-) 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 17d45e6af..699e3b7ff 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 @@ -11,6 +11,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 @@ -49,123 +50,140 @@ public class DhLightingEngine HashMap chunksByChunkPos = new HashMap<>(9); - // TODO get from a cache instead of creating new each time - StableLightPosArrayList blockLightPosQueue = new StableLightPosArrayList(); - StableLightPosArrayList skyLightPosQueue = new StableLightPosArrayList(); - - // 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(blockLightPos.x, blockLightPos.y, blockLightPos.z, 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 + 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 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(skyLightPos.x, skyLightPos.y, skyLightPos.z, 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 (chunksByChunkPos.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, 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)); } - - // 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( - StableLightPosArrayList lightPosQueue, HashMap chunksByChunkPos, + StableLightPosStack lightPosQueue, HashMap chunksByChunkPos, IGetLightFunc getLightFunc, ISetLightFunc setLightFunc) { // update each light position @@ -223,7 +241,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(neighbourBlockPos.x, neighbourBlockPos.y, neighbourBlockPos.z, targetLevel); + lightPosQueue.push(neighbourBlockPos.x, neighbourBlockPos.y, neighbourBlockPos.z, targetLevel); } } } @@ -256,9 +274,17 @@ public class DhLightingEngine } - - private static class StableLightPosArrayList + /** + * 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; @@ -268,10 +294,53 @@ public class DhLightingEngine + //================// + // 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 add(int blockX, int blockY, int blockZ, int lightValue) + public void push(int blockX, int blockY, int blockZ, int lightValue) { this.index++; if (this.index < this.arrayList.size()) @@ -298,7 +367,7 @@ public class DhLightingEngine } @Override - public String toString() { return this.index + " / " + this.size(); } + public String toString() { return this.index + "/" + this.arrayList.size(); } } From 3148991667e4600411e5cfc6a229b52ea99c5017 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Thu, 31 Aug 2023 07:55:43 -0500 Subject: [PATCH 08/49] Make light propagation mutate instead of create BlockPos to reduce GC pressure --- .../core/generation/DhLightingEngine.java | 61 +++++++++++++++---- .../distanthorizons/core/pos/DhBlockPos.java | 51 ++++++++++++++-- 2 files changed, 96 insertions(+), 16 deletions(-) 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 699e3b7ff..104e90bb6 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 @@ -47,8 +47,7 @@ public class DhLightingEngine DhChunkPos centerChunkPos = centerChunk.getChunkPos(); - - HashMap chunksByChunkPos = new HashMap<>(9); + AdjacentChunkHolder adjacentChunkHolder = new AdjacentChunkHolder(centerChunk); // try-finally to handle the stableArray resources @@ -85,7 +84,7 @@ public class DhLightingEngine requestedAdjacentPositions.remove(chunk.getChunkPos()); // add the adjacent chunk - chunksByChunkPos.put(chunk.getChunkPos(), chunk); + adjacentChunkHolder.add(chunk); @@ -147,7 +146,7 @@ public class DhLightingEngine } // validate that at least 1 chunk was found - if (chunksByChunkPos.size() == 0) + if (adjacentChunkHolder.size() == 0) { 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; @@ -156,12 +155,12 @@ public class DhLightingEngine // block light - this.propagateLightPosList(blockLightPosQueue, chunksByChunkPos, + 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, chunksByChunkPos, + 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)); } @@ -183,9 +182,15 @@ public class DhLightingEngine /** Applies each {@link LightPos} from the queue to the given set of {@link IChunkWrapper}'s. */ private void propagateLightPosList( - StableLightPosStack 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()) { @@ -200,14 +205,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 @@ -274,6 +278,41 @@ 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, 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 d7f9d650d..d673aa5be 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 @@ -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 @@ -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(this.x + x, this.y + y, this.z + z); + } + } + + /** 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,19 @@ 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.z = relX; + + return mutableBlockPos; + } + else + { + return new DhBlockPos(relX, this.y, relZ); + } } /** From 7ac562c5e9bde6770e7c8c5d55aab1c8668cd854 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Thu, 31 Aug 2023 19:01:57 -0500 Subject: [PATCH 09/49] Fix DhBlockPos mutable methods --- .../java/com/seibel/distanthorizons/core/pos/DhBlockPos.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 d673aa5be..dc386e576 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 @@ -151,7 +151,7 @@ public class DhBlockPos } else { - return new DhBlockPos(this.x + x, this.y + y, this.z + z); + return new DhBlockPos(newX, newY, newZ); } } @@ -177,7 +177,8 @@ public class DhBlockPos if (mutableBlockPos != null) { mutableBlockPos.x = relX; - mutableBlockPos.z = relX; + mutableBlockPos.y = this.y; + mutableBlockPos.z = relZ; return mutableBlockPos; } From 751eb75c504a9930bf5031ec23719c94437621e0 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Thu, 31 Aug 2023 19:08:31 -0500 Subject: [PATCH 10/49] Fix GLProxy null pointer --- .../distanthorizons/core/render/glObject/GLProxy.java | 7 +++++++ 1 file changed, 7 insertions(+) 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..3ee8e0c3c 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 @@ -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: From 08f78c22f027ba99a2ee541cf03e1f7b4c51b0dc Mon Sep 17 00:00:00 2001 From: James Seibel Date: Thu, 31 Aug 2023 21:06:41 -0500 Subject: [PATCH 11/49] Move SSAO gInvProj to the CPU instead of GPU Also make Mat4f.invert() return void instead of boolean to prevent confusion about trying to pass the result into shader uniforms. --- .../distanthorizons/coreapi/util/math/Mat4f.java | 13 +++++++------ .../core/render/renderer/shaders/SSAORenderer.java | 7 +++++++ core/src/main/resources/shaders/ssao/ao.frag | 3 ++- 3 files changed, 16 insertions(+), 7 deletions(-) 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..72dc3e02f 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 @@ -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/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..bcddd4e1a 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 @@ -53,6 +53,7 @@ public class SSAORenderer private static class SsaoShaderUniforms { public int gProjUniform; + public int gInvProjUniform; public int gSampleRadUniform; public int gFactorUniform; public int gPowerUniform; @@ -100,6 +101,7 @@ public class SSAORenderer // SSAO uniform setup this.ssaoShaderUniforms.gProjUniform = this.ssaoShader.getUniformLocation("gProj"); + this.ssaoShaderUniforms.gInvProjUniform = this.ssaoShader.getUniformLocation("gInvProj"); this.ssaoShaderUniforms.gSampleRadUniform = this.ssaoShader.getUniformLocation("gSampleRad"); this.ssaoShaderUniforms.gFactorUniform = this.ssaoShader.getUniformLocation("gFactor"); this.ssaoShaderUniforms.gPowerUniform = this.ssaoShader.getUniformLocation("gPower"); @@ -216,8 +218,13 @@ public class SSAORenderer RenderUtil.getNearClipPlaneDistanceInBlocks(partialTicks), (float) ((RenderUtil.getFarClipPlaneDistanceInBlocks() + LodUtil.REGION_WIDTH) * Math.sqrt(2))); + Mat4f invertedPerspective = new Mat4f(perspective); + invertedPerspective.invert(); + + this.ssaoShader.bind(); this.ssaoShader.setUniform(this.ssaoShaderUniforms.gProjUniform, perspective); + this.ssaoShader.setUniform(this.ssaoShaderUniforms.gInvProjUniform, invertedPerspective); this.ssaoShader.setUniform(this.ssaoShaderUniforms.gSampleRadUniform, 3.0f); this.ssaoShader.setUniform(this.ssaoShaderUniforms.gFactorUniform, 0.8f); this.ssaoShader.setUniform(this.ssaoShaderUniforms.gPowerUniform, 1.0f); diff --git a/core/src/main/resources/shaders/ssao/ao.frag b/core/src/main/resources/shaders/ssao/ao.frag index 0e5501870..fc48bcc05 100644 --- a/core/src/main/resources/shaders/ssao/ao.frag +++ b/core/src/main/resources/shaders/ssao/ao.frag @@ -9,6 +9,7 @@ uniform float gSampleRad; uniform float gFactor; uniform float gPower; uniform mat4 gProj; +uniform mat4 gInvProj; const int MAX_KERNEL_SIZE = 128; const float INV_MAX_KERNEL_SIZE_F = 1.0 / float(MAX_KERNEL_SIZE); @@ -25,7 +26,7 @@ vec3 calcViewPosition(vec2 coords) { 1.0 ); - vec4 vs_pos = inverse(gProj) * ndc; + vec4 vs_pos = gInvProj * ndc; vs_pos.xyz = vs_pos.xyz / vs_pos.w; return vs_pos.xyz; } From b894cc883632e168623167b22758cf9e61f25896 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Thu, 31 Aug 2023 21:15:49 -0500 Subject: [PATCH 12/49] Move Fog matrix inversion to the CPU --- .../core/render/renderer/shaders/FogShader.java | 10 +++++++--- core/src/main/resources/shaders/fog/fog.frag | 7 +++---- 2 files changed, 10 insertions(+), 7 deletions(-) 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..3ec34ca26 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 @@ -21,7 +21,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 +48,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 +119,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/resources/shaders/fog/fog.frag b/core/src/main/resources/shaders/fog/fog.frag index a9f317700..8e9f0767a 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; @@ -62,8 +62,7 @@ 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; } From c28ec1298337712dc6f2c8190a5611ab12304ff2 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Thu, 31 Aug 2023 21:42:57 -0500 Subject: [PATCH 13/49] Improve a couple data update comments --- .../core/dataObjects/render/ColumnRenderSource.java | 3 ++- .../transformers/FullDataToRenderDataTransformer.java | 2 ++ .../core/file/renderfile/RenderMetaDataFile.java | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) 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 472d3b1c9..c26d942c5 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 @@ -281,13 +281,14 @@ public class ColumnRenderSource } } + /** @return true if any data was changed, false otherwise */ public boolean fastWrite(ChunkSizedFullDataAccessor chunkData, IDhClientLevel level) { try { if (FullDataToRenderDataTransformer.writeFullDataChunkToColumnData(this, level, chunkData)) { - localVersion.incrementAndGet(); + this.localVersion.incrementAndGet(); return true; } else 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..d3c27410c 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 @@ -159,6 +159,8 @@ 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. + * + * @return true if any data was changed, false otherwise */ public static boolean writeFullDataChunkToColumnData(ColumnRenderSource renderSource, IDhClientLevel level, ChunkSizedFullDataAccessor chunkDataView) throws InterruptedException, IllegalArgumentException { 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..b404edfbb 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 @@ -147,14 +147,14 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements if (renderSourceLoadFuture == null) return; renderSourceLoadFuture.thenAccept((renderSource) -> { - boolean worked = renderSource.fastWrite(chunkDataView, level); + boolean dataUpdated = renderSource.fastWrite(chunkDataView, level); //if (pos.sectionDetailLevel == DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL+5) { 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 ) ); From 9ba1b18fac04bf21ff858976ef258b7ff18d50a9 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Thu, 31 Aug 2023 21:43:17 -0500 Subject: [PATCH 14/49] Remove debug disable lighting engine configs --- .../distanthorizons/core/config/Config.java | 14 ----------- .../core/generation/DhLightingEngine.java | 7 ------ .../chunk/IChunkWrapper.java | 25 ++++++++----------- 3 files changed, 11 insertions(+), 35 deletions(-) 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 5354cd921..c1233ce7e 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 @@ -1111,20 +1111,6 @@ public class Config .set(ExampleConfigScreen.class) .build(); - public static ConfigEntry disableDhLightingEngine = new ConfigEntry.Builder() - .set(false) - .comment("" - + "Temporary, only for testing." - + "") - .build(); - - public static ConfigEntry disableChunkWrapperLightBaking = new ConfigEntry.Builder() - .set(false) - .comment("" - + "Temporary, only for testing." - + "") - .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 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 104e90bb6..da988e4d5 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 @@ -39,13 +39,6 @@ public class DhLightingEngine */ public void lightChunk(IChunkWrapper centerChunk, List nearbyChunkList, int maxSkyLight) { - if (Config.Client.Advanced.Debugging.disableDhLightingEngine.get()) - { - centerChunk.setIsDhLightCorrect(true); - return; - } - - DhChunkPos centerChunkPos = centerChunk.getChunkPos(); AdjacentChunkHolder adjacentChunkHolder = new AdjacentChunkHolder(centerChunk); 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 69557cd5b..d94b1f145 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 @@ -75,23 +75,20 @@ public interface IChunkWrapper extends IBindable */ default void bakeDhLightingUsingMcLightingEngine() throws IllegalStateException { - if (!Config.Client.Advanced.Debugging.disableChunkWrapperLightBaking.get()) + if (!this.isLightCorrect()) { - if (!this.isLightCorrect()) + throw new IllegalStateException("Unable to bake lighting for for chunk [" + this.getChunkPos() + "], Minecraft lighting not valid."); + } + + // get the lighting for every relative block pos + for (int relX = 0; relX < LodUtil.CHUNK_WIDTH; relX++) + { + for (int relZ = 0; relZ < LodUtil.CHUNK_WIDTH; relZ++) { - throw new IllegalStateException("Unable to bake lighting for for chunk [" + this.getChunkPos() + "], Minecraft lighting not valid."); - } - - // get the lighting for every relative block pos - for (int relX = 0; relX < LodUtil.CHUNK_WIDTH; relX++) - { - for (int relZ = 0; relZ < LodUtil.CHUNK_WIDTH; relZ++) + for (int y = this.getMinBuildHeight(); y < this.getMaxBuildHeight(); y++) { - for (int y = this.getMinBuildHeight(); y < this.getMaxBuildHeight(); y++) - { - this.setDhSkyLight(relX, y, relZ, this.getSkyLight(relX, y, relZ)); - this.setDhBlockLight(relX, y, relZ, this.getBlockLight(relX, y, relZ)); - } + this.setDhSkyLight(relX, y, relZ, this.getSkyLight(relX, y, relZ)); + this.setDhBlockLight(relX, y, relZ, this.getBlockLight(relX, y, relZ)); } } } From aee64079410505f34f14120c06ff5a8232790398 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Thu, 31 Aug 2023 22:01:43 -0500 Subject: [PATCH 15/49] Add file write locking to AbstractMetaDataContainerFile Done to try preventing a rare bug where multiple threads would write the same file --- .../AbstractMetaDataContainerFile.java | 179 ++++++++++-------- 1 file changed, 97 insertions(+), 82 deletions(-) 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..6fb46e322 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 @@ -6,6 +6,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 +34,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
@@ -74,6 +75,7 @@ public abstract class AbstractMetaDataContainerFile /** Should be used instead of the position inside {@link AbstractMetaDataContainerFile#baseMetaData} */ public final DhSectionPos pos; + public final ReentrantLock writeLock = new ReentrantLock(); public File file; @@ -192,103 +194,116 @@ public abstract class AbstractMetaDataContainerFile 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) - { - tempFile = new File(this.file.getPath() + ".tmp"); - //tempFile.deleteOnExit(); - } - else - { - tempFile = this.file; - } - try (FileChannel fileChannel = FileChannel.open(tempFile.toPath(), StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING)) + + try { - fileChannel.position(METADATA_SIZE_IN_BYTES); - - // the order of these streams is important, otherwise the checksum won't be calculated - CheckedOutputStream checkedOut = new CheckedOutputStream(Channels.newOutputStream(fileChannel), new Adler32()); - // normally a DhStream should be the topmost stream to prevent closing the stream accidentally, but since this stream will be closed immediately after writing anyway, it won't be an issue - DhDataOutputStream compressedOut = new DhDataOutputStream(checkedOut); - - // write the contained data - dataWriterFunc.writeBufferToFile(compressedOut); - compressedOut.flush(); - this.baseMetaData.checksum = (int) checkedOut.getChecksum().getValue(); + // done to try preventing a rare issue where multiple threads would write/delete the same file at the same time + this.writeLock.lock(); - // Write metadata - fileChannel.position(0); - ByteBuffer buffer = ByteBuffer.allocate(METADATA_SIZE_IN_BYTES); - buffer.putInt(METADATA_IDENTITY_BYTES); - buffer.putInt(this.pos.sectionX); - buffer.putInt(Integer.MIN_VALUE); // Unused - y pos - buffer.putInt(this.pos.sectionZ); - buffer.putInt(this.baseMetaData.checksum); - buffer.put(this.pos.sectionDetailLevel); - buffer.put(this.baseMetaData.dataLevel); - buffer.put(this.baseMetaData.binaryDataFormatVersion); - buffer.put(this.baseMetaData.worldGenStep != null ? this.baseMetaData.worldGenStep.value : EDhApiWorldGenerationStep.EMPTY.value); // TODO this null check shouldn't be necessary - buffer.putLong(this.baseMetaData.dataTypeId); - buffer.putLong(this.baseMetaData.dataVersion.get()); // for types that doesn't need data versioning, this will be Long.MAX_VALUE - LodUtil.assertTrue(buffer.remaining() == METADATA_RESERVED_SIZE); - buffer.flip(); - fileChannel.write(buffer); - - - fileChannel.close(); - //LOGGER.info("Saved file: "+this.file.getName()); - + File tempFile; if (USE_ATOMIC_MOVE_REPLACE) { - // Atomic move / replace the actual file - Files.move(tempFile.toPath(), this.file.toPath(), StandardCopyOption.REPLACE_EXISTING); // TODO couldn't StandardCopyOption. also work here? - //LOGGER.info("replaced file: "+this.file.toPath()); + tempFile = new File(this.file.getPath() + ".tmp"); + //tempFile.deleteOnExit(); + } + else + { + tempFile = this.file; + } + + try (FileChannel fileChannel = FileChannel.open(tempFile.toPath(), StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING)) + { + fileChannel.position(METADATA_SIZE_IN_BYTES); + + // the order of these streams is important, otherwise the checksum won't be calculated + CheckedOutputStream checkedOut = new CheckedOutputStream(Channels.newOutputStream(fileChannel), new Adler32()); + // normally a DhStream should be the topmost stream to prevent closing the stream accidentally, but since this stream will be closed immediately after writing anyway, it won't be an issue + DhDataOutputStream compressedOut = new DhDataOutputStream(checkedOut); + + // write the contained data + dataWriterFunc.writeBufferToFile(compressedOut); + compressedOut.flush(); + this.baseMetaData.checksum = (int) checkedOut.getChecksum().getValue(); + + + // Write metadata + fileChannel.position(0); + ByteBuffer buffer = ByteBuffer.allocate(METADATA_SIZE_IN_BYTES); + buffer.putInt(METADATA_IDENTITY_BYTES); + buffer.putInt(this.pos.sectionX); + buffer.putInt(Integer.MIN_VALUE); // Unused - y pos + buffer.putInt(this.pos.sectionZ); + buffer.putInt(this.baseMetaData.checksum); + buffer.put(this.pos.sectionDetailLevel); + buffer.put(this.baseMetaData.dataLevel); + buffer.put(this.baseMetaData.binaryDataFormatVersion); + buffer.put(this.baseMetaData.worldGenStep != null ? this.baseMetaData.worldGenStep.value : EDhApiWorldGenerationStep.EMPTY.value); // TODO this null check shouldn't be necessary + buffer.putLong(this.baseMetaData.dataTypeId); + buffer.putLong(this.baseMetaData.dataVersion.get()); // for types that doesn't need data versioning, this will be Long.MAX_VALUE + LodUtil.assertTrue(buffer.remaining() == METADATA_RESERVED_SIZE); + buffer.flip(); + fileChannel.write(buffer); + + + fileChannel.close(); + //LOGGER.info("Saved file: "+this.file.getName()); + + if (USE_ATOMIC_MOVE_REPLACE) + { + // Atomic move / replace the actual file + Files.move(tempFile.toPath(), this.file.toPath(), StandardCopyOption.REPLACE_EXISTING); // TODO couldn't StandardCopyOption. also work here? + //LOGGER.info("replaced file: "+this.file.toPath()); + } + } + catch (NoSuchFileException e) + { + // can be thrown by the "Files.move" method if the system tries writing to an unloaded level + } + 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()); + } + finally + { + String tempDeleteErrorMessage = null; + try + { + // Delete temp file if it exists (this generally means there was an issue saving) + if (USE_ATOMIC_MOVE_REPLACE && tempFile.exists()) + { + boolean fileRemoved = tempFile.delete(); + if (!fileRemoved) + { + tempDeleteErrorMessage = "Unable to remove Temporary file at: " + tempFile.getPath(); + } + } + } + catch (SecurityException exception) + { + tempDeleteErrorMessage = "Security error: [" + exception.getMessage() + "] when attempting to remove Temporary file at: " + tempFile.getPath(); + } + + if (tempDeleteErrorMessage != null) + { + LOGGER.error(tempDeleteErrorMessage); + } + this.DebugThreadCheck = false; } - } - catch (NoSuchFileException e) - { - // can be thrown by the "Files.move" method if the system tries writing to an unloaded level - } - 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()); } finally { - String tempDeleteErrorMessage = null; - try - { - // Delete temp file if it exists (this generally means there was an issue saving) - if (USE_ATOMIC_MOVE_REPLACE && tempFile.exists()) - { - boolean fileRemoved = tempFile.delete(); - if (!fileRemoved) - { - tempDeleteErrorMessage = "Unable to remove Temporary file at: " + tempFile.getPath(); - } - } - } - catch (SecurityException exception) - { - tempDeleteErrorMessage = "Security error: [" + exception.getMessage() + "] when attempting to remove Temporary file at: " + tempFile.getPath(); - } - - if (tempDeleteErrorMessage != null) - { - LOGGER.error(tempDeleteErrorMessage); - } - this.DebugThreadCheck = false; + this.writeLock.unlock(); } } From e29974282e0101635e8e4f3de6310cc61e50ebed Mon Sep 17 00:00:00 2001 From: NULL511 Date: Fri, 1 Sep 2023 03:22:40 -0400 Subject: [PATCH 16/49] faster ssao --- .../render/renderer/shaders/SSAORenderer.java | 106 +++--------------- core/src/main/resources/shaders/ssao/ao.frag | 99 +++++++++------- .../resources/shaders/ssao/apply-frag.frag | 25 ----- 3 files changed, 73 insertions(+), 157 deletions(-) delete mode 100644 core/src/main/resources/shaders/ssao/apply-frag.frag 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 bcddd4e1a..cd7ee6423 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 @@ -22,7 +22,7 @@ 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 int MAX_KERNEL_SIZE = 32; private static final float[] box_vertices = { -1, -1, 1, -1, @@ -33,21 +33,14 @@ 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; - - private int ssaoTexture = -1; - // ssao uniforms private final SsaoShaderUniforms ssaoShaderUniforms = new SsaoShaderUniforms(); private static class SsaoShaderUniforms @@ -61,15 +54,6 @@ public class SSAORenderer public int gDepthMapUniform; } - // apply uniforms - private final ApplyShaderUniforms applyShaderUniforms = new ApplyShaderUniforms(); - private static class ApplyShaderUniforms - { - public int gSSAOMapUniform; - public int gDepthMapUniform; - } - - //=============// // constructor // @@ -79,26 +63,19 @@ 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", - "fragColor", new String[]{"vPosition"}); - - - // SSAO uniform setup this.ssaoShaderUniforms.gProjUniform = this.ssaoShader.getUniformLocation("gProj"); this.ssaoShaderUniforms.gInvProjUniform = this.ssaoShader.getUniformLocation("gInvProj"); @@ -108,43 +85,12 @@ public class SSAORenderer this.ssaoShaderUniforms.gKernelUniform = this.ssaoShader.getUniformLocation("gKernel"); this.ssaoShaderUniforms.gDepthMapUniform = this.ssaoShader.getUniformLocation("gDepthMap"); - // Apply uniform setup - this.applyShaderUniforms.gSSAOMapUniform = this.applyShader.getUniformLocation("gSSAOMap"); - this.applyShaderUniforms.gDepthMapUniform = this.applyShader.getUniformLocation("gDepthMap"); - - - // Generate kernel this.kernel = genKernel(); // Framebuffer this.createBuffer(); } - - private void createFramebuffer(int width, int height) - { - if (this.ssaoFramebuffer != -1) - { - GL32.glDeleteFramebuffers(this.ssaoFramebuffer); - this.ssaoFramebuffer = -1; - } - if (this.ssaoTexture != -1) - { - GL32.glDeleteTextures(this.ssaoTexture); - this.ssaoTexture = -1; - } - - this.ssaoFramebuffer = GL32.glGenFramebuffers(); - GL32.glBindFramebuffer(GL32.GL_FRAMEBUFFER, this.ssaoFramebuffer); - - 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.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); @@ -194,24 +140,20 @@ public class SSAORenderer public void render(float partialTicks) { GLState state = new GLState(); + this.init(); + int width = MC_RENDER.getTargetFrameBufferViewportWidth(); int height = MC_RENDER.getTargetFrameBufferViewportHeight(); - if (this.width != width || this.height != height) - { - this.width = width; - this.height = height; - this.createFramebuffer(width, height); - } - - 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.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.glBindFramebuffer(GL32.GL_FRAMEBUFFER, MC_RENDER.getTargetFrameBuffer()); GL32.glDisable(GL32.GL_SCISSOR_TEST); - Mat4f perspective = Mat4f.perspective( (float) MC_RENDER.getFov(partialTicks), MC_RENDER.getTargetFrameBufferViewportWidth() / (float) MC_RENDER.getTargetFrameBufferViewportHeight(), @@ -221,13 +163,12 @@ public class SSAORenderer Mat4f invertedPerspective = new Mat4f(perspective); invertedPerspective.invert(); - this.ssaoShader.bind(); this.ssaoShader.setUniform(this.ssaoShaderUniforms.gProjUniform, perspective); this.ssaoShader.setUniform(this.ssaoShaderUniforms.gInvProjUniform, invertedPerspective); 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.gFactorUniform, 0.7f); + this.ssaoShader.setUniform(this.ssaoShaderUniforms.gPowerUniform, 1.5f); this.va.bind(); this.va.bindBufferToAllBindingPoint(this.boxBuffer.getId()); @@ -240,30 +181,11 @@ public class SSAORenderer 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.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.glDrawArrays(GL32.GL_TRIANGLES, 0, 6); - - state.restore(); } public void free() { this.ssaoShader.free(); - this.applyShader.free(); } - } diff --git a/core/src/main/resources/shaders/ssao/ao.frag b/core/src/main/resources/shaders/ssao/ao.frag index fc48bcc05..32124d957 100644 --- a/core/src/main/resources/shaders/ssao/ao.frag +++ b/core/src/main/resources/shaders/ssao/ao.frag @@ -1,4 +1,5 @@ #version 150 core +#extension GL_ARB_derivative_control : enable in vec2 TexCoord; @@ -11,55 +12,73 @@ uniform float gPower; uniform mat4 gProj; uniform mat4 gInvProj; -const int MAX_KERNEL_SIZE = 128; +const float SAMPLE_BIAS = 0.1; +const int MAX_KERNEL_SIZE = 32; 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]; -vec3 calcViewPosition(vec2 coords) { - float fragmentDepth = texture(gDepthMap, coords).r; +const vec3 MAGIC = vec3(0.06711056, 0.00583715, 52.9829189); +const float PI = 3.1415926538; - 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 = gInvProj * ndc; - vs_pos.xyz = vs_pos.xyz / vs_pos.w; - return vs_pos.xyz; +float InterleavedGradientNoise(const in vec2 pixel) { + float x = dot(pixel, MAGIC.xy); + return fract(MAGIC.z * fract(x)); } -void main() -{ - vec3 viewPos = calcViewPosition(TexCoord); - vec3 viewNormal = normalize(cross(dFdy(viewPos.xyz), dFdx(viewPos.xyz)) * -1.0); +vec3 calcViewPosition(const in vec3 clipPos) { + vec4 viewPos = gInvProj * vec4(clipPos * 2.0 - 1.0, 1.0); + return viewPos.xyz / viewPos.w; +} - vec3 randomVec = vec3(0.0, -1.0, 0.0); +void main() { + float fragmentDepth = textureLod(gDepthMap, TexCoord, 0).r; + float occlusion = 1.0; + + if (fragmentDepth < 1.0) { + float dither = InterleavedGradientNoise(gl_FragCoord.xy); + vec3 viewPos = calcViewPosition(vec3(TexCoord, fragmentDepth)); + + #ifdef GL_ARB_derivative_control + vec3 viewNormal = normalize(cross(dFdxFine(viewPos.xyz), dFdyFine(viewPos.xyz))); + #else + vec3 viewNormal = normalize(cross(dFdx(viewPos.xyz), dFdy(viewPos.xyz))); + #endif - vec3 tangent = normalize(randomVec - viewNormal * dot(randomVec, viewNormal)); - vec3 bitangent = cross(viewNormal, tangent); - mat3 TBN = mat3(tangent, bitangent, viewNormal); + const vec3 upVec = vec3(0.0, -1.0, 0.0); - 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 angle = dither * (PI * 2.0); + vec3 rotation = vec3(sin(angle), cos(angle), 0.0); + vec3 tangent = normalize(cross(viewNormal, rotation)); + vec3 bitangent = normalize(cross(viewNormal, tangent)); + mat3 TBN = mat3(tangent, bitangent, viewNormal); + + float maxWeight = 0.0; + float occlusion_factor = 0.0; + for (int i = 0; i < MAX_KERNEL_SIZE; i++) { + vec3 samplePos = TBN * gKernel[i]; + samplePos = viewPos + samplePos * gSampleRad; + + vec4 sampleNdcPos = gProj * vec4(samplePos + viewPos, 1.0); + sampleNdcPos = sampleNdcPos / sampleNdcPos.w; + if (any(greaterThanEqual(abs(sampleNdcPos.xy), vec2(1.0)))) continue; + + maxWeight += 1.0; + + vec2 sampleTexPos = sampleNdcPos.xy * 0.5 + 0.5; + float sampleDepth = textureLod(gDepthMap, sampleTexPos, 0).r; + float geometryDepth = calcViewPosition(vec3(sampleTexPos, sampleDepth)).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 += step(samplePos.z + SAMPLE_BIAS, geometryDepth) * rangeCheck; + } + + float visibility_factor = 1.0 - (occlusion_factor / maxWeight); + occlusion = (1.0 - pow(visibility_factor, gFactor)) * gPower; + occlusion = clamp(1.0 - occlusion, 0.25, 1.0); } - - 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 + + fragColor = vec4(vec3(1.0), occlusion); +} 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); - } -} From 983703479f53b0cd8fb23e686766de9374c60d61 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Fri, 1 Sep 2023 07:41:44 -0500 Subject: [PATCH 17/49] Remove unused IDE files and move Gitlab docker setup instructions --- .../IDE files/Eclipse Auto Formatting V1.xml | 390 ------------------ _Misc Files/IDE files/README.txt | 11 - .../IDE files/intellij Auto Formatting V1.xml | 50 --- .../IDE files/minecraft launch options.txt | Bin 34798 -> 0 bytes ...derDocMcDistantHorizonsSettings-1.16.5.cap | 87 ---- .../renderDocMcDistantHorizonsSettings.cap | 39 -- .../Gitlab Docker Container Setup.txt | 2 +- 7 files changed, 1 insertion(+), 578 deletions(-) delete mode 100644 _Misc Files/IDE files/Eclipse Auto Formatting V1.xml delete mode 100644 _Misc Files/IDE files/README.txt delete mode 100644 _Misc Files/IDE files/intellij Auto Formatting V1.xml delete mode 100644 _Misc Files/IDE files/minecraft launch options.txt delete mode 100644 _Misc Files/IDE files/renderDocMcDistantHorizonsSettings-1.16.5.cap delete mode 100644 _Misc Files/IDE files/renderDocMcDistantHorizonsSettings.cap rename _Misc Files/{IDE files => setup documentation}/Gitlab Docker Container Setup.txt (94%) 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 b22d7a44d1023bcc2b4a9c78a79f482d9dc4a9fd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 34798 zcmeI*TW=g!b_L*i4v_y~_%&`0ucA1C9+Ft`Okg91?U~F20fAzZvS>>rNYR$_3-~9cF(&%b|>Am`?)*o zp477QTK~GcsBfqB`AsdG*6Xuca@rksKh&OYy3gv{QLX){e|^&Z(l5E}_j2TE?Pb|P zeVW#GN44gnmObv)`@ete{-K+6pLfUo7-q9pb2+Vfy{H+zuGh61>$IQ8X|2inqkg;} z`xzb8yf16JyBz6N&EveE`FTH!Z@Q=57u}z`Z@cfhZ|ePNefp&Pw4af&Uexx7HUEFB zkq`Qre_iiyy6JEjh0(Pipz$yCc2oG4tKEJFcaZ z+VZrJpVWxn_j|O=+-KwFyo}_$_G{0}8o?RAtRtJ_v)b3S7$0{)r0uy@TfVLTPp=TP z$D2ax`rhNK{i2`iw8nF7zZiY{w)S?t9OI(i$wJes>#MymUSLmz$ zy!PwUWvw~uU)x!KdL`o!ecNA?wc7i2X~S9_;iynKsC~YvPsep6pQFc@wWP`QP5ZVz z?49GB^&`CK{=MEGzNG*CXuqs$^SZ8xBYas{T-23$QhIb+e>6Cj@~qb-x^q~1L|0=Q zX}dj7dRhLyURgzW+Jg4ID(z(BUe#YL-LRY#Kz~?bfBOGR?P)H<8uK`+zqaJFI_jXs zlUhSRS%%L_K3>&2quS@Qes(|Ank@gZKC!)*_0A@LR$Iqb%q|`Dcyc9QW@pYk!bRD; zm;DGVl(Bw!&^kMNZex9PH6is?o#nJ}bA9=_lm2Q=x}DO{$MwHn|B(ckJ03d@?>B`# zgh<2Af^829QCpvuc_ww?; z7lI;;+w4j3+bjHb3Y-1HYP+y{R2ZxmBAd1Edc8jCkFwVzv|FDa^*CC)Sy*NL^ZNF< z)@;?0rge;?`X*v{-wc9Yo53>Cqe~)&(~?3m8B4qW?tR|k?w1TjZXeg#!e*o1H|nf6 z>)f9g3WtRtNm}pM2aoMqve8TBPHi`>t+#4x+ju>$B`{lT<0tP%TxE=!_ZiUH>ZK(T zv)#+a;~p#8MpL)y4+;nMdQeLa3ax{}=6U@;s_h@uyLDu8v(^vjw6PunF7rNkz-PNK zV2fC+t^So&B2&(uHDlY4d%Zj?ncA*zdnGIMaIf~D-=e~u`a7uQ13vR(J_MXvL^9yR z3j1S?$bs`*FKqVeykq5Q-EOVhuH^?kB9>bkOSaqZGp)7sa=@pJwfeXWXwVQ6!D6s4 zEVHY>Ro{2&b?4pp!&<`z@7A*TMCVU-j_aQ%44MNPv1ZM-v`A%A$7YjSHrTxQC*8kP zWcy_;|El}XirM~BpP$yZuWR{t-Jjm&9mC$I6|=}Y*ZR0FSuYPX z?UDLJow*p_oH94@-?SpQwuNZ1VJR|fN67jAt@~T?41X%DJ|Ez5jdE72i# zp{-l%qeJr&`Mu5IHY9x^X5n`7KB?p!T)>EoHK9^?0+UX#Iwv|KdI7@Nz+vWl$2S??=F>#?d~ zHE`0+cCa${$(C0^=bWF+{GdP6hi5Y~e_jfk_E6`KeK@XbAgX$ZXK`85le)lhY0I zh7^B@!ISf>SBB#XZPwZ_RPvskTDMpKvgD0gj+>ETZ};2S{&D@wwJi^KH6DvZwy~Cr zn9S+tI>YCMmK=rdv0))`&sSVb>^<}7OQl7g^|r_?7SL;Dst1Mwf=0Ug~hZa2frY@I;`&) z8k_{qX0u-Le;6$ixYOeY%ixE{vc@Y$deMl@Y8g=`tG4!g$lYz$M&>=XFgM%u#1gDC zeSL9-S8VS5+IDWuA~(yPeb>7GuA`j&rZ)Ai@-fdfyq~}R$e<4uoV#gPs~Db^RI@hc zbJB9%_hYFJONZ#wqx!>g(XZ#Fb*%hm|9VhM!xV1UaaAUEYCX<0nuax_v8)|$p`NMN zq0M4mD(54R-$VQUe!0w^>VV@4a+pGPUNwx5PLFwzLiG zp7)=y(L5n0(R%fv#iNEn&8W*nX{g|YZPc68*tLsdoUE7k$Z3b~sqBdASb23<^08g7 zsdzyUcZzdX7YmEZy5s4w^`v zz7}KDnBsx2|5*LfoiJaC8u0m8{d!fFq1Ag^MQXt3WAzI@t-IDr17-5>x8QBU7^&ksC3gj*jF0Jjs@>sqimY0*u{e z{mYP{Lgo?|ksxwptxg!Z@A!JmkG(3G-6ylbUbScvtG5MIw*Ra z*7x+vh(y))X{wqzorI$p6xRCMMD;DJX){>mjOK2Lrf;7tVgT7Tk+MvKB}(=OVVv+@ z{WlGTthk-+6Nl^0N`5GFoYtN}+}h}F@|*eb(ubMxmZ`IMLu=r2RHt4RLM)EilM?wL z4oY_<=1ImEW|Xb-CzFxukR_RnyqYwUIvHfV1KE^|vkdbiMqk^AtB+XIl;pKz`JzqG zkp1emAt|~>SwHq3O7wBsBcsQNmg>*K3CghJA9S1Ai}vH-V;kCdgM8uYfBRZO#%WzU zH}~G&O}==Ai;^7L6W&XoB*_YIK-2VK;b+JhCLw*1GG}ZuE);*vQ$hwx(M-H4k71cE zzwub<5zSc3M9J0DkE1t+4HkjvIQhAB4VR>EMeqOjwI-~>>pCAx_G^iKG0Ex(kLsTV zqgjz8ybJqJ@8}=<4<$B@{o)_uX<>W=&gWG1J?|=VAY_ z?<{#bmDw>pZ{&-8%T|fdbS=Zu7Al7rEy$(wJX*Obn3;_}Fs#35TPMAmgQ@e_t3cWO)UDN*UT}7jX$M_@`Lq4iM}Np(6>$I_)~hC z+zQHJSVhG27}T|g>PPdWVhrptizXhEg$7ZYDpn0jtQZL+WA43>lfqVAmmbTwWcT--O>&0i z``X1CJb$NezHe9Lv|l*uAn!UW?mZK?j8WA=Ad(TSK$t(~clc?! z2A#GR8!ndiU9SPoz`iU4A7oom;w-8+&Ei8rIko+HOliNkE_Z(n0 zHHmCBQb_YSSS;}otY;j4{HgqkPS~{6f7g2* z#sc7kVJOxiS@>gkChq3XWp}LUqdCmxM_(P>n%BOlGjaXgmm*hlXLM{^ByaKZ#yy2M zmfwoF$&joBOur+5RphYN^Jly$ zkH;CJ!R4aUn1R_o#@r9@UZ?%S>$2YSnXL(L;(YW6u;9r}hgZ6VNr_AaH@XHT9eAWI zHjVvLt-+fNBaji_YbtzHdekzk2hk zw6}38cgIc3#98^AaLi5`vSWsiHW30pCgL;G;^$-|!hQ zBvU-D+?G`0RmWqsJSx2Y@?x|mH+~7tJ-(N91^u3dUPsly_G!$Ih-uk85`>Y9pJlt$ z>Jxp5WaXo@OkN-dfKnJK(TE6+#?sCFZUbZ&jhJ{gBQ8^dn$K{xL}l)&R{b?6tR3s@ zebO@?<6qlJ4Z6iAqJMHFt{0Dy4}38kphdrU3rr^|v^Cy|v|&A1u|zl6(_|lu#|?7J zk5}%B+$>J|7gVgAwSVZS#is)8dzd-i)zUtUf}k|asIPv@FdW}(T7I6yB0Jkl|! zPAFF3*&HFc76}}WGpV&1XBF_6^=!>bjeo(bMXYOeMyfBom28LP1QkpJyPU{~r=w?y zpW@lrDt10qR9y`$yN-`A60wcrQCr-UQJ0C7Uwcq-r$Z`J?VeMg>04?sjf3ae*7{#2 zOigCL(BRj3t5jN?eeg-uUDU)v(?9V5J1y!YH==sBoGgi>NZg|F(+@-E=f__ra?!a~ z2gU2Ve{}IuQIyyKo6M`>pktHdHW>R zWtm6;TB0!9V?pS5s(LKo;xQv{8FQH!&dZYT;wx6=wskZmy=qt=vIQrKqoFwH#0%pw z2aFtLnOe3OB{Crr*RA)qN9nTkPOpnQ2E-8X5-a4cN|7Y_NJT76b9!4?qeP}`70C&T zVhw#S*7Kq~VYmj7$jze<9koVZJ>=YfifiEa#6av){128Sb?f|Eok%n}4$CZ07I%t1 zX{Y#zJSAday?vs4(1DhJcMFWii*0J-Efbx^QNygSTkM0>9aYfW(-XTzL!bv8tblxn zM+>_geou6o-XNMvYvU_r$WRvfvvd4rJRwGJc0S>O#^Xm%GyXEsoS$cUd)hDjUq6re z^@$@AdGU7sQ;YS^SK_f^&&09ufoz~&phU5$B9YVfOAc86MUm_5=q;Lv9xN}OSS*o4 zq>4ekIgYhAHj3?|U+#&esfqf8I_wcs=4QBCK?wvc2E(^uf=Uhb^Rc*{hnN!O3n0dP|Bg|4vS^Q4yLsQ~$n1#y3*D3Zhr z@`Yk9G9&IvXBZD40!t<&k7UC{r4Wie6R+WUSVF#(Y~D6@`cGiCT&a2=X6;u}aTl|A zks19uvPJn(?i=u#?7%Tx1j_}dbV9LvbdbHHc`#0FH;dPJ+=qr$ByTKRVs!BXA4n7B zL%8>3&@ht~LMdKA-3!N~vkpe$jr0t(%yBGR4J+e56s*kkxb$>Zrr2iIiiEJ<^pQs4 z0P)EzJ+$QQaACncAUpFg5gS0L)7Fe89>jL%sn9YipWYX9_cabDE_lg%~dH8&i5}wbQ>UvZ0Vq3@( z`M^oYrz2&ecQL$bs(6xq(a+rPaDChsm1o>#qSc}RsIje{@Z;WQzeer8!ngf59R|a< z$yK~5M{HMJ#EE5a_K~PC4Dx2&Xk;oC3(-b-`ImC6G`1P?x1}zTwZM6 z@WXJm-*oUiHoRrB6}>PR2GZi}#E|~QkhxceG)6DoF(a$9Esg;e>1mG6<~Jnw`zO9_ zkMfh%I{yKS`Cm|ow5X`Kw&BgaI!Ap8SSzw4f^_!rR5}|}OP=87 zks~h|c{SvPm(roTR&pcTbidX?`LsMcO}9$B@ACF7^MpZ17Kg84)@*|Pi3Xkc1diRDYFI8erXQSzc|jR!C*JvVRr8Mgjk zRt3vSk1-AL3it$l;9@8qfyGb0Bko9j463{VP39Ne2WM{#zp7=rd9IH+V8w1MAFCnm znf3Cw=hBJD)$K*$iO4ag>6(@S(sj8_B8=ENu^6^qUP!OiJ479HdYH%cJbv&3n`I5v z(nV-L)t;W^NInWs*x)XK`#} zekd3&%H>sjS;6QjSxYZ@dgr{tRX&!SgSU})z%sQLS}kVGog}jeUeDzpvTYpa+_Q2h z8-*jbj85Vt$s!*ELz3x_&BVjecXCX2%D;vwfB>Ck)q)0DOf3cD%eu)~NFPMS zfMR?oHa>xmCac!njVV}VJ#HN_x8L`aCt!~|WfEnFe@RxH{4SA=$e9%+Z6a>Wm5v6! zn71Ljv=@hv&PUsdmsm%A$FitlyxgPN>WIsWvKv}0`w*RuJF3Rt7Ipor9YHR4O5k^$ zeJmX;PW0Sbb`itMR_X#2ughkVE4n(i zNypZ3t*>9*+wonUtme0rVcv*8PGlahq!z@w$_z=a=tr-8a&1^zmJTr-1(^?XK`MTY z47)cee895gw{b0M`#;oqVYXEK-`4Xe!t?}S}+{$e89-FoJDb6%W>7Xz`K zP!ok?ej3UmAjc0A;df}4XCK@7&-OjfcH&&`yvh3c4kn1;!(ha|v5WjkixSzxtPvw7 zs!Rq5A2yXgNoNUEp}wf|W`6YGX!M3;d(K;)hWSs$<9ZIj&-KK%u9udMk$e$p8p 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 From 7a0a217822d71b89c8c8e8eb777f87747986ac08 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Fri, 1 Sep 2023 07:44:15 -0500 Subject: [PATCH 18/49] Update existing licensing headers --- .../distanthorizons/api/enums/config/EBlocksToAvoid.java | 4 ++-- .../distanthorizons/api/enums/config/EBufferRebuildTimes.java | 4 ++-- .../api/enums/config/EGLErrorHandlingMode.java | 4 ++-- .../distanthorizons/api/enums/config/EGenerationPriority.java | 4 ++-- .../distanthorizons/api/enums/config/EGpuUploadMethod.java | 4 ++-- .../distanthorizons/api/enums/config/EHorizontalQuality.java | 4 ++-- .../api/enums/config/ELightGenerationMode.java | 4 ++-- .../seibel/distanthorizons/api/enums/config/ELodShading.java | 4 ++-- .../seibel/distanthorizons/api/enums/config/ELoggerMode.java | 4 ++-- .../api/enums/config/EMaxHorizontalResolution.java | 4 ++-- .../distanthorizons/api/enums/config/EOverdrawPrevention.java | 4 ++-- .../api/enums/config/EServerFolderNameMode.java | 4 ++-- .../distanthorizons/api/enums/config/EVanillaOverdraw.java | 4 ++-- .../distanthorizons/api/enums/config/EVerticalQuality.java | 4 ++-- .../api/enums/config/quickOptions/EQualityPreset.java | 4 ++-- .../api/enums/config/quickOptions/EThreadPreset.java | 4 ++-- .../distanthorizons/api/enums/rendering/EDebugRendering.java | 4 ++-- .../distanthorizons/api/enums/rendering/EFogColorMode.java | 4 ++-- .../distanthorizons/api/enums/rendering/EFogDistance.java | 4 ++-- .../distanthorizons/api/enums/rendering/EFogDrawMode.java | 4 ++-- .../api/enums/rendering/EHeightFogMixMode.java | 4 ++-- .../distanthorizons/api/enums/rendering/EHeightFogMode.java | 4 ++-- .../distanthorizons/api/enums/rendering/ERendererMode.java | 4 ++-- .../distanthorizons/api/enums/rendering/ETransparency.java | 4 ++-- .../api/enums/worldGeneration/EDhApiDistantGeneratorMode.java | 4 ++-- .../api/interfaces/block/IDhApiBiomeWrapper.java | 4 ++-- .../interfaces/config/both/IDhApiWorldGenerationConfig.java | 4 ++-- .../api/interfaces/config/client/IDhApiDebuggingConfig.java | 4 ++-- .../api/interfaces/config/client/IDhApiFarFogConfig.java | 4 ++-- .../api/interfaces/config/client/IDhApiFogConfig.java | 4 ++-- .../api/interfaces/config/client/IDhApiGpuBuffersConfig.java | 4 ++-- .../api/interfaces/config/client/IDhApiGraphicsConfig.java | 4 ++-- .../api/interfaces/config/client/IDhApiHeightFogConfig.java | 4 ++-- .../api/interfaces/config/client/IDhApiLoggingConfig.java | 4 ++-- .../interfaces/config/client/IDhApiMultiThreadingConfig.java | 4 ++-- .../api/interfaces/config/client/IDhApiMultiplayerConfig.java | 4 ++-- .../interfaces/config/client/IDhApiNoiseTextureConfig.java | 4 ++-- .../api/interfaces/events/IDhApiEventInjector.java | 4 ++-- .../api/interfaces/render/IDhApiRenderProxy.java | 4 ++-- .../api/interfaces/world/IDhApiDimensionTypeWrapper.java | 4 ++-- .../api/interfaces/world/IDhApiLevelWrapper.java | 4 ++-- .../api/interfaces/world/IDhApiWorldProxy.java | 4 ++-- .../seibel/distanthorizons/api/objects/math/DhApiVec3i.java | 4 ++-- .../coreapi/DependencyInjection/ApiEventInjector.java | 4 ++-- .../coreapi/DependencyInjection/DependencyInjector.java | 4 ++-- .../coreapi/DependencyInjection/OverrideInjector.java | 4 ++-- .../coreapi/DependencyInjection/WorldGeneratorInjector.java | 4 ++-- .../main/java/com/seibel/distanthorizons/coreapi/ModInfo.java | 4 ++-- .../coreapi/interfaces/dependencyInjection/IBindable.java | 4 ++-- .../com/seibel/distanthorizons/coreapi/util/StringUtil.java | 4 ++-- .../com/seibel/distanthorizons/coreapi/util/math/Mat4f.java | 4 ++-- .../com/seibel/distanthorizons/coreapi/util/math/Vec3d.java | 4 ++-- .../com/seibel/distanthorizons/coreapi/util/math/Vec3f.java | 4 ++-- .../com/seibel/distanthorizons/coreapi/util/math/Vec3i.java | 4 ++-- api/src/test/java/tests/ExampleTest.java | 4 ++-- .../com/seibel/distanthorizons/core/IReflectionHandler.java | 4 ++-- .../com/seibel/distanthorizons/core/ReflectionHandler.java | 4 ++-- .../external/methods/config/client/DhApiDebuggingConfig.java | 4 ++-- .../api/external/methods/config/client/DhApiFarFogConfig.java | 4 ++-- .../api/external/methods/config/client/DhApiFogConfig.java | 4 ++-- .../external/methods/config/client/DhApiGpuBuffersConfig.java | 4 ++-- .../external/methods/config/client/DhApiGraphicsConfig.java | 4 ++-- .../external/methods/config/client/DhApiHeightFogConfig.java | 4 ++-- .../methods/config/client/DhApiMultiThreadingConfig.java | 4 ++-- .../methods/config/client/DhApiMultiplayerConfig.java | 4 ++-- .../methods/config/client/DhApiNoiseTextureConfig.java | 4 ++-- .../methods/config/common/DhApiWorldGenerationConfig.java | 4 ++-- .../seibel/distanthorizons/core/api/internal/ClientApi.java | 4 ++-- .../seibel/distanthorizons/core/api/internal/ServerApi.java | 4 ++-- .../java/com/seibel/distanthorizons/core/config/Config.java | 4 ++-- .../render/bufferBuilding/BufferMergeDirectionEnum.java | 4 ++-- .../core/dataObjects/render/bufferBuilding/BufferQuad.java | 4 ++-- .../core/dataObjects/render/bufferBuilding/ColumnBox.java | 4 ++-- .../dataObjects/render/bufferBuilding/CubicLodTemplate.java | 4 ++-- .../dataObjects/render/bufferBuilding/LodQuadBuilder.java | 4 ++-- .../core/dataObjects/transformers/LodBuilderConfig.java | 4 ++-- .../core/dependencyInjection/ModAccessorInjector.java | 4 ++-- .../core/dependencyInjection/SingletonInjector.java | 4 ++-- .../com/seibel/distanthorizons/core/enums/EDhDirection.java | 4 ++-- .../seibel/distanthorizons/core/enums/EGLProxyContext.java | 4 ++-- .../com/seibel/distanthorizons/core/enums/ELevelType.java | 4 ++-- .../core/file/subDimMatching/SubDimCompare.java | 4 ++-- .../core/file/subDimMatching/SubDimensionPlayerData.java | 4 ++-- .../distanthorizons/core/generation/BatchGenerator.java | 2 +- .../distanthorizons/core/logging/ConfigBasedLogger.java | 4 ++-- .../distanthorizons/core/logging/ConfigBasedSpamLogger.java | 4 ++-- .../distanthorizons/core/logging/SpamReducedLogger.java | 4 ++-- .../java/com/seibel/distanthorizons/core/pos/DhBlockPos.java | 4 ++-- .../java/com/seibel/distanthorizons/core/pos/DhChunkPos.java | 4 ++-- .../main/java/com/seibel/distanthorizons/core/pos/Pos2D.java | 4 ++-- .../distanthorizons/core/render/AbstractRenderBuffer.java | 4 ++-- .../seibel/distanthorizons/core/render/fog/FogSettings.java | 4 ++-- .../seibel/distanthorizons/core/render/fog/LodFogConfig.java | 4 ++-- .../seibel/distanthorizons/core/render/glObject/GLEnums.java | 4 ++-- .../seibel/distanthorizons/core/render/glObject/GLProxy.java | 4 ++-- .../seibel/distanthorizons/core/render/glObject/GLState.java | 4 ++-- .../distanthorizons/core/render/glObject/LightmapTexture.java | 4 ++-- .../core/render/glObject/buffer/GLElementBuffer.java | 4 ++-- .../core/render/glObject/buffer/GLVertexBuffer.java | 4 ++-- .../distanthorizons/core/render/glObject/shader/Shader.java | 4 ++-- .../core/render/glObject/shader/ShaderProgram.java | 4 ++-- .../core/render/glObject/vertexAttribute/VertexAttribute.java | 4 ++-- .../glObject/vertexAttribute/VertexAttributePostGL43.java | 4 ++-- .../glObject/vertexAttribute/VertexAttributePreGL43.java | 4 ++-- .../core/render/renderer/LodRenderProgram.java | 4 ++-- .../distanthorizons/core/render/renderer/LodRenderer.java | 4 ++-- .../distanthorizons/core/render/renderer/TestRenderer.java | 4 ++-- .../core/render/vertexFormat/DefaultLodVertexFormats.java | 4 ++-- .../core/render/vertexFormat/LodVertexFormat.java | 4 ++-- .../core/render/vertexFormat/LodVertexFormatElement.java | 4 ++-- .../java/com/seibel/distanthorizons/core/util/ColorUtil.java | 4 ++-- .../java/com/seibel/distanthorizons/core/util/EnumUtil.java | 4 ++-- .../java/com/seibel/distanthorizons/core/util/LodUtil.java | 4 ++-- .../com/seibel/distanthorizons/core/util/RayCastUtil.java | 4 ++-- .../seibel/distanthorizons/core/util/RenderDataPointUtil.java | 4 ++-- .../java/com/seibel/distanthorizons/core/util/RenderUtil.java | 4 ++-- .../distanthorizons/core/util/gridList/ArrayGridList.java | 4 ++-- .../core/util/gridList/EdgeDistanceBooleanGrid.java | 4 ++-- .../core/util/gridList/MovableGridRingList.java | 4 ++-- .../distanthorizons/core/util/gridList/PosArrayGridList.java | 4 ++-- .../com/seibel/distanthorizons/core/util/math/UnitBytes.java | 4 ++-- .../seibel/distanthorizons/core/util/objects/BoolType.java | 4 ++-- .../distanthorizons/core/util/objects/DhThreadFactory.java | 4 ++-- .../core/util/objects/DummyRunExecutorService.java | 4 ++-- .../seibel/distanthorizons/core/util/objects/GLMessage.java | 4 ++-- .../core/util/objects/GLMessageOutputStream.java | 4 ++-- .../seibel/distanthorizons/core/util/objects/ParsedIp.java | 4 ++-- .../seibel/distanthorizons/core/util/objects/StatsMap.java | 4 ++-- .../core/wrapperInterfaces/IVersionConstants.java | 4 ++-- .../core/wrapperInterfaces/IWrapperFactory.java | 4 ++-- .../core/wrapperInterfaces/chunk/IChunkWrapper.java | 4 ++-- .../wrapperInterfaces/minecraft/IMinecraftClientWrapper.java | 4 ++-- .../wrapperInterfaces/minecraft/IMinecraftRenderWrapper.java | 4 ++-- .../core/wrapperInterfaces/minecraft/IProfilerWrapper.java | 4 ++-- .../core/wrapperInterfaces/misc/ILightMapWrapper.java | 4 ++-- .../core/wrapperInterfaces/modAccessor/IModAccessor.java | 4 ++-- .../core/wrapperInterfaces/modAccessor/IModChecker.java | 4 ++-- .../core/wrapperInterfaces/modAccessor/IOptifineAccessor.java | 4 ++-- .../core/wrapperInterfaces/modAccessor/ISodiumAccessor.java | 4 ++-- .../wrapperInterfaces/modAccessor/IStarlightAccessor.java | 4 ++-- .../core/wrapperInterfaces/world/IBiomeWrapper.java | 4 ++-- .../core/wrapperInterfaces/world/IDimensionTypeWrapper.java | 4 ++-- .../core/wrapperInterfaces/world/ILevelWrapper.java | 4 ++-- .../AbstractBatchGenerationEnvironmentWrapper.java | 4 ++-- core/src/test/java/tests/CompressionTest.java | 4 ++-- core/src/test/java/tests/DhSectionPosTest.java | 4 ++-- core/src/test/java/tests/ExampleTest.java | 4 ++-- core/src/test/java/tests/QuadTreeTest.java | 4 ++-- core/src/test/java/tests/RaycastingTest.java | 4 ++-- core/src/test/java/tests/SquareIntersectTest.java | 4 ++-- 150 files changed, 299 insertions(+), 299 deletions(-) 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/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/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/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/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..97c500fa0 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 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/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/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/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/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/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/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/math/Mat4f.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/util/math/Mat4f.java index 72dc3e02f..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 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/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/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/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..81c7cc547 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 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/internal/ClientApi.java b/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ClientApi.java index cfcaf8881..a3956654a 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 afc363e1e..6545df623 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/config/Config.java b/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java index c1233ce7e..5398f5f1a 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 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/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/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/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/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/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/logging/ConfigBasedLogger.java b/core/src/main/java/com/seibel/distanthorizons/core/logging/ConfigBasedLogger.java index 36a060b9a..9471d77af 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/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/pos/DhBlockPos.java b/core/src/main/java/com/seibel/distanthorizons/core/pos/DhBlockPos.java index dc386e576..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 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 c083e7b0f..e9cd29ba0 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/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/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 3ee8e0c3c..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 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/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/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/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..00b2cc1c7 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 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/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/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/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/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..4b1e34c9c 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 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/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/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/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/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/chunk/IChunkWrapper.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/chunk/IChunkWrapper.java index d94b1f145..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 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..47b2ecced 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 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/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/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/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/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/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 From 88b02ef2f72dfd55ad300640be8c3ad9bdccb1aa Mon Sep 17 00:00:00 2001 From: NULL511 Date: Fri, 1 Sep 2023 12:11:26 -0400 Subject: [PATCH 19/49] revert ssao tuning --- .../core/render/renderer/shaders/SSAORenderer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 cd7ee6423..9d3321b2f 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 @@ -167,8 +167,8 @@ public class SSAORenderer this.ssaoShader.setUniform(this.ssaoShaderUniforms.gProjUniform, perspective); this.ssaoShader.setUniform(this.ssaoShaderUniforms.gInvProjUniform, invertedPerspective); this.ssaoShader.setUniform(this.ssaoShaderUniforms.gSampleRadUniform, 3.0f); - this.ssaoShader.setUniform(this.ssaoShaderUniforms.gFactorUniform, 0.7f); - this.ssaoShader.setUniform(this.ssaoShaderUniforms.gPowerUniform, 1.5f); + this.ssaoShader.setUniform(this.ssaoShaderUniforms.gFactorUniform, 0.8f); + this.ssaoShader.setUniform(this.ssaoShaderUniforms.gPowerUniform, 1.0f); this.va.bind(); this.va.bindBufferToAllBindingPoint(this.boxBuffer.getId()); From 3ee3b9c98cf29f74e2a918bfdbf9d8c32ef1f7c3 Mon Sep 17 00:00:00 2001 From: NULL511 Date: Fri, 1 Sep 2023 17:18:29 -0400 Subject: [PATCH 20/49] vanilla-matched ssao --- .../render/renderer/shaders/SSAORenderer.java | 6 +- .../main/resources/shaders/flat_shaded.frag | 106 ++++-------------- .../main/resources/shaders/noise/noise.frag | 8 -- core/src/main/resources/shaders/ssao/ao.frag | 13 ++- 4 files changed, 31 insertions(+), 102 deletions(-) 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 9d3321b2f..935112376 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 @@ -156,7 +156,7 @@ public class SSAORenderer Mat4f perspective = Mat4f.perspective( (float) MC_RENDER.getFov(partialTicks), - MC_RENDER.getTargetFrameBufferViewportWidth() / (float) MC_RENDER.getTargetFrameBufferViewportHeight(), + width / (float) height, RenderUtil.getNearClipPlaneDistanceInBlocks(partialTicks), (float) ((RenderUtil.getFarClipPlaneDistanceInBlocks() + LodUtil.REGION_WIDTH) * Math.sqrt(2))); @@ -167,8 +167,8 @@ public class SSAORenderer this.ssaoShader.setUniform(this.ssaoShaderUniforms.gProjUniform, perspective); this.ssaoShader.setUniform(this.ssaoShaderUniforms.gInvProjUniform, invertedPerspective); 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.gFactorUniform, 0.5f); + this.ssaoShader.setUniform(this.ssaoShaderUniforms.gPowerUniform, 6.0f); this.va.bind(); this.va.bindBufferToAllBindingPoint(this.boxBuffer.getId()); 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/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 32124d957..b23f6c901 100644 --- a/core/src/main/resources/shaders/ssao/ao.frag +++ b/core/src/main/resources/shaders/ssao/ao.frag @@ -12,7 +12,8 @@ uniform float gPower; uniform mat4 gProj; uniform mat4 gInvProj; -const float SAMPLE_BIAS = 0.1; +const float MIN_LIGHT = 0.6; +const float SAMPLE_BIAS = 0.5; const int MAX_KERNEL_SIZE = 32; const float INV_MAX_KERNEL_SIZE_F = 1.0 / float(MAX_KERNEL_SIZE); uniform vec3 gKernel[MAX_KERNEL_SIZE]; @@ -40,12 +41,13 @@ void main() { vec3 viewPos = calcViewPosition(vec3(TexCoord, fragmentDepth)); #ifdef GL_ARB_derivative_control - vec3 viewNormal = normalize(cross(dFdxFine(viewPos.xyz), dFdyFine(viewPos.xyz))); + vec3 viewNormal = cross(dFdxFine(viewPos.xyz), dFdyFine(viewPos.xyz)); #else - vec3 viewNormal = normalize(cross(dFdx(viewPos.xyz), dFdy(viewPos.xyz))); + vec3 viewNormal = cross(dFdx(viewPos.xyz), dFdy(viewPos.xyz)); #endif - const vec3 upVec = vec3(0.0, -1.0, 0.0); + viewNormal = normalize(viewNormal); + //const vec3 upVec = vec3(0.0, -1.0, 0.0); float angle = dither * (PI * 2.0); vec3 rotation = vec3(sin(angle), cos(angle), 0.0); @@ -58,6 +60,7 @@ void main() { float occlusion_factor = 0.0; for (int i = 0; i < MAX_KERNEL_SIZE; i++) { vec3 samplePos = TBN * gKernel[i]; + samplePos *= sign(dot(samplePos, viewNormal)); samplePos = viewPos + samplePos * gSampleRad; vec4 sampleNdcPos = gProj * vec4(samplePos + viewPos, 1.0); @@ -77,7 +80,7 @@ void main() { float visibility_factor = 1.0 - (occlusion_factor / maxWeight); occlusion = (1.0 - pow(visibility_factor, gFactor)) * gPower; - occlusion = clamp(1.0 - occlusion, 0.25, 1.0); + occlusion = clamp(1.0 - occlusion, MIN_LIGHT, 1.0); } fragColor = vec4(vec3(1.0), occlusion); From f692ddaf9365953bcbcece8d2ebfbd2517947057 Mon Sep 17 00:00:00 2001 From: NULL511 Date: Fri, 1 Sep 2023 17:56:59 -0400 Subject: [PATCH 21/49] dither fog --- core/src/main/resources/shaders/fog/fog.frag | 61 ++++++++------------ core/src/main/resources/shaders/ssao/ao.frag | 4 +- 2 files changed, 25 insertions(+), 40 deletions(-) diff --git a/core/src/main/resources/shaders/fog/fog.frag b/core/src/main/resources/shaders/fog/fog.frag index 8e9f0767a..04eb3f7c1 100644 --- a/core/src/main/resources/shaders/fog/fog.frag +++ b/core/src/main/resources/shaders/fog/fog.frag @@ -42,23 +42,14 @@ 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; @@ -76,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); @@ -94,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) @@ -112,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); @@ -132,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/ssao/ao.frag b/core/src/main/resources/shaders/ssao/ao.frag index b23f6c901..abd315fdb 100644 --- a/core/src/main/resources/shaders/ssao/ao.frag +++ b/core/src/main/resources/shaders/ssao/ao.frag @@ -13,7 +13,7 @@ uniform mat4 gProj; uniform mat4 gInvProj; const float MIN_LIGHT = 0.6; -const float SAMPLE_BIAS = 0.5; +const float SAMPLE_BIAS = 0.6; const int MAX_KERNEL_SIZE = 32; const float INV_MAX_KERNEL_SIZE_F = 1.0 / float(MAX_KERNEL_SIZE); uniform vec3 gKernel[MAX_KERNEL_SIZE]; @@ -60,7 +60,7 @@ void main() { float occlusion_factor = 0.0; for (int i = 0; i < MAX_KERNEL_SIZE; i++) { vec3 samplePos = TBN * gKernel[i]; - samplePos *= sign(dot(samplePos, viewNormal)); + //samplePos *= sign(dot(samplePos, viewNormal)); samplePos = viewPos + samplePos * gSampleRad; vec4 sampleNdcPos = gProj * vec4(samplePos + viewPos, 1.0); From 8c7937f9a237d282140a2a2fcd13adfe26b3cff6 Mon Sep 17 00:00:00 2001 From: NULL511 Date: Fri, 1 Sep 2023 18:25:37 -0400 Subject: [PATCH 22/49] cleanup --- .../render/renderer/shaders/SSAORenderer.java | 16 +++++++++------- core/src/main/resources/shaders/ssao/ao.frag | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) 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 935112376..9d49ee098 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 @@ -105,13 +105,13 @@ public class SSAORenderer 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(); - - + float sampleX = (float)Math.random() * 2f - 1f; + float sampleY = (float)Math.random() * 2f - 1f; + float sampleZ = (float)Math.random() * 2f - 1f; + // Normalize float magnitude = (float) Math.sqrt(Math.pow(sampleX, 2) + Math.pow(sampleY, 2) + Math.pow(sampleZ, 2)); sampleX /= magnitude; @@ -119,15 +119,17 @@ public class SSAORenderer sampleZ /= magnitude; float scale = i / (float) MAX_KERNEL_SIZE; - float interpolatedScale = (float) (0.1 + (scale * scale) * (0.9)); + float interpolatedScale = (float) (0.1 + 0.9 * (scale * scale)); sampleX *= interpolatedScale; sampleY *= interpolatedScale; sampleZ *= interpolatedScale; - kernel[i * 3] = sampleX; + + kernel[i * 3 ] = sampleX; kernel[i * 3 + 1] = sampleY; kernel[i * 3 + 2] = sampleZ; } + return kernel; } diff --git a/core/src/main/resources/shaders/ssao/ao.frag b/core/src/main/resources/shaders/ssao/ao.frag index abd315fdb..f2677e86b 100644 --- a/core/src/main/resources/shaders/ssao/ao.frag +++ b/core/src/main/resources/shaders/ssao/ao.frag @@ -60,7 +60,7 @@ void main() { float occlusion_factor = 0.0; for (int i = 0; i < MAX_KERNEL_SIZE; i++) { vec3 samplePos = TBN * gKernel[i]; - //samplePos *= sign(dot(samplePos, viewNormal)); + samplePos *= sign(dot(samplePos, viewNormal)); samplePos = viewPos + samplePos * gSampleRad; vec4 sampleNdcPos = gProj * vec4(samplePos + viewPos, 1.0); From 1af6e830860f3b308185c933dc5a260a0375faa4 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Fri, 1 Sep 2023 20:43:26 -0500 Subject: [PATCH 23/49] Add missing licensing headers --- .../com/seibel/distanthorizons/api/DhApi.java | 19 +++++++++++++++++ .../api/enums/EDhApiDetailLevel.java | 19 +++++++++++++++++ .../config/DisallowSelectingViaConfigGui.java | 19 +++++++++++++++++ .../api/enums/rendering/EFogFalloff.java | 19 +++++++++++++++++ .../worldGeneration/EDhApiLevelType.java | 19 +++++++++++++++++ .../EDhApiWorldGenerationStep.java | 19 +++++++++++++++++ .../api/interfaces/IDhApiUnsafeWrapper.java | 19 +++++++++++++++++ .../block/IDhApiBlockStateWrapper.java | 19 +++++++++++++++++ .../api/interfaces/config/IDhApiConfig.java | 19 +++++++++++++++++ .../interfaces/config/IDhApiConfigGroup.java | 19 +++++++++++++++++ .../interfaces/config/IDhApiConfigValue.java | 19 +++++++++++++++++ .../data/IDhApiTerrainDataRepo.java | 19 +++++++++++++++++ .../override/IDhApiOverrideable.java | 19 +++++++++++++++++ .../AbstractDhApiChunkWorldGenerator.java | 19 +++++++++++++++++ .../worldGenerator/IDhApiWorldGenerator.java | 19 +++++++++++++++++ .../IDhApiWorldGeneratorOverrideRegister.java | 19 +++++++++++++++++ .../methods/events/DhApiEventRegister.java | 19 +++++++++++++++++ .../abstractEvents/DhApiAfterDhInitEvent.java | 19 +++++++++++++++++ .../abstractEvents/DhApiAfterRenderEvent.java | 19 +++++++++++++++++ .../DhApiBeforeDhInitEvent.java | 19 +++++++++++++++++ .../DhApiBeforeRenderEvent.java | 19 +++++++++++++++++ .../DhApiChunkModifiedEvent.java | 19 +++++++++++++++++ .../abstractEvents/DhApiLevelLoadEvent.java | 19 +++++++++++++++++ .../abstractEvents/DhApiLevelUnloadEvent.java | 19 +++++++++++++++++ .../interfaces/IDhApiCancelableEvent.java | 19 +++++++++++++++++ .../events/interfaces/IDhApiEvent.java | 19 +++++++++++++++++ .../events/interfaces/IDhApiOneTimeEvent.java | 19 +++++++++++++++++ .../interfaces/IDhServerMessageReceived.java | 19 +++++++++++++++++ .../DhApiCancelableEventParam.java | 19 +++++++++++++++++ .../DhApiEventParam.java | 19 +++++++++++++++++ .../DhApiRenderParam.java | 19 +++++++++++++++++ .../DhApiWorldGeneratorOverrideRegister.java | 19 +++++++++++++++++ .../api/objects/DhApiResult.java | 19 +++++++++++++++++ .../api/objects/config/DhApiConfigValue.java | 19 +++++++++++++++++ .../api/objects/data/DhApiRaycastResult.java | 19 +++++++++++++++++ .../objects/data/DhApiTerrainDataPoint.java | 19 +++++++++++++++++ .../OverridePriorityListContainer.java | 19 +++++++++++++++++ .../interfaces/config/IConfigEntry.java | 19 +++++++++++++++++ .../coreapi/interfaces/config/IConverter.java | 19 +++++++++++++++++ .../IDependencyInjector.java | 19 +++++++++++++++++ .../IOverrideInjector.java | 19 +++++++++++++++++ .../coreapi/util/BitShiftUtil.java | 19 +++++++++++++++++ .../coreapi/util/MathUtil.java | 19 +++++++++++++++++ .../util/converters/DefaultConverter.java | 19 +++++++++++++++++ .../RenderModeEnabledConverter.java | 19 +++++++++++++++++ ...stractDhApiCancelableOneTimeTestEvent.java | 19 +++++++++++++++++ ...AbstractDhApiRemoveAfterFireTestEvent.java | 19 +++++++++++++++++ .../AbstractDhApiTestEvent.java | 19 +++++++++++++++++ .../DhCancelableOneTimeTestEventHandler.java | 19 +++++++++++++++++ ...hCancelableOneTimeTestEventHandlerAlt.java | 19 +++++++++++++++++ .../DhRemoveAfterFireTestEventHandler.java | 19 +++++++++++++++++ .../events/objects/DhTestEventHandler.java | 19 +++++++++++++++++ .../events/objects/DhTestEventHandlerAlt.java | 19 +++++++++++++++++ .../test/java/tests/EventInjectorTest.java | 19 +++++++++++++++++ .../distanthorizons/core/Initializer.java | 19 +++++++++++++++++ .../external/methods/config/DhApiConfig.java | 19 +++++++++++++++++ .../methods/data/DhApiTerrainDataRepo.java | 19 +++++++++++++++++ .../core/api/internal/SharedApi.java | 19 +++++++++++++++++ .../core/config/AppliedConfigState.java | 19 +++++++++++++++++ .../core/config/ConfigBase.java | 19 +++++++++++++++++ .../config/ConfigEntryWithPresetOptions.java | 19 +++++++++++++++++ .../core/config/NumberUtil.java | 19 +++++++++++++++++ .../QuickRenderToggleConfigEventHandler.java | 19 +++++++++++++++++ .../RenderCacheConfigEventHandler.java | 19 +++++++++++++++++ .../ResetConfigEventHandler.java | 19 +++++++++++++++++ .../UnsafeValuesConfigListener.java | 19 +++++++++++++++++ .../WorldCurvatureConfigEventHandler.java | 19 +++++++++++++++++ .../AbstractPresetConfigEventHandler.java | 19 +++++++++++++++++ ...RenderQualityPresetConfigEventHandler.java | 19 +++++++++++++++++ .../ThreadPresetConfigEventHandler.java | 19 +++++++++++++++++ .../core/config/file/ConfigFileHandling.java | 19 +++++++++++++++++ .../config/file/ConfigTypeConverters.java | 19 +++++++++++++++++ .../core/config/gui/AbstractScreen.java | 19 +++++++++++++++++ .../core/config/gui/ConfigScreen.java | 19 +++++++++++++++++ .../core/config/gui/EmbeddedFrameUtil.java | 19 +++++++++++++++++ .../config/gui/JavaScreenHandlerScreen.java | 19 +++++++++++++++++ .../core/config/gui/OpenGLConfigScreen.java | 19 +++++++++++++++++ .../listeners/ConfigChangeListener.java | 19 +++++++++++++++++ .../config/listeners/IConfigListener.java | 19 +++++++++++++++++ .../core/config/types/AbstractConfigType.java | 19 +++++++++++++++++ .../core/config/types/ConfigCategory.java | 19 +++++++++++++++++ .../core/config/types/ConfigEntry.java | 19 +++++++++++++++++ .../core/config/types/ConfigLinkedEntry.java | 19 +++++++++++++++++ .../core/config/types/ConfigUIButton.java | 19 +++++++++++++++++ .../core/config/types/ConfigUIComment.java | 19 +++++++++++++++++ .../types/enums/EConfigEntryAppearance.java | 19 +++++++++++++++++ .../types/enums/EConfigEntryPerformance.java | 19 +++++++++++++++++ .../fullData/FullDataDownSampler.java | 19 +++++++++++++++++ .../fullData/FullDataPointIdMap.java | 19 +++++++++++++++++ .../accessor/ChunkSizedFullDataAccessor.java | 19 +++++++++++++++++ .../accessor/FullDataArrayAccessor.java | 19 +++++++++++++++++ .../fullData/accessor/IFullDataAccessor.java | 19 +++++++++++++++++ .../SingleColumnFullDataAccessor.java | 19 +++++++++++++++++ .../loader/AbstractFullDataSourceLoader.java | 19 +++++++++++++++++ .../loader/CompleteFullDataSourceLoader.java | 19 +++++++++++++++++ ...hDetailIncompleteFullDataSourceLoader.java | 19 +++++++++++++++++ ...wDetailIncompleteFullDataSourceLoader.java | 19 +++++++++++++++++ .../sources/CompleteFullDataSource.java | 19 +++++++++++++++++ .../HighDetailIncompleteFullDataSource.java | 19 +++++++++++++++++ .../LowDetailIncompleteFullDataSource.java | 19 +++++++++++++++++ .../sources/interfaces/IFullDataSource.java | 19 +++++++++++++++++ .../interfaces/IIncompleteFullDataSource.java | 19 +++++++++++++++++ .../interfaces/IStreamableFullDataSource.java | 19 +++++++++++++++++ .../render/ColumnRenderLoader.java | 19 +++++++++++++++++ .../render/ColumnRenderSource.java | 19 +++++++++++++++++ .../bufferBuilding/ColumnRenderBuffer.java | 19 +++++++++++++++++ .../ColumnRenderBufferBuilder.java | 19 +++++++++++++++++ .../render/columnViews/ColumnArrayView.java | 19 +++++++++++++++++ .../render/columnViews/ColumnQuadView.java | 19 +++++++++++++++++ .../render/columnViews/IColumnDataView.java | 19 +++++++++++++++++ .../transformers/ChunkToLodBuilder.java | 19 +++++++++++++++++ .../transformers/DataRenderTransformer.java | 19 +++++++++++++++++ .../FullDataToRenderDataTransformer.java | 19 +++++++++++++++++ .../transformers/LodDataBuilder.java | 19 +++++++++++++++++ .../worldGeneration/EWorldGenThreadMode.java | 19 +++++++++++++++++ .../fullDatafile/FullDataFileHandler.java | 19 +++++++++++++++++ .../file/fullDatafile/FullDataMetaFile.java | 19 +++++++++++++++++ .../GeneratedFullDataFileHandler.java | 19 +++++++++++++++++ .../fullDatafile/IFullDataSourceProvider.java | 19 +++++++++++++++++ .../RemoteFullDataFileHandler.java | 19 +++++++++++++++++ .../AbstractMetaDataContainerFile.java | 19 +++++++++++++++++ .../core/file/metaData/BaseMetaData.java | 19 +++++++++++++++++ .../renderfile/ILodRenderSourceProvider.java | 19 +++++++++++++++++ .../file/renderfile/RenderMetaDataFile.java | 19 +++++++++++++++++ .../renderfile/RenderSourceFileHandler.java | 19 +++++++++++++++++ .../file/structure/AbstractSaveStructure.java | 19 +++++++++++++++++ .../structure/ClientOnlySaveStructure.java | 19 +++++++++++++++++ .../file/structure/LocalSaveStructure.java | 19 +++++++++++++++++ .../SubDimensionLevelMatcher.java | 19 +++++++++++++++++ .../core/generation/DhLightingEngine.java | 19 +++++++++++++++++ .../generation/IWorldGenerationQueue.java | 19 +++++++++++++++++ .../core/generation/WorldGenerationQueue.java | 19 +++++++++++++++++ .../tasks/IWorldGenTaskTracker.java | 19 +++++++++++++++++ .../tasks/InProgressWorldGenTaskGroup.java | 19 +++++++++++++++++ .../core/generation/tasks/WorldGenResult.java | 19 +++++++++++++++++ .../core/generation/tasks/WorldGenTask.java | 19 +++++++++++++++++ .../generation/tasks/WorldGenTaskGroup.java | 19 +++++++++++++++++ .../core/jar/DarkModeDetector.java | 21 ++++++++++++++++++- .../core/jar/JarDependencySetup.java | 19 +++++++++++++++++ .../distanthorizons/core/jar/JarMain.java | 19 +++++++++++++++++ .../distanthorizons/core/jar/JarUtils.java | 19 +++++++++++++++++ .../distanthorizons/core/jar/ModGitInfo.java | 19 +++++++++++++++++ .../distanthorizons/core/jar/Platform.java | 19 +++++++++++++++++ .../core/jar/gui/BaseJFrame.java | 19 +++++++++++++++++ .../distanthorizons/core/jar/gui/JSwitch.java | 19 +++++++++++++++++ .../core/jar/gui/JSwitchBox.java | 19 +++++++++++++++++ .../core/jar/gui/cusomJObject/JBox.java | 19 +++++++++++++++++ .../core/jar/installer/GitlabGetter.java | 19 +++++++++++++++++ .../core/jar/installer/MarkdownFormatter.java | 19 +++++++++++++++++ .../core/jar/installer/ModrinthGetter.java | 19 +++++++++++++++++ .../core/jar/installer/WebDownloader.java | 19 +++++++++++++++++ .../distanthorizons/core/jar/tui/BaseTUI.java | 19 +++++++++++++++++ .../core/jar/updater/SelfUpdater.java | 19 +++++++++++++++++ .../wrapperInterfaces/config/LangWrapper.java | 19 +++++++++++++++++ .../core/level/ClientLevelModule.java | 19 +++++++++++++++++ .../core/level/DhClientLevel.java | 19 +++++++++++++++++ .../core/level/DhClientServerLevel.java | 19 +++++++++++++++++ .../distanthorizons/core/level/DhLevel.java | 19 +++++++++++++++++ .../core/level/DhServerLevel.java | 19 +++++++++++++++++ .../core/level/IDhClientLevel.java | 19 +++++++++++++++++ .../distanthorizons/core/level/IDhLevel.java | 19 +++++++++++++++++ .../core/level/IDhServerLevel.java | 19 +++++++++++++++++ .../core/level/IDhWorldGenLevel.java | 19 +++++++++++++++++ .../core/level/IKeyedClientLevelManager.java | 19 +++++++++++++++++ .../core/level/IServerKeyedClientLevel.java | 19 +++++++++++++++++ .../core/level/ServerLevelModule.java | 19 +++++++++++++++++ .../core/level/WorldGenModule.java | 19 +++++++++++++++++ .../core/logging/DhLoggerBuilder.java | 19 +++++++++++++++++ .../core/logging/f3/F3Screen.java | 19 +++++++++++++++++ .../core/network/NetworkClient.java | 19 +++++++++++++++++ .../core/network/NetworkEventSource.java | 19 +++++++++++++++++ .../core/network/NetworkServer.java | 19 +++++++++++++++++ .../core/network/messages/AckMessage.java | 19 +++++++++++++++++ .../core/network/messages/CloseMessage.java | 19 +++++++++++++++++ .../network/messages/CloseReasonMessage.java | 19 +++++++++++++++++ .../core/network/messages/HelloMessage.java | 19 +++++++++++++++++ .../network/messages/PlayerUUIDMessage.java | 19 +++++++++++++++++ .../messages/RemotePlayerConfigMessage.java | 19 +++++++++++++++++ .../messages/RequestChunksMessage.java | 19 +++++++++++++++++ .../core/network/objects/RemotePlayer.java | 19 +++++++++++++++++ .../network/protocol/EMessageHandlerSide.java | 19 +++++++++++++++++ .../network/protocol/INetworkMessage.java | 19 +++++++++++++++++ .../core/network/protocol/INetworkObject.java | 19 +++++++++++++++++ .../core/network/protocol/MessageDecoder.java | 19 +++++++++++++++++ .../core/network/protocol/MessageEncoder.java | 19 +++++++++++++++++ .../core/network/protocol/MessageHandler.java | 19 +++++++++++++++++ .../network/protocol/MessageRegistry.java | 19 +++++++++++++++++ .../protocol/NetworkChannelInitializer.java | 19 +++++++++++++++++ .../protocol/NetworkExceptionHandler.java | 19 +++++++++++++++++ .../NetworkOutboundExceptionRouter.java | 19 +++++++++++++++++ .../core/pos/DhBlockPos2D.java | 19 +++++++++++++++++ .../distanthorizons/core/pos/DhLodPos.java | 19 +++++++++++++++++ .../distanthorizons/core/pos/DhLodUnit.java | 19 +++++++++++++++++ .../core/pos/DhSectionPos.java | 19 +++++++++++++++++ .../core/render/DhApiRenderProxy.java | 19 +++++++++++++++++ .../core/render/LodQuadTree.java | 19 +++++++++++++++++ .../core/render/LodRenderSection.java | 19 +++++++++++++++++ .../core/render/RenderBufferHandler.java | 19 +++++++++++++++++ .../core/render/glObject/buffer/GLBuffer.java | 19 +++++++++++++++++ .../glObject/buffer/QuadElementBuffer.java | 19 +++++++++++++++++ .../core/render/renderer/DebugRenderer.java | 19 +++++++++++++++++ .../render/renderer/IDebugRenderable.java | 19 +++++++++++++++++ .../shaders/AbstractShaderRenderer.java | 19 +++++++++++++++++ .../render/renderer/shaders/DarkShader.java | 19 +++++++++++++++++ .../render/renderer/shaders/FogShader.java | 19 +++++++++++++++++ .../render/renderer/shaders/SSAORenderer.java | 19 +++++++++++++++++ .../core/util/AnnotationUtil.java | 19 +++++++++++++++++ .../core/util/AtomicsUtil.java | 19 +++++++++++++++++ .../core/util/FileScanUtil.java | 19 +++++++++++++++++ .../distanthorizons/core/util/FileUtil.java | 19 +++++++++++++++++ .../core/util/FullDataPointUtil.java | 19 +++++++++++++++++ .../distanthorizons/core/util/ThreadUtil.java | 19 +++++++++++++++++ .../core/util/objects/EventLoop.java | 19 +++++++++++++++++ .../core/util/objects/EventTimer.java | 19 +++++++++++++++++ .../core/util/objects/Pair.java | 19 +++++++++++++++++ .../RateLimitedThreadPoolExecutor.java | 19 +++++++++++++++++ .../core/util/objects/Reference.java | 19 +++++++++++++++++ .../core/util/objects/SortedArraySet.java | 19 +++++++++++++++++ .../UncheckedInterruptedException.java | 19 +++++++++++++++++ .../dataStreams/DhDataInputStream.java | 19 +++++++++++++++++ .../dataStreams/DhDataOutputStream.java | 19 +++++++++++++++++ .../core/util/objects/quadTree/QuadNode.java | 19 +++++++++++++++++ .../core/util/objects/quadTree/QuadTree.java | 19 +++++++++++++++++ .../iterators/QuadNodeChildIndexIterator.java | 19 +++++++++++++++++ .../QuadNodeDirectChildIterator.java | 19 +++++++++++++++++ .../QuadNodeDirectChildPosIterator.java | 19 +++++++++++++++++ .../iterators/QuadTreeNodeIterator.java | 19 +++++++++++++++++ .../core/world/AbstractDhWorld.java | 19 +++++++++++++++++ .../core/world/DhApiWorldProxy.java | 19 +++++++++++++++++ .../core/world/DhClientServerWorld.java | 19 +++++++++++++++++ .../core/world/DhClientWorld.java | 19 +++++++++++++++++ .../core/world/DhServerWorld.java | 19 +++++++++++++++++ .../core/world/EWorldEnvironment.java | 19 +++++++++++++++++ .../core/world/IDhClientWorld.java | 19 +++++++++++++++++ .../core/world/IDhServerWorld.java | 19 +++++++++++++++++ .../distanthorizons/core/world/IDhWorld.java | 19 +++++++++++++++++ .../block/IBlockStateWrapper.java | 19 +++++++++++++++++ .../wrapperInterfaces/config/IConfigGui.java | 19 +++++++++++++++++ .../config/ILangWrapper.java | 19 +++++++++++++++++ .../minecraft/IMinecraftSharedWrapper.java | 19 +++++++++++++++++ .../misc/IServerPlayerWrapper.java | 19 +++++++++++++++++ .../modAccessor/AbstractOptifineAccessor.java | 19 +++++++++++++++++ .../modAccessor/IBCLibAccessor.java | 19 +++++++++++++++++ .../world/IClientLevelWrapper.java | 19 +++++++++++++++++ .../world/IServerLevelWrapper.java | 19 +++++++++++++++++ .../interfaces/IOverrideTest.java | 19 +++++++++++++++++ .../objects/OverrideTestAssembly.java | 19 +++++++++++++++++ .../objects/OverrideTestCore.java | 19 +++++++++++++++++ .../objects/OverrideTestPrimary.java | 19 +++++++++++++++++ .../interfaces/ISingletonTestOne.java | 19 +++++++++++++++++ .../interfaces/ISingletonTestTwo.java | 19 +++++++++++++++++ .../objects/ConcreteSingletonTestBoth.java | 19 +++++++++++++++++ .../objects/ConcreteSingletonTestOne.java | 19 +++++++++++++++++ .../objects/ConcreteSingletonTestTwo.java | 19 +++++++++++++++++ .../objects/LevelWrapperTest.java | 19 +++++++++++++++++ .../objects/TestWorldGenerator.java | 19 +++++++++++++++++ .../objects/WorldGeneratorTestAssembly.java | 19 +++++++++++++++++ .../objects/WorldGeneratorTestCore.java | 19 +++++++++++++++++ .../objects/WorldGeneratorTestPrimary.java | 19 +++++++++++++++++ .../objects/WorldGeneratorTestSecondary.java | 19 +++++++++++++++++ .../java/tests/DependencyInjectorTest.java | 19 +++++++++++++++++ 261 files changed, 4960 insertions(+), 1 deletion(-) 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/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/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/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/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/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/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/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/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/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/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/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/core/src/main/java/com/seibel/distanthorizons/core/Initializer.java b/core/src/main/java/com/seibel/distanthorizons/core/Initializer.java index 54befa44a..254db658e 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/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/data/DhApiTerrainDataRepo.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/data/DhApiTerrainDataRepo.java index 1968658ee..dadecd63d 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; 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..8300f7f00 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,3 +1,22 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2023 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You 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; 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/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 7e6ceaca7..446b52740 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..e0cd426bc 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; 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..33b3dfcfe 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; 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 faf82939b..5f6fb61b5 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.pos.DhChunkPos; 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..2cae7d488 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; 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 1b41b38b4..a863710d5 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 d7d044dda..38f32c24e 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 3d122233e..6ac6de517 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 ac2d0cbc8..b518316f8 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 98af3e610..6e2845800 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..b83769d4e 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; 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 c26d942c5..d0c95adbd 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,3 +1,22 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2023 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You 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; 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 d9b7e3b7a..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; 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/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 1931fb0cb..69ab63690 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 index 99d1c2120..92febfdd1 100644 --- 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 @@ -1,3 +1,22 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2023 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You 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.config.Config; 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 d3c27410c..ded0da39a 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,3 +1,22 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2023 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You 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; 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/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 ee8d0c2f7..62c34ddb4 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,3 +1,22 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2023 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You 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; 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..2158b28e5 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,3 +1,22 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2023 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You 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.*; 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 4122962cd..f30617fce 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; 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..dd06577b6 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,3 +1,22 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2023 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You 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/fullDatafile/RemoteFullDataFileHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/RemoteFullDataFileHandler.java index 54b22366a..73277cd0e 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.file.structure.AbstractSaveStructure; 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 6fb46e322..31343402b 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.*; 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..9e44ac7e7 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; 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 b404edfbb..446e2afda 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,3 +1,22 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2023 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You 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; 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..0941c6283 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,3 +1,22 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2023 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You 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; 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/SubDimensionLevelMatcher.java b/core/src/main/java/com/seibel/distanthorizons/core/file/subDimMatching/SubDimensionLevelMatcher.java index a5e45ed90..767a2ebf5 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; 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 da988e4d5..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,3 +1,22 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2023 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You 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; 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 c9553b312..d30653121 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..92fd0ebf2 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; 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..89345f11e 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; 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..5337107ce 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; 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 6c8cf45c3..ac38b49d9 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; 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..355f76373 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; 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 08fd32fd8..392693047 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 36a950644..84ab0fb4a 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.dataObjects.fullData.accessor.ChunkSizedFullDataAccessor; 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 f7d71c392..85c836d36 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 688e7fe29..5320db0e7 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.file.fullDatafile.IFullDataSourceProvider; 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/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/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 599fc771c..d0f1d28c7 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 3c10d619d..42c14927b 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.seibel.distanthorizons.core.logging.DhLoggerBuilder; 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 971dce9ce..a9034a071 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/messages/AckMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/AckMessage.java index 8ca09f2c8..573c3809e 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/AckMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/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; import com.seibel.distanthorizons.core.network.protocol.INetworkMessage; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/CloseMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/CloseMessage.java index 4ced87800..d9dcb269a 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/CloseMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/CloseMessage.java @@ -1,3 +1,22 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2023 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You 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; import com.seibel.distanthorizons.core.network.protocol.INetworkMessage; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/CloseReasonMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/CloseReasonMessage.java index b36b0ce5f..5e2e6bc19 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/CloseReasonMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/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; import com.seibel.distanthorizons.core.network.protocol.INetworkMessage; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/HelloMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/HelloMessage.java index 62bd27a98..cc7bcdc9f 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/HelloMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/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; import com.seibel.distanthorizons.core.network.protocol.INetworkMessage; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/PlayerUUIDMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/PlayerUUIDMessage.java index 4186f4470..759671d5e 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/PlayerUUIDMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/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; import com.seibel.distanthorizons.core.network.protocol.INetworkMessage; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/RemotePlayerConfigMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/RemotePlayerConfigMessage.java index e219c6937..2460d8d48 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/RemotePlayerConfigMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/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; import com.seibel.distanthorizons.core.network.protocol.INetworkObject; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/RequestChunksMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/RequestChunksMessage.java index 9f3745f2c..f35f22359 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/messages/RequestChunksMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/messages/RequestChunksMessage.java @@ -1,3 +1,22 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2023 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You 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; import com.seibel.distanthorizons.core.network.protocol.INetworkMessage; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/objects/RemotePlayer.java b/core/src/main/java/com/seibel/distanthorizons/core/network/objects/RemotePlayer.java index ed719168a..ca0909ed6 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/objects/RemotePlayer.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/objects/RemotePlayer.java @@ -1,3 +1,22 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2023 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You 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.objects; import com.seibel.distanthorizons.core.network.protocol.INetworkObject; diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/EMessageHandlerSide.java b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/EMessageHandlerSide.java index f3076577c..732aa0b74 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/EMessageHandlerSide.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/EMessageHandlerSide.java @@ -1,3 +1,22 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2023 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You 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; /** diff --git a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/INetworkMessage.java b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/INetworkMessage.java index d66c81ec1..c3dc6390b 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/INetworkMessage.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/INetworkMessage.java @@ -1,3 +1,22 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2023 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You 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; /** For now this is only used for constraining listeners */ 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 d76a79e11..180700c44 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 41c832fec..84628d6c6 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 5b08cd6bd..72faa358f 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 d525b8003..183f302f3 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 c9d2499e0..270d8cb68 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 6be986456..9038f60c7 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 a52d7b699..468c10dc6 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/NetworkOutboundExceptionRouter.java b/core/src/main/java/com/seibel/distanthorizons/core/network/protocol/NetworkOutboundExceptionRouter.java index 138e12706..e07e462f7 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/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/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 2351fea8b..380c22aa2 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/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 2778e0286..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; 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/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/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/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/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 3ec34ca26..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; 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 bcddd4e1a..c10efa6a3 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,3 +1,22 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2023 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You 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/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..f9e725c64 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; 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 index fced83bda..0f62ac1ba 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/FileScanUtil.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/FileScanUtil.java @@ -1,3 +1,22 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2023 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You 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.file.fullDatafile.IFullDataSourceProvider; 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/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/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/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/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/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 0e284681f..99f04e5a2 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 144c3c0ae..58c5d73fa 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.google.common.collect.BiMap; 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/block/IBlockStateWrapper.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/block/IBlockStateWrapper.java index 768168188..becf4cf33 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/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/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/misc/IServerPlayerWrapper.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/misc/IServerPlayerWrapper.java index c2e996533..c56f04216 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/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/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/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/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; From a3a41c44a92d846bc04eeb7589f9dc7dab9df7e0 Mon Sep 17 00:00:00 2001 From: coolGi Date: Sat, 2 Sep 2023 20:10:56 +0930 Subject: [PATCH 24/49] Fixed crash ran on version not on Modrinth --- .../core/jar/installer/ModrinthGetter.java | 9 ++++++++- .../distanthorizons/core/jar/updater/SelfUpdater.java | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) 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 92fd0ebf2..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 @@ -122,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/updater/SelfUpdater.java b/core/src/main/java/com/seibel/distanthorizons/core/jar/updater/SelfUpdater.java index 89345f11e..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 @@ -57,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 { @@ -71,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))) From d71ab1138b2dbbc2992199bcad5c29e800301951 Mon Sep 17 00:00:00 2001 From: coolGi Date: Sat, 2 Sep 2023 20:59:31 +0930 Subject: [PATCH 25/49] Fixed deep dark not blackening lods --- .../java/com/seibel/distanthorizons/core/util/RenderUtil.java | 2 +- .../wrapperInterfaces/minecraft/IMinecraftRenderWrapper.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 4b1e34c9c..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 @@ -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/wrapperInterfaces/minecraft/IMinecraftRenderWrapper.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/minecraft/IMinecraftRenderWrapper.java index 47b2ecced..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 @@ -49,7 +49,7 @@ public interface IMinecraftRenderWrapper extends IBindable DhBlockPos getCameraBlockPosition(); - boolean playerHasBlindnessEffect(); + boolean playerHasBlindingEffect(); Vec3d getCameraExactPosition(); From 6976cb9bb0ddb8a9344d057969f693f975555ff5 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 2 Sep 2023 07:32:54 -0500 Subject: [PATCH 26/49] Remove useless file lock from AbstractMetaDataContainerFile --- .../AbstractMetaDataContainerFile.java | 172 ++++++++---------- 1 file changed, 80 insertions(+), 92 deletions(-) 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 31343402b..b86ac480f 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 @@ -94,7 +94,6 @@ public abstract class AbstractMetaDataContainerFile /** Should be used instead of the position inside {@link AbstractMetaDataContainerFile#baseMetaData} */ public final DhSectionPos pos; - public final ReentrantLock writeLock = new ReentrantLock(); public File file; @@ -223,106 +222,95 @@ public abstract class AbstractMetaDataContainerFile - try + File tempFile; + if (USE_ATOMIC_MOVE_REPLACE) { - // done to try preventing a rare issue where multiple threads would write/delete the same file at the same time - this.writeLock.lock(); + tempFile = new File(this.file.getPath() + ".tmp"); + //tempFile.deleteOnExit(); + } + else + { + tempFile = this.file; + } + + try (FileChannel fileChannel = FileChannel.open(tempFile.toPath(), StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING)) + { + fileChannel.position(METADATA_SIZE_IN_BYTES); + + // the order of these streams is important, otherwise the checksum won't be calculated + CheckedOutputStream checkedOut = new CheckedOutputStream(Channels.newOutputStream(fileChannel), new Adler32()); + // normally a DhStream should be the topmost stream to prevent closing the stream accidentally, but since this stream will be closed immediately after writing anyway, it won't be an issue + DhDataOutputStream compressedOut = new DhDataOutputStream(checkedOut); + + // write the contained data + dataWriterFunc.writeBufferToFile(compressedOut); + compressedOut.flush(); + this.baseMetaData.checksum = (int) checkedOut.getChecksum().getValue(); - File tempFile; + // Write metadata + fileChannel.position(0); + ByteBuffer buffer = ByteBuffer.allocate(METADATA_SIZE_IN_BYTES); + buffer.putInt(METADATA_IDENTITY_BYTES); + buffer.putInt(this.pos.sectionX); + buffer.putInt(Integer.MIN_VALUE); // Unused - y pos + buffer.putInt(this.pos.sectionZ); + buffer.putInt(this.baseMetaData.checksum); + buffer.put(this.pos.sectionDetailLevel); + buffer.put(this.baseMetaData.dataLevel); + buffer.put(this.baseMetaData.binaryDataFormatVersion); + buffer.put(this.baseMetaData.worldGenStep != null ? this.baseMetaData.worldGenStep.value : EDhApiWorldGenerationStep.EMPTY.value); // TODO this null check shouldn't be necessary + buffer.putLong(this.baseMetaData.dataTypeId); + buffer.putLong(this.baseMetaData.dataVersion.get()); // for types that doesn't need data versioning, this will be Long.MAX_VALUE + LodUtil.assertTrue(buffer.remaining() == METADATA_RESERVED_SIZE); + buffer.flip(); + fileChannel.write(buffer); + + + fileChannel.close(); + //LOGGER.info("Saved file: "+this.file.getName()); + if (USE_ATOMIC_MOVE_REPLACE) { - tempFile = new File(this.file.getPath() + ".tmp"); - //tempFile.deleteOnExit(); - } - else - { - tempFile = this.file; - } - - try (FileChannel fileChannel = FileChannel.open(tempFile.toPath(), StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING)) - { - fileChannel.position(METADATA_SIZE_IN_BYTES); - - // the order of these streams is important, otherwise the checksum won't be calculated - CheckedOutputStream checkedOut = new CheckedOutputStream(Channels.newOutputStream(fileChannel), new Adler32()); - // normally a DhStream should be the topmost stream to prevent closing the stream accidentally, but since this stream will be closed immediately after writing anyway, it won't be an issue - DhDataOutputStream compressedOut = new DhDataOutputStream(checkedOut); - - // write the contained data - dataWriterFunc.writeBufferToFile(compressedOut); - compressedOut.flush(); - this.baseMetaData.checksum = (int) checkedOut.getChecksum().getValue(); - - - // Write metadata - fileChannel.position(0); - ByteBuffer buffer = ByteBuffer.allocate(METADATA_SIZE_IN_BYTES); - buffer.putInt(METADATA_IDENTITY_BYTES); - buffer.putInt(this.pos.sectionX); - buffer.putInt(Integer.MIN_VALUE); // Unused - y pos - buffer.putInt(this.pos.sectionZ); - buffer.putInt(this.baseMetaData.checksum); - buffer.put(this.pos.sectionDetailLevel); - buffer.put(this.baseMetaData.dataLevel); - buffer.put(this.baseMetaData.binaryDataFormatVersion); - buffer.put(this.baseMetaData.worldGenStep != null ? this.baseMetaData.worldGenStep.value : EDhApiWorldGenerationStep.EMPTY.value); // TODO this null check shouldn't be necessary - buffer.putLong(this.baseMetaData.dataTypeId); - buffer.putLong(this.baseMetaData.dataVersion.get()); // for types that doesn't need data versioning, this will be Long.MAX_VALUE - LodUtil.assertTrue(buffer.remaining() == METADATA_RESERVED_SIZE); - buffer.flip(); - fileChannel.write(buffer); - - - fileChannel.close(); - //LOGGER.info("Saved file: "+this.file.getName()); - - if (USE_ATOMIC_MOVE_REPLACE) - { - // Atomic move / replace the actual file - Files.move(tempFile.toPath(), this.file.toPath(), StandardCopyOption.REPLACE_EXISTING); // TODO couldn't StandardCopyOption. also work here? - //LOGGER.info("replaced file: "+this.file.toPath()); - } - } - catch (NoSuchFileException e) - { - // can be thrown by the "Files.move" method if the system tries writing to an unloaded level - } - 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()); - } - finally - { - String tempDeleteErrorMessage = null; - try - { - // Delete temp file if it exists (this generally means there was an issue saving) - if (USE_ATOMIC_MOVE_REPLACE && tempFile.exists()) - { - boolean fileRemoved = tempFile.delete(); - if (!fileRemoved) - { - tempDeleteErrorMessage = "Unable to remove Temporary file at: " + tempFile.getPath(); - } - } - } - catch (SecurityException exception) - { - tempDeleteErrorMessage = "Security error: [" + exception.getMessage() + "] when attempting to remove Temporary file at: " + tempFile.getPath(); - } - - if (tempDeleteErrorMessage != null) - { - LOGGER.error(tempDeleteErrorMessage); - } - this.DebugThreadCheck = false; + // Atomic move / replace the actual file + Files.move(tempFile.toPath(), this.file.toPath(), StandardCopyOption.REPLACE_EXISTING); // TODO couldn't StandardCopyOption. also work here? + //LOGGER.info("replaced file: "+this.file.toPath()); } } + catch (NoSuchFileException e) + { + // can be thrown by the "Files.move" method if the system tries writing to an unloaded level + } + 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()); + } finally { - this.writeLock.unlock(); + String tempDeleteErrorMessage = null; + try + { + // Delete temp file if it exists (this generally means there was an issue saving) + if (USE_ATOMIC_MOVE_REPLACE && tempFile.exists()) + { + boolean fileRemoved = tempFile.delete(); + if (!fileRemoved) + { + tempDeleteErrorMessage = "Unable to remove Temporary file at: " + tempFile.getPath(); + } + } + } + catch (SecurityException exception) + { + tempDeleteErrorMessage = "Security error: [" + exception.getMessage() + "] when attempting to remove Temporary file at: " + tempFile.getPath(); + } + + if (tempDeleteErrorMessage != null) + { + LOGGER.error(tempDeleteErrorMessage); + } + this.DebugThreadCheck = false; } } From a60f91ad002d25a9bdbc75743fdc1f8677d7c904 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 2 Sep 2023 11:53:12 -0500 Subject: [PATCH 27/49] refactor FileScanUtil --- .../fullDatafile/FullDataFileHandler.java | 2 +- .../renderfile/RenderSourceFileHandler.java | 2 +- .../core/util/FileScanUtil.java | 60 +++++++++---------- 3 files changed, 30 insertions(+), 34 deletions(-) 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 62c34ddb4..6793f9e0e 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 @@ -83,7 +83,7 @@ public class FullDataFileHandler implements IFullDataSourceProvider { LOGGER.warn("Unable to create full data folder, file saving may fail."); } - FileScanUtil.scanFiles(saveStructure, level.getLevelWrapper(), this, null); + FileScanUtil.scanFullDataFiles(saveStructure, level.getLevelWrapper(), this); } // constructor helpers // 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 0941c6283..3e135be3c 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 @@ -101,7 +101,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider this.threadPoolMsg = new F3Screen.NestedMessage(this::f3Log); - FileScanUtil.scanFiles(saveStructure, level.getLevelWrapper(), null, this); + FileScanUtil.scanRenderFiles(saveStructure, level.getLevelWrapper(), this); } /** Returns what should be displayed in Minecraft's F3 debug menu */ 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 index 0f62ac1ba..430897d5f 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/FileScanUtil.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/FileScanUtil.java @@ -35,7 +35,7 @@ import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; -// Static util class?? +/** Used to pull in the initial files used by both {@link IFullDataSourceProvider} and {@link ILodRenderSourceProvider}s. */ public class FileScanUtil { private static final Logger LOGGER = DhLoggerBuilder.getLogger(); @@ -43,41 +43,37 @@ public class FileScanUtil 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) + + + public static void scanFullDataFiles(AbstractSaveStructure saveStructure, ILevelWrapper levelWrapper, IFullDataSourceProvider dataSourceProvider) { - if (dataSourceProvider != null) + try (Stream pathStream = Files.walk(saveStructure.getFullDataFolder(levelWrapper).toPath(), MAX_SCAN_DEPTH)) { - 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); - } + 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); } - - if (renderSourceProvider != null) + catch (Exception e) { - 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); - } + LOGGER.error("Failed to scan and collect full data files for " + levelWrapper + " in " + saveStructure, e); + } + } + + 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(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); } } From dc1ce86cc392b25c42fe7e9cd6c385afea63f5b6 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 2 Sep 2023 20:17:08 -0500 Subject: [PATCH 28/49] Remove commented out code in FullDataToRenderDataTransformer --- .../FullDataToRenderDataTransformer.java | 249 ------------------ 1 file changed, 249 deletions(-) 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 ded0da39a..6d53e09ba 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 @@ -378,253 +378,4 @@ public class FullDataToRenderDataTransformer } - -// /** 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); -// } } From 3d62ca361db1a88bbe0aa59ff0c599c3e72536a2 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 2 Sep 2023 20:17:56 -0500 Subject: [PATCH 29/49] Refactor RenderSourceFileHandler and DataRenderTransformer --- .../methods/data/DhApiTerrainDataRepo.java | 2 +- .../fullData/FullDataDownSampler.java | 4 +- .../transformers/DataRenderTransformer.java | 10 +- .../fullDatafile/FullDataFileHandler.java | 4 +- .../GeneratedFullDataFileHandler.java | 5 +- .../fullDatafile/IFullDataSourceProvider.java | 5 +- .../renderfile/ILodRenderSourceProvider.java | 2 +- .../file/renderfile/RenderMetaDataFile.java | 59 +- .../renderfile/RenderSourceFileHandler.java | 547 ++++++++---------- .../SubDimensionLevelMatcher.java | 2 +- .../core/level/ClientLevelModule.java | 19 +- .../core/level/DhClientLevel.java | 5 +- .../core/level/DhClientServerLevel.java | 2 +- .../core/level/DhServerLevel.java | 2 +- .../core/util/FileScanUtil.java | 4 +- 15 files changed, 317 insertions(+), 355 deletions(-) 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 dadecd63d..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 @@ -212,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/dataObjects/fullData/FullDataDownSampler.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/FullDataDownSampler.java index 33b3dfcfe..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 @@ -54,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) @@ -78,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/transformers/DataRenderTransformer.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/DataRenderTransformer.java index 92febfdd1..7506491e9 100644 --- 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 @@ -49,17 +49,17 @@ public class DataRenderTransformer // transformers // //==============// - public static CompletableFuture transformDataSourceAsync(IFullDataSource fullDataSource, IDhClientLevel level) + public static CompletableFuture transformFullDataToRenderSourceAsync(IFullDataSource fullDataSource, IDhClientLevel level) { - return CompletableFuture.supplyAsync(() -> transform(fullDataSource, level), transformerThreadPool); + return CompletableFuture.supplyAsync(() -> transformFullDataToRenderSource(fullDataSource, level), transformerThreadPool); } - public static CompletableFuture transformDataSourceAsync(CompletableFuture fullDataSourceFuture, IDhClientLevel level) + public static CompletableFuture transformFullDataToRenderSourceAsync(CompletableFuture fullDataSourceFuture, IDhClientLevel level) { - return fullDataSourceFuture.thenApplyAsync((fullDataSource) -> transform(fullDataSource, level), transformerThreadPool); + return fullDataSourceFuture.thenApplyAsync((fullDataSource) -> transformFullDataToRenderSource(fullDataSource, level), transformerThreadPool); } - private static ColumnRenderSource transform(IFullDataSource fullDataSource, IDhClientLevel level) + private static ColumnRenderSource transformFullDataToRenderSource(IFullDataSource fullDataSource, IDhClientLevel level) { if (fullDataSource == null) { 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 6793f9e0e..cbd4a4c80 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 @@ -369,7 +369,7 @@ public class FullDataFileHandler implements IFullDataSourceProvider * This call is concurrent. I.e. it supports being called by multiple threads at the same time. */ @Override - public CompletableFuture read(DhSectionPos pos) + public CompletableFuture readAsync(DhSectionPos pos) { this.topDetailLevel.updateAndGet(oldDetailLevel -> Math.max(oldDetailLevel, pos.sectionDetailLevel)); FullDataMetaFile metaFile = this.getLoadOrMakeFile(pos, true); @@ -398,7 +398,7 @@ public class FullDataFileHandler implements IFullDataSourceProvider /** 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); 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 f30617fce..b75608115 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 @@ -30,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; @@ -63,9 +62,9 @@ public class GeneratedFullDataFileHandler extends FullDataFileHandler //======// @Override - public CompletableFuture read(DhSectionPos pos) + public CompletableFuture readAsync(DhSectionPos pos) { - return super.read(pos); + return super.readAsync(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 dd06577b6..a295557dd 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 @@ -21,7 +21,6 @@ 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; @@ -36,8 +35,8 @@ public interface IFullDataSourceProvider extends AutoCloseable { void addScannedFile(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); 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 9e44ac7e7..bbb3dc2dc 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 @@ -36,7 +36,7 @@ import java.util.concurrent.CompletableFuture; public interface ILodRenderSourceProvider extends AutoCloseable { CompletableFuture readAsync(DhSectionPos pos); - void addScannedFile(Collection detectedFiles); + void addScannedFiles(Collection detectedFiles); void writeChunkDataToFile(DhSectionPos sectionPos, ChunkSizedFullDataAccessor chunkData); CompletableFuture flushAndSaveAsync(); 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 446e2afda..f92f64149 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 @@ -19,6 +19,7 @@ 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.file.metaData.AbstractMetaDataContainerFile; import com.seibel.distanthorizons.core.file.metaData.BaseMetaData; @@ -33,7 +34,6 @@ 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.dataStreams.DhDataInputStream; import org.apache.logging.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -228,11 +228,13 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements private CompletableFuture getCachedDataSourceAsync(boolean doTriggerUpdate) { // use the existing future - CompletableFuture renderSourceLoadFuture = renderSourceLoadFutureRef.get(); + 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) @@ -248,7 +250,7 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements CompletableFuture cas = AtomicsUtil.compareAndExchange(renderSourceLoadFutureRef, null, newFuture); if (cas == null) { - this.fileHandler.onReadRenderSourceLoadedFromCacheAsync(this, cachedRenderDataSource) + this.fileHandler.onRenderSourceLoadedFromCacheAsync(this, cachedRenderDataSource) // wait for the handler to finish before returning the renderSource .handle((voidObj, ex) -> { if (ex != null) @@ -280,30 +282,37 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements // load or create the render source 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)) + // create a new Meta file and render source + + + // create the new 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, level.getMinY()); + + this.baseMetaData = new BaseMetaData( + newColumnRenderSource.getSectionPos(), -1, newColumnRenderSource.getDataDetail(), + newColumnRenderSource.worldGenStep, RenderSourceFileHandler.RENDER_SOURCE_TYPE_ID, + newColumnRenderSource.getRenderDataFormatVersion(), Long.MAX_VALUE); + + this.fileHandler.onRenderFileLoadedAsync(newColumnRenderSource, 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); + { + LOGGER.error("Uncaught error on RenderMetaDataFile ColumnRenderSource creation for file: ["+this.file+"]. Error: ", ex); + } + + // set the render source to null to prevent instances where a corrupt or incomplete render source was returned + renderSource = null; } + + this.renderSourceLoadFutureRef.set(null); + + this.cachedRenderDataSource = new SoftReference<>(renderSource); + future.complete(renderSource); }); } else @@ -329,7 +338,7 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements return renderSource; }, fileReaderThreads) // TODO: Check for file version and only update if needed. - .thenCompose((renderSource) -> this.fileHandler.onRenderFileLoaded(renderSource, this)) + .thenCompose((renderSource) -> this.fileHandler.onRenderFileLoadedAsync(renderSource, this)) .whenComplete((renderSource, ex) -> { if (ex != null) @@ -351,12 +360,6 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements return future; } - 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); 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 3e135be3c..6d8683ac0 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 @@ -24,7 +24,6 @@ import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.ChunkSizedF 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; @@ -39,8 +38,7 @@ 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; @@ -65,8 +63,9 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider 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 File saveDir; @@ -74,12 +73,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider AtomicInteger topDetailLevel = 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<>(); @@ -104,57 +98,14 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider FileScanUtil.scanRenderFiles(saveStructure, level.getLevelWrapper(), this); } - /** 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() + ")"); - - int totalFutures = taskTracker.size(); - EnumMap tasksOutstanding = new EnumMap<>(TaskType.class); - EnumMap tasksCompleted = new EnumMap<>(TaskType.class); - for (TaskType type : TaskType.values()) - { - tasksOutstanding.put(type, 0); - tasksCompleted.put(type, 0); - } - - synchronized (taskTracker) - { - for (Map.Entry, TaskType> entry : taskTracker.entrySet()) - { - if (entry.getKey().isDone()) - { - tasksCompleted.put(entry.getValue(), tasksCompleted.get(entry.getValue()) + 1); - } - else - { - tasksOutstanding.put(entry.getValue(), tasksOutstanding.get(entry.getValue()) + 1); - } - } - } - int totalOutstanding = tasksOutstanding.values().stream().mapToInt(Integer::intValue).sum(); - lines.add(" Futures: " + totalFutures + " (outstanding: " + totalOutstanding + ")"); - for (TaskType type : TaskType.values()) - { - lines.add(" " + type + ": " + tasksOutstanding.get(type) + " / " + (tasksOutstanding.get(type) + tasksCompleted.get(type))); - } - return lines.toArray(new String[0]); - } - - - //===============// - // 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. + * and that the given files are not used before this method is called.

+ * + * Used by {@link FileScanUtil#scanRenderFiles(AbstractSaveStructure, ILevelWrapper, ILodRenderSourceProvider)} */ @Override - public void addScannedFile(Collection detectedFiles) + public void addScannedFiles(Collection detectedFiles) { if (USE_LAZY_LOADING) { @@ -165,7 +116,6 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider this.immediateAddScannedFile(detectedFiles); } } - private void lazyAddScannedFile(Collection detectedFiles) { for (File file : detectedFiles) @@ -180,11 +130,11 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider try { - DhSectionPos pos = this.decodePositionByFile(file); + DhSectionPos pos = this.decodePositionFromFileName(file); if (pos != null) { - this.unloadedFiles.put(pos, file); - this.topDetailLevel.updateAndGet(v -> Math.max(v, pos.sectionDetailLevel)); + this.unloadedFileBySectionPos.put(pos, file); + this.topDetailLevel.updateAndGet(currentTopDetailLevel -> Math.max(currentTopDetailLevel, pos.sectionDetailLevel)); } } catch (Exception e) @@ -194,7 +144,6 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider } } } - private void immediateAddScannedFile(Collection newRenderFiles) { HashMultimap filesByPos = HashMultimap.create(); @@ -272,86 +221,19 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider fileToUse = metaFiles.iterator().next(); } // Add this file to the list of files. - this.filesBySectionPos.put(pos, fileToUse); + this.metaFileBySectionPos.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. */ + + //===============// + // file handling // + //===============// + + /** This call is thread safe and can be called concurrently from multiple threads. */ @Override public CompletableFuture readAsync(DhSectionPos pos) { @@ -361,20 +243,20 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider return CompletableFuture.completedFuture(null); } - RenderMetaDataFile metaFile = this.getLoadOrMakeFile(pos, true); - // On error, (when it returns null,) return an empty render source + + RenderMetaDataFile metaFile = this.getLoadOrMakeFile(pos); if (metaFile == null) { return CompletableFuture.completedFuture(ColumnRenderSource.createEmptyRenderSource(pos)); } - CompletableFuture future = metaFile.loadOrGetCachedDataSourceAsync(this.fileHandlerThreadPool, this.level).handle( - (renderSource, exception) -> + CompletableFuture getDataSourceFuture = metaFile.loadOrGetCachedDataSourceAsync(this.fileHandlerThreadPool, this.level) + .handle((renderSource, exception) -> { if (exception != null) { - LOGGER.error("Uncaught error on " + pos + ":", exception); + LOGGER.error("Uncaught error in readAsync for pos: " + pos + ". Error:", exception); } return (renderSource != null) ? renderSource : ColumnRenderSource.createEmptyRenderSource(pos); @@ -382,18 +264,89 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider synchronized (this.taskTracker) { - this.taskTracker.put(future, TaskType.Read); + this.taskTracker.put(getDataSourceFuture, ETaskType.READ); } - return future; + return getDataSourceFuture; } - - public CompletableFuture onCreateRenderFileAsync(RenderMetaDataFile file) + /** @return null if there was an issue */ + private RenderMetaDataFile getLoadOrMakeFile(DhSectionPos pos) { - final int verticalSize = Config.Client.Advanced.Graphics.Quality.verticalQuality.get() - .calculateMaxVerticalData((byte) (file.pos.sectionDetailLevel - ColumnRenderSource.SECTION_SIZE_OFFSET)); + RenderMetaDataFile metaFile = this.metaFileBySectionPos.get(pos); + if (metaFile != null) + { + // return the loaded file + return metaFile; + } - return CompletableFuture.completedFuture( - new ColumnRenderSource(file.pos, verticalSize, this.level.getMinY())); + + // 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, fileToLoad); + this.topDetailLevel.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, pos); + + this.topDetailLevel.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; + } } @@ -403,107 +356,133 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider //=============// /** - * This call is concurrent. I.e. it supports multiple threads calling this method at the same time.
+ * 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.fastWriteDataToSourceRecursively(chunkDataView, DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL); - this.fullDataSourceProvider.write(sectionPos, chunkDataView); + this.writeChunkDataToFileRecursively(chunkDataView, DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL); + this.fullDataSourceProvider.writeChunkDataToFile(sectionPos, chunkDataView); } - - private void fastWriteDataToSourceRecursively(ChunkSizedFullDataAccessor chunk, byte sectionDetailLevel) + private void writeChunkDataToFileRecursively(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++) + DhLodPos minSectionPos = boundingPos.convertToDetailLevel(sectionDetailLevel); + + int width = (sectionDetailLevel > boundingPos.detailLevel) ? 1 : boundingPos.getWidthAtDetail(sectionDetailLevel); + for (int xOffset = 0; xOffset < width; xOffset++) { - for (int oz = 0; oz < width; oz++) + for (int zOffset = 0; zOffset < width; zOffset++) { - 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. + 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.updateChunkIfSourceExists(chunk, this.level); } } } - if (sectionDetailLevel < topDetailLevel.get()) + + if (sectionDetailLevel < this.topDetailLevel.get()) { - fastWriteDataToSourceRecursively(chunk, (byte) (sectionDetailLevel + 1)); + this.writeChunkDataToFileRecursively(chunk, (byte) (sectionDetailLevel + 1)); } } - /** This call is concurrent. I.e. it supports multiple threads calling this method at the same time. */ + /** 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.filesBySectionPos.values()) + for (RenderMetaDataFile metaFile : this.metaFileBySectionPos.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())); + .whenComplete((voidObj, exception) -> LOGGER.info("Finished saving " + RenderSourceFileHandler.class.getSimpleName())); } - //================// - // cache updating // - //================// + //==========================// + // meta file cache updating // + //==========================// - private CompletableFuture updateCacheAsync(ColumnRenderSource renderSource, RenderMetaDataFile file) + public CompletableFuture onRenderFileLoadedAsync(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()); + CompletableFuture future = this.updateMetaFileCacheAsync(renderSource, file).handle((voidObj, ex) -> renderSource); + + synchronized (this.taskTracker) + { + this.taskTracker.put(future, ETaskType.ON_LOADED); + } + return future; + } + + public CompletableFuture onRenderSourceLoadedFromCacheAsync(RenderMetaDataFile file, ColumnRenderSource renderSource) { return this.updateMetaFileCacheAsync(renderSource, file); } + + private CompletableFuture updateMetaFileCacheAsync(ColumnRenderSource renderSource, RenderMetaDataFile renderMetaFile) + { + 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(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); + FullDataMetaFile dataFile = this.fullDataSourceProvider.getFileIfExist(renderMetaFile.pos); + if (!ALWAYS_INVALIDATE_CACHE && dataFile != null && dataFile.baseMetaData != null && dataFile.baseMetaData.checksum == renderMetaFile.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 " + renderMetaFile.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) + + 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(renderMetaFile.pos); + if (renderSourceMetaFile != null) + { + renderDataVersionRef.value = renderSourceMetaFile.baseMetaData.checksum; + } + + return fullDataSource; + }).exceptionally((ex) -> + { + LOGGER.error("Exception when getting data for updateCache()", ex); + return null; + }); + + synchronized (this.taskTracker) { - taskTracker.put(fullDataSourceFuture, TaskType.UpdateReadData); + this.taskTracker.put(fullDataSourceFuture, ETaskType.UPDATE_READ_DATA); } + + // convert the full data source into a render source - //LOGGER.info("Recreating cache for {}", data.getSectionPos()); - CompletableFuture transformFuture = DataRenderTransformer.transformDataSourceAsync(fullDataSourceFuture, this.level) + CompletableFuture transformFuture = DataRenderTransformer.transformFullDataToRenderSourceAsync(fullDataSourceFuture, this.level) .handle((newRenderSource, ex) -> { if (ex == null) { try { - file.baseMetaData.dataVersion.set(targetChecksumVersion.value); - this.writeRenderSourceToFile(renderSource, file, newRenderSource); + renderMetaFile.baseMetaData.dataVersion.set(renderDataVersionRef.value); + this.mergeRenderSourcesAndWriteToFile(renderSource, renderMetaFile, newRenderSource); } catch (Throwable e) { @@ -514,42 +493,24 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider { 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(); + + debugBox.close(); return null; }); - synchronized (taskTracker) + + synchronized (this.taskTracker) { - taskTracker.put(transformFuture, TaskType.Update); + this.taskTracker.put(transformFuture, ETaskType.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) + + private void mergeRenderSourcesAndWriteToFile(ColumnRenderSource currentRenderSource, RenderMetaDataFile metaFile, ColumnRenderSource newRenderSource) { if (currentRenderSource == null || newRenderSource == null) { @@ -558,85 +519,72 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider 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); + metaFile.baseMetaData.dataLevel = currentRenderSource.getDataDetail(); + metaFile.baseMetaData.dataTypeId = RENDER_SOURCE_TYPE_ID; + metaFile.baseMetaData.binaryDataFormatVersion = currentRenderSource.getRenderDataFormatVersion(); + metaFile.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; - } - */ + + + //=========// + // 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.metaFileBySectionPos.size() + " / " + (this.unloadedFileBySectionPos.size() + this.metaFileBySectionPos.size())); + lines.add(" Thread pool tasks: " + this.fileHandlerThreadPool.getQueue().size() + " (completed: " + this.fileHandlerThreadPool.getCompletedTaskCount() + ")"); + + 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 (this.taskTracker) + { + for (Map.Entry, ETaskType> entry : this.taskTracker.entrySet()) + { + if (entry.getKey().isDone()) + { + tasksCompleted.put(entry.getValue(), tasksCompleted.get(entry.getValue()) + 1); + } + else + { + tasksOutstanding.put(entry.getValue(), tasksOutstanding.get(entry.getValue()) + 1); + } + } + } + int totalOutstanding = tasksOutstanding.values().stream().mapToInt(Integer::intValue).sum(); + lines.add(" Futures: " + totalFutures + " (outstanding: " + totalOutstanding + ")"); + for (ETaskType type : ETaskType.values()) + { + lines.add(" " + type + ": " + tasksOutstanding.get(type) + " / " + (tasksOutstanding.get(type) + tasksCompleted.get(type))); + } + return lines.toArray(new String[0]); + } + + //=====================// // 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 @@ -653,7 +601,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider } // clear the cached files - this.filesBySectionPos.clear(); + this.metaFileBySectionPos.clear(); } @@ -665,7 +613,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider public File computeRenderFilePath(DhSectionPos pos) { return new File(this.saveDir, pos.serialize() + RENDER_FILE_POSTFIX); } @Nullable - public DhSectionPos decodePositionByFile(File file) + public DhSectionPos decodePositionFromFileName(File file) { String fileName = file.getName(); if (!fileName.endsWith(RENDER_FILE_POSTFIX)) return null; @@ -673,4 +621,21 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider return DhSectionPos.deserialize(fileName); } + + + //================// + // helper classes // + //================// + + /** + * READ
+ * UPDATE_READ_DATA
+ * UPDATE
+ * ON_LOADED
+ */ + private enum ETaskType + { + READ, UPDATE_READ_DATA, UPDATE, ON_LOADED, + } + } 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 767a2ebf5..710f0e1b4 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 @@ -242,7 +242,7 @@ public class SubDimensionLevelMatcher implements AutoCloseable } IDhLevel tempLevel = 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/level/ClientLevelModule.java b/core/src/main/java/com/seibel/distanthorizons/core/level/ClientLevelModule.java index 5337107ce..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 @@ -50,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); } @@ -88,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? @@ -120,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"); @@ -173,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); } } @@ -240,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 ac38b49d9..b48735765 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 @@ -102,10 +102,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 355f76373..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 @@ -176,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/DhServerLevel.java b/core/src/main/java/com/seibel/distanthorizons/core/level/DhServerLevel.java index 84ab0fb4a..2bee0ac1c 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 @@ -59,7 +59,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/util/FileScanUtil.java b/core/src/main/java/com/seibel/distanthorizons/core/util/FileScanUtil.java index 430897d5f..8db0eb414 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/FileScanUtil.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/FileScanUtil.java @@ -21,13 +21,11 @@ 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; @@ -69,7 +67,7 @@ public class FileScanUtil 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); + renderSourceProvider.addScannedFiles(files); } catch (Exception e) { From 2e49bf299e8e8cb04e467055331c31a21f9c63aa Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 2 Sep 2023 20:41:58 -0500 Subject: [PATCH 30/49] Merge DataRenderTransformer and FullDataToRenderDataTransformer --- .../core/api/internal/SharedApi.java | 6 +- .../render/ColumnRenderLoader.java | 16 - .../render/ColumnRenderSource.java | 114 ++++++- .../transformers/DataRenderTransformer.java | 134 --------- .../FullDataToRenderDataTransformer.java | 279 +++++++++--------- .../renderfile/RenderSourceFileHandler.java | 4 +- 6 files changed, 259 insertions(+), 294 deletions(-) delete mode 100644 core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/DataRenderTransformer.java 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 8300f7f00..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 @@ -22,7 +22,7 @@ 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.*; @@ -52,7 +52,7 @@ public class SharedApi if (currentWorld != null) { // static thread pool setup - DataRenderTransformer.setupExecutorService(); + FullDataToRenderDataTransformer.setupExecutorService(); FullDataFileHandler.setupExecutorService(); ColumnRenderBufferBuilder.setupExecutorService(); WorldGenerationQueue.setupWorldGenThreadPool(); @@ -61,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/dataObjects/render/ColumnRenderLoader.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/ColumnRenderLoader.java index b83769d4e..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 @@ -75,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 d0c95adbd..41c4acd79 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 @@ -21,8 +21,10 @@ 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; @@ -305,7 +307,7 @@ public class ColumnRenderSource { try { - if (FullDataToRenderDataTransformer.writeFullDataChunkToColumnData(this, level, chunkData)) + if (writeFullDataChunkToColumnData(this, level, chunkData)) { this.localVersion.incrementAndGet(); return true; @@ -327,6 +329,116 @@ public class ColumnRenderSource } return false; } + /** + * @throws InterruptedException Can be caused by interrupting the thread upstream. + * Generally thrown if the method is running after the client leaves the current world. + * + * @return true if any data was changed, false otherwise + */ + public static boolean writeFullDataChunkToColumnData(ColumnRenderSource renderSource, IDhClientLevel level, ChunkSizedFullDataAccessor chunkDataView) throws InterruptedException, IllegalArgumentException + { + 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()) + { + 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"); + } + + + if (Thread.interrupted()) + { + throw new InterruptedException(ColumnRenderSource.class.getSimpleName() + " write interrupted."); + } + + + 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); + FullDataToRenderDataTransformer.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); + FullDataToRenderDataTransformer.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); + FullDataToRenderDataTransformer.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; + } 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 7506491e9..000000000 --- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/DataRenderTransformer.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * This file is part of the Distant Horizons mod - * licensed under the GNU LGPL v3 License. - * - * Copyright (C) 2020-2023 James Seibel - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You 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.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 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 (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 6d53e09ba..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 @@ -21,6 +21,7 @@ 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; @@ -31,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}, @@ -50,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 // //==============// @@ -79,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(); @@ -129,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(); @@ -175,137 +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. - * - * @return true if any data was changed, false otherwise + * 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); @@ -376,6 +304,81 @@ public class FullDataToRenderDataTransformer column.set(0, RenderDataPointUtil.createVoidDataPoint((byte) genMode)); } } - - + + // 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/file/renderfile/RenderSourceFileHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/file/renderfile/RenderSourceFileHandler.java index 6d8683ac0..bd8a536ad 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 @@ -22,6 +22,7 @@ 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.dataObjects.transformers.FullDataToRenderDataTransformer; import com.seibel.distanthorizons.core.file.fullDatafile.FullDataMetaFile; import com.seibel.distanthorizons.core.file.structure.AbstractSaveStructure; import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; @@ -29,7 +30,6 @@ 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; @@ -474,7 +474,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider // convert the full data source into a render source - CompletableFuture transformFuture = DataRenderTransformer.transformFullDataToRenderSourceAsync(fullDataSourceFuture, this.level) + CompletableFuture transformFuture = FullDataToRenderDataTransformer.transformFullDataToRenderSourceAsync(fullDataSourceFuture, this.level) .handle((newRenderSource, ex) -> { if (ex == null) From 89c6dc0333f21d906badb25998ab64e14139a424 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 2 Sep 2023 21:05:45 -0500 Subject: [PATCH 31/49] rename ColumnRenderSource fastWrite() -> updateWithChunkData() --- .../render/ColumnRenderSource.java | 112 ++++++++---------- .../file/renderfile/RenderMetaDataFile.java | 2 +- 2 files changed, 48 insertions(+), 66 deletions(-) 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 41c4acd79..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 @@ -298,46 +298,19 @@ public class ColumnRenderSource { this.verticalDataCount = newVerticalSize; this.renderDataContainer = new long[SECTION_SIZE * SECTION_SIZE * this.verticalDataCount]; - localVersion.incrementAndGet(); + this.localVersion.incrementAndGet(); } } - /** @return true if any data was changed, false otherwise */ - public boolean fastWrite(ChunkSizedFullDataAccessor chunkData, IDhClientLevel level) - { - try - { - if (writeFullDataChunkToColumnData(this, level, chunkData)) - { - this.localVersion.incrementAndGet(); - return true; - } - else - { - return false; - } - } - catch (InterruptedException e) - { - // expected if the transformer is shut down, the exception can be ignored - LOGGER.warn(ColumnRenderSource.class.getSimpleName() + " fast write interrupted."); - } - catch (Throwable e) - { - // shouldn't happen, but just in case - LOGGER.warn("Unable to complete fastWrite for RenderSource pos: [" + this.sectionPos + "] and chunk pos: [" + chunkData.pos + "].", e); - } - return false; - } - /** - * @throws InterruptedException Can be caused by interrupting the thread upstream. - * Generally thrown if the method is running after the client leaves the current world. - * - * @return true if any data was changed, false otherwise + /** + * Doesn't write anything to file. + * @return true if any data was changed, false otherwise */ - public static boolean writeFullDataChunkToColumnData(ColumnRenderSource renderSource, IDhClientLevel level, ChunkSizedFullDataAccessor chunkDataView) throws InterruptedException, IllegalArgumentException + public boolean updateWithChunkData(ChunkSizedFullDataAccessor chunkDataView, IDhClientLevel level) { - final DhSectionPos renderSourcePos = renderSource.getSectionPos(); + 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; @@ -346,26 +319,28 @@ public class ColumnRenderSource 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()); + final int sourceDataPointBlockWidth = BitShiftUtil.powerOfTwo(this.getDataDetail()); - boolean changed = false; + boolean dataChanged = false; - if (chunkDataView.detailLevel == renderSource.getDataDetail()) + if (chunkDataView.detailLevel == this.getDataDetail()) { - renderSource.markNotEmpty(); + this.markNotEmpty(); // confirm the render source contains this chunk if (blockOffsetX < 0 - || blockOffsetX + LodUtil.CHUNK_WIDTH > renderSource.getWidthInDataPoints() + || blockOffsetX + LodUtil.CHUNK_WIDTH > this.getWidthInDataPoints() || blockOffsetZ < 0 - || blockOffsetZ + LodUtil.CHUNK_WIDTH > renderSource.getWidthInDataPoints()) + || blockOffsetZ + LodUtil.CHUNK_WIDTH > this.getWidthInDataPoints()) { - throw new IllegalArgumentException("Data offset is out of bounds"); + LOGGER.warn(errorMessagePrefix+"Data offset is out of bounds."); + return false; } if (Thread.interrupted()) { - throw new InterruptedException(ColumnRenderSource.class.getSimpleName() + " write interrupted."); + LOGGER.warn(errorMessagePrefix+"write interrupted."); + return false; } @@ -373,29 +348,29 @@ public class ColumnRenderSource { for (int z = 0; z < LodUtil.CHUNK_WIDTH; z++) { - ColumnArrayView columnArrayView = renderSource.getVerticalDataPointView(blockOffsetX + x, blockOffsetZ + 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); - changed |= hash != columnArrayView.getDataHash(); + dataChanged |= hash != columnArrayView.getDataHash(); } } - renderSource.fillDebugFlag(blockOffsetX, blockOffsetZ, LodUtil.CHUNK_WIDTH, LodUtil.CHUNK_WIDTH, ColumnRenderSource.DebugSourceFlag.DIRECT); + this.fillDebugFlag(blockOffsetX, blockOffsetZ, LodUtil.CHUNK_WIDTH, LodUtil.CHUNK_WIDTH, ColumnRenderSource.DebugSourceFlag.DIRECT); } - else if (chunkDataView.detailLevel < renderSource.getDataDetail() && renderSource.getDataDetail() <= chunkDataView.getLodPos().detailLevel) + else if (chunkDataView.detailLevel < this.getDataDetail() && this.getDataDetail() <= chunkDataView.getLodPos().detailLevel) { - renderSource.markNotEmpty(); + this.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()); + 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(renderSource.getDataDetail()); + int columnsInChunk = chunkDataView.getLodPos().getWidthAtDetail(this.getDataDetail()); for (int ox = 0; ox < columnsInChunk; ox++) { @@ -403,41 +378,48 @@ public class ColumnRenderSource { int relSourceX = relStartX + ox; int relSourceZ = relStartZ + oz; - ColumnArrayView columnArrayView = renderSource.getVerticalDataPointView(relSourceX, relSourceZ); + 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); - changed |= hash != columnArrayView.getDataHash(); + dataChanged |= hash != columnArrayView.getDataHash(); } } - renderSource.fillDebugFlag(relStartX, relStartZ, columnsInChunk, columnsInChunk, ColumnRenderSource.DebugSourceFlag.DIRECT); + this.fillDebugFlag(relStartX, relStartZ, columnsInChunk, columnsInChunk, ColumnRenderSource.DebugSourceFlag.DIRECT); } - else if (chunkDataView.getLodPos().detailLevel < renderSource.getDataDetail()) + else if (chunkDataView.getLodPos().detailLevel < this.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()); + 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, renderSource.getWidthInDataPoints()); - int relStartZ = Math.floorMod(sourceStartingChangePos.z, renderSource.getWidthInDataPoints()); - ColumnArrayView columnArrayView = renderSource.getVerticalDataPointView(relStartX, relStartZ); + 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); - changed = hash != columnArrayView.getDataHash(); - renderSource.fillDebugFlag(relStartX, relStartZ, 1, 1, ColumnRenderSource.DebugSourceFlag.DIRECT); + dataChanged = hash != columnArrayView.getDataHash(); + this.fillDebugFlag(relStartX, relStartZ, 1, 1, ColumnRenderSource.DebugSourceFlag.DIRECT); } - return changed; + + + if (dataChanged) + { + this.localVersion.incrementAndGet(); + } + + return dataChanged; } 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 f92f64149..60eed59b2 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 @@ -166,7 +166,7 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements if (renderSourceLoadFuture == null) return; renderSourceLoadFuture.thenAccept((renderSource) -> { - boolean dataUpdated = renderSource.fastWrite(chunkDataView, level); + boolean dataUpdated = renderSource.updateWithChunkData(chunkDataView, level); //if (pos.sectionDetailLevel == DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL+5) { float offset = new Random(System.nanoTime() ^ Thread.currentThread().getId()).nextFloat() * 16f; From 800ffc5611d4cccdaa5f62d19a90bebc6d2c244a Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sun, 3 Sep 2023 16:55:52 -0500 Subject: [PATCH 32/49] Move RenderSourceFileHandler code into RenderMetaDataFile --- .../file/renderfile/RenderMetaDataFile.java | 558 +++++++++++------- .../renderfile/RenderSourceFileHandler.java | 133 +---- .../core/util/AtomicsUtil.java | 14 +- 3 files changed, 372 insertions(+), 333 deletions(-) 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 60eed59b2..764cd00d3 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 @@ -21,6 +21,10 @@ 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; @@ -34,6 +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.Reference; import com.seibel.distanthorizons.core.util.objects.dataStreams.DhDataInputStream; import org.apache.logging.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -63,37 +68,7 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements private final RenderSourceFileHandler fileHandler; 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 // @@ -135,6 +110,7 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements DebugRenderer.register(this); } + /** * NOTE: should only be used if there IS an existing file. * @@ -144,7 +120,6 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements { return new RenderMetaDataFile(fileHandler, path); } - private RenderMetaDataFile(RenderSourceFileHandler fileHandler, File path) throws IOException { super(path); @@ -156,19 +131,30 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements DebugRenderer.register(this); } - public void updateChunkIfSourceExists(ChunkSizedFullDataAccessor chunkDataView, IDhClientLevel level) + + + //=============// + // data update // + //=============// + + public void updateChunkIfSourceExistsAsync(ChunkSizedFullDataAccessor chunkDataView, IDhClientLevel level) { 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) -> { + + renderSourceLoadFuture.thenAccept((renderSource) -> + { boolean dataUpdated = renderSource.updateWithChunkData(chunkDataView, level); - //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 debugColor = dataUpdated ? Color.blue : Color.red; DebugRenderer.makeParticle( @@ -177,55 +163,318 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements 2.0, 16f ) ); - //} }); } - public CompletableFuture flushAndSaveAsync(ExecutorService renderCacheThread) + + + //======================// + // render source getter // + //======================// + + public CompletableFuture getOrLoadCachedDataSourceAsync(Executor fileReaderThreads, IDhLevel level) + { + CacheQueryResult cacheQueryResult = this.getOrStartCachedDataSourceAsync(); + if (cacheQueryResult.cacheQueryAlreadyInProcess) + { + // return the in-process future + return cacheQueryResult.future; + } + + + + CompletableFuture getSourceFuture = cacheQueryResult.future; + if (!this.doesFileExist) + { + // 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, level.getMinY()); + + this.baseMetaData = new BaseMetaData( + newColumnRenderSource.getSectionPos(), -1, newColumnRenderSource.getDataDetail(), + newColumnRenderSource.worldGenStep, RenderSourceFileHandler.RENDER_SOURCE_TYPE_ID, + newColumnRenderSource.getRenderDataFormatVersion(), Long.MAX_VALUE); + + this.fileHandler.onRenderFileLoadedAsync(newColumnRenderSource, this) // TODO just calls // metaFile.updateRenderCacheAsync() + // wait for the file handler to finish before returning the render source + .whenComplete((renderSource, ex) -> + { + this.cachedRenderDataSource = new SoftReference<>(renderSource); + + this.renderSourceLoadFutureRef.set(null); + getSourceFuture.complete(renderSource); + }); + } + else + { + CompletableFuture.supplyAsync(() -> + { + if (this.baseMetaData == null) + { + throw new IllegalStateException("Meta data not loaded!"); + } + + // Load the render source file. + ColumnRenderSource renderSource; + try (FileInputStream fileInputStream = this.getFileInputStream(); // throws IoException + DhDataInputStream compressedInputStream = new DhDataInputStream(fileInputStream)) + { + renderSource = ColumnRenderLoader.INSTANCE.loadRenderSource(this, compressedInputStream, level); + } + catch (IOException ex) + { + throw new CompletionException(ex); + } + + return renderSource; + }, fileReaderThreads) + // TODO: Check for file version and only update if needed. + .thenCompose((renderSource) -> this.fileHandler.onRenderFileLoadedAsync(renderSource, this)) // TODO just calls // metaFile.updateRenderCacheAsync() + .whenComplete((renderSource, ex) -> + { + if (ex != null) + { + if (!LodUtil.isInterruptOrReject(ex)) + { + 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 getSourceFuture; + } + // TODO why is this being used vs just // this.getCachedDataSourceAsync(true); ? + private CacheQueryResult getOrStartCachedDataSourceAsync() + { + CompletableFuture renderSourceLoadFuture = this.getCachedDataSourceAsync(true); + if (renderSourceLoadFuture != null) + { + // return the existing load future + return new CacheQueryResult(renderSourceLoadFuture, true); + } + else + { + // Create a new future if one doesn't already exist + CompletableFuture newFuture = new CompletableFuture<>(); + CompletableFuture oldFuture = AtomicsUtil.compareAndExchange(this.renderSourceLoadFutureRef, null, newFuture); + + CompletableFuture activeFuture = (oldFuture == null) ? newFuture : oldFuture; + // if a loading future is already active we don't need to trigger another load + boolean cacheQueryAlreadyInProcess = (oldFuture != null); + return new CacheQueryResult(activeFuture, cacheQueryAlreadyInProcess); + } + } + private FileInputStream getFileInputStream() throws IOException + { + FileInputStream inputStream = new FileInputStream(this.file); + int toSkip = METADATA_SIZE_IN_BYTES; + while (toSkip > 0) + { + long skipped = inputStream.skip(toSkip); + if (skipped == 0) + { + throw new IOException("Invalid file: Failed to skip metadata."); + } + toSkip -= skipped; + } + + if (toSkip != 0) + { + throw new IOException("File IO Error: Failed to skip metadata."); + } + else + { + return inputStream; + } + } + + + + //===============// + // cache handler // + //===============// + + public CompletableFuture updateRenderCacheAsync(ColumnRenderSource renderSource, IFullDataSourceProvider fullDataSourceProvider, IDhClientLevel clientLevel) + { + 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 = fullDataSourceProvider.getFileIfExist(this.pos); + if (!RenderSourceFileHandler.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(null); + } + + + + final Reference renderDataVersionRef = new Reference<>(Integer.MAX_VALUE); + + // get the full data source + CompletableFuture fullDataSourceFuture = + fullDataSourceProvider.readAsync(renderSource.getSectionPos()) + .thenApply((fullDataSource) -> + { + debugBox.box.color = Color.yellow.darker(); + + // get the metaFile's version + FullDataMetaFile renderSourceMetaFile = 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, clientLevel) + .handle((newRenderSource, ex) -> + { + if (ex == null) + { + try + { + renderSource.updateFromRenderSource(newRenderSource); + + // update the meta data + this.baseMetaData.dataVersion.set(renderDataVersionRef.value); + this.baseMetaData.dataLevel = renderSource.getDataDetail(); + this.baseMetaData.dataTypeId = RenderSourceFileHandler.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: ", e); + } + } + else if (!LodUtil.isInterruptOrReject(ex)) + { + LOGGER.error("Exception when updating render file using data source: ", ex); + } + + debugBox.close(); + return null; + }); + 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 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) + CompletableFuture getSourceFuture = this.getCachedDataSourceAsync(false); + if (getSourceFuture == 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). + + // 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 */ }); } - private CacheQueryResult getOrStartCachedDataSourceAsync() + + /** writes the given {@link ColumnRenderSource} to file */ + private void save(ColumnRenderSource renderSource) { - // use the existing future - CompletableFuture renderSourceLoadFuture = getCachedDataSourceAsync(true); - if (renderSourceLoadFuture == null) + if (renderSource.isEmpty()) { - // 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) + if (this.file.exists()) { - return new CacheQueryResult(newFuture, true); - } - else - { - return new CacheQueryResult(cas, false); + // attempt to remove the empty render source + if (!this.file.delete()) + { + LOGGER.warn("Failed to delete render file at " + this.file); + } } + + this.doesFileExist = false; } else { - return new CacheQueryResult(renderSourceLoadFuture, false); + //LOGGER.info("Saving updated render file v[{}] at sect {}", this.metaData.dataVersion.get(), this.pos); + try + { + super.writeData((dhDataOutputStream) -> renderSource.writeData(dhDataOutputStream)); + this.doesFileExist = true; + } + catch (IOException e) + { + LOGGER.error("Failed to save updated render file at {} for sect {}", this.file, this.pos, e); + } } } + + + //=======// + // 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 // + //================// + @Nullable - private CompletableFuture getCachedDataSourceAsync(boolean doTriggerUpdate) + private CompletableFuture getCachedDataSourceAsync(boolean triggerAndWaitForListener) { // use the existing future CompletableFuture renderSourceLoadFuture = this.renderSourceLoadFutureRef.get(); @@ -243,173 +492,56 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements } else { - if (!doTriggerUpdate) return CompletableFuture.completedFuture(cachedRenderDataSource); - - // 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) + if (!triggerAndWaitForListener) { - this.fileHandler.onRenderSourceLoadedFromCacheAsync(this, cachedRenderDataSource) + // immediately return the render source + return CompletableFuture.completedFuture(cachedRenderDataSource); + } + + // trigger the listener, wait for it 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) + { + return oldFuture; + } + else + { + this.fileHandler.onRenderSourceLoadedFromCacheAsync(this, cachedRenderDataSource) // TODO just calls // metaFile.updateRenderCacheAsync() // 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); - } + .handle((voidObj, ex) -> + { newFuture.complete(cachedRenderDataSource); - renderSourceLoadFutureRef.set(null); + this.renderSourceLoadFutureRef.set(null); + return null; }); return newFuture; } - else - { - return cas; - } } } - public CompletableFuture loadOrGetCachedDataSourceAsync(Executor fileReaderThreads, IDhLevel level) + + + //================// + // helper classes // + //================// + + /** TODO couldn't this just be made into an atomic future or something? */ + private static final class CacheQueryResult { - CacheQueryResult getCachedFuture = this.getOrStartCachedDataSourceAsync(); - if (!getCachedFuture.needsLoad) + public final CompletableFuture future; + public final boolean cacheQueryAlreadyInProcess; + + public CacheQueryResult(CompletableFuture future, boolean cacheQueryAlreadyInProcess) { - return getCachedFuture.future; + this.future = future; + this.cacheQueryAlreadyInProcess = cacheQueryAlreadyInProcess; } - CompletableFuture future = getCachedFuture.future; - // load or create the render source - if (!this.doesFileExist) - { - // create a new Meta file and render source - - - // create the new 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, level.getMinY()); - - this.baseMetaData = new BaseMetaData( - newColumnRenderSource.getSectionPos(), -1, newColumnRenderSource.getDataDetail(), - newColumnRenderSource.worldGenStep, RenderSourceFileHandler.RENDER_SOURCE_TYPE_ID, - newColumnRenderSource.getRenderDataFormatVersion(), Long.MAX_VALUE); - - this.fileHandler.onRenderFileLoadedAsync(newColumnRenderSource, this) - .whenComplete((renderSource, ex) -> - { - if (ex != null) - { - if (!LodUtil.isInterruptOrReject(ex)) - { - LOGGER.error("Uncaught error on RenderMetaDataFile ColumnRenderSource creation for file: ["+this.file+"]. Error: ", ex); - } - - // set the render source to null to prevent instances where a corrupt or incomplete render source was returned - renderSource = null; - } - - this.renderSourceLoadFutureRef.set(null); - - this.cachedRenderDataSource = new SoftReference<>(renderSource); - future.complete(renderSource); - }); - } - else - { - CompletableFuture.supplyAsync(() -> - { - if (this.baseMetaData == null) - { - throw new IllegalStateException("Meta data not loaded!"); - } - - // Load the file. - ColumnRenderSource renderSource; - try (FileInputStream fileInputStream = this.getFileInputStream(); - DhDataInputStream compressedStream = new DhDataInputStream(fileInputStream)) - { - renderSource = ColumnRenderLoader.INSTANCE.loadRenderSource(this, compressedStream, level); - } - catch (IOException ex) - { - throw new CompletionException(ex); - } - return renderSource; - }, fileReaderThreads) - // TODO: Check for file version and only update if needed. - .thenCompose((renderSource) -> this.fileHandler.onRenderFileLoadedAsync(renderSource, this)) - .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); - } - }); - } - return future; - } - - private FileInputStream getFileInputStream() throws IOException - { - FileInputStream fin = new FileInputStream(this.file); - int toSkip = METADATA_SIZE_IN_BYTES; - while (toSkip > 0) - { - long skipped = fin.skip(toSkip); - if (skipped == 0) - { - throw new IOException("Invalid file: Failed to skip metadata."); - } - toSkip -= skipped; - } - - if (toSkip != 0) - { - throw new IOException("File IO Error: Failed to skip metadata."); - } - else - { - return fin; - } - } - - public void save(ColumnRenderSource renderSource) - { - if (renderSource.isEmpty()) - { - if (this.file.exists()) - { - if (!this.file.delete()) - { - LOGGER.warn("Failed to delete render file at {}", this.file); - } - } - this.doesFileExist = false; - } - else - { - //LOGGER.info("Saving updated render file v[{}] at sect {}", this.metaData.dataVersion.get(), this.pos); - try - { - super.writeData((out) -> renderSource.writeData(out)); - this.doesFileExist = true; - } - catch (IOException e) - { - LOGGER.error("Failed to save updated render file at {} for sect {}", this.file, this.pos, e); - } - } } } 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 bd8a536ad..d44d22eda 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 @@ -21,9 +21,6 @@ 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.dataObjects.transformers.FullDataToRenderDataTransformer; -import com.seibel.distanthorizons.core.file.fullDatafile.FullDataMetaFile; import com.seibel.distanthorizons.core.file.structure.AbstractSaveStructure; import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; import com.seibel.distanthorizons.core.logging.f3.F3Screen; @@ -32,17 +29,13 @@ import com.seibel.distanthorizons.core.pos.DhSectionPos; import com.seibel.distanthorizons.core.dataObjects.render.ColumnRenderSource; 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.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.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.*; @@ -67,7 +60,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider /** 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); @@ -81,21 +74,21 @@ 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.scanRenderFiles(saveStructure, level.getLevelWrapper(), this); + FileScanUtil.scanRenderFiles(saveStructure, clientLevel.getLevelWrapper(), this); } /** @@ -251,7 +244,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider return CompletableFuture.completedFuture(ColumnRenderSource.createEmptyRenderSource(pos)); } - CompletableFuture getDataSourceFuture = metaFile.loadOrGetCachedDataSourceAsync(this.fileHandlerThreadPool, this.level) + CompletableFuture getDataSourceFuture = metaFile.getOrLoadCachedDataSourceAsync(this.fileHandlerThreadPool, this.clientLevel) .handle((renderSource, exception) -> { if (exception != null) @@ -380,7 +373,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider RenderMetaDataFile metaFile = this.metaFileBySectionPos.get(sectionPos); // bypass the getLoadOrMakeFile() since we only want cached files. if (metaFile != null) { - metaFile.updateChunkIfSourceExists(chunk, this.level); + metaFile.updateChunkIfSourceExistsAsync(chunk, this.clientLevel); } } } @@ -401,7 +394,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider ArrayList> futures = new ArrayList<>(); for (RenderMetaDataFile metaFile : this.metaFileBySectionPos.values()) { - futures.add(metaFile.flushAndSaveAsync(this.fileHandlerThreadPool)); + futures.add(metaFile.flushAndSaveAsync()); } return CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])) @@ -414,9 +407,10 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider // meta file cache updating // //==========================// - public CompletableFuture onRenderFileLoadedAsync(ColumnRenderSource renderSource, RenderMetaDataFile file) + @Deprecated + public CompletableFuture onRenderFileLoadedAsync(ColumnRenderSource renderSource, RenderMetaDataFile metaFile) { - CompletableFuture future = this.updateMetaFileCacheAsync(renderSource, file).handle((voidObj, ex) -> renderSource); + CompletableFuture future = metaFile.updateRenderCacheAsync(renderSource, this.fullDataSourceProvider, this.clientLevel).handle((voidObj, ex) -> renderSource); synchronized (this.taskTracker) { @@ -425,105 +419,8 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider return future; } - public CompletableFuture onRenderSourceLoadedFromCacheAsync(RenderMetaDataFile file, ColumnRenderSource renderSource) { return this.updateMetaFileCacheAsync(renderSource, file); } - - private CompletableFuture updateMetaFileCacheAsync(ColumnRenderSource renderSource, RenderMetaDataFile renderMetaFile) - { - 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(renderMetaFile.pos); - if (!ALWAYS_INVALIDATE_CACHE && dataFile != null && dataFile.baseMetaData != null && dataFile.baseMetaData.checksum == renderMetaFile.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 " + renderMetaFile.pos); - renderSource.localVersion.incrementAndGet(); - return CompletableFuture.completedFuture(null); - } - - - - 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(renderMetaFile.pos); - if (renderSourceMetaFile != null) - { - renderDataVersionRef.value = renderSourceMetaFile.baseMetaData.checksum; - } - - return fullDataSource; - }).exceptionally((ex) -> - { - LOGGER.error("Exception when getting data for updateCache()", ex); - return null; - }); - - synchronized (this.taskTracker) - { - this.taskTracker.put(fullDataSourceFuture, ETaskType.UPDATE_READ_DATA); - } - - - - // convert the full data source into a render source - CompletableFuture transformFuture = FullDataToRenderDataTransformer.transformFullDataToRenderSourceAsync(fullDataSourceFuture, this.level) - .handle((newRenderSource, ex) -> - { - if (ex == null) - { - try - { - renderMetaFile.baseMetaData.dataVersion.set(renderDataVersionRef.value); - this.mergeRenderSourcesAndWriteToFile(renderSource, renderMetaFile, 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); - } - - debugBox.close(); - return null; - }); - - synchronized (this.taskTracker) - { - this.taskTracker.put(transformFuture, ETaskType.UPDATE); - } - - - return transformFuture; - } - - - - - private void mergeRenderSourcesAndWriteToFile(ColumnRenderSource currentRenderSource, RenderMetaDataFile metaFile, ColumnRenderSource newRenderSource) - { - if (currentRenderSource == null || newRenderSource == null) - { - return; - } - - currentRenderSource.updateFromRenderSource(newRenderSource); - - metaFile.baseMetaData.dataLevel = currentRenderSource.getDataDetail(); - metaFile.baseMetaData.dataTypeId = RENDER_SOURCE_TYPE_ID; - metaFile.baseMetaData.binaryDataFormatVersion = currentRenderSource.getRenderDataFormatVersion(); - metaFile.save(currentRenderSource); - } + @Deprecated + public CompletableFuture onRenderSourceLoadedFromCacheAsync(RenderMetaDataFile metaFile, ColumnRenderSource renderSource) { return metaFile.updateRenderCacheAsync(renderSource, this.fullDataSourceProvider, this.clientLevel); } @@ -535,7 +432,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider private String[] f3Log() { ArrayList lines = new ArrayList<>(); - lines.add("Render Source File Handler [" + this.level.getClientLevelWrapper().getDimensionType().getDimensionName() + "]"); + 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() + ")"); 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 f9e725c64..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 @@ -55,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; + } } } From ed596955f732530784f087d56c1cd6c9dd386829 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sun, 3 Sep 2023 17:42:47 -0500 Subject: [PATCH 33/49] Remove CacheQueryResult from RenderMetaDataFile --- .../file/renderfile/RenderMetaDataFile.java | 66 ++++++------------- 1 file changed, 20 insertions(+), 46 deletions(-) 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 764cd00d3..a606e20c3 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 @@ -174,16 +174,27 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements public CompletableFuture getOrLoadCachedDataSourceAsync(Executor fileReaderThreads, IDhLevel level) { - CacheQueryResult cacheQueryResult = this.getOrStartCachedDataSourceAsync(); - if (cacheQueryResult.cacheQueryAlreadyInProcess) + CompletableFuture renderSourceLoadFuture = this.getCachedDataSourceAsync(true); + if (renderSourceLoadFuture != null) { // return the in-process future - return cacheQueryResult.future; + return renderSourceLoadFuture; + } + else + { + // there is no cached data, we'll have to load it + + renderSourceLoadFuture = new CompletableFuture<>(); + if (!this.renderSourceLoadFutureRef.compareAndSet(null, renderSourceLoadFuture)) + { + // two threads attempted to start this job at the same time, only use the first future + renderSourceLoadFuture = this.renderSourceLoadFutureRef.get(); + } } - CompletableFuture getSourceFuture = cacheQueryResult.future; + final CompletableFuture getSourceFuture = renderSourceLoadFuture; if (!this.doesFileExist) { // create a new Meta file and render source @@ -256,27 +267,6 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements return getSourceFuture; } - // TODO why is this being used vs just // this.getCachedDataSourceAsync(true); ? - private CacheQueryResult getOrStartCachedDataSourceAsync() - { - CompletableFuture renderSourceLoadFuture = this.getCachedDataSourceAsync(true); - if (renderSourceLoadFuture != null) - { - // return the existing load future - return new CacheQueryResult(renderSourceLoadFuture, true); - } - else - { - // Create a new future if one doesn't already exist - CompletableFuture newFuture = new CompletableFuture<>(); - CompletableFuture oldFuture = AtomicsUtil.compareAndExchange(this.renderSourceLoadFutureRef, null, newFuture); - - CompletableFuture activeFuture = (oldFuture == null) ? newFuture : oldFuture; - // if a loading future is already active we don't need to trigger another load - boolean cacheQueryAlreadyInProcess = (oldFuture != null); - return new CacheQueryResult(activeFuture, cacheQueryAlreadyInProcess); - } - } private FileInputStream getFileInputStream() throws IOException { FileInputStream inputStream = new FileInputStream(this.file); @@ -473,10 +463,11 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements // helper methods // //================// + /** @return returns null if {@link RenderMetaDataFile#renderSourceLoadFutureRef} is empty and no cached {@link ColumnRenderSource} exists. */ @Nullable private CompletableFuture getCachedDataSourceAsync(boolean triggerAndWaitForListener) { - // use the existing future + // check if another thread is already loading the data source CompletableFuture renderSourceLoadFuture = this.renderSourceLoadFutureRef.get(); if (renderSourceLoadFuture != null) { @@ -488,10 +479,13 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements 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 (!triggerAndWaitForListener) { // immediately return the render source @@ -524,24 +518,4 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements } } - - - //================// - // helper classes // - //================// - - /** TODO couldn't this just be made into an atomic future or something? */ - private static final class CacheQueryResult - { - public final CompletableFuture future; - public final boolean cacheQueryAlreadyInProcess; - - public CacheQueryResult(CompletableFuture future, boolean cacheQueryAlreadyInProcess) - { - this.future = future; - this.cacheQueryAlreadyInProcess = cacheQueryAlreadyInProcess; - } - - } - } From 33cb8c02e85b57e0ec6f1a6c9428111ffeb02e47 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sun, 3 Sep 2023 21:59:55 -0500 Subject: [PATCH 34/49] Move code from RenderSourceFileHandler to RenderMetaDataFile and refactor --- .../file/renderfile/RenderMetaDataFile.java | 90 +++++++++---------- .../renderfile/RenderSourceFileHandler.java | 34 ++----- 2 files changed, 48 insertions(+), 76 deletions(-) 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 a606e20c3..044edbf4e 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 @@ -56,6 +56,10 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements { private static final Logger LOGGER = DhLoggerBuilder.getLogger(); + 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.

* @@ -65,7 +69,8 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements 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; @@ -78,33 +83,29 @@ 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); @@ -113,21 +114,16 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements /** * 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); } @@ -137,7 +133,7 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements // data update // //=============// - public void updateChunkIfSourceExistsAsync(ChunkSizedFullDataAccessor chunkDataView, IDhClientLevel level) + 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); @@ -152,7 +148,7 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements renderSourceLoadFuture.thenAccept((renderSource) -> { - boolean dataUpdated = renderSource.updateWithChunkData(chunkDataView, level); + boolean dataUpdated = renderSource.updateWithChunkData(chunkDataView, clientLevel); // add a debug renderer float offset = new Random(System.nanoTime() ^ Thread.currentThread().getId()).nextFloat() * 16f; @@ -172,7 +168,7 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements // render source getter // //======================// - public CompletableFuture getOrLoadCachedDataSourceAsync(Executor fileReaderThreads, IDhLevel level) + public CompletableFuture getOrLoadCachedDataSourceAsync(Executor fileReaderThreads) { CompletableFuture renderSourceLoadFuture = this.getCachedDataSourceAsync(true); if (renderSourceLoadFuture != null) @@ -203,22 +199,20 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements // 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, level.getMinY()); + ColumnRenderSource newColumnRenderSource = new ColumnRenderSource(this.pos, verticalSize, this.clientLevel.getMinY()); this.baseMetaData = new BaseMetaData( newColumnRenderSource.getSectionPos(), -1, newColumnRenderSource.getDataDetail(), - newColumnRenderSource.worldGenStep, RenderSourceFileHandler.RENDER_SOURCE_TYPE_ID, + newColumnRenderSource.worldGenStep, RENDER_SOURCE_TYPE_ID, newColumnRenderSource.getRenderDataFormatVersion(), Long.MAX_VALUE); - this.fileHandler.onRenderFileLoadedAsync(newColumnRenderSource, this) // TODO just calls // metaFile.updateRenderCacheAsync() - // wait for the file handler to finish before returning the render source - .whenComplete((renderSource, ex) -> - { - this.cachedRenderDataSource = new SoftReference<>(renderSource); - - this.renderSourceLoadFutureRef.set(null); - getSourceFuture.complete(renderSource); - }); + this.updateRenderCacheAsync(newColumnRenderSource, this.fullDataSourceProvider).whenComplete((voidObj, ex) -> + { + this.cachedRenderDataSource = new SoftReference<>(newColumnRenderSource); + + this.renderSourceLoadFutureRef.set(null); + getSourceFuture.complete(newColumnRenderSource); + }); } else { @@ -234,7 +228,7 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements try (FileInputStream fileInputStream = this.getFileInputStream(); // throws IoException DhDataInputStream compressedInputStream = new DhDataInputStream(fileInputStream)) { - renderSource = ColumnRenderLoader.INSTANCE.loadRenderSource(this, compressedInputStream, level); + renderSource = ColumnRenderLoader.INSTANCE.loadRenderSource(this, compressedInputStream, this.clientLevel); } catch (IOException ex) { @@ -244,7 +238,9 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements return renderSource; }, fileReaderThreads) // TODO: Check for file version and only update if needed. - .thenCompose((renderSource) -> this.fileHandler.onRenderFileLoadedAsync(renderSource, this)) // TODO just calls // metaFile.updateRenderCacheAsync() + //.thenCompose((renderSource) -> this.fileHandler.onRenderFileLoadedAsync(renderSource, this)) // TODO just calls // metaFile.updateRenderCacheAsync() + //.whenComplete((renderSource, ex) -> + .thenCompose(renderSource -> this.updateRenderCacheAsync(renderSource, this.fullDataSourceProvider)) .whenComplete((renderSource, ex) -> { if (ex != null) @@ -297,18 +293,18 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements // cache handler // //===============// - public CompletableFuture updateRenderCacheAsync(ColumnRenderSource renderSource, IFullDataSourceProvider fullDataSourceProvider, IDhClientLevel clientLevel) + public CompletableFuture updateRenderCacheAsync(ColumnRenderSource renderSource, IFullDataSourceProvider fullDataSourceProvider) { 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 = fullDataSourceProvider.getFileIfExist(this.pos); - if (!RenderSourceFileHandler.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 + 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(null); + return CompletableFuture.completedFuture(renderSource); } @@ -339,7 +335,7 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements // convert the full data source into a render source - CompletableFuture transformFuture = FullDataToRenderDataTransformer.transformFullDataToRenderSourceAsync(fullDataSourceFuture, clientLevel) + CompletableFuture transformFuture = FullDataToRenderDataTransformer.transformFullDataToRenderSourceAsync(fullDataSourceFuture, this.clientLevel) .handle((newRenderSource, ex) -> { if (ex == null) @@ -351,7 +347,7 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements // update the meta data this.baseMetaData.dataVersion.set(renderDataVersionRef.value); this.baseMetaData.dataLevel = renderSource.getDataDetail(); - this.baseMetaData.dataTypeId = RenderSourceFileHandler.RENDER_SOURCE_TYPE_ID; + this.baseMetaData.dataTypeId = RENDER_SOURCE_TYPE_ID; this.baseMetaData.binaryDataFormatVersion = renderSource.getRenderDataFormatVersion(); // save to file @@ -368,7 +364,7 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements } debugBox.close(); - return null; + return renderSource; }); return transformFuture; } @@ -504,9 +500,9 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements } else { - this.fileHandler.onRenderSourceLoadedFromCacheAsync(this, cachedRenderDataSource) // TODO just calls // metaFile.updateRenderCacheAsync() + this.updateRenderCacheAsync(cachedRenderDataSource, this.fullDataSourceProvider) // wait for the handler to finish before returning the renderSource - .handle((voidObj, ex) -> + .handle((ignoredRenderSource, ex) -> { newFuture.complete(cachedRenderDataSource); this.renderSourceLoadFutureRef.set(null); 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 d44d22eda..f421e45cf 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 @@ -47,9 +47,6 @@ import static com.seibel.distanthorizons.core.util.FileScanUtil.RENDER_FILE_POST 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(); @@ -146,7 +143,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider { try { - RenderMetaDataFile metaFile = RenderMetaDataFile.createFromExistingFile(this, file); + RenderMetaDataFile metaFile = RenderMetaDataFile.createFromExistingFile(this.fullDataSourceProvider, this.clientLevel, file); filesByPos.put(metaFile.pos, metaFile); } catch (IOException e) @@ -244,7 +241,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider return CompletableFuture.completedFuture(ColumnRenderSource.createEmptyRenderSource(pos)); } - CompletableFuture getDataSourceFuture = metaFile.getOrLoadCachedDataSourceAsync(this.fileHandlerThreadPool, this.clientLevel) + CompletableFuture getDataSourceFuture = metaFile.getOrLoadCachedDataSourceAsync(this.fileHandlerThreadPool) .handle((renderSource, exception) -> { if (exception != null) @@ -302,7 +299,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider // attempt to load the file try { - metaFile = RenderMetaDataFile.createFromExistingFile(this, fileToLoad); + metaFile = RenderMetaDataFile.createFromExistingFile(this.fullDataSourceProvider, this.clientLevel, fileToLoad); this.topDetailLevel.updateAndGet(currentTopDetailLevel -> Math.max(currentTopDetailLevel, pos.sectionDetailLevel)); this.metaFileBySectionPos.put(pos, metaFile); return metaFile; @@ -327,7 +324,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider { // 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, pos); + metaFile = RenderMetaDataFile.createFromExistingOrNewFile(this.clientLevel, this.fullDataSourceProvider, pos, this.computeRenderFilePath(pos)); this.topDetailLevel.updateAndGet(newDetailLevel -> Math.max(newDetailLevel, pos.sectionDetailLevel)); @@ -373,7 +370,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider RenderMetaDataFile metaFile = this.metaFileBySectionPos.get(sectionPos); // bypass the getLoadOrMakeFile() since we only want cached files. if (metaFile != null) { - metaFile.updateChunkIfSourceExistsAsync(chunk, this.clientLevel); + metaFile.updateChunkIfSourceExistsAsync(chunk); } } } @@ -403,27 +400,6 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider - //==========================// - // meta file cache updating // - //==========================// - - @Deprecated - public CompletableFuture onRenderFileLoadedAsync(ColumnRenderSource renderSource, RenderMetaDataFile metaFile) - { - CompletableFuture future = metaFile.updateRenderCacheAsync(renderSource, this.fullDataSourceProvider, this.clientLevel).handle((voidObj, ex) -> renderSource); - - synchronized (this.taskTracker) - { - this.taskTracker.put(future, ETaskType.ON_LOADED); - } - return future; - } - - @Deprecated - public CompletableFuture onRenderSourceLoadedFromCacheAsync(RenderMetaDataFile metaFile, ColumnRenderSource renderSource) { return metaFile.updateRenderCacheAsync(renderSource, this.fullDataSourceProvider, this.clientLevel); } - - - //=========// // F3 menu // //=========// From f21545a3af34c215e168d9137f293748b95c6196 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sun, 3 Sep 2023 22:09:52 -0500 Subject: [PATCH 35/49] RenderMetaDataFile refactor cleanup --- .../file/renderfile/RenderMetaDataFile.java | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) 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 044edbf4e..f88b82850 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 @@ -206,7 +206,7 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements newColumnRenderSource.worldGenStep, RENDER_SOURCE_TYPE_ID, newColumnRenderSource.getRenderDataFormatVersion(), Long.MAX_VALUE); - this.updateRenderCacheAsync(newColumnRenderSource, this.fullDataSourceProvider).whenComplete((voidObj, ex) -> + this.updateRenderCacheAsync(newColumnRenderSource).whenComplete((voidObj, ex) -> { this.cachedRenderDataSource = new SoftReference<>(newColumnRenderSource); @@ -238,9 +238,7 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements return renderSource; }, fileReaderThreads) // TODO: Check for file version and only update if needed. - //.thenCompose((renderSource) -> this.fileHandler.onRenderFileLoadedAsync(renderSource, this)) // TODO just calls // metaFile.updateRenderCacheAsync() - //.whenComplete((renderSource, ex) -> - .thenCompose(renderSource -> this.updateRenderCacheAsync(renderSource, this.fullDataSourceProvider)) + .thenCompose(renderSource -> this.updateRenderCacheAsync(renderSource)) .whenComplete((renderSource, ex) -> { if (ex != null) @@ -293,13 +291,14 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements // cache handler // //===============// - public CompletableFuture updateRenderCacheAsync(ColumnRenderSource renderSource, IFullDataSourceProvider fullDataSourceProvider) + // 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 = fullDataSourceProvider.getFileIfExist(this.pos); + 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); @@ -313,13 +312,13 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements // get the full data source CompletableFuture fullDataSourceFuture = - fullDataSourceProvider.readAsync(renderSource.getSectionPos()) + this.fullDataSourceProvider.readAsync(renderSource.getSectionPos()) .thenApply((fullDataSource) -> { debugBox.box.color = Color.yellow.darker(); // get the metaFile's version - FullDataMetaFile renderSourceMetaFile = fullDataSourceProvider.getFileIfExist(this.pos); + FullDataMetaFile renderSourceMetaFile = this.fullDataSourceProvider.getFileIfExist(this.pos); if (renderSourceMetaFile != null) { renderDataVersionRef.value = renderSourceMetaFile.baseMetaData.checksum; @@ -382,7 +381,7 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements 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, + // 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) @@ -461,7 +460,7 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements /** @return returns null if {@link RenderMetaDataFile#renderSourceLoadFutureRef} is empty and no cached {@link ColumnRenderSource} exists. */ @Nullable - private CompletableFuture getCachedDataSourceAsync(boolean triggerAndWaitForListener) + private CompletableFuture getCachedDataSourceAsync(boolean updateRenderSourceCache) { // check if another thread is already loading the data source CompletableFuture renderSourceLoadFuture = this.renderSourceLoadFutureRef.get(); @@ -482,13 +481,13 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements { // cached data exists - if (!triggerAndWaitForListener) + if (!updateRenderSourceCache) { - // immediately return the render source + // just return the render source return CompletableFuture.completedFuture(cachedRenderDataSource); } - // trigger the listener, wait for it to finish, then return the render source + // 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<>(); @@ -500,7 +499,7 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements } else { - this.updateRenderCacheAsync(cachedRenderDataSource, this.fullDataSourceProvider) + this.updateRenderCacheAsync(cachedRenderDataSource) // wait for the handler to finish before returning the renderSource .handle((ignoredRenderSource, ex) -> { From 4f1f11e7690b8cd98c59808e834c22877174f9d5 Mon Sep 17 00:00:00 2001 From: NULL511 Date: Sun, 3 Sep 2023 23:33:30 -0400 Subject: [PATCH 36/49] add debug ssao settings; improve vanilla matching --- .../config/client/IDhApiGraphicsConfig.java | 8 + .../config/client/DhApiGraphicsConfig.java | 16 ++ .../distanthorizons/core/config/Config.java | 20 ++ ...RenderQualityPresetConfigEventHandler.java | 2 +- .../render/renderer/shaders/SSAORenderer.java | 177 ++++++++++++------ .../assets/distanthorizons/lang/en_us.json | 8 + core/src/main/resources/shaders/ssao/ao.frag | 119 +++++++----- .../main/resources/shaders/ssao/apply.frag | 77 ++++++++ 8 files changed, 324 insertions(+), 103 deletions(-) create mode 100644 core/src/main/resources/shaders/ssao/apply.frag 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..a1d033fa1 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 @@ -86,6 +86,14 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup IDhApiConfigValue ambientOcclusion(); + IDhApiConfigValue ambientOcclusionRadius(); + + IDhApiConfigValue ambientOcclusionStrength(); + + IDhApiConfigValue ambientOcclusionBias(); + + IDhApiConfigValue ambientOcclusionMinLight(); + IDhApiConfigValue transparency(); /** Defines what blocks won't be rendered as LODs. */ 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..91224c0c6 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 @@ -84,6 +84,22 @@ public class DhApiGraphicsConfig implements IDhApiGraphicsConfig public IDhApiConfigValue ambientOcclusion() { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.ssao); } + @Override + public IDhApiConfigValue ambientOcclusionRadius() + { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.ssaoRadius); } + + @Override + public IDhApiConfigValue ambientOcclusionStrength() + { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.ssaoStrength); } + + @Override + public IDhApiConfigValue ambientOcclusionBias() + { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.ssaoBias); } + + @Override + public IDhApiConfigValue ambientOcclusionMinLight() + { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.ssaoMinLight); } + @Override public IDhApiConfigValue transparency() { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.transparency); } 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 c1233ce7e..b9e962daf 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 @@ -179,6 +179,26 @@ public class Config .comment("Enable Screen Space Ambient Occlusion") .build(); + public static ConfigEntry ssaoRadius = new ConfigEntry.Builder() + .set(3.0) + .comment("Radius of Screen Space Ambient Occlusion effect in blocks") + .build(); + + public static ConfigEntry ssaoStrength = new ConfigEntry.Builder() + .set(6.0) + .comment("Strength of Screen Space Ambient Occlusion effect") + .build(); + + public static ConfigEntry ssaoBias = new ConfigEntry.Builder() + .set(0.0) + .comment("Bias of Screen Space Ambient Occlusion effect") + .build(); + + public static ConfigEntry ssaoMinLight = new ConfigEntry.Builder() + .set(0.3) + .comment("Minimum brightness of Screen Space Ambient Occlusion effect") + .build(); + public static ConfigEntry horizontalQuality = new ConfigEntry.Builder() .set(EHorizontalQuality.MEDIUM) .comment("" 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..7017a2a2f 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 @@ -66,7 +66,7 @@ public class RenderQualityPresetConfigEventHandler extends AbstractPresetConfigE this.put(EQualityPreset.HIGH, true); this.put(EQualityPreset.EXTREME, true); }}); - + //==============// 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 9d49ee098..c9252dc31 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,7 @@ 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 +23,6 @@ public class SSAORenderer private static final IMinecraftRenderWrapper MC_RENDER = SingletonInjector.INSTANCE.get(IMinecraftRenderWrapper.class); - private static final int MAX_KERNEL_SIZE = 32; private static final float[] box_vertices = { -1, -1, 1, -1, @@ -34,12 +34,17 @@ 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; + + private int ssaoTexture = -1; // ssao uniforms private final SsaoShaderUniforms ssaoShaderUniforms = new SsaoShaderUniforms(); @@ -47,13 +52,24 @@ public class SSAORenderer { public int gProjUniform; public int gInvProjUniform; - public int gSampleRadUniform; - public int gFactorUniform; - public int gPowerUniform; - public int gKernelUniform; + public int gRadiusUniform; + public int gStrengthUniform; + public int gBiasUniform; + public int gMinLightUniform; public int gDepthMapUniform; } + // apply uniforms + private final ApplyShaderUniforms applyShaderUniforms = new ApplyShaderUniforms(); + private static class ApplyShaderUniforms + { + public int gSSAOMapUniform; + public int gDepthMapUniform; + public int gViewSizeUniform; + public int gNearUniform; + public int gFarUniform; + } + //=============// // constructor // @@ -66,7 +82,6 @@ public class SSAORenderer if (this.init) return; this.init = true; - this.va = VertexAttribute.create(); this.va.bind(); @@ -76,20 +91,53 @@ public class SSAORenderer 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", + "fragColor", new String[]{"vPosition"}); + // SSAO uniform setup this.ssaoShaderUniforms.gProjUniform = this.ssaoShader.getUniformLocation("gProj"); this.ssaoShaderUniforms.gInvProjUniform = this.ssaoShader.getUniformLocation("gInvProj"); - 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.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"); - // Generate kernel - this.kernel = genKernel(); + // 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.gNearUniform = tryGetUniformLocation(this.applyShader, "gNear"); + this.applyShaderUniforms.gFarUniform = tryGetUniformLocation(this.applyShader, "gFar"); + // Framebuffer this.createBuffer(); } + + private void createFramebuffer(int width, int height) + { + if (this.ssaoFramebuffer != -1) + { + GL32.glDeleteFramebuffers(this.ssaoFramebuffer); + this.ssaoFramebuffer = -1; + } + + if (this.ssaoTexture != -1) + { + GL32.glDeleteTextures(this.ssaoTexture); + this.ssaoTexture = -1; + } + + this.ssaoFramebuffer = GL32.glGenFramebuffers(); + GL32.glBindFramebuffer(GL32.GL_FRAMEBUFFER, this.ssaoFramebuffer); + + this.ssaoTexture = GL32.glGenTextures(); + GL32.glBindTexture(GL32.GL_TEXTURE_2D, this.ssaoTexture); + 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() { @@ -97,43 +145,12 @@ public class SSAORenderer 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() * 2f - 1f; - float sampleY = (float)Math.random() * 2f - 1f; - float sampleZ = (float)Math.random() * 2f - 1f; - - // 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 + 0.9 * (scale * scale)); - - sampleX *= interpolatedScale; - sampleY *= interpolatedScale; - sampleZ *= interpolatedScale; - - kernel[i * 3 ] = sampleX; - kernel[i * 3 + 1] = sampleY; - kernel[i * 3 + 2] = sampleZ; - } - - return kernel; - } - - //========// // render // @@ -148,29 +165,42 @@ public class SSAORenderer int width = MC_RENDER.getTargetFrameBufferViewportWidth(); int height = MC_RENDER.getTargetFrameBufferViewportHeight(); + if (this.width != width || this.height != height) + { + this.width = width; + this.height = height; + this.createFramebuffer(width, height); + } + + GL32.glBindFramebuffer(GL32.GL_FRAMEBUFFER, this.ssaoFramebuffer); GL32.glViewport(0, 0, width, height); - GL32.glDisable(GL32.GL_DEPTH_TEST); - 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.glBindFramebuffer(GL32.GL_FRAMEBUFFER, MC_RENDER.getTargetFrameBuffer()); 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), width / (float) height, - RenderUtil.getNearClipPlaneDistanceInBlocks(partialTicks), - (float) ((RenderUtil.getFarClipPlaneDistanceInBlocks() + LodUtil.REGION_WIDTH) * Math.sqrt(2))); + near, far); Mat4f invertedPerspective = new Mat4f(perspective); invertedPerspective.invert(); + float radius = Config.Client.Advanced.Graphics.Quality.ssaoRadius.get().floatValue(); + float strength = Config.Client.Advanced.Graphics.Quality.ssaoStrength.get().floatValue(); + float minLight = Config.Client.Advanced.Graphics.Quality.ssaoMinLight.get().floatValue(); + float bias = Config.Client.Advanced.Graphics.Quality.ssaoBias.get().floatValue(); + this.ssaoShader.bind(); this.ssaoShader.setUniform(this.ssaoShaderUniforms.gProjUniform, perspective); this.ssaoShader.setUniform(this.ssaoShaderUniforms.gInvProjUniform, invertedPerspective); - this.ssaoShader.setUniform(this.ssaoShaderUniforms.gSampleRadUniform, 3.0f); - this.ssaoShader.setUniform(this.ssaoShaderUniforms.gFactorUniform, 0.5f); - this.ssaoShader.setUniform(this.ssaoShaderUniforms.gPowerUniform, 6.0f); + 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()); @@ -178,16 +208,51 @@ 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.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); + + 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/resources/assets/distanthorizons/lang/en_us.json b/core/src/main/resources/assets/distanthorizons/lang/en_us.json index bd549717e..d386bf7cd 100644 --- a/core/src/main/resources/assets/distanthorizons/lang/en_us.json +++ b/core/src/main/resources/assets/distanthorizons/lang/en_us.json @@ -96,6 +96,14 @@ "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.ssaoRadius": + "SSAO Radius", + "distanthorizons.config.client.advanced.graphics.quality.ssaoStrength": + "SSAO Strength", + "distanthorizons.config.client.advanced.graphics.quality.ssaoMinLight": + "SSAO Min Light", + "distanthorizons.config.client.advanced.graphics.quality.ssaoBias": + "SSAO Bias", "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": diff --git a/core/src/main/resources/shaders/ssao/ao.frag b/core/src/main/resources/shaders/ssao/ao.frag index f2677e86b..e700a3d81 100644 --- a/core/src/main/resources/shaders/ssao/ao.frag +++ b/core/src/main/resources/shaders/ssao/ao.frag @@ -1,27 +1,34 @@ #version 150 core #extension GL_ARB_derivative_control : enable +#define saturate(x) (clamp((x), 0.0, 1.0)) +#define rcp(x) (1.0 / (x)) + +const float SSAO_SAMPLES = 24; // [2 4 6 8 10 12 14 16 24 32] + in vec2 TexCoord; out vec4 fragColor; uniform sampler2D gDepthMap; -uniform float gSampleRad; -uniform float gFactor; -uniform float gPower; -uniform mat4 gProj; +uniform float gRadius; +uniform float gStrength; +uniform float gMinLight; +uniform float gBias; uniform mat4 gInvProj; +uniform mat4 gProj; -const float MIN_LIGHT = 0.6; -const float SAMPLE_BIAS = 0.6; -const int MAX_KERNEL_SIZE = 32; -const float INV_MAX_KERNEL_SIZE_F = 1.0 / float(MAX_KERNEL_SIZE); -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 unproject(vec4 pos) { + return pos.xyz / pos.w; +} + float InterleavedGradientNoise(const in vec2 pixel) { float x = dot(pixel, MAGIC.xy); return fract(MAGIC.z * fract(x)); @@ -32,12 +39,64 @@ vec3 calcViewPosition(const in vec3 clipPos) { return viewPos.xyz / viewPos.w; } + +float GetSpiralOcclusion(const in vec2 uv, const in vec3 viewPos, const in vec3 viewNormal) { + const float inv = rcp(SSAO_SAMPLES); + float rStep = inv * gRadius; + + float dither = InterleavedGradientNoise(gl_FragCoord.xy); + float rotatePhase = dither * TAU; + + float radius = rStep; + vec2 offset; + + float ao = 0.0; + int sampleCount = 0; + for (int i = 0; i < SSAO_SAMPLES; i++) { + offset.x = sin(rotatePhase); + offset.y = cos(rotatePhase); + offset *= 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; + //if (sampleClipPos != saturate(sampleClipPos)) continue; + 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 += 1; + } + + ao /= max(sampleCount, 1); + //ao = max(ao - SSAO_THRESHOLD, 0.0) * gStrength; + //ao /= ao + 0.25; + + ao = smoothstep(0.0, gStrength, ao); + + return ao * (1.0 - gMinLight); +} + + void main() { float fragmentDepth = textureLod(gDepthMap, TexCoord, 0).r; - float occlusion = 1.0; + float occlusion = 0.0; if (fragmentDepth < 1.0) { - float dither = InterleavedGradientNoise(gl_FragCoord.xy); vec3 viewPos = calcViewPosition(vec3(TexCoord, fragmentDepth)); #ifdef GL_ARB_derivative_control @@ -47,41 +106,9 @@ void main() { #endif viewNormal = normalize(viewNormal); - //const vec3 upVec = vec3(0.0, -1.0, 0.0); - float angle = dither * (PI * 2.0); - vec3 rotation = vec3(sin(angle), cos(angle), 0.0); - vec3 tangent = normalize(cross(viewNormal, rotation)); - - vec3 bitangent = normalize(cross(viewNormal, tangent)); - mat3 TBN = mat3(tangent, bitangent, viewNormal); - - float maxWeight = 0.0; - float occlusion_factor = 0.0; - for (int i = 0; i < MAX_KERNEL_SIZE; i++) { - vec3 samplePos = TBN * gKernel[i]; - samplePos *= sign(dot(samplePos, viewNormal)); - samplePos = viewPos + samplePos * gSampleRad; - - vec4 sampleNdcPos = gProj * vec4(samplePos + viewPos, 1.0); - sampleNdcPos = sampleNdcPos / sampleNdcPos.w; - if (any(greaterThanEqual(abs(sampleNdcPos.xy), vec2(1.0)))) continue; - - maxWeight += 1.0; - - vec2 sampleTexPos = sampleNdcPos.xy * 0.5 + 0.5; - float sampleDepth = textureLod(gDepthMap, sampleTexPos, 0).r; - float geometryDepth = calcViewPosition(vec3(sampleTexPos, sampleDepth)).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 += step(samplePos.z + SAMPLE_BIAS, geometryDepth) * rangeCheck; - } - - float visibility_factor = 1.0 - (occlusion_factor / maxWeight); - occlusion = (1.0 - pow(visibility_factor, gFactor)) * gPower; - occlusion = clamp(1.0 - occlusion, MIN_LIGHT, 1.0); + occlusion = GetSpiralOcclusion(TexCoord, viewPos, viewNormal); } - fragColor = vec4(vec3(1.0), occlusion); + fragColor = vec4(vec3(1.0 - occlusion), 1.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..f9490e2ce --- /dev/null +++ b/core/src/main/resources/shaders/ssao/apply.frag @@ -0,0 +1,77 @@ +#version 150 core + +#define ENABLE_SSAO_BLUR + +in vec2 TexCoord; +//in vec2 ViewRay; + +out vec4 fragColor; + +uniform sampler2D gSSAOMap; +uniform sampler2D gDepthMap; +uniform vec2 gViewSize; +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; + + const float c_halfSamplesX = 2.0; + const float c_halfSamplesY = 2.0; + + vec2 pixelSize = 1.0 / gViewSize; + + float accum = 0.0; + float total = 0.0; + for (float iy = -c_halfSamplesY; iy <= c_halfSamplesY; iy++) { + float fy = Gaussian(g_sigmaY, iy); + + for (float ix = -c_halfSamplesX; ix <= c_halfSamplesX; ix++) { + float fx = Gaussian(g_sigmaX, ix); + + vec2 sampleTex = texcoord + vec2(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) { + #ifdef ENABLE_SSAO_BLUR + float fragmentDepthLinear = linearizeDepth(fragmentDepth); + fragColor.a = BilateralGaussianBlur(TexCoord, fragmentDepthLinear, 1.6); + #else + fragColor.a = textureLod(gSSAOMap, TexCoord, 0).r; + #endif + } +} From 4cd6bc06f168ad0f6dc56fa670664af30461285c Mon Sep 17 00:00:00 2001 From: NULL511 Date: Mon, 4 Sep 2023 00:12:45 -0400 Subject: [PATCH 37/49] reset default ssao settings --- .../config/client/IDhApiGraphicsConfig.java | 10 ++++++---- .../methods/config/client/DhApiGraphicsConfig.java | 12 ++++++++---- .../seibel/distanthorizons/core/config/Config.java | 13 +++++++++---- .../core/render/renderer/shaders/SSAORenderer.java | 4 ++++ .../assets/distanthorizons/lang/en_us.json | 2 ++ core/src/main/resources/shaders/ssao/ao.frag | 10 +++------- core/src/main/resources/shaders/ssao/apply.frag | 1 - 7 files changed, 32 insertions(+), 20 deletions(-) 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 a1d033fa1..ea8478856 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 @@ -86,13 +86,15 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup IDhApiConfigValue ambientOcclusion(); - IDhApiConfigValue ambientOcclusionRadius(); + IDhApiConfigValue ambientOcclusion_SampleCount(); - IDhApiConfigValue ambientOcclusionStrength(); + IDhApiConfigValue ambientOcclusion_Radius(); - IDhApiConfigValue ambientOcclusionBias(); + IDhApiConfigValue ambientOcclusion_Strength(); - IDhApiConfigValue ambientOcclusionMinLight(); + IDhApiConfigValue ambientOcclusion_Bias(); + + IDhApiConfigValue ambientOcclusion_MinLight(); IDhApiConfigValue transparency(); 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 91224c0c6..55dfa5758 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 @@ -85,19 +85,23 @@ public class DhApiGraphicsConfig implements IDhApiGraphicsConfig { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.ssao); } @Override - public IDhApiConfigValue ambientOcclusionRadius() + public IDhApiConfigValue ambientOcclusion_SampleCount() + { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.ssaoSampleCount); } + + @Override + public IDhApiConfigValue ambientOcclusion_Radius() { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.ssaoRadius); } @Override - public IDhApiConfigValue ambientOcclusionStrength() + public IDhApiConfigValue ambientOcclusion_Strength() { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.ssaoStrength); } @Override - public IDhApiConfigValue ambientOcclusionBias() + public IDhApiConfigValue ambientOcclusion_Bias() { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.ssaoBias); } @Override - public IDhApiConfigValue ambientOcclusionMinLight() + public IDhApiConfigValue ambientOcclusion_MinLight() { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.ssaoMinLight); } @Override 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 b9e962daf..3ee3ff8b1 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 @@ -179,23 +179,28 @@ public class Config .comment("Enable Screen Space Ambient Occlusion") .build(); + public static ConfigEntry ssaoSampleCount = new ConfigEntry.Builder() + .set(6) + .comment("Number of samples to use for Screen Space Ambient Occlusion") + .build(); + public static ConfigEntry ssaoRadius = new ConfigEntry.Builder() - .set(3.0) + .set(4.0) .comment("Radius of Screen Space Ambient Occlusion effect in blocks") .build(); public static ConfigEntry ssaoStrength = new ConfigEntry.Builder() - .set(6.0) + .set(0.2) .comment("Strength of Screen Space Ambient Occlusion effect") .build(); public static ConfigEntry ssaoBias = new ConfigEntry.Builder() - .set(0.0) + .set(0.02) .comment("Bias of Screen Space Ambient Occlusion effect") .build(); public static ConfigEntry ssaoMinLight = new ConfigEntry.Builder() - .set(0.3) + .set(0.25) .comment("Minimum brightness of Screen Space Ambient Occlusion effect") .build(); 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 c9252dc31..bd6ad3988 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 @@ -52,6 +52,7 @@ public class SSAORenderer { public int gProjUniform; public int gInvProjUniform; + public int gSampleCountUniform; public int gRadiusUniform; public int gStrengthUniform; public int gBiasUniform; @@ -97,6 +98,7 @@ public class SSAORenderer // SSAO uniform setup this.ssaoShaderUniforms.gProjUniform = this.ssaoShader.getUniformLocation("gProj"); 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"); @@ -189,6 +191,7 @@ public class SSAORenderer Mat4f invertedPerspective = new Mat4f(perspective); invertedPerspective.invert(); + int sampleCount = Config.Client.Advanced.Graphics.Quality.ssaoSampleCount.get(); float radius = Config.Client.Advanced.Graphics.Quality.ssaoRadius.get().floatValue(); float strength = Config.Client.Advanced.Graphics.Quality.ssaoStrength.get().floatValue(); float minLight = Config.Client.Advanced.Graphics.Quality.ssaoMinLight.get().floatValue(); @@ -197,6 +200,7 @@ public class SSAORenderer this.ssaoShader.bind(); this.ssaoShader.setUniform(this.ssaoShaderUniforms.gProjUniform, perspective); 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); 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 d386bf7cd..526ecdf8e 100644 --- a/core/src/main/resources/assets/distanthorizons/lang/en_us.json +++ b/core/src/main/resources/assets/distanthorizons/lang/en_us.json @@ -96,6 +96,8 @@ "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.ssaoSampleCount": + "SSAO Sample Count", "distanthorizons.config.client.advanced.graphics.quality.ssaoRadius": "SSAO Radius", "distanthorizons.config.client.advanced.graphics.quality.ssaoStrength": diff --git a/core/src/main/resources/shaders/ssao/ao.frag b/core/src/main/resources/shaders/ssao/ao.frag index e700a3d81..94901abba 100644 --- a/core/src/main/resources/shaders/ssao/ao.frag +++ b/core/src/main/resources/shaders/ssao/ao.frag @@ -4,13 +4,12 @@ #define saturate(x) (clamp((x), 0.0, 1.0)) #define rcp(x) (1.0 / (x)) -const float SSAO_SAMPLES = 24; // [2 4 6 8 10 12 14 16 24 32] - in vec2 TexCoord; out vec4 fragColor; uniform sampler2D gDepthMap; +uniform int gSampleCount; uniform float gRadius; uniform float gStrength; uniform float gMinLight; @@ -41,7 +40,7 @@ vec3 calcViewPosition(const in vec3 clipPos) { float GetSpiralOcclusion(const in vec2 uv, const in vec3 viewPos, const in vec3 viewNormal) { - const float inv = rcp(SSAO_SAMPLES); + float inv = rcp(gSampleCount); float rStep = inv * gRadius; float dither = InterleavedGradientNoise(gl_FragCoord.xy); @@ -52,7 +51,7 @@ float GetSpiralOcclusion(const in vec2 uv, const in vec3 viewPos, const in vec3 float ao = 0.0; int sampleCount = 0; - for (int i = 0; i < SSAO_SAMPLES; i++) { + for (int i = 0; i < gSampleCount; i++) { offset.x = sin(rotatePhase); offset.y = cos(rotatePhase); offset *= radius; @@ -83,9 +82,6 @@ float GetSpiralOcclusion(const in vec2 uv, const in vec3 viewPos, const in vec3 } ao /= max(sampleCount, 1); - //ao = max(ao - SSAO_THRESHOLD, 0.0) * gStrength; - //ao /= ao + 0.25; - ao = smoothstep(0.0, gStrength, ao); return ao * (1.0 - gMinLight); diff --git a/core/src/main/resources/shaders/ssao/apply.frag b/core/src/main/resources/shaders/ssao/apply.frag index f9490e2ce..f91e787b2 100644 --- a/core/src/main/resources/shaders/ssao/apply.frag +++ b/core/src/main/resources/shaders/ssao/apply.frag @@ -3,7 +3,6 @@ #define ENABLE_SSAO_BLUR in vec2 TexCoord; -//in vec2 ViewRay; out vec4 fragColor; From 1da2b3558e5dbf788fa144064e268f1d39df8e59 Mon Sep 17 00:00:00 2001 From: NULL511 Date: Mon, 4 Sep 2023 03:09:25 -0400 Subject: [PATCH 38/49] add sample count --- .../config/client/IDhApiGraphicsConfig.java | 2 ++ .../config/client/DhApiGraphicsConfig.java | 4 +++ .../distanthorizons/core/config/Config.java | 5 ++++ .../render/renderer/shaders/SSAORenderer.java | 6 ++++- .../assets/distanthorizons/lang/en_us.json | 6 +++-- core/src/main/resources/shaders/ssao/ao.frag | 26 +++++++++---------- .../main/resources/shaders/ssao/apply.frag | 21 +++++++-------- 7 files changed, 43 insertions(+), 27 deletions(-) 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 ea8478856..b5bfce8f0 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 @@ -96,6 +96,8 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup IDhApiConfigValue ambientOcclusion_MinLight(); + IDhApiConfigValue ambientOcclusion_BlurRadius(); + IDhApiConfigValue transparency(); /** Defines what blocks won't be rendered as LODs. */ 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 55dfa5758..478645a28 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 @@ -104,6 +104,10 @@ public class DhApiGraphicsConfig implements IDhApiGraphicsConfig public IDhApiConfigValue ambientOcclusion_MinLight() { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.ssaoMinLight); } + @Override + public IDhApiConfigValue ambientOcclusion_BlurRadius() + { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.ssaoBlurRadius); } + @Override public IDhApiConfigValue transparency() { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.transparency); } 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 3ee3ff8b1..e74e4900d 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 @@ -204,6 +204,11 @@ public class Config .comment("Minimum brightness of Screen Space Ambient Occlusion effect") .build(); + public static ConfigEntry ssaoBlurRadius = new ConfigEntry.Builder() + .set(2) + .comment("Radius in pixels of Screen Space Ambient Occlusion blurring") + .build(); + public static ConfigEntry horizontalQuality = new ConfigEntry.Builder() .set(EHorizontalQuality.MEDIUM) .comment("" 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 bd6ad3988..fcd01ecab 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 @@ -55,8 +55,8 @@ public class SSAORenderer public int gSampleCountUniform; public int gRadiusUniform; public int gStrengthUniform; - public int gBiasUniform; public int gMinLightUniform; + public int gBiasUniform; public int gDepthMapUniform; } @@ -67,6 +67,7 @@ public class SSAORenderer public int gSSAOMapUniform; public int gDepthMapUniform; public int gViewSizeUniform; + public int gBlurRadiusUniform; public int gNearUniform; public int gFarUniform; } @@ -109,6 +110,7 @@ public class SSAORenderer 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"); @@ -192,6 +194,7 @@ public class SSAORenderer invertedPerspective.invert(); int sampleCount = Config.Client.Advanced.Graphics.Quality.ssaoSampleCount.get(); + int blurRadius = Config.Client.Advanced.Graphics.Quality.ssaoBlurRadius.get(); float radius = Config.Client.Advanced.Graphics.Quality.ssaoRadius.get().floatValue(); float strength = Config.Client.Advanced.Graphics.Quality.ssaoStrength.get().floatValue(); float minLight = Config.Client.Advanced.Graphics.Quality.ssaoMinLight.get().floatValue(); @@ -229,6 +232,7 @@ public class SSAORenderer 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); 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 526ecdf8e..0cade8c24 100644 --- a/core/src/main/resources/assets/distanthorizons/lang/en_us.json +++ b/core/src/main/resources/assets/distanthorizons/lang/en_us.json @@ -96,6 +96,8 @@ "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.ssaoSampleCount": "SSAO Sample Count", "distanthorizons.config.client.advanced.graphics.quality.ssaoRadius": @@ -106,8 +108,8 @@ "SSAO Min Light", "distanthorizons.config.client.advanced.graphics.quality.ssaoBias": "SSAO Bias", - "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.ssaoBlurRadius": + "SSAO Blur Radius", "distanthorizons.config.client.advanced.graphics.quality.horizontalQuality": "Horizontal Quality", "distanthorizons.config.client.advanced.graphics.quality.horizontalQuality.@tooltip": diff --git a/core/src/main/resources/shaders/ssao/ao.frag b/core/src/main/resources/shaders/ssao/ao.frag index 94901abba..149736efb 100644 --- a/core/src/main/resources/shaders/ssao/ao.frag +++ b/core/src/main/resources/shaders/ssao/ao.frag @@ -1,8 +1,9 @@ #version 150 core #extension GL_ARB_derivative_control : enable +#define SAMPLE_MAX 64 + #define saturate(x) (clamp((x), 0.0, 1.0)) -#define rcp(x) (1.0 / (x)) in vec2 TexCoord; @@ -40,28 +41,26 @@ vec3 calcViewPosition(const in vec3 clipPos) { float GetSpiralOcclusion(const in vec2 uv, const in vec3 viewPos, const in vec3 viewNormal) { - float inv = rcp(gSampleCount); - float rStep = inv * gRadius; - float dither = InterleavedGradientNoise(gl_FragCoord.xy); float rotatePhase = dither * TAU; + float rStep = gRadius / gSampleCount; - float radius = rStep; vec2 offset; float ao = 0.0; int sampleCount = 0; - for (int i = 0; i < gSampleCount; i++) { - offset.x = sin(rotatePhase); - offset.y = cos(rotatePhase); - offset *= radius; + 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; - //if (sampleClipPos != saturate(sampleClipPos)) continue; sampleClipPos = saturate(sampleClipPos); float sampleClipDepth = textureLod(gDepthMap, sampleClipPos.xy, 0.0).r; @@ -77,8 +76,7 @@ float GetSpiralOcclusion(const in vec2 uv, const in vec3 viewPos, const in vec3 float sampleNoLm = max(dot(viewNormal, sampleNormal) - gBias, 0.0); float aoF = 1.0 - saturate(sampleDist / gRadius); ao += sampleNoLm * aoF; - - sampleCount += 1; + sampleCount++; } ao /= max(sampleCount, 1); @@ -92,10 +90,12 @@ 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)); diff --git a/core/src/main/resources/shaders/ssao/apply.frag b/core/src/main/resources/shaders/ssao/apply.frag index f91e787b2..44026c96c 100644 --- a/core/src/main/resources/shaders/ssao/apply.frag +++ b/core/src/main/resources/shaders/ssao/apply.frag @@ -1,7 +1,5 @@ #version 150 core -#define ENABLE_SSAO_BLUR - in vec2 TexCoord; out vec4 fragColor; @@ -9,6 +7,7 @@ out vec4 fragColor; uniform sampler2D gSSAOMap; uniform sampler2D gDepthMap; uniform vec2 gViewSize; +uniform int gBlurRadius; uniform float gNear; uniform float gFar; @@ -25,20 +24,19 @@ float BilateralGaussianBlur(const in vec2 texcoord, const in float linearDepth, float g_sigmaX = 1.6; float g_sigmaY = 1.6; - const float c_halfSamplesX = 2.0; - const float c_halfSamplesY = 2.0; + int radius = clamp(gBlurRadius, 1, 3); vec2 pixelSize = 1.0 / gViewSize; float accum = 0.0; float total = 0.0; - for (float iy = -c_halfSamplesY; iy <= c_halfSamplesY; iy++) { + for (int iy = -radius; iy <= radius; iy++) { float fy = Gaussian(g_sigmaY, iy); - for (float ix = -c_halfSamplesX; ix <= c_halfSamplesX; ix++) { + for (int ix = -radius; ix <= radius; ix++) { float fx = Gaussian(g_sigmaX, ix); - vec2 sampleTex = texcoord + vec2(ix, iy) * pixelSize; + 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); @@ -66,11 +64,12 @@ void main() // 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) { - #ifdef ENABLE_SSAO_BLUR + if (gBlurRadius > 0) { float fragmentDepthLinear = linearizeDepth(fragmentDepth); fragColor.a = BilateralGaussianBlur(TexCoord, fragmentDepthLinear, 1.6); - #else - fragColor.a = textureLod(gSSAOMap, TexCoord, 0).r; - #endif + } + else { + fragColor.a = texelFetch(gSSAOMap, ivec2(gl_FragCoord.xy), 0).r; + } } } From 08359b1b311650597b7051a59dc0329636422136 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Mon, 4 Sep 2023 09:46:32 -0500 Subject: [PATCH 39/49] Move meta file scanning into FileScanUtil (now MetaFileScanUtil) --- .../fullDatafile/FullDataFileHandler.java | 299 ++++++------------ .../file/fullDatafile/FullDataMetaFile.java | 4 + .../GeneratedFullDataFileHandler.java | 12 - .../fullDatafile/IFullDataSourceProvider.java | 4 +- .../renderfile/ILodRenderSourceProvider.java | 7 +- .../file/renderfile/RenderMetaDataFile.java | 1 + .../renderfile/RenderSourceFileHandler.java | 158 ++------- .../core/util/FileScanUtil.java | 78 ----- .../core/util/MetaFileScanUtil.java | 257 +++++++++++++++ 9 files changed, 387 insertions(+), 433 deletions(-) delete mode 100644 core/src/main/java/com/seibel/distanthorizons/core/util/FileScanUtil.java create mode 100644 core/src/main/java/com/seibel/distanthorizons/core/util/MetaFileScanUtil.java 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 cbd4a4c80..f87e17503 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 @@ -19,7 +19,6 @@ 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; @@ -33,12 +32,11 @@ 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.MetaFileScanUtil; import com.seibel.distanthorizons.core.util.FileUtil; import com.seibel.distanthorizons.core.util.LodUtil; 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; @@ -48,8 +46,6 @@ 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 { public static final boolean USE_LAZY_LOADING = true; @@ -59,18 +55,17 @@ 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 LinkedList> onUpdatedListeners = new LinkedList<>(); + private final ConcurrentHashMap unloadedFileBySectionPos = new ConcurrentHashMap<>(); + /** contains the loaded {@link FullDataMetaFile}'s */ + private final ConcurrentHashMap metaFileBySectionPos = new ConcurrentHashMap<>(); 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 // //=============// @@ -83,133 +78,85 @@ public class FullDataFileHandler implements IFullDataSourceProvider { LOGGER.warn("Unable to create full data folder, file saving may fail."); } - FileScanUtil.scanFullDataFiles(saveStructure, level.getLevelWrapper(), this); + MetaFileScanUtil.scanFullDataFiles(saveStructure, level.getLevelWrapper(), this); } - // constructor helpers // + @Override + public void addScannedFiles(Collection detectedFiles) + { + MetaFileScanUtil.CreateMetadataFunc createMetadataFunc = (file) -> new FullDataMetaFile(this, this.level, file); + + MetaFileScanUtil.AddUnloadedFileFunc addUnloadedFileFunc = (pos, file) -> + { + this.unloadedFileBySectionPos.put(pos, file); + this.topDetailLevelRef.updateAndGet(oldDetailLevel -> Math.max(oldDetailLevel, pos.sectionDetailLevel)); + }; + MetaFileScanUtil.AddLoadedMetaFileFunc 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.loadOrGetCachedDataSourceAsync().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) { @@ -218,7 +165,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. @@ -227,8 +174,8 @@ 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); + this.topDetailLevelRef.updateAndGet(oldDetailLevel -> Math.max(oldDetailLevel, pos.sectionDetailLevel)); + this.metaFileBySectionPos.put(pos, metaFile); return metaFile; } catch (IOException e) @@ -238,7 +185,7 @@ public class FullDataFileHandler implements IFullDataSourceProvider } finally { - this.unloadedFiles.remove(pos); + this.unloadedFileBySectionPos.remove(pos); } } } @@ -262,10 +209,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; } @@ -304,7 +251,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; @@ -334,13 +281,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 @@ -359,42 +306,13 @@ 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 readAsync(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 @@ -408,14 +326,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); @@ -427,7 +345,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()); } @@ -437,7 +355,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); @@ -446,11 +364,7 @@ public class FullDataFileHandler implements IFullDataSourceProvider } - @Override - public synchronized void addOnUpdatedListener(Consumer listener) - { - this.onUpdatedListeners.add(listener); - } + protected IIncompleteFullDataSource makeEmptyDataSource(DhSectionPos pos) { @@ -526,7 +440,7 @@ 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); } @@ -537,10 +451,6 @@ public class FullDataFileHandler implements IFullDataSourceProvider Consumer onUpdated, Function updater) { boolean changed = updater.apply(source); -// if (changed) -// { -// metaData.dataVersion.incrementAndGet(); -// } if (source instanceof IIncompleteFullDataSource) { @@ -556,17 +466,6 @@ public class FullDataFileHandler implements IFullDataSourceProvider 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); - } //==========================// @@ -619,12 +518,6 @@ public class FullDataFileHandler implements IFullDataSourceProvider @Override public ExecutorService getIOExecutor() { return fileHandlerThreadPool; } - @Override - public FullDataMetaFile getFileIfExist(DhSectionPos pos) - { - return getLoadOrMakeFile(pos, false); - } - //=========// @@ -632,9 +525,15 @@ public class FullDataFileHandler implements IFullDataSourceProvider //=========// @Override - public void close() - { - FullDataMetaFile.debugPhantomLifeCycleCheck(); - } + public void close() { FullDataMetaFile.debugPhantomLifeCycleCheck(); } + + + + //================// + // 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 2158b28e5..6fe90ab5f 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 @@ -51,8 +51,12 @@ import org.apache.logging.log4j.Logger; */ 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; 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 b75608115..76056359c 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 @@ -57,18 +57,6 @@ public class GeneratedFullDataFileHandler extends FullDataFileHandler - //======// - // data // - //======// - - @Override - public CompletableFuture readAsync(DhSectionPos pos) - { - return super.readAsync(pos); - } - - - //==================// // generation queue // //==================// 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 a295557dd..8055e34a6 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 @@ -33,15 +33,13 @@ import java.util.function.Function; public interface IFullDataSourceProvider extends AutoCloseable { - void addScannedFile(Collection detectedFiles); + void addScannedFiles(Collection detectedFiles); 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); 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 bbb3dc2dc..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 @@ -35,14 +35,13 @@ import java.util.concurrent.CompletableFuture; */ public interface ILodRenderSourceProvider extends AutoCloseable { - CompletableFuture readAsync(DhSectionPos pos); void addScannedFiles(Collection detectedFiles); + + CompletableFuture readAsync(DhSectionPos pos); + 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 f88b82850..b829c4c3f 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 @@ -56,6 +56,7 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements { 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; 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 f421e45cf..57d3e8987 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 @@ -19,7 +19,6 @@ 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.file.structure.AbstractSaveStructure; import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; @@ -29,12 +28,11 @@ import com.seibel.distanthorizons.core.pos.DhSectionPos; import com.seibel.distanthorizons.core.dataObjects.render.ColumnRenderSource; import com.seibel.distanthorizons.core.file.fullDatafile.IFullDataSourceProvider; import com.seibel.distanthorizons.core.level.IDhClientLevel; -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.ThreadUtil; 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; @@ -42,8 +40,6 @@ 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; @@ -60,7 +56,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider 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; private final WeakHashMap, ETaskType> taskTracker = new WeakHashMap<>(); @@ -85,136 +81,35 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider this.threadPoolMsg = new F3Screen.NestedMessage(this::f3Log); - FileScanUtil.scanRenderFiles(saveStructure, clientLevel.getLevelWrapper(), 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 FileScanUtil#scanRenderFiles(AbstractSaveStructure, ILevelWrapper, ILodRenderSourceProvider)} + * Used by {@link MetaFileScanUtil#scanRenderFiles(AbstractSaveStructure, ILevelWrapper, ILodRenderSourceProvider)} */ @Override public void addScannedFiles(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.decodePositionFromFileName(file); - if (pos != null) - { - this.unloadedFileBySectionPos.put(pos, file); - this.topDetailLevel.updateAndGet(currentTopDetailLevel -> Math.max(currentTopDetailLevel, 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(); + MetaFileScanUtil.CreateMetadataFunc createMetadataFunc = (file) -> RenderMetaDataFile.createFromExistingFile(this.fullDataSourceProvider, this.clientLevel, file); - // Sort files by pos. - for (File file : newRenderFiles) + MetaFileScanUtil.AddUnloadedFileFunc addUnloadedFileFunc = (pos, file) -> { - try - { - RenderMetaDataFile metaFile = RenderMetaDataFile.createFromExistingFile(this.fullDataSourceProvider, this.clientLevel, file); - filesByPos.put(metaFile.pos, metaFile); - } - catch (IOException e) - { - LOGGER.error("Failed to read render meta file at [" + file + "]. Error: ", e); - FileUtil.renameCorruptedFile(file); - } - } + this.unloadedFileBySectionPos.put(pos, file); + this.topDetailLevelRef.updateAndGet(oldDetailLevel -> Math.max(oldDetailLevel, pos.sectionDetailLevel)); + }; + MetaFileScanUtil.AddLoadedMetaFileFunc addLoadedMetaFileFunc = (pos, loadedMetaFile) -> + { + this.topDetailLevelRef.updateAndGet(oldDetailLevel -> Math.max(oldDetailLevel, pos.sectionDetailLevel)); + this.metaFileBySectionPos.put(pos, (RenderMetaDataFile) loadedMetaFile); + }; - // 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.metaFileBySectionPos.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)); - } + + MetaFileScanUtil.addScannedFiles(detectedFiles, USE_LAZY_LOADING, RenderMetaDataFile.FILE_SUFFIX, + createMetadataFunc, + addUnloadedFileFunc, addLoadedMetaFileFunc); } @@ -300,7 +195,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider try { metaFile = RenderMetaDataFile.createFromExistingFile(this.fullDataSourceProvider, this.clientLevel, fileToLoad); - this.topDetailLevel.updateAndGet(currentTopDetailLevel -> Math.max(currentTopDetailLevel, pos.sectionDetailLevel)); + this.topDetailLevelRef.updateAndGet(currentTopDetailLevel -> Math.max(currentTopDetailLevel, pos.sectionDetailLevel)); this.metaFileBySectionPos.put(pos, metaFile); return metaFile; } @@ -326,7 +221,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider // 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.topDetailLevel.updateAndGet(newDetailLevel -> Math.max(newDetailLevel, pos.sectionDetailLevel)); + 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); @@ -375,7 +270,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider } } - if (sectionDetailLevel < this.topDetailLevel.get()) + if (sectionDetailLevel < this.topDetailLevelRef.get()) { this.writeChunkDataToFileRecursively(chunk, (byte) (sectionDetailLevel + 1)); } @@ -483,16 +378,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider // helper methods // //================// - public File computeRenderFilePath(DhSectionPos pos) { return new File(this.saveDir, pos.serialize() + RENDER_FILE_POSTFIX); } - - @Nullable - public DhSectionPos decodePositionFromFileName(File file) - { - 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); - } + public File computeRenderFilePath(DhSectionPos pos) { return new File(this.saveDir, pos.serialize() + RenderMetaDataFile.FILE_SUFFIX); } 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 8db0eb414..000000000 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/FileScanUtil.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * This file is part of the Distant Horizons mod - * licensed under the GNU LGPL v3 License. - * - * Copyright (C) 2020-2023 James Seibel - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You 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.file.fullDatafile.IFullDataSourceProvider; -import com.seibel.distanthorizons.core.file.renderfile.ILodRenderSourceProvider; -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 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; - -/** Used to pull in the initial files used by both {@link IFullDataSourceProvider} and {@link ILodRenderSourceProvider}s. */ -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 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(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); - } - } - - 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(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.addScannedFiles(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/MetaFileScanUtil.java b/core/src/main/java/com/seibel/distanthorizons/core/util/MetaFileScanUtil.java new file mode 100644 index 000000000..18d002019 --- /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, + CreateMetadataFunc createMetadataFunc, + AddUnloadedFileFunc addUnloadedFileFunc, AddLoadedMetaFileFunc addLoadedMetaFileFunc) + { + if (useLazyLoading) + { + lazyAddScannedFile(detectedFiles, fileSuffix, addUnloadedFileFunc); + } + else + { + immediateAddScannedFile(detectedFiles, createMetadataFunc, addLoadedMetaFileFunc); + } + } + private static void lazyAddScannedFile(Collection detectedFiles, String fileSuffix, AddUnloadedFileFunc 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, + CreateMetadataFunc createMetadataFunc, AddLoadedMetaFileFunc 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 CreateMetadataFunc { AbstractMetaDataContainerFile createFile(File file) throws IOException; } + + @FunctionalInterface + public interface AddUnloadedFileFunc { void addFile(DhSectionPos pos, File file); } + @FunctionalInterface + public interface AddLoadedMetaFileFunc { void addFile(DhSectionPos pos, AbstractMetaDataContainerFile metaFile); } + +} From 4da4666aec6cf8fcdfa49416b5abcc4b730385d1 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Mon, 4 Sep 2023 09:51:35 -0500 Subject: [PATCH 40/49] Add named FullDataMetaFile constructors --- .../file/fullDatafile/FullDataFileHandler.java | 6 +++--- .../file/fullDatafile/FullDataMetaFile.java | 17 ++++++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) 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 f87e17503..eb8315a4e 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 @@ -84,7 +84,7 @@ public class FullDataFileHandler implements IFullDataSourceProvider @Override public void addScannedFiles(Collection detectedFiles) { - MetaFileScanUtil.CreateMetadataFunc createMetadataFunc = (file) -> new FullDataMetaFile(this, this.level, file); + MetaFileScanUtil.CreateMetadataFunc createMetadataFunc = (file) -> FullDataMetaFile.createFromExistingFile(this, this.level, file); MetaFileScanUtil.AddUnloadedFileFunc addUnloadedFileFunc = (pos, file) -> { @@ -173,7 +173,7 @@ public class FullDataFileHandler implements IFullDataSourceProvider try { - metaFile = new FullDataMetaFile(this, this.level, fileToLoad); + metaFile = FullDataMetaFile.createFromExistingFile(this, this.level, fileToLoad); this.topDetailLevelRef.updateAndGet(oldDetailLevel -> Math.max(oldDetailLevel, pos.sectionDetailLevel)); this.metaFileBySectionPos.put(pos, metaFile); return metaFile; @@ -201,7 +201,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) { 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 6fe90ab5f..f1e8adfd7 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 @@ -34,6 +34,8 @@ import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.ChunkSizedF import com.seibel.distanthorizons.core.dataObjects.fullData.sources.interfaces.IFullDataSource; import com.seibel.distanthorizons.core.file.metaData.AbstractMetaDataContainerFile; import com.seibel.distanthorizons.core.file.metaData.BaseMetaData; +import com.seibel.distanthorizons.core.file.renderfile.RenderMetaDataFile; +import com.seibel.distanthorizons.core.level.IDhClientLevel; import com.seibel.distanthorizons.core.level.IDhLevel; import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; import com.seibel.distanthorizons.core.pos.DhLodPos; @@ -182,11 +184,11 @@ 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(); @@ -198,13 +200,14 @@ 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(); From ceda768f2ba6fba27a09642f055483e1fc11baa0 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Mon, 4 Sep 2023 11:05:02 -0500 Subject: [PATCH 41/49] Fix allowUnsafeValues localization typo --- core/src/main/resources/assets/distanthorizons/lang/en_us.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 bd549717e..da6229faa 100644 --- a/core/src/main/resources/assets/distanthorizons/lang/en_us.json +++ b/core/src/main/resources/assets/distanthorizons/lang/en_us.json @@ -387,7 +387,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": From 31faa9925a63d4371b4a3643e517a19a81a90f00 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Mon, 4 Sep 2023 17:17:44 -0500 Subject: [PATCH 42/49] refactor AbstractMetaDataContainerFile and FullDataMetaFile --- .../file/fullDatafile/FullDataMetaFile.java | 209 ++++++++++-------- .../AbstractMetaDataContainerFile.java | 62 +++--- 2 files changed, 153 insertions(+), 118 deletions(-) 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 f1e8adfd7..337c8660a 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 @@ -67,6 +67,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I public boolean genQueueChecked = false; private volatile boolean markedNeedUpdate = false; + private volatile boolean inCrit = false; public AbstractFullDataSourceLoader fullDataSourceLoader; public Class dataType; @@ -80,67 +81,13 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I private SoftReference cachedFullDataSource = 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=== 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<>(); @@ -228,7 +175,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I DebugRenderer.register(this); } - public void markNeedUpdate() { this.markedNeedUpdate = true; } + //==========// // get data // @@ -312,7 +259,8 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I })); } - 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() @@ -357,29 +305,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I return result.future; } - /** @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()); @@ -401,13 +327,15 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I { return new CacheQueryResult(dataSourceLoadFuture, false); } + + // attempt to get the cached data source IFullDataSource cachedFullDataSource = this.cachedFullDataSource.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); + CompletableFuture cas = AtomicsUtil.compareAndExchange(this.dataSourceLoadFutureRef, null, newFuture); if (cas == null) { return new CacheQueryResult(newFuture, true); @@ -420,7 +348,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I else { // The file is cached in RAM - boolean needUpdate = !this.writeQueueRef.get().queue.isEmpty() || markedNeedUpdate; + boolean needUpdate = !this.writeQueueRef.get().queue.isEmpty() || this.markedNeedUpdate; if (!needUpdate) { @@ -434,7 +362,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I // 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); + CompletableFuture compareAndSwapFuture = AtomicsUtil.compareAndExchange(this.dataSourceLoadFutureRef, null, future); if (compareAndSwapFuture != null) { // a write is already in progress, return its future. @@ -442,21 +370,22 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I } else { - LodUtil.assertTrue(!inCrit); - inCrit = true; + LodUtil.assertTrue(!this.inCrit); + this.inCrit = true; // don't continue if the provider has been shut down ExecutorService executorService = this.fullDataSourceProvider.getIOExecutor(); if (executorService.isTerminated()) { - inCrit = false; - dataSourceLoadFutureRef.set(null); + this.inCrit = false; + this.dataSourceLoadFutureRef.set(null); future.complete(null); } else { // write the queue to the data source by triggering an update - makeUpdateCompletionStage(future, CompletableFuture.supplyAsync(() -> cachedFullDataSource, executorService)); + this.makeUpdateCompletionStage(future, CompletableFuture.supplyAsync(() -> cachedFullDataSource, executorService)); } + return new CacheQueryResult(future, false); } } @@ -598,6 +527,9 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I } + public void markNeedUpdate() { this.markedNeedUpdate = true; } + + //===========// // debugging // @@ -624,4 +556,105 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I } } + @Override + public void debugRender(DebugRenderer debugRenderer) + { + if (this.pos.sectionDetailLevel > DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL) + { + return; + } + + IFullDataSource cached = this.cachedFullDataSource.get(); + if (this.markedNeedUpdate) + { + 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.markedNeedUpdate; + 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; + } + + + + //================// + // helper classes // + //================// + + 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; + } + + } + + //TODO: use ConcurrentAppendSingleSwapContainer instead of below: + private static class GuardedMultiAppendQueue + { + ReentrantReadWriteLock appendLock = new ReentrantReadWriteLock(); + ConcurrentLinkedQueue queue = new ConcurrentLinkedQueue<>(); + + } + } 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 b86ac480f..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 @@ -185,30 +185,9 @@ 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 { @@ -284,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 { @@ -316,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; } } From d98c052d0d3177ca0c7b44383132b39b2a8ba830 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Mon, 4 Sep 2023 17:55:57 -0500 Subject: [PATCH 43/49] RenderMetaDataFile null pointer fix --- .../core/file/renderfile/RenderMetaDataFile.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 b829c4c3f..0132d3836 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 @@ -217,6 +217,8 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements } else { + // load the existing Meta file and render source + CompletableFuture.supplyAsync(() -> { if (this.baseMetaData == null) @@ -342,7 +344,10 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements { try { - renderSource.updateFromRenderSource(newRenderSource); + if (newRenderSource != null) + { + renderSource.updateFromRenderSource(newRenderSource); + } // update the meta data this.baseMetaData.dataVersion.set(renderDataVersionRef.value); @@ -355,7 +360,7 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements } catch (Throwable e) { - LOGGER.error("Exception when writing render data to file: ", e); + LOGGER.error("Exception when writing render data to file: "+this.file, e); } } else if (!LodUtil.isInterruptOrReject(ex)) @@ -496,6 +501,7 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements if (oldFuture != null) { + // An update is already in progress, return its future. return oldFuture; } else From 8c7d640f377d68d35ef159931f040034bd450fbd Mon Sep 17 00:00:00 2001 From: James Seibel Date: Mon, 4 Sep 2023 18:02:43 -0500 Subject: [PATCH 44/49] temp --- .../core/file/fullDatafile/FullDataMetaFile.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) 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 337c8660a..6cd23e1af 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 @@ -23,7 +23,6 @@ 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; @@ -34,8 +33,6 @@ import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.ChunkSizedF import com.seibel.distanthorizons.core.dataObjects.fullData.sources.interfaces.IFullDataSource; import com.seibel.distanthorizons.core.file.metaData.AbstractMetaDataContainerFile; import com.seibel.distanthorizons.core.file.metaData.BaseMetaData; -import com.seibel.distanthorizons.core.file.renderfile.RenderMetaDataFile; -import com.seibel.distanthorizons.core.level.IDhClientLevel; import com.seibel.distanthorizons.core.level.IDhLevel; import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; import com.seibel.distanthorizons.core.pos.DhLodPos; @@ -78,7 +75,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I * When clearing, don't set to null, instead create a SoftReference containing null. * This will make null checks simpler. */ - private SoftReference cachedFullDataSource = new SoftReference<>(null); + private SoftReference cachedFullDataSourceRef = new SoftReference<>(null); private final AtomicReference> dataSourceLoadFutureRef = new AtomicReference<>(null); @@ -186,7 +183,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I public IFullDataSource getCachedDataSourceNowOrNull() { debugPhantomLifeCycleCheck(); - return this.cachedFullDataSource.get(); + return this.cachedFullDataSourceRef.get(); } private void makeUpdateCompletionStage(CompletableFuture completer, CompletableFuture currentStage) @@ -217,7 +214,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I ) ); - this.cachedFullDataSource = new SoftReference<>(fullDataSource); + this.cachedFullDataSourceRef = new SoftReference<>(fullDataSource); inCrit = false; dataSourceLoadFutureRef.set(null); completer.complete(fullDataSource); @@ -330,7 +327,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I // 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 @@ -564,7 +561,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I return; } - IFullDataSource cached = this.cachedFullDataSource.get(); + IFullDataSource cached = this.cachedFullDataSourceRef.get(); if (this.markedNeedUpdate) { debugRenderer.renderBox(new DebugRenderer.Box(this.pos, 80f, 96f, 0.05f, Color.red)); From 2cf798ed4ca3edae0d5fabb4833583dfa757fcf0 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Mon, 4 Sep 2023 18:11:02 -0500 Subject: [PATCH 45/49] Remove CacheQueryResult from FullDataMetaFile --- .../fullDatafile/FullDataFileHandler.java | 4 +- .../file/fullDatafile/FullDataMetaFile.java | 176 ++++++++---------- 2 files changed, 82 insertions(+), 98 deletions(-) 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 eb8315a4e..b2867daa8 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 @@ -130,7 +130,7 @@ public class FullDataFileHandler implements IFullDataSourceProvider // future wrapper necessary in order to handle file read errors CompletableFuture futureWrapper = new CompletableFuture<>(); - metaFile.loadOrGetCachedDataSourceAsync().exceptionally((e) -> + metaFile.getOrLoadCachedDataSourceAsync().exceptionally((e) -> { FullDataMetaFile newMetaFile = this.removeCorruptedFile(pos, metaFile, e); @@ -380,7 +380,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) -> { 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 6cd23e1af..1246eb254 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 @@ -64,7 +64,6 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I public boolean genQueueChecked = false; private volatile boolean markedNeedUpdate = false; - private volatile boolean inCrit = false; public AbstractFullDataSourceLoader fullDataSourceLoader; public Class dataType; @@ -188,9 +187,9 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I private void makeUpdateCompletionStage(CompletableFuture completer, CompletableFuture currentStage) { - currentStage.thenCompose( - (fullDataSource) -> { - markedNeedUpdate = false; + currentStage.thenCompose((fullDataSource) -> + { + this.markedNeedUpdate = false; return this.fullDataSourceProvider.onDataFileUpdate(fullDataSource, this, this::_updateAndWriteDataSource, this::_applyWriteQueueToFullDataSource); }) .whenComplete((fullDataSource, ex) -> @@ -206,7 +205,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I new DataObjSoftTracker(this, fullDataSource); } //LOGGER.info("Updated file "+this.file); - if (pos.sectionDetailLevel == DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL) + 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()), @@ -215,21 +214,21 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I ); this.cachedFullDataSourceRef = new SoftReference<>(fullDataSource); - inCrit = false; - dataSourceLoadFutureRef.set(null); + this.dataSourceLoadFutureRef.set(null); completer.complete(fullDataSource); if (this.markedNeedUpdate) { // trigger another update - this.loadOrGetCachedDataSourceAsync(); + this.getOrLoadCachedDataSourceAsync(); } }); } private void makeLoadCompletionStage(ExecutorService executorService, CompletableFuture completer) { - makeUpdateCompletionStage(completer, CompletableFuture.supplyAsync(() -> { + this.makeUpdateCompletionStage(completer, CompletableFuture.supplyAsync(() -> + { // Load the file. IFullDataSource fullDataSource; try (FileInputStream fileInputStream = this.getFileInputStream(); @@ -258,48 +257,62 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I - // 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() + public CompletableFuture getOrLoadCachedDataSourceAsync() { debugPhantomLifeCycleCheck(); - CacheQueryResult result = this.getCachedDataSourceAsync(); - - if (result.needsLoad) + CompletableFuture dataSourceLoadFuture = this.getCachedDataSourceAsync(); + if (dataSourceLoadFuture != null) { - LodUtil.assertTrue(!this.inCrit); - this.inCrit = true; + // return the in-process future + return dataSourceLoadFuture; + } + 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()) + dataSourceLoadFuture = new CompletableFuture<>(); + if (!this.dataSourceLoadFutureRef.compareAndSet(null, dataSourceLoadFuture)) { - this.inCrit = false; - this.dataSourceLoadFutureRef.set(null); - future.complete(null); - return future; - } - - // create a new Meta file - if (!this.doesFileExist) - { - this.makeCreateCompletionStage(future); - } - else - { - // Otherwise, load and update file - if (this.baseMetaData == null) - { - throw new IllegalStateException("Meta data not loaded!"); - } - - this.makeLoadCompletionStage(executorService, future); + // two threads attempted to start this job at the same time, only use the first future + dataSourceLoadFuture = this.dataSourceLoadFutureRef.get(); } } - return result.future; + + + if (!this.doesFileExist) + { + // create a new Meta file and data source + + this.makeCreateCompletionStage(dataSourceLoadFuture); + } + else + { + // load the existing Meta file and data source + + if (this.baseMetaData == null) + { + throw new IllegalStateException("Meta data not loaded!"); + } + + + ExecutorService executorService = this.fullDataSourceProvider.getIOExecutor(); + if (!executorService.isTerminated()) + { + // load the data source + this.makeLoadCompletionStage(executorService, dataSourceLoadFuture); + } + else + { + // don't load anything if the provider has been shut down + this.dataSourceLoadFutureRef.set(null); + dataSourceLoadFuture.complete(null); + return dataSourceLoadFuture; + } + } + + return dataSourceLoadFuture; } @@ -310,19 +323,14 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I 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; } @@ -330,60 +338,48 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I 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(this.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() || this.markedNeedUpdate; + // cached data exists - if (!needUpdate) + boolean dataNeedsUpdating = !this.writeQueueRef.get().queue.isEmpty() || this.markedNeedUpdate; + 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(this.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(!this.inCrit); - this.inCrit = true; - // don't continue if the provider has been shut down ExecutorService executorService = this.fullDataSourceProvider.getIOExecutor(); - if (executorService.isTerminated()) + if (!executorService.isTerminated()) { - this.inCrit = false; - this.dataSourceLoadFutureRef.set(null); - future.complete(null); + // write for the update to finish before returning the data source + this.makeUpdateCompletionStage(newFuture, CompletableFuture.supplyAsync(() -> cachedFullDataSource, executorService)); } else { - // write the queue to the data source by triggering an update - this.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; } } } @@ -436,7 +432,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I 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 { @@ -634,18 +630,6 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I // helper classes // //================// - 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; - } - - } - //TODO: use ConcurrentAppendSingleSwapContainer instead of below: private static class GuardedMultiAppendQueue { From cc16e21352d51f2eb7894e39151e9b7c21ad24f3 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Mon, 4 Sep 2023 18:12:09 -0500 Subject: [PATCH 46/49] Fix interface naming convention in MetaFileScanUtil --- .../file/fullDatafile/FullDataFileHandler.java | 6 +++--- .../file/renderfile/RenderSourceFileHandler.java | 6 +++--- .../core/util/MetaFileScanUtil.java | 14 +++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) 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 b2867daa8..359543b40 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 @@ -84,14 +84,14 @@ public class FullDataFileHandler implements IFullDataSourceProvider @Override public void addScannedFiles(Collection detectedFiles) { - MetaFileScanUtil.CreateMetadataFunc createMetadataFunc = (file) -> FullDataMetaFile.createFromExistingFile(this, this.level, file); + MetaFileScanUtil.ICreateMetadataFunc createMetadataFunc = (file) -> FullDataMetaFile.createFromExistingFile(this, this.level, file); - MetaFileScanUtil.AddUnloadedFileFunc addUnloadedFileFunc = (pos, file) -> + MetaFileScanUtil.IAddUnloadedFileFunc addUnloadedFileFunc = (pos, file) -> { this.unloadedFileBySectionPos.put(pos, file); this.topDetailLevelRef.updateAndGet(oldDetailLevel -> Math.max(oldDetailLevel, pos.sectionDetailLevel)); }; - MetaFileScanUtil.AddLoadedMetaFileFunc addLoadedMetaFileFunc = (pos, loadedMetaFile) -> + MetaFileScanUtil.IAddLoadedMetaFileFunc addLoadedMetaFileFunc = (pos, loadedMetaFile) -> { this.topDetailLevelRef.updateAndGet(oldDetailLevel -> Math.max(oldDetailLevel, pos.sectionDetailLevel)); this.metaFileBySectionPos.put(pos, (FullDataMetaFile) loadedMetaFile); 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 57d3e8987..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 @@ -93,14 +93,14 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider @Override public void addScannedFiles(Collection detectedFiles) { - MetaFileScanUtil.CreateMetadataFunc createMetadataFunc = (file) -> RenderMetaDataFile.createFromExistingFile(this.fullDataSourceProvider, this.clientLevel, file); + MetaFileScanUtil.ICreateMetadataFunc createMetadataFunc = (file) -> RenderMetaDataFile.createFromExistingFile(this.fullDataSourceProvider, this.clientLevel, file); - MetaFileScanUtil.AddUnloadedFileFunc addUnloadedFileFunc = (pos, file) -> + MetaFileScanUtil.IAddUnloadedFileFunc addUnloadedFileFunc = (pos, file) -> { this.unloadedFileBySectionPos.put(pos, file); this.topDetailLevelRef.updateAndGet(oldDetailLevel -> Math.max(oldDetailLevel, pos.sectionDetailLevel)); }; - MetaFileScanUtil.AddLoadedMetaFileFunc addLoadedMetaFileFunc = (pos, loadedMetaFile) -> + MetaFileScanUtil.IAddLoadedMetaFileFunc addLoadedMetaFileFunc = (pos, loadedMetaFile) -> { this.topDetailLevelRef.updateAndGet(oldDetailLevel -> Math.max(oldDetailLevel, pos.sectionDetailLevel)); this.metaFileBySectionPos.put(pos, (RenderMetaDataFile) loadedMetaFile); 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 index 18d002019..3b17c65f5 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/MetaFileScanUtil.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/MetaFileScanUtil.java @@ -104,8 +104,8 @@ public class MetaFileScanUtil */ public static void addScannedFiles( Collection detectedFiles, boolean useLazyLoading, String fileSuffix, - CreateMetadataFunc createMetadataFunc, - AddUnloadedFileFunc addUnloadedFileFunc, AddLoadedMetaFileFunc addLoadedMetaFileFunc) + ICreateMetadataFunc createMetadataFunc, + IAddUnloadedFileFunc addUnloadedFileFunc, IAddLoadedMetaFileFunc addLoadedMetaFileFunc) { if (useLazyLoading) { @@ -116,7 +116,7 @@ public class MetaFileScanUtil immediateAddScannedFile(detectedFiles, createMetadataFunc, addLoadedMetaFileFunc); } } - private static void lazyAddScannedFile(Collection detectedFiles, String fileSuffix, AddUnloadedFileFunc addUnloadedFileFunc) + private static void lazyAddScannedFile(Collection detectedFiles, String fileSuffix, IAddUnloadedFileFunc addUnloadedFileFunc) { for (File file : detectedFiles) { @@ -144,7 +144,7 @@ public class MetaFileScanUtil } private static void immediateAddScannedFile( Collection detectedFiles, - CreateMetadataFunc createMetadataFunc, AddLoadedMetaFileFunc addLoadedMetaFileFunc) + ICreateMetadataFunc createMetadataFunc, IAddLoadedMetaFileFunc addLoadedMetaFileFunc) { HashMultimap filesByPos = HashMultimap.create(); { // Sort files by pos. @@ -247,11 +247,11 @@ public class MetaFileScanUtil //===================// @FunctionalInterface - public interface CreateMetadataFunc { AbstractMetaDataContainerFile createFile(File file) throws IOException; } + public interface ICreateMetadataFunc { AbstractMetaDataContainerFile createFile(File file) throws IOException; } @FunctionalInterface - public interface AddUnloadedFileFunc { void addFile(DhSectionPos pos, File file); } + public interface IAddUnloadedFileFunc { void addFile(DhSectionPos pos, File file); } @FunctionalInterface - public interface AddLoadedMetaFileFunc { void addFile(DhSectionPos pos, AbstractMetaDataContainerFile metaFile); } + public interface IAddLoadedMetaFileFunc { void addFile(DhSectionPos pos, AbstractMetaDataContainerFile metaFile); } } From 65e6aa1aa01593414ee425d298d92cfc1b1fb05a Mon Sep 17 00:00:00 2001 From: James Seibel Date: Mon, 4 Sep 2023 18:32:58 -0500 Subject: [PATCH 47/49] Refactor AbstractFullDataSourceLoader phantom check/logging --- .../loader/AbstractFullDataSourceLoader.java | 18 +- .../fullDatafile/FullDataFileHandler.java | 2 +- .../file/fullDatafile/FullDataMetaFile.java | 170 ++++++++++-------- .../file/renderfile/RenderMetaDataFile.java | 3 +- 4 files changed, 109 insertions(+), 84 deletions(-) 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 2cae7d488..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 @@ -32,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; @@ -40,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 @@ -65,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/file/fullDatafile/FullDataFileHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataFileHandler.java index 359543b40..232280b58 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 @@ -525,7 +525,7 @@ public class FullDataFileHandler implements IFullDataSourceProvider //=========// @Override - public void close() { FullDataMetaFile.debugPhantomLifeCycleCheck(); } + public void close() { FullDataMetaFile.checkAndLogPhantomDataSourceLifeCycles(); } 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 1246eb254..7a5cc1bae 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 @@ -45,82 +45,52 @@ 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()); + // === 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(); + // =========================== + - private final IDhLevel level; - private final IFullDataSourceProvider fullDataSourceProvider; public boolean doesFileExist; - //TODO: Atm can't find a better way to store when genQueue is checked. public boolean genQueueChecked = false; + public AbstractFullDataSourceLoader fullDataSourceLoader; + public Class fullDataSourceClass; + + private volatile boolean markedNeedUpdate = false; - public AbstractFullDataSourceLoader fullDataSourceLoader; - public Class dataType; + 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 cachedFullDataSourceRef = new SoftReference<>(null); private final AtomicReference> dataSourceLoadFutureRef = new AtomicReference<>(null); - - // ===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); } - - } - // =========================== - - //==============// // constructors // @@ -134,7 +104,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I private FullDataMetaFile(IFullDataSourceProvider fullDataSourceProvider, IDhLevel level, DhSectionPos pos) throws IOException { super(fullDataSourceProvider.computeDataFilePath(pos), pos); - debugPhantomLifeCycleCheck(); + checkAndLogPhantomDataSourceLifeCycles(); this.fullDataSourceProvider = fullDataSourceProvider; this.level = level; @@ -153,7 +123,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I private FullDataMetaFile(IFullDataSourceProvider fullDataSourceProvider, IDhLevel level, File file) throws IOException, FileNotFoundException { super(file); - debugPhantomLifeCycleCheck(); + checkAndLogPhantomDataSourceLifeCycles(); this.fullDataSourceProvider = fullDataSourceProvider; this.level = level; @@ -167,7 +137,7 @@ 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); } @@ -177,12 +147,14 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I // 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.cachedFullDataSourceRef.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) @@ -204,6 +176,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I new DataObjTracker(fullDataSource); new DataObjSoftTracker(this, fullDataSource); } + //LOGGER.info("Updated file "+this.file); if (this.pos.sectionDetailLevel == DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL) DebugRenderer.makeParticle( @@ -259,7 +232,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I public CompletableFuture getOrLoadCachedDataSourceAsync() { - debugPhantomLifeCycleCheck(); + checkAndLogPhantomDataSourceLifeCycles(); CompletableFuture dataSourceLoadFuture = this.getCachedDataSourceAsync(); if (dataSourceLoadFuture != null) @@ -397,7 +370,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); @@ -427,7 +400,7 @@ 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(); + checkAndLogPhantomDataSourceLifeCycles(); boolean isEmpty = this.writeQueueRef.get().queue.isEmpty() && !markedNeedUpdate; if (!isEmpty) { @@ -467,7 +440,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(); @@ -528,24 +501,33 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I // debugging // //===========// - public static void debugPhantomLifeCycleCheck() + /** can be used to log when data sources have been garbage collected */ + public static void checkAndLogPhantomDataSourceLifeCycles() { - DataObjTracker phantom = (DataObjTracker) lifeCycleDebugQueue.poll(); - + DataObjTracker phantomRef = (DataObjTracker) LIFE_CYCLE_DEBUG_QUEUE.poll(); // wait for the tracker to be garbage collected(?) - while (phantom != null) + while (phantomRef != null) { - //LOGGER.info("Full Data at pos: "+phantom.pos+" has been freed. "+lifeCycleDebugSet.size()+" Full Data files remaining."); - phantom.close(); - phantom = (DataObjTracker) lifeCycleDebugQueue.poll(); + 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 soft = (DataObjSoftTracker) softRefDebugQueue.poll(); - while (soft != null) + + DataObjSoftTracker softRef = (DataObjSoftTracker) SOFT_REF_DEBUG_QUEUE.poll(); + while (softRef != null) { - //LOGGER.info("Full Data at pos: "+soft.file.pos+" has been soft released."); - soft.close(); - soft = (DataObjSoftTracker) softRefDebugQueue.poll(); + 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(); } } @@ -638,4 +620,46 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I } + /** used to debug data source soft reference garbage collection */ + private static class DataObjTracker extends PhantomReference implements Closeable + { + public final DhSectionPos pos; + + + DataObjTracker(IFullDataSource data) + { + super(data, LIFE_CYCLE_DEBUG_QUEUE); + + if (LOG_DATA_SOURCE_LIVES) + { + LOGGER.info("Phantom created on {}! count: {}", data.getSectionPos(), LIFE_CYCLE_DEBUG_SET.size()); + } + + LIFE_CYCLE_DEBUG_SET.add(this); + this.pos = data.getSectionPos(); + } + + @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) + { + 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/renderfile/RenderMetaDataFile.java b/core/src/main/java/com/seibel/distanthorizons/core/file/renderfile/RenderMetaDataFile.java index 0132d3836..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 @@ -52,6 +52,7 @@ 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(); @@ -65,7 +66,7 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements * 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); From 72ee85465510387c37412997803bafc8a20644b0 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Wed, 6 Sep 2023 17:36:52 -0500 Subject: [PATCH 48/49] Overhaul FullDataMetaFile async completion stages and write queue application --- .../fullDatafile/FullDataFileHandler.java | 23 +- .../file/fullDatafile/FullDataMetaFile.java | 393 ++++++++++-------- .../GeneratedFullDataFileHandler.java | 47 +-- .../fullDatafile/IFullDataSourceProvider.java | 29 +- 4 files changed, 262 insertions(+), 230 deletions(-) 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 232280b58..b892bc185 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 @@ -410,7 +410,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); @@ -445,27 +445,6 @@ public class FullDataFileHandler implements IFullDataSourceProvider return this.getLoadOrMakeFile(pos, true); } - @Override - public CompletableFuture onDataFileUpdate( - IFullDataSource source, FullDataMetaFile file, - Consumer onUpdated, Function updater) - { - boolean changed = updater.apply(source); - - if (source instanceof IIncompleteFullDataSource) - { - IFullDataSource newSource = ((IIncompleteFullDataSource) source).tryPromotingToCompleteDataSource(); - changed |= newSource != source; - source = newSource; - } - - if (changed) - { - onUpdated.accept(source); - } - return CompletableFuture.completedFuture(source); - } - //==========================// 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 7a5cc1bae..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 @@ -31,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; @@ -71,7 +72,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I public Class fullDataSourceClass; - private volatile boolean markedNeedUpdate = false; + private volatile boolean needsUpdate = false; private final IDhLevel level; private final IFullDataSourceProvider fullDataSourceProvider; @@ -157,108 +158,54 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I return this.cachedFullDataSourceRef.get(); } - private void makeUpdateCompletionStage(CompletableFuture completer, CompletableFuture currentStage) - { - currentStage.thenCompose((fullDataSource) -> - { - this.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 (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 - ) - ); - - this.cachedFullDataSourceRef = new SoftReference<>(fullDataSource); - this.dataSourceLoadFutureRef.set(null); - completer.complete(fullDataSource); - - if (this.markedNeedUpdate) - { - // trigger another update - this.getOrLoadCachedDataSourceAsync(); - } - }); - } - - private void makeLoadCompletionStage(ExecutorService executorService, CompletableFuture completer) - { - this.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; - })); - } - - public CompletableFuture getOrLoadCachedDataSourceAsync() { checkAndLogPhantomDataSourceLifeCycles(); - CompletableFuture dataSourceLoadFuture = this.getCachedDataSourceAsync(); - if (dataSourceLoadFuture != null) + CompletableFuture potentialLoadFuture = this.getCachedDataSourceAsync(); + if (potentialLoadFuture != null) { // return the in-process future - return dataSourceLoadFuture; + return potentialLoadFuture; } else { // there is no cached data, we'll have to load it - dataSourceLoadFuture = new CompletableFuture<>(); - if (!this.dataSourceLoadFutureRef.compareAndSet(null, dataSourceLoadFuture)) + potentialLoadFuture = new CompletableFuture<>(); + if (!this.dataSourceLoadFutureRef.compareAndSet(null, potentialLoadFuture)) { // two threads attempted to start this job at the same time, only use the first future - dataSourceLoadFuture = this.dataSourceLoadFutureRef.get(); + potentialLoadFuture = this.dataSourceLoadFutureRef.get(); } } + CompletableFuture dataSourceLoadFuture = potentialLoadFuture; if (!this.doesFileExist) { // create a new Meta file and data source - this.makeCreateCompletionStage(dataSourceLoadFuture); + 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 { @@ -274,13 +221,35 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I if (!executorService.isTerminated()) { // load the data source - this.makeLoadCompletionStage(executorService, dataSourceLoadFuture); + + 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 { - // don't load anything if the provider has been shut down - this.dataSourceLoadFutureRef.set(null); + // don't load anything if the provider has been shut down dataSourceLoadFuture.complete(null); + this.dataSourceLoadFutureRef.set(null); return dataSourceLoadFuture; } } @@ -289,12 +258,6 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I } - 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 returns null if {@link FullDataMetaFile#cachedFullDataSourceRef} is empty and no cached {@link IFullDataSource} exists. */ private CompletableFuture getCachedDataSourceAsync() @@ -318,7 +281,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I { // cached data exists - boolean dataNeedsUpdating = !this.writeQueueRef.get().queue.isEmpty() || this.markedNeedUpdate; + boolean dataNeedsUpdating = !this.writeQueueRef.get().queue.isEmpty() || this.needsUpdate; if (!dataNeedsUpdating) { // return the cached data @@ -342,8 +305,15 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I ExecutorService executorService = this.fullDataSourceProvider.getIOExecutor(); if (!executorService.isTerminated()) { - // write for the update to finish before returning the data source - this.makeUpdateCompletionStage(newFuture, CompletableFuture.supplyAsync(() -> cachedFullDataSource, executorService)); + // 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 { @@ -401,7 +371,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I public CompletableFuture flushAndSaveAsync() { checkAndLogPhantomDataSourceLifeCycles(); - boolean isEmpty = this.writeQueueRef.get().queue.isEmpty() && !markedNeedUpdate; + boolean isEmpty = this.writeQueueRef.get().queue.isEmpty() && !needsUpdate; if (!isEmpty) { // This will flush the data to disk. @@ -414,86 +384,11 @@ 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) - { - if (fullDataSource.isEmpty()) - { - // delete the empty data source - if (this.file.exists() && !this.file.delete()) - { - LOGGER.warn("Failed to delete data file at " + this.file); - } - this.doesFileExist = false; - } - else - { - // update the data source and write the new data to file - - //LOGGER.info("Saving data file of {}", data.getSectionPos()); - try - { - // Write/Update data - LodUtil.assertTrue(this.baseMetaData != null); - - this.baseMetaData.dataLevel = fullDataSource.getDataDetailLevel(); - this.fullDataSourceLoader = AbstractFullDataSourceLoader.getLoader(fullDataSource.getClass(), fullDataSource.getBinaryDataFormatVersion()); - LodUtil.assertTrue(this.fullDataSourceLoader != null, "No loader for " + fullDataSource.getClass() + " (v" + fullDataSource.getBinaryDataFormatVersion() + ")"); - - this.fullDataSourceClass = fullDataSource.getClass(); - this.baseMetaData.dataTypeId = (this.fullDataSourceLoader == null) ? 0 : this.fullDataSourceLoader.datatypeId; - this.baseMetaData.binaryDataFormatVersion = fullDataSource.getBinaryDataFormatVersion(); - - super.writeData((bufferedOutputStream) -> fullDataSource.writeToStream((bufferedOutputStream), this.level)); - this.doesFileExist = true; - } - 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); - } - catch (IOException e) - { - LOGGER.error("Failed to save updated data file at " + this.file + " for section " + this.pos, e); - } - } - } - - /** @return true if the queue was not empty and data was applied to the {@link IFullDataSource}. */ - private boolean _applyWriteQueueToFullDataSource(IFullDataSource fullDataSource) - { - // 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) - { - this._swapWriteQueue(); - 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 || !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; - } - public void markNeedUpdate() { this.markedNeedUpdate = true; } + + + public void markNeedsUpdate() { this.needsUpdate = true; } @@ -540,7 +435,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I } IFullDataSource cached = this.cachedFullDataSourceRef.get(); - if (this.markedNeedUpdate) + if (this.needsUpdate) { debugRenderer.renderBox(new DebugRenderer.Box(this.pos, 80f, 96f, 0.05f, Color.red)); } @@ -567,7 +462,7 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I color = Color.RED; } - boolean needsUpdate = !this.writeQueueRef.get().queue.isEmpty() || this.markedNeedUpdate; + boolean needsUpdate = !this.writeQueueRef.get().queue.isEmpty() || this.needsUpdate; if (needsUpdate) { color = color.darker().darker(); @@ -606,6 +501,158 @@ public class FullDataMetaFile extends AbstractMetaDataContainerFile implements I 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()) + { + // delete the empty data source + if (this.file.exists() && !this.file.delete()) + { + LOGGER.warn("Failed to delete data file at " + this.file); + } + this.doesFileExist = false; + } + else + { + // update the data source and write the new data to file + + //LOGGER.info("Saving data file of {}", data.getSectionPos()); + try + { + // Write/Update data + LodUtil.assertTrue(this.baseMetaData != null); + + this.baseMetaData.dataLevel = fullDataSource.getDataDetailLevel(); + this.fullDataSourceLoader = AbstractFullDataSourceLoader.getLoader(fullDataSource.getClass(), fullDataSource.getBinaryDataFormatVersion()); + LodUtil.assertTrue(this.fullDataSourceLoader != null, "No loader for " + fullDataSource.getClass() + " (v" + fullDataSource.getBinaryDataFormatVersion() + ")"); + + this.fullDataSourceClass = fullDataSource.getClass(); + this.baseMetaData.dataTypeId = (this.fullDataSourceLoader == null) ? 0 : this.fullDataSourceLoader.datatypeId; + this.baseMetaData.binaryDataFormatVersion = fullDataSource.getBinaryDataFormatVersion(); + + super.writeData((bufferedOutputStream) -> fullDataSource.writeToStream((bufferedOutputStream), this.level)); + this.doesFileExist = true; + } + 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); + } + catch (IOException e) + { + LOGGER.error("Failed to save updated data file at " + this.file + " for section " + this.pos, e); + } + } + } + //================// 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 76056359c..c2326c3cf 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 @@ -73,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 @@ -170,7 +170,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<>(); @@ -196,58 +196,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 8055e34a6..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 @@ -28,8 +28,6 @@ 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 { @@ -43,11 +41,34 @@ public interface IFullDataSourceProvider extends AutoCloseable //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; + } + } + } From 36fc6aaea33480ad8d909c8d32828cd8bc8ba077 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Wed, 6 Sep 2023 21:25:13 -0500 Subject: [PATCH 49/49] Reorganize SSAO config --- .../client/IDhApiAmbientOcclusionConfig.java | 68 +++++++++++++ .../config/client/IDhApiGraphicsConfig.java | 15 +-- .../client/DhApiAmbientOcclusionConfig.java | 64 ++++++++++++ .../config/client/DhApiGraphicsConfig.java | 30 +----- .../distanthorizons/core/config/Config.java | 99 ++++++++++++------- ...RenderQualityPresetConfigEventHandler.java | 4 +- .../core/render/renderer/LodRenderer.java | 3 +- .../render/renderer/shaders/SSAORenderer.java | 12 +-- .../assets/distanthorizons/lang/en_us.json | 49 ++++++--- 9 files changed, 241 insertions(+), 103 deletions(-) create mode 100644 api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiAmbientOcclusionConfig.java create mode 100644 core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiAmbientOcclusionConfig.java 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/IDhApiGraphicsConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiGraphicsConfig.java index b083c4eb8..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 @@ -40,6 +40,7 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup //===============// IDhApiFogConfig fog(); + IDhApiAmbientOcclusionConfig ambientOcclusion(); IDhApiNoiseTextureConfig noiseTexture(); @@ -84,20 +85,6 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup /** Modifies the quadratic function fake chunks use for horizontal quality drop-off. */ IDhApiConfigValue horizontalQuality(); - IDhApiConfigValue ambientOcclusion(); - - IDhApiConfigValue ambientOcclusion_SampleCount(); - - IDhApiConfigValue ambientOcclusion_Radius(); - - IDhApiConfigValue ambientOcclusion_Strength(); - - IDhApiConfigValue ambientOcclusion_Bias(); - - IDhApiConfigValue ambientOcclusion_MinLight(); - - IDhApiConfigValue ambientOcclusion_BlurRadius(); - IDhApiConfigValue transparency(); /** Defines what blocks won't be rendered as LODs. */ 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/DhApiGraphicsConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGraphicsConfig.java index 3e7943751..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 @@ -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,34 +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 ambientOcclusion_SampleCount() - { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.ssaoSampleCount); } - - @Override - public IDhApiConfigValue ambientOcclusion_Radius() - { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.ssaoRadius); } - - @Override - public IDhApiConfigValue ambientOcclusion_Strength() - { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.ssaoStrength); } - - @Override - public IDhApiConfigValue ambientOcclusion_Bias() - { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.ssaoBias); } - - @Override - public IDhApiConfigValue ambientOcclusion_MinLight() - { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.ssaoMinLight); } - - @Override - public IDhApiConfigValue ambientOcclusion_BlurRadius() - { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.ssaoBlurRadius); } - @Override public IDhApiConfigValue transparency() { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.transparency); } 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 6d6ddece6..4cc2a1d77 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 @@ -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,41 +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 ssaoSampleCount = new ConfigEntry.Builder() - .set(6) - .comment("Number of samples to use for Screen Space Ambient Occlusion") - .build(); - - public static ConfigEntry ssaoRadius = new ConfigEntry.Builder() - .set(4.0) - .comment("Radius of Screen Space Ambient Occlusion effect in blocks") - .build(); - - public static ConfigEntry ssaoStrength = new ConfigEntry.Builder() - .set(0.2) - .comment("Strength of Screen Space Ambient Occlusion effect") - .build(); - - public static ConfigEntry ssaoBias = new ConfigEntry.Builder() - .set(0.02) - .comment("Bias of Screen Space Ambient Occlusion effect") - .build(); - - public static ConfigEntry ssaoMinLight = new ConfigEntry.Builder() - .set(0.25) - .comment("Minimum brightness of Screen Space Ambient Occlusion effect") - .build(); - - public static ConfigEntry ssaoBlurRadius = new ConfigEntry.Builder() - .set(2) - .comment("Radius in pixels of Screen Space Ambient Occlusion blurring") - .build(); - public static ConfigEntry horizontalQuality = new ConfigEntry.Builder() .set(EHorizontalQuality.MEDIUM) .comment("" @@ -473,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() @@ -549,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("" 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 bc8808689..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 @@ -76,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); @@ -100,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/render/renderer/LodRenderer.java b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/LodRenderer.java index 00b2cc1c7..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 @@ -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/shaders/SSAORenderer.java b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/shaders/SSAORenderer.java index 926a2e8b1..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 @@ -212,12 +212,12 @@ public class SSAORenderer Mat4f invertedPerspective = new Mat4f(perspective); invertedPerspective.invert(); - int sampleCount = Config.Client.Advanced.Graphics.Quality.ssaoSampleCount.get(); - int blurRadius = Config.Client.Advanced.Graphics.Quality.ssaoBlurRadius.get(); - float radius = Config.Client.Advanced.Graphics.Quality.ssaoRadius.get().floatValue(); - float strength = Config.Client.Advanced.Graphics.Quality.ssaoStrength.get().floatValue(); - float minLight = Config.Client.Advanced.Graphics.Quality.ssaoMinLight.get().floatValue(); - float bias = Config.Client.Advanced.Graphics.Quality.ssaoBias.get().floatValue(); + 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); 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 a0f378a23..dbcfd896a 100644 --- a/core/src/main/resources/assets/distanthorizons/lang/en_us.json +++ b/core/src/main/resources/assets/distanthorizons/lang/en_us.json @@ -94,22 +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.ssaoSampleCount": - "SSAO Sample Count", - "distanthorizons.config.client.advanced.graphics.quality.ssaoRadius": - "SSAO Radius", - "distanthorizons.config.client.advanced.graphics.quality.ssaoStrength": - "SSAO Strength", - "distanthorizons.config.client.advanced.graphics.quality.ssaoMinLight": - "SSAO Min Light", - "distanthorizons.config.client.advanced.graphics.quality.ssaoBias": - "SSAO Bias", - "distanthorizons.config.client.advanced.graphics.quality.ssaoBlurRadius": - "SSAO Blur Radius", "distanthorizons.config.client.advanced.graphics.quality.horizontalQuality": "Horizontal Quality", "distanthorizons.config.client.advanced.graphics.quality.horizontalQuality.@tooltip": @@ -175,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":