Compare commits
78 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3f37f7f02a | |||
| a88feda9ec | |||
| 07b7ecb30a | |||
| 32bbe487c0 | |||
| b367e5c3aa | |||
| a43b2b69a6 | |||
| 2a1de6f579 | |||
| 7dadff4219 | |||
| 07c53a02ca | |||
| 1e54885d88 | |||
| 68f4084ab0 | |||
| 6fa968e016 | |||
| 93c2078724 | |||
| 2289d898ce | |||
| 15e5a04ffd | |||
| 150ba98a4e | |||
| d9484c9df4 | |||
| a92e09c2be | |||
| f7e1dc378f | |||
| f7b84b1909 | |||
| abae2f6358 | |||
| e83939f1b2 | |||
| 0bddc2dcac | |||
| 42a8e0e0f0 | |||
| 7b77e07a7d | |||
| db17d27823 | |||
| 362b800f25 | |||
| 29e26d659d | |||
| afa658cc00 | |||
| cde0d466dd | |||
| 4031b55630 | |||
| 86e07156d1 | |||
| 1e8df274ee | |||
| f0153cc4a6 | |||
| 3044c238fd | |||
| ead58390cd | |||
| 504d22ff37 | |||
| cc42f8667f | |||
| 6135b3ce7f | |||
| 3c8efa17d5 | |||
| dccae0aea0 | |||
| 2728236ced | |||
| 76ce1d6b21 | |||
| 94ddebaec0 | |||
| cec165176b | |||
| 99ad837441 | |||
| f8be132ba2 | |||
| 122f5431a6 | |||
| c2884954a4 | |||
| 3a0453c8c5 | |||
| 9d241ab175 | |||
| ee7eed8d3c | |||
| 1125452a8f | |||
| a3712c8f72 | |||
| e2022fab2d | |||
| bcea1be19b | |||
| 8d799203c5 | |||
| 980ce2f2af | |||
| c6bea3faa3 | |||
| 7707f55b25 | |||
| f087bb7182 | |||
| bf269c9abf | |||
| a8c7405f9d | |||
| 43c9232e7e | |||
| 8351c58d7b | |||
| aa86381b80 | |||
| 563840ca58 | |||
| b5b9b688c3 | |||
| 3731223087 | |||
| 72d770c0f3 | |||
| ee4b83fa99 | |||
| ee6e3a9876 | |||
| f84570a6fc | |||
| a0f5af46a2 | |||
| 18074f15f5 | |||
| bba0424c6d | |||
| 282f6cfbb8 | |||
| b97b1b61b7 |
+4
-1
@@ -50,4 +50,7 @@ classes/
|
|||||||
Merged/
|
Merged/
|
||||||
|
|
||||||
# file from notepad++
|
# file from notepad++
|
||||||
*.bak
|
*.bak
|
||||||
|
|
||||||
|
# file genearated via MC version switching using preprocessor
|
||||||
|
build.properties
|
||||||
+29
-43
@@ -3,13 +3,10 @@ image: gradle:eclipse-temurin
|
|||||||
|
|
||||||
# all stages need to be defined here
|
# all stages need to be defined here
|
||||||
stages:
|
stages:
|
||||||
- build_18-1
|
- build_18_1
|
||||||
- build_18-2
|
- build_18_2
|
||||||
# - zip_artifacts
|
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
# If we have correctness issues when compiling this can be set to false
|
|
||||||
GRADLE_OPTS: "-Dorg.gradle.daemon=true"
|
|
||||||
# Pull core when building
|
# Pull core when building
|
||||||
GIT_SUBMODULE_STRATEGY: recursive
|
GIT_SUBMODULE_STRATEGY: recursive
|
||||||
|
|
||||||
@@ -20,59 +17,47 @@ before_script:
|
|||||||
- echo GE_JOB_ID=$CI_JOB_ID >> generate_jars.env
|
- echo GE_JOB_ID=$CI_JOB_ID >> generate_jars.env
|
||||||
|
|
||||||
|
|
||||||
# 1.18.1 build
|
# 1.18.1 build
|
||||||
build_18-1:
|
build_18_1:
|
||||||
stage: build_18-1
|
stage: build_18_1
|
||||||
script: ./gradlew build -PmcVer=1.18.1 --gradle-user-home cache/; ./gradlew merge --gradle-user-home cache/
|
script:
|
||||||
|
- ./gradlew deleteMerged --gradle-user-home cache/; # make sure any previously merged jars are removed before running this job
|
||||||
|
- ./gradlew build -PmcVer=1.18.1 --gradle-user-home cache/;
|
||||||
|
- ./gradlew merge --gradle-user-home cache/;
|
||||||
# build using Java 17
|
# build using Java 17
|
||||||
image: eclipse-temurin:17
|
image: eclipse-temurin:17
|
||||||
|
artifacts:
|
||||||
|
name: "Merged_NightlyBuild_1_18_1-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}"
|
||||||
|
paths:
|
||||||
|
# relative to the root directory
|
||||||
|
- Merged
|
||||||
|
expire_in: 1 day
|
||||||
cache:
|
cache:
|
||||||
key: "$CI_COMMIT_REF_NAME_18-1"
|
key: "gradleCache"
|
||||||
policy: pull-push
|
policy: pull-push
|
||||||
paths:
|
paths:
|
||||||
- .gradle
|
- .gradle
|
||||||
- cache/
|
- cache/
|
||||||
|
|
||||||
|
|
||||||
# 1.18.2 build
|
# 1.18.2 build
|
||||||
build_18-2:
|
build_18_2:
|
||||||
stage: build_18-2
|
stage: build_18_2
|
||||||
script: ./gradlew build -PmcVer=1.18.2 --gradle-user-home cache/; ./gradlew merge --gradle-user-home cache/
|
script:
|
||||||
# build using Java 17
|
- ./gradlew deleteMerged --gradle-user-home cache/;
|
||||||
|
- ./gradlew build -PmcVer=1.18.2 --gradle-user-home cache/;
|
||||||
|
- ./gradlew merge --gradle-user-home cache/;
|
||||||
image: eclipse-temurin:17
|
image: eclipse-temurin:17
|
||||||
|
artifacts:
|
||||||
|
name: "Merged_NightlyBuild_1_18_2-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}"
|
||||||
|
paths:
|
||||||
|
- Merged
|
||||||
|
expire_in: 1 day
|
||||||
cache:
|
cache:
|
||||||
key: "$CI_COMMIT_REF_NAME_18-2"
|
key: "gradleCache"
|
||||||
policy: pull-push
|
policy: pull-push
|
||||||
paths:
|
paths:
|
||||||
- .gradle
|
- .gradle
|
||||||
- cache/
|
- cache/
|
||||||
|
|
||||||
# TEMPORARY, there should be a way of either generating artifacts per build or in a separate stage
|
|
||||||
artifacts:
|
|
||||||
# This should only be done after the last build, otherwise there will be duplicate jars
|
|
||||||
name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}"
|
|
||||||
paths:
|
|
||||||
# relative to the root directory
|
|
||||||
- Merged
|
|
||||||
expire_in: 1 day
|
|
||||||
|
|
||||||
|
|
||||||
# # put artifacts in a zip
|
|
||||||
# # This should only be done after all the builds have been completed
|
|
||||||
# zip_artifacts:
|
|
||||||
# stage: zip_artifacts
|
|
||||||
# # The complier complains if we don't do something with the script line
|
|
||||||
# script: echo 'Building complete. Creating artifact Zip.'
|
|
||||||
# # build using Java 17
|
|
||||||
# image: eclipse-temurin:17
|
|
||||||
# artifacts:
|
|
||||||
# # This should only be done after the last build, otherwise there will be duplicate jars
|
|
||||||
# name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}"
|
|
||||||
# paths:
|
|
||||||
# # relative to the root directory
|
|
||||||
# - Merged
|
|
||||||
# expire_in: 1 day
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# unused deployment stage
|
# unused deployment stage
|
||||||
@@ -98,3 +83,4 @@ build_18-2:
|
|||||||
# url: 'https://gitlab.com/jeseibel/minecraft-lod-mod/cw/-/jobs/${GE_JOB_ID}/artifacts/file/fabric/build/libs'
|
# url: 'https://gitlab.com/jeseibel/minecraft-lod-mod/cw/-/jobs/${GE_JOB_ID}/artifacts/file/fabric/build/libs'
|
||||||
# - name: 'Forge Jars'
|
# - name: 'Forge Jars'
|
||||||
# url: 'https://gitlab.com/jeseibel/minecraft-lod-mod/cw/-/jobs/${GE_JOB_ID}/artifacts/file/forge/build/libs'
|
# url: 'https://gitlab.com/jeseibel/minecraft-lod-mod/cw/-/jobs/${GE_JOB_ID}/artifacts/file/forge/build/libs'
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ fabric_api_version=0.46.6+1.18
|
|||||||
# Fabric mod versions
|
# Fabric mod versions
|
||||||
modmenu_version=3.0.1
|
modmenu_version=3.0.1
|
||||||
starlight_version_fabric=3554912
|
starlight_version_fabric=3554912
|
||||||
|
phosphor_version_fabric=3573395
|
||||||
lithium_version=mc1.18.1-0.7.7
|
lithium_version=mc1.18.1-0.7.7
|
||||||
sodium_version=3605309
|
sodium_version=3605309
|
||||||
iris_version=1.18.x-v1.1.4
|
iris_version=1.18.x-v1.1.4
|
||||||
@@ -20,6 +21,7 @@ fabric_api_version=0.46.6+1.18
|
|||||||
# 1 = Can be referenced in code but doesn't run
|
# 1 = Can be referenced in code but doesn't run
|
||||||
# 2 = Can be referenced in code and runs in client
|
# 2 = Can be referenced in code and runs in client
|
||||||
enable_starlight=0
|
enable_starlight=0
|
||||||
|
enable_phosphor=0
|
||||||
enable_sodium=1
|
enable_sodium=1
|
||||||
enable_lithium=0
|
enable_lithium=0
|
||||||
enable_iris=0
|
enable_iris=0
|
||||||
|
|||||||
+3
-1
@@ -10,6 +10,7 @@ fabric_api_version=0.48.0+1.18.2
|
|||||||
# Fabric mod versions
|
# Fabric mod versions
|
||||||
modmenu_version=3.1.0
|
modmenu_version=3.1.0
|
||||||
starlight_version_fabric=3667443
|
starlight_version_fabric=3667443
|
||||||
|
phosphor_version_fabric=3573395
|
||||||
lithium_version=mc1.18.2-0.7.9
|
lithium_version=mc1.18.2-0.7.9
|
||||||
sodium_version=3669187
|
sodium_version=3669187
|
||||||
iris_version=1.18.x-v1.2.2
|
iris_version=1.18.x-v1.2.2
|
||||||
@@ -21,6 +22,7 @@ fabric_api_version=0.48.0+1.18.2
|
|||||||
# 1 = Can be referenced in code but doesn't run
|
# 1 = Can be referenced in code but doesn't run
|
||||||
# 2 = Can be referenced in code and runs in client
|
# 2 = Can be referenced in code and runs in client
|
||||||
enable_starlight=0
|
enable_starlight=0
|
||||||
|
enable_phosphor=0
|
||||||
enable_sodium=1
|
enable_sodium=1
|
||||||
enable_lithium=0
|
enable_lithium=0
|
||||||
enable_iris=0
|
enable_iris=0
|
||||||
@@ -32,7 +34,7 @@ forge_version=40.0.18
|
|||||||
starlight_version_forge=0
|
starlight_version_forge=0
|
||||||
|
|
||||||
# Forge mod run
|
# Forge mod run
|
||||||
# 0 = Dont enable and don't run
|
# 0 = Don't enable and don't run
|
||||||
# 1 = Can be referenced in code but doesn't run
|
# 1 = Can be referenced in code but doesn't run
|
||||||
# 2 = Can be referenced in code and runs in client
|
# 2 = Can be referenced in code and runs in client
|
||||||
enable_starlight_forge=0
|
enable_starlight_forge=0
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# THIS VERSION IS NO LONGER MAINTAINED! ALL DEVELOPMENT HAVE BEEN MOVED OVER TO THE MAIN BRANCH
|
||||||
|
|
||||||
# <img src="https://gitlab.com/jeseibel/distant-horizons-core/-/raw/main/_logo%20files/LOD%20logo%20flat%20-%20with%20boarder.png" width="32"> Distant Horizons
|
# <img src="https://gitlab.com/jeseibel/distant-horizons-core/-/raw/main/_logo%20files/LOD%20logo%20flat%20-%20with%20boarder.png" width="32"> Distant Horizons
|
||||||
|
|
||||||
> A mod that adds a Level of Detail System to Minecraft
|
> A mod that adds a Level of Detail System to Minecraft
|
||||||
@@ -80,7 +82,7 @@ If running on IDE, to ensure IDE pickup the changed versions, you will need to r
|
|||||||
6. The compiled jar file will be in the folder `Merged`
|
6. The compiled jar file will be in the folder `Merged`
|
||||||
|
|
||||||
**If in terminal:**
|
**If in terminal:**
|
||||||
1. `git clone -b preprocessor_test --recurse-submodules https://gitlab.com/jeseibel/minecraft-lod-mod.git`
|
1. `git clone -b 1.18.X --recurse-submodules https://gitlab.com/jeseibel/minecraft-lod-mod.git`
|
||||||
2. `cd minecraft-lod-mod`
|
2. `cd minecraft-lod-mod`
|
||||||
3. `./gradlew assemble`
|
3. `./gradlew assemble`
|
||||||
4. `./gradlew mergeJars`
|
4. `./gradlew mergeJars`
|
||||||
|
|||||||
+27
-1
@@ -180,10 +180,17 @@ allprojects { p ->
|
|||||||
// def excapedMCVersion = rootProject.minecraft_version.replace(".", "_")
|
// def excapedMCVersion = rootProject.minecraft_version.replace(".", "_")
|
||||||
// options.compilerArgs += ['-Xplugin:Manifold', "-AMC_VERSION_${excapedMCVersion}"]
|
// options.compilerArgs += ['-Xplugin:Manifold', "-AMC_VERSION_${excapedMCVersion}"]
|
||||||
//
|
//
|
||||||
options.compilerArgs += ['-Xplugin:Manifold']
|
//options.compilerArgs += ['-deprecation']
|
||||||
|
//options.compilerArgs += ['-verbose']
|
||||||
|
//options.compilerArgs += ['-Xlint:unchecked']
|
||||||
|
//options.compilerArgs += ['-Xdiags:verbose']
|
||||||
|
//options.compilerArgs += ['-Xprint']
|
||||||
|
//options.compilerArgs += ['-XprintProcessorInfo']
|
||||||
|
//options.compilerArgs += ['-XprintRounds']
|
||||||
|
|
||||||
// println options.compilerArgs
|
// println options.compilerArgs
|
||||||
if (p != project(":core")) {
|
if (p != project(":core")) {
|
||||||
|
options.compilerArgs += ['-Xplugin:Manifold']
|
||||||
options.release = rootProject.java_version as Integer
|
options.release = rootProject.java_version as Integer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -196,4 +203,23 @@ allprojects { p ->
|
|||||||
runClient.enabled = false
|
runClient.enabled = false
|
||||||
runServer.enabled = false
|
runServer.enabled = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// this is necessary for running the fabric build
|
||||||
|
if (p == project(":common")) {
|
||||||
|
println "Coping [common/src/main/resources/lod.accesswidner] to [fabric/build/resources/main]."
|
||||||
|
|
||||||
|
copy {
|
||||||
|
from "$rootProject.rootDir/common/src/main/resources"
|
||||||
|
into "$rootProject.rootDir/fabric/build/resources/main"
|
||||||
|
include "*.accesswidener"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// this deletes the merged folder so we don't carry over
|
||||||
|
// the previous merges to each new build job in the CI/CD pipeline
|
||||||
|
task deleteMerged(type: Delete) {
|
||||||
|
delete files("./Merged")
|
||||||
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
MC_VERSION_1_18_2=
|
|
||||||
@@ -29,6 +29,8 @@ import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton.I
|
|||||||
import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton.IClient.IGraphics.IFogQuality.IAdvancedFog.IHeightFog;
|
import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton.IClient.IGraphics.IFogQuality.IAdvancedFog.IHeightFog;
|
||||||
import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton.IClient.IMultiplayer;
|
import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton.IClient.IMultiplayer;
|
||||||
import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton.IClient.IWorldGenerator;
|
import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton.IClient.IWorldGenerator;
|
||||||
|
import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton.IClient.IAdvanced;
|
||||||
|
import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton.IClient.IAdvanced.IDebugging.*;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -257,7 +259,12 @@ public class Config
|
|||||||
public static String _vanillaOverdraw = IAdvancedGraphics.VANILLA_OVERDRAW_DESC;
|
public static String _vanillaOverdraw = IAdvancedGraphics.VANILLA_OVERDRAW_DESC;
|
||||||
@ConfigAnnotations.Entry
|
@ConfigAnnotations.Entry
|
||||||
public static VanillaOverdraw vanillaOverdraw = IAdvancedGraphics.VANILLA_OVERDRAW_DEFAULT;
|
public static VanillaOverdraw vanillaOverdraw = IAdvancedGraphics.VANILLA_OVERDRAW_DEFAULT;
|
||||||
|
|
||||||
|
@ConfigAnnotations.FileComment
|
||||||
|
public static String _overdrawOffset = IAdvancedGraphics.OVERDRAW_OFFSET_DESC;
|
||||||
|
@ConfigAnnotations.Entry(minValue = -16, maxValue = 16)
|
||||||
|
public static int overdrawOffset = IAdvancedGraphics.OVERDRAW_OFFSET_MIN_DEFAULT_MAX.defaultValue;
|
||||||
|
|
||||||
@ConfigAnnotations.FileComment
|
@ConfigAnnotations.FileComment
|
||||||
public static String _useExtendedNearClipPlane = IAdvancedGraphics.USE_EXTENDED_NEAR_CLIP_PLANE_DESC;
|
public static String _useExtendedNearClipPlane = IAdvancedGraphics.USE_EXTENDED_NEAR_CLIP_PLANE_DESC;
|
||||||
@ConfigAnnotations.Entry
|
@ConfigAnnotations.Entry
|
||||||
@@ -272,7 +279,17 @@ public class Config
|
|||||||
public static String _saturationMultiplier = IAdvancedGraphics.SATURATION_MULTIPLIER_DESC;
|
public static String _saturationMultiplier = IAdvancedGraphics.SATURATION_MULTIPLIER_DESC;
|
||||||
@ConfigAnnotations.Entry
|
@ConfigAnnotations.Entry
|
||||||
public static double saturationMultiplier = IAdvancedGraphics.SATURATION_MULTIPLIER_DEFAULT;
|
public static double saturationMultiplier = IAdvancedGraphics.SATURATION_MULTIPLIER_DEFAULT;
|
||||||
|
|
||||||
|
@ConfigAnnotations.FileComment
|
||||||
|
public static String _enableCaveCulling = IAdvancedGraphics.ENABLE_CAVE_CULLING_DESC;
|
||||||
|
@ConfigAnnotations.Entry
|
||||||
|
public static boolean enableCaveCulling = IAdvancedGraphics.ENABLE_CAVE_CULLING_DEFAULT;
|
||||||
|
|
||||||
|
@ConfigAnnotations.FileComment
|
||||||
|
public static String _caveCullingHeight = IAdvancedGraphics.CAVE_CULLING_HEIGHT_DESC;
|
||||||
|
@ConfigAnnotations.Entry(minValue = -4096, maxValue = 4096)
|
||||||
|
public static int caveCullingHeight = IAdvancedGraphics.CAVE_CULLING_HEIGHT_MIN_DEFAULT_MAX.defaultValue;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ConfigAnnotations.FileComment
|
@ConfigAnnotations.FileComment
|
||||||
public static String _backsideCullingRange = IAdvancedGraphics.VANILLA_CULLING_RANGE_DESC;
|
public static String _backsideCullingRange = IAdvancedGraphics.VANILLA_CULLING_RANGE_DESC;
|
||||||
@@ -329,8 +346,8 @@ public class Config
|
|||||||
|
|
||||||
@ConfigAnnotations.FileComment
|
@ConfigAnnotations.FileComment
|
||||||
public static String _multiDimensionRequiredSimilarity = IMultiplayer.MULTI_DIMENSION_REQUIRED_SIMILARITY_DESC;
|
public static String _multiDimensionRequiredSimilarity = IMultiplayer.MULTI_DIMENSION_REQUIRED_SIMILARITY_DESC;
|
||||||
@ConfigAnnotations.Entry
|
@ConfigAnnotations.Entry(minValue = 0.0, maxValue = 1.0)
|
||||||
public static double multiDimensionRequiredSimilarity = IMultiplayer.MULTI_DIMENSION_REQUIRED_SIMILARITY_DEFAULT;
|
public static double multiDimensionRequiredSimilarity = IMultiplayer.MULTI_DIMENSION_REQUIRED_SIMILARITY_MIN_DEFAULT_MAX.defaultValue;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -345,8 +362,13 @@ public class Config
|
|||||||
|
|
||||||
@ConfigAnnotations.ScreenEntry
|
@ConfigAnnotations.ScreenEntry
|
||||||
public static Buffers buffers;
|
public static Buffers buffers;
|
||||||
|
|
||||||
|
@ConfigAnnotations.FileComment
|
||||||
|
public static String _lodOnlyMode = IAdvanced.LOD_ONLY_MODE_DESC;
|
||||||
|
@ConfigAnnotations.Entry
|
||||||
|
public static boolean lodOnlyMode = IAdvanced.LOD_ONLY_MODE_DEFAULT;
|
||||||
|
|
||||||
|
|
||||||
public static class Threading
|
public static class Threading
|
||||||
{
|
{
|
||||||
@ConfigAnnotations.FileComment
|
@ConfigAnnotations.FileComment
|
||||||
@@ -364,9 +386,9 @@ public class Config
|
|||||||
public static class Debugging
|
public static class Debugging
|
||||||
{
|
{
|
||||||
@ConfigAnnotations.FileComment
|
@ConfigAnnotations.FileComment
|
||||||
public static String _drawLods = IDebugging.DRAW_LODS_DESC;
|
public static String _rendererType = IDebugging.RENDERER_TYPE_DESC;
|
||||||
@ConfigAnnotations.Entry
|
@ConfigAnnotations.Entry
|
||||||
public static boolean drawLods = IDebugging.DRAW_LODS_DEFAULT;
|
public static RendererType rendererType = IDebugging.RENDERER_TYPE_DEFAULT;
|
||||||
|
|
||||||
@ConfigAnnotations.FileComment
|
@ConfigAnnotations.FileComment
|
||||||
public static String _debugMode = IDebugging.DEBUG_MODE_DESC;
|
public static String _debugMode = IDebugging.DEBUG_MODE_DESC;
|
||||||
@@ -377,6 +399,67 @@ public class Config
|
|||||||
public static String _enableDebugKeybindings = IDebugging.DEBUG_KEYBINDINGS_ENABLED_DESC;
|
public static String _enableDebugKeybindings = IDebugging.DEBUG_KEYBINDINGS_ENABLED_DESC;
|
||||||
@ConfigAnnotations.Entry
|
@ConfigAnnotations.Entry
|
||||||
public static boolean enableDebugKeybindings = IDebugging.DEBUG_KEYBINDINGS_ENABLED_DEFAULT;
|
public static boolean enableDebugKeybindings = IDebugging.DEBUG_KEYBINDINGS_ENABLED_DEFAULT;
|
||||||
|
|
||||||
|
@ConfigAnnotations.ScreenEntry
|
||||||
|
public static DebugSwitch debugSwitch;
|
||||||
|
|
||||||
|
public static class DebugSwitch {
|
||||||
|
/* The logging switches available:
|
||||||
|
* WorldGenEvent
|
||||||
|
* WorldGenPerformance
|
||||||
|
* WorldGenLoadEvent
|
||||||
|
* LodBuilderEvent
|
||||||
|
* RendererBufferEvent
|
||||||
|
* RendererGLEvent
|
||||||
|
* FileReadWriteEvent
|
||||||
|
* FileSubDimEvent
|
||||||
|
* NetworkEvent //NOT IMPL YET
|
||||||
|
*/
|
||||||
|
@ConfigAnnotations.FileComment
|
||||||
|
public static String _logWorldGenEvent = IDebugSwitch.LOG_WORLDGEN_EVENT_DESC;
|
||||||
|
@ConfigAnnotations.Entry
|
||||||
|
public static LoggerMode logWorldGenEvent = IDebugSwitch.LOG_WORLDGEN_EVENT_DEFAULT;
|
||||||
|
|
||||||
|
@ConfigAnnotations.FileComment
|
||||||
|
public static String _logWorldGenPerformance = IDebugSwitch.LOG_WORLDGEN_PERFORMANCE_DESC;
|
||||||
|
@ConfigAnnotations.Entry
|
||||||
|
public static LoggerMode logWorldGenPerformance = IDebugSwitch.LOG_WORLDGEN_PERFORMANCE_DEFAULT;
|
||||||
|
|
||||||
|
@ConfigAnnotations.FileComment
|
||||||
|
public static String _logWorldGenLoadEvent = IDebugSwitch.LOG_WORLDGEN_LOAD_EVENT_DESC;
|
||||||
|
@ConfigAnnotations.Entry
|
||||||
|
public static LoggerMode logWorldGenLoadEvent = IDebugSwitch.LOG_WORLDGEN_LOAD_EVENT_DEFAULT;
|
||||||
|
|
||||||
|
@ConfigAnnotations.FileComment
|
||||||
|
public static String _logLodBuilderEvent = IDebugSwitch.LOG_LODBUILDER_EVENT_DESC;
|
||||||
|
@ConfigAnnotations.Entry
|
||||||
|
public static LoggerMode logLodBuilderEvent = IDebugSwitch.LOG_LODBUILDER_EVENT_DEFAULT;
|
||||||
|
|
||||||
|
@ConfigAnnotations.FileComment
|
||||||
|
public static String _logRendererBufferEvent = IDebugSwitch.LOG_RENDERER_BUFFER_EVENT_DESC;
|
||||||
|
@ConfigAnnotations.Entry
|
||||||
|
public static LoggerMode logRendererBufferEvent = IDebugSwitch.LOG_RENDERER_BUFFER_EVENT_DEFAULT;
|
||||||
|
|
||||||
|
@ConfigAnnotations.FileComment
|
||||||
|
public static String _logRendererGLEvent = IDebugSwitch.LOG_RENDERER_GL_EVENT_DESC;
|
||||||
|
@ConfigAnnotations.Entry
|
||||||
|
public static LoggerMode logRendererGLEvent = IDebugSwitch.LOG_RENDERER_GL_EVENT_DEFAULT;
|
||||||
|
|
||||||
|
@ConfigAnnotations.FileComment
|
||||||
|
public static String _logFileReadWriteEvent = IDebugSwitch.LOG_FILE_READWRITE_EVENT_DESC;
|
||||||
|
@ConfigAnnotations.Entry
|
||||||
|
public static LoggerMode logFileReadWriteEvent = IDebugSwitch.LOG_FILE_READWRITE_EVENT_DEFAULT;
|
||||||
|
|
||||||
|
@ConfigAnnotations.FileComment
|
||||||
|
public static String _logFileSubDimEvent = IDebugSwitch.LOG_FILE_SUB_DIM_EVENT_DESC;
|
||||||
|
@ConfigAnnotations.Entry
|
||||||
|
public static LoggerMode logFileSubDimEvent = IDebugSwitch.LOG_FILE_SUB_DIM_EVENT_DEFAULT;
|
||||||
|
|
||||||
|
@ConfigAnnotations.FileComment
|
||||||
|
public static String _logNetworkEvent = IDebugSwitch.LOG_NETWORK_EVENT_DESC;
|
||||||
|
@ConfigAnnotations.Entry
|
||||||
|
public static LoggerMode logNetworkEvent = IDebugSwitch.LOG_NETWORK_EVENT_DEFAULT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -237,13 +237,24 @@ public class BlockDetailWrapper extends IBlockDetailWrapper
|
|||||||
!(state.getBlock() instanceof RotatedPillarBlock && direction == Direction.UP))
|
!(state.getBlock() instanceof RotatedPillarBlock && direction == Direction.UP))
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
|
if (quads == null || quads.isEmpty()) {
|
||||||
|
quads = Minecraft.getInstance().getModelManager().getBlockModelShaper().
|
||||||
|
getBlockModel(state).getQuads(state, null, random);
|
||||||
|
}
|
||||||
|
|
||||||
if (quads != null && !quads.isEmpty()) {
|
if (quads != null && !quads.isEmpty()) {
|
||||||
needPostTinting = quads.get(0).isTinted();
|
needPostTinting = quads.get(0).isTinted();
|
||||||
needShade = quads.get(0).isShade();
|
needShade = quads.get(0).isShade();
|
||||||
tintIndex = quads.get(0).getTintIndex();
|
tintIndex = quads.get(0).getTintIndex();
|
||||||
baseColor = calculateColorFromTexture(quads.get(0).getSprite(),
|
baseColor = calculateColorFromTexture(quads.get(0).getSprite(),
|
||||||
ColorMode.getColorMode(state.getBlock()));
|
ColorMode.getColorMode(state.getBlock()));
|
||||||
}
|
} else { // Backup method.
|
||||||
|
needPostTinting = false;
|
||||||
|
needShade = false;
|
||||||
|
tintIndex = 0;
|
||||||
|
baseColor = calculateColorFromTexture(Minecraft.getInstance().getModelManager().getBlockModelShaper().getParticleIcon(state),
|
||||||
|
ColorMode.getColorMode(state.getBlock()));
|
||||||
|
}
|
||||||
} else { // Liquid Block
|
} else { // Liquid Block
|
||||||
|
|
||||||
needPostTinting = true;
|
needPostTinting = true;
|
||||||
|
|||||||
+1
-7
@@ -27,15 +27,9 @@ import java.util.stream.Stream;
|
|||||||
|
|
||||||
public class TintGetterOverrideFast implements BlockAndTintGetter {
|
public class TintGetterOverrideFast implements BlockAndTintGetter {
|
||||||
LevelReader parent;
|
LevelReader parent;
|
||||||
private final Object2ObjectArrayMap<ColorResolver, ConcurrentHashMap<Biome, Integer>> tintCaches;
|
|
||||||
|
|
||||||
public TintGetterOverrideFast(LevelReader parent) {
|
public TintGetterOverrideFast(LevelReader parent) {
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.tintCaches = Util.make(new Object2ObjectArrayMap(3), object2ObjectArrayMap -> {
|
|
||||||
object2ObjectArrayMap.put(BiomeColors.GRASS_COLOR_RESOLVER, new ConcurrentHashMap<Biome, Integer>());
|
|
||||||
object2ObjectArrayMap.put(BiomeColors.FOLIAGE_COLOR_RESOLVER, new ConcurrentHashMap<Biome, Integer>());
|
|
||||||
object2ObjectArrayMap.put(BiomeColors.WATER_COLOR_RESOLVER, new ConcurrentHashMap<Biome, Integer>());
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Biome _getBiome(BlockPos pos) {
|
private Biome _getBiome(BlockPos pos) {
|
||||||
@@ -49,7 +43,7 @@ public class TintGetterOverrideFast implements BlockAndTintGetter {
|
|||||||
@Override
|
@Override
|
||||||
public int getBlockTint(BlockPos blockPos, ColorResolver colorResolver) {
|
public int getBlockTint(BlockPos blockPos, ColorResolver colorResolver) {
|
||||||
Biome b = _getBiome(blockPos);
|
Biome b = _getBiome(blockPos);
|
||||||
return tintCaches.get(colorResolver).computeIfAbsent(b, (key) -> colorResolver.getColor(b, blockPos.getX(), blockPos.getZ()));
|
return colorResolver.getColor(b, blockPos.getX(), blockPos.getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+1
-8
@@ -26,17 +26,11 @@ import java.util.stream.Stream;
|
|||||||
|
|
||||||
public class TintGetterOverrideSmooth implements BlockAndTintGetter {
|
public class TintGetterOverrideSmooth implements BlockAndTintGetter {
|
||||||
LevelReader parent;
|
LevelReader parent;
|
||||||
private final Object2ObjectArrayMap<ColorResolver, BlockTintCache> tintCaches;
|
|
||||||
public int smoothingRange;
|
public int smoothingRange;
|
||||||
|
|
||||||
public TintGetterOverrideSmooth(LevelReader parent, int smoothingRange) {
|
public TintGetterOverrideSmooth(LevelReader parent, int smoothingRange) {
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.smoothingRange = smoothingRange;
|
this.smoothingRange = smoothingRange;
|
||||||
this.tintCaches = Util.make(new Object2ObjectArrayMap(3), object2ObjectArrayMap -> {
|
|
||||||
object2ObjectArrayMap.put(BiomeColors.GRASS_COLOR_RESOLVER, new BlockTintCache((pos) -> calculateBlockTint(pos, BiomeColors.GRASS_COLOR_RESOLVER)));
|
|
||||||
object2ObjectArrayMap.put(BiomeColors.FOLIAGE_COLOR_RESOLVER, new BlockTintCache((pos) -> calculateBlockTint(pos, BiomeColors.FOLIAGE_COLOR_RESOLVER)));
|
|
||||||
object2ObjectArrayMap.put(BiomeColors.WATER_COLOR_RESOLVER, new BlockTintCache((pos) -> calculateBlockTint(pos, BiomeColors.WATER_COLOR_RESOLVER)));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Biome _getBiome(BlockPos pos) {
|
private Biome _getBiome(BlockPos pos) {
|
||||||
@@ -71,8 +65,7 @@ public class TintGetterOverrideSmooth implements BlockAndTintGetter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getBlockTint(BlockPos blockPos, ColorResolver colorResolver) {
|
public int getBlockTint(BlockPos blockPos, ColorResolver colorResolver) {
|
||||||
BlockTintCache blockTintCache = this.tintCaches.get(colorResolver);
|
return calculateBlockTint(blockPos, colorResolver);
|
||||||
return blockTintCache.getColor(blockPos);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+176
-9
@@ -459,6 +459,17 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
|
|||||||
ConfigGui.editSingleOption.getEntry("client.graphics.advancedGraphics.vanillaOverdraw").value = newVanillaOverdraw;
|
ConfigGui.editSingleOption.getEntry("client.graphics.advancedGraphics.vanillaOverdraw").value = newVanillaOverdraw;
|
||||||
ConfigGui.editSingleOption.saveOption("client.graphics.advancedGraphics.vanillaOverdraw");
|
ConfigGui.editSingleOption.saveOption("client.graphics.advancedGraphics.vanillaOverdraw");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getOverdrawOffset() {
|
||||||
|
return Config.Client.Graphics.AdvancedGraphics.overdrawOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setOverdrawOffset(int newOverdrawOffset) {
|
||||||
|
ConfigGui.editSingleOption.getEntry("client.graphics.advancedGraphics.overdrawOffset").value = newOverdrawOffset;
|
||||||
|
ConfigGui.editSingleOption.saveOption("client.graphics.advancedGraphics.overdrawOffset");
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
@Override
|
@Override
|
||||||
public int getBacksideCullingRange()
|
public int getBacksideCullingRange()
|
||||||
@@ -507,6 +518,30 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
|
|||||||
ConfigGui.editSingleOption.getEntry("client.graphics.advancedGraphics.saturationMultiplier").value = newSaturationMultiplier;
|
ConfigGui.editSingleOption.getEntry("client.graphics.advancedGraphics.saturationMultiplier").value = newSaturationMultiplier;
|
||||||
ConfigGui.editSingleOption.saveOption("client.graphics.advancedGraphics.saturationMultiplier");
|
ConfigGui.editSingleOption.saveOption("client.graphics.advancedGraphics.saturationMultiplier");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getEnableCaveCulling() {
|
||||||
|
return Config.Client.Graphics.AdvancedGraphics.enableCaveCulling;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setEnableCaveCulling(boolean newEnableCaveCulling) {
|
||||||
|
ConfigGui.editSingleOption.getEntry("client.graphics.advancedGraphics.enableCaveCulling").value = newEnableCaveCulling;
|
||||||
|
ConfigGui.editSingleOption.saveOption("client.graphics.advancedGraphics.enableCaveCulling");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getCaveCullingHeight() {
|
||||||
|
return Config.Client.Graphics.AdvancedGraphics.caveCullingHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setCaveCullingHeight(int newCaveCullingHeight) {
|
||||||
|
ConfigGui.editSingleOption.getEntry("client.graphics.advancedGraphics.caveCullingHeight").value = newCaveCullingHeight;
|
||||||
|
ConfigGui.editSingleOption.saveOption("client.graphics.advancedGraphics.caveCullingHeight");
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -656,8 +691,8 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
|
|||||||
{
|
{
|
||||||
return buffers;
|
return buffers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Advanced()
|
public Advanced()
|
||||||
{
|
{
|
||||||
threading = new Threading();
|
threading = new Threading();
|
||||||
@@ -701,19 +736,29 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
|
|||||||
//===============//
|
//===============//
|
||||||
public static class Debugging implements IDebugging
|
public static class Debugging implements IDebugging
|
||||||
{
|
{
|
||||||
|
public final IDebugSwitch debugSwitch;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getDrawLods()
|
public IDebugSwitch debugSwitch()
|
||||||
{
|
{
|
||||||
return (boolean) ConfigGui.editSingleOption.getEntry("client.advanced.debugging.drawLods").value;
|
return debugSwitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* RendererType:
|
||||||
|
* DEFAULT
|
||||||
|
* DEBUG
|
||||||
|
* DISABLED
|
||||||
|
* */
|
||||||
|
@Override
|
||||||
|
public RendererType getRendererType() {
|
||||||
|
return (RendererType) ConfigGui.editSingleOption.getEntry("client.advanced.debugging.rendererType").value;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void setDrawLods(boolean newDrawLods)
|
public void setRendererType(RendererType newRenderType) {
|
||||||
{
|
ConfigGui.editSingleOption.getEntry("client.advanced.debugging.rendererType").value = newRenderType;
|
||||||
ConfigGui.editSingleOption.getEntry("client.advanced.debugging.drawLods").value = newDrawLods;
|
ConfigGui.editSingleOption.saveOption("client.advanced.debugging.rendererType");
|
||||||
ConfigGui.editSingleOption.saveOption("client.advanced.debugging.drawLods");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DebugMode getDebugMode()
|
public DebugMode getDebugMode()
|
||||||
{
|
{
|
||||||
@@ -738,6 +783,116 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
|
|||||||
ConfigGui.editSingleOption.getEntry("client.advanced.debugging.enableDebugKeybindings").value = newEnableDebugKeybindings;
|
ConfigGui.editSingleOption.getEntry("client.advanced.debugging.enableDebugKeybindings").value = newEnableDebugKeybindings;
|
||||||
ConfigGui.editSingleOption.saveOption("client.advanced.debugging.enableDebugKeybindings");
|
ConfigGui.editSingleOption.saveOption("client.advanced.debugging.enableDebugKeybindings");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Debugging()
|
||||||
|
{
|
||||||
|
debugSwitch = new DebugSwitch();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class DebugSwitch implements IDebugSwitch {
|
||||||
|
|
||||||
|
/* The logging switches available:
|
||||||
|
* WorldGenEvent
|
||||||
|
* WorldGenPerformance
|
||||||
|
* WorldGenLoadEvent
|
||||||
|
* LodBuilderEvent
|
||||||
|
* RendererBufferEvent
|
||||||
|
* RendererGLEvent
|
||||||
|
* FileReadWriteEvent
|
||||||
|
* FileSubDimEvent
|
||||||
|
* NetworkEvent //NOT IMPL YET
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LoggerMode getLogWorldGenEvent() {
|
||||||
|
return (LoggerMode) ConfigGui.editSingleOption.getEntry("client.advanced.debugging.debugSwitch.logWorldGenEvent").value;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void setLogWorldGenEvent(LoggerMode newLogWorldGenEvent) {
|
||||||
|
ConfigGui.editSingleOption.getEntry("client.advanced.debugging.debugSwitch.logWorldGenEvent").value = newLogWorldGenEvent;
|
||||||
|
ConfigGui.editSingleOption.saveOption("client.advanced.debugging.debugSwitch.logWorldGenEvent");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LoggerMode getLogWorldGenPerformance() {
|
||||||
|
return (LoggerMode) ConfigGui.editSingleOption.getEntry("client.advanced.debugging.debugSwitch.logWorldGenPerformance").value;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void setLogWorldGenPerformance(LoggerMode newLogWorldGenPerformance) {
|
||||||
|
ConfigGui.editSingleOption.getEntry("client.advanced.debugging.debugSwitch.logWorldGenPerformance").value = newLogWorldGenPerformance;
|
||||||
|
ConfigGui.editSingleOption.saveOption("client.advanced.debugging.debugSwitch.logWorldGenPerformance");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LoggerMode getLogWorldGenLoadEvent() {
|
||||||
|
return (LoggerMode) ConfigGui.editSingleOption.getEntry("client.advanced.debugging.debugSwitch.logWorldGenLoadEvent").value;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void setLogWorldGenLoadEvent(LoggerMode newLogWorldGenLoadEvent) {
|
||||||
|
ConfigGui.editSingleOption.getEntry("client.advanced.debugging.debugSwitch.logWorldGenLoadEvent").value = newLogWorldGenLoadEvent;
|
||||||
|
ConfigGui.editSingleOption.saveOption("client.advanced.debugging.debugSwitch.logWorldGenLoadEvent");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LoggerMode getLogLodBuilderEvent() {
|
||||||
|
return (LoggerMode) ConfigGui.editSingleOption.getEntry("client.advanced.debugging.debugSwitch.logLodBuilderEvent").value;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void setLogLodBuilderEvent(LoggerMode newLogLodBuilderEvent) {
|
||||||
|
ConfigGui.editSingleOption.getEntry("client.advanced.debugging.debugSwitch.logLodBuilderEvent").value = newLogLodBuilderEvent;
|
||||||
|
ConfigGui.editSingleOption.saveOption("client.advanced.debugging.debugSwitch.logLodBuilderEvent");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LoggerMode getLogRendererBufferEvent() {
|
||||||
|
return (LoggerMode) ConfigGui.editSingleOption.getEntry("client.advanced.debugging.debugSwitch.logRendererBufferEvent").value;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void setLogRendererBufferEvent(LoggerMode newLogRendererBufferEvent) {
|
||||||
|
ConfigGui.editSingleOption.getEntry("client.advanced.debugging.debugSwitch.logRendererBufferEvent").value = newLogRendererBufferEvent;
|
||||||
|
ConfigGui.editSingleOption.saveOption("client.advanced.debugging.debugSwitch.logRendererBufferEvent");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LoggerMode getLogRendererGLEvent() {
|
||||||
|
return (LoggerMode) ConfigGui.editSingleOption.getEntry("client.advanced.debugging.debugSwitch.logRendererGLEvent").value;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void setLogRendererGLEvent(LoggerMode newLogRendererGLEvent) {
|
||||||
|
ConfigGui.editSingleOption.getEntry("client.advanced.debugging.debugSwitch.logRendererGLEvent").value = newLogRendererGLEvent;
|
||||||
|
ConfigGui.editSingleOption.saveOption("client.advanced.debugging.debugSwitch.logRendererGLEvent");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LoggerMode getLogFileReadWriteEvent() {
|
||||||
|
return (LoggerMode) ConfigGui.editSingleOption.getEntry("client.advanced.debugging.debugSwitch.logFileReadWriteEvent").value;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void setLogFileReadWriteEvent(LoggerMode newLogFileReadWriteEvent) {
|
||||||
|
ConfigGui.editSingleOption.getEntry("client.advanced.debugging.debugSwitch.logFileReadWriteEvent").value = newLogFileReadWriteEvent;
|
||||||
|
ConfigGui.editSingleOption.saveOption("client.advanced.debugging.debugSwitch.logFileReadWriteEvent");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LoggerMode getLogFileSubDimEvent() {
|
||||||
|
return (LoggerMode) ConfigGui.editSingleOption.getEntry("client.advanced.debugging.debugSwitch.logFileSubDimEvent").value;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void setLogFileSubDimEvent(LoggerMode newLogFileSubDimEvent) {
|
||||||
|
ConfigGui.editSingleOption.getEntry("client.advanced.debugging.debugSwitch.logFileSubDimEvent").value = newLogFileSubDimEvent;
|
||||||
|
ConfigGui.editSingleOption.saveOption("client.advanced.debugging.debugSwitch.logFileSubDimEvent");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LoggerMode getLogNetworkEvent() {
|
||||||
|
return (LoggerMode) ConfigGui.editSingleOption.getEntry("client.advanced.debugging.debugSwitch.logNetworkEvent").value;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void setLogNetworkEvent(LoggerMode newLogNetworkEvent) {
|
||||||
|
ConfigGui.editSingleOption.getEntry("client.advanced.debugging.debugSwitch.logNetworkEvent").value = newLogNetworkEvent;
|
||||||
|
ConfigGui.editSingleOption.saveOption("client.advanced.debugging.debugSwitch.logNetworkEvent");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -781,6 +936,18 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
|
|||||||
ConfigGui.editSingleOption.saveOption("client.advanced.buffers.newBufferRebuildTimes");
|
ConfigGui.editSingleOption.saveOption("client.advanced.buffers.newBufferRebuildTimes");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getLodOnlyMode() {
|
||||||
|
return Config.Client.Advanced.lodOnlyMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setLodOnlyMode(boolean newLodOnlyMode) {
|
||||||
|
ConfigGui.editSingleOption.getEntry("client.advanced.buffers.lodOnlyMode").value = newLodOnlyMode;
|
||||||
|
ConfigGui.editSingleOption.saveOption("client.advanced.buffers.lodOnlyMode");
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-20
@@ -63,8 +63,7 @@ import net.minecraft.world.level.dimension.DimensionType;
|
|||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A singleton that wraps the Minecraft class
|
* A singleton that wraps the Minecraft object.
|
||||||
* to allow for easier movement between Minecraft versions.
|
|
||||||
*
|
*
|
||||||
* @author James Seibel
|
* @author James Seibel
|
||||||
* @version 3-5-2022
|
* @version 3-5-2022
|
||||||
@@ -188,7 +187,7 @@ public class MinecraftClientWrapper implements IMinecraftClientWrapper
|
|||||||
{
|
{
|
||||||
if (lightMap == null)
|
if (lightMap == null)
|
||||||
{
|
{
|
||||||
sendChatMessage("new");
|
//sendChatMessage("new");
|
||||||
// make sure the lightMap is up-to-date
|
// make sure the lightMap is up-to-date
|
||||||
getCurrentLightMap();
|
getCurrentLightMap();
|
||||||
}
|
}
|
||||||
@@ -196,23 +195,6 @@ public class MinecraftClientWrapper implements IMinecraftClientWrapper
|
|||||||
return lightMap.getPixelRGBA(blockLight, skyLight);
|
return lightMap.getPixelRGBA(blockLight, skyLight);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the Color at the given pixel coordinates
|
|
||||||
* from the current lightmap.
|
|
||||||
* @param blockLight x location in texture space
|
|
||||||
* @param skyLight z location in texture space
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Color getColorFromLightMap(int blockLight, int skyLight) {
|
|
||||||
if (lightMap == null) {
|
|
||||||
// make sure the lightMap is up-to-date
|
|
||||||
getCurrentLightMap();
|
|
||||||
}
|
|
||||||
|
|
||||||
return LodUtil.intToColor(lightMap.getPixelRGBA(blockLight, skyLight));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//=============//
|
//=============//
|
||||||
|
|||||||
+24
-15
@@ -10,11 +10,9 @@ import com.mojang.blaze3d.platform.NativeImage;
|
|||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import com.seibel.lod.common.wrappers.misc.LightMapWrapper;
|
import com.seibel.lod.common.wrappers.misc.LightMapWrapper;
|
||||||
import com.seibel.lod.core.api.ApiShared;
|
import com.seibel.lod.core.api.ApiShared;
|
||||||
import com.seibel.lod.core.api.ClientApi;
|
|
||||||
import com.seibel.lod.core.handlers.dependencyInjection.ModAccessorHandler;
|
import com.seibel.lod.core.handlers.dependencyInjection.ModAccessorHandler;
|
||||||
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
|
|
||||||
import com.seibel.lod.core.util.LodUtil;
|
|
||||||
|
|
||||||
|
import com.seibel.lod.core.wrapperInterfaces.misc.ILightMapWrapper;
|
||||||
import net.minecraft.client.renderer.LightTexture;
|
import net.minecraft.client.renderer.LightTexture;
|
||||||
|
|
||||||
import com.mojang.math.Vector3f;
|
import com.mojang.math.Vector3f;
|
||||||
@@ -170,7 +168,7 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
|
|||||||
* <p>
|
* <p>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public boolean usingBackupGetVanillaRenderedChunks = true;
|
public boolean usingBackupGetVanillaRenderedChunks = false;
|
||||||
@Override
|
@Override
|
||||||
public HashSet<AbstractChunkPosWrapper> getVanillaRenderedChunks()
|
public HashSet<AbstractChunkPosWrapper> getVanillaRenderedChunks()
|
||||||
{
|
{
|
||||||
@@ -214,13 +212,14 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
|
|||||||
}
|
}
|
||||||
return getMaximumRenderedChunks();
|
return getMaximumRenderedChunks();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public int[] getLightmapPixels()
|
public int[] getLightmapPixels()
|
||||||
{
|
{
|
||||||
LightTexture tex = GAME_RENDERER.lightTexture();
|
LightTexture tex = GAME_RENDERER.lightTexture();
|
||||||
tex.tick(); // This call makes no sense, but it fixes pause menu flicker bug
|
//tex.tick(); // This call makes no sense, but it fixes pause menu flicker bug
|
||||||
NativeImage lightMapPixels = tex.lightPixels;
|
NativeImage lightMapPixels = tex.lightTexture.getPixels();
|
||||||
LightMapWrapper lightMap = new LightMapWrapper(lightMapPixels);
|
LightMapWrapper lightMap = new LightMapWrapper(lightMapPixels);
|
||||||
|
|
||||||
|
|
||||||
@@ -235,7 +234,7 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
|
|||||||
// this could probably be kept as a int, but
|
// this could probably be kept as a int, but
|
||||||
// it is easier to test and see the colors when debugging this way.
|
// it is easier to test and see the colors when debugging this way.
|
||||||
// When creating a new release this should be changed to the int version.
|
// When creating a new release this should be changed to the int version.
|
||||||
Color c = LodUtil.intToColor(lightMap.getLightValue(u, v));
|
int col = lightMap.getLightValue(u, v);
|
||||||
|
|
||||||
// these should both create a totally white image
|
// these should both create a totally white image
|
||||||
// int col =
|
// int col =
|
||||||
@@ -245,12 +244,12 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
|
|||||||
// (0b11111111 << 8) + // green
|
// (0b11111111 << 8) + // green
|
||||||
// (0b11111111 << 16) + // blue
|
// (0b11111111 << 16) + // blue
|
||||||
// (0b11111111 << 24); // blue
|
// (0b11111111 << 24); // blue
|
||||||
|
|
||||||
int col =
|
// int col =
|
||||||
((c.getRed() & 0xFF) << 16) | // blue
|
// ((c.getRed() & 0xFF) << 16) | // blue
|
||||||
((c.getGreen() & 0xFF) << 8) | // green
|
// ((c.getGreen() & 0xFF) << 8) | // green
|
||||||
((c.getBlue() & 0xFF)) | // red
|
// ((c.getBlue() & 0xFF)) | // red
|
||||||
((c.getAlpha() & 0xFF) << 24); // alpha
|
// ((c.getAlpha() & 0xFF) << 24); // alpha
|
||||||
|
|
||||||
// 2D array stored in a 1D array.
|
// 2D array stored in a 1D array.
|
||||||
// Thank you Tim from College ;)
|
// Thank you Tim from College ;)
|
||||||
@@ -260,9 +259,17 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
|
|||||||
|
|
||||||
return pixels;
|
return pixels;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ILightMapWrapper getLightmapWrapper() {
|
||||||
|
return new LightMapWrapper(GAME_RENDERER.lightTexture());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public int getLightmapTextureHeight()
|
public int getLightmapTextureHeight()
|
||||||
{
|
{
|
||||||
int height = -1;
|
int height = -1;
|
||||||
@@ -281,6 +288,7 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public int getLightmapTextureWidth()
|
public int getLightmapTextureWidth()
|
||||||
{
|
{
|
||||||
int width = -1;
|
int width = -1;
|
||||||
@@ -300,6 +308,7 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public int getLightmapGLFormat() {
|
public int getLightmapGLFormat() {
|
||||||
int glFormat = -1;
|
int glFormat = -1;
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package com.seibel.lod.common.wrappers.misc;
|
|||||||
|
|
||||||
import com.mojang.blaze3d.platform.NativeImage;
|
import com.mojang.blaze3d.platform.NativeImage;
|
||||||
import com.seibel.lod.core.wrapperInterfaces.misc.ILightMapWrapper;
|
import com.seibel.lod.core.wrapperInterfaces.misc.ILightMapWrapper;
|
||||||
|
import net.minecraft.client.renderer.LightTexture;
|
||||||
|
import org.lwjgl.opengl.GL32;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author James Seibel
|
* @author James Seibel
|
||||||
@@ -11,11 +13,17 @@ public class LightMapWrapper implements ILightMapWrapper
|
|||||||
{
|
{
|
||||||
static NativeImage lightMap = null;
|
static NativeImage lightMap = null;
|
||||||
|
|
||||||
|
private LightTexture tex;
|
||||||
|
|
||||||
public LightMapWrapper(NativeImage newLightMap)
|
public LightMapWrapper(NativeImage newLightMap)
|
||||||
{
|
{
|
||||||
lightMap = newLightMap;
|
lightMap = newLightMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LightMapWrapper(LightTexture lightTexture) {
|
||||||
|
tex = lightTexture;
|
||||||
|
}
|
||||||
|
|
||||||
public static void setLightMap(NativeImage newLightMap)
|
public static void setLightMap(NativeImage newLightMap)
|
||||||
{
|
{
|
||||||
lightMap = newLightMap;
|
lightMap = newLightMap;
|
||||||
@@ -26,4 +34,14 @@ public class LightMapWrapper implements ILightMapWrapper
|
|||||||
{
|
{
|
||||||
return lightMap.getPixelRGBA(skyLight, blockLight);
|
return lightMap.getPixelRGBA(skyLight, blockLight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void bind() {
|
||||||
|
GL32.glBindTexture(GL32.GL_TEXTURE_2D, tex.lightTexture.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void unbind() {
|
||||||
|
GL32.glBindTexture(GL32.GL_TEXTURE_2D, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,9 +110,11 @@ public class BiomeWrapper implements IBiomeWrapper
|
|||||||
case SAVANNA:
|
case SAVANNA:
|
||||||
case SWAMP:
|
case SWAMP:
|
||||||
default:
|
default:
|
||||||
Color tmp = LodUtil.intToColor(biome.getGrassColor(x, z));
|
colorInt = biome.getGrassColor(x,z);
|
||||||
tmp = tmp.darker();
|
//FIXME: Repair what James did - LeeTom
|
||||||
colorInt = LodUtil.colorToInt(tmp);
|
// Color tmp = LodUtil.intToColor(biome.getGrassColor(x, z));
|
||||||
|
// tmp = tmp.darker();
|
||||||
|
// colorInt = LodUtil.colorToInt(tmp);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+36
-35
@@ -19,7 +19,8 @@
|
|||||||
|
|
||||||
package com.seibel.lod.common.wrappers.worldGeneration;
|
package com.seibel.lod.common.wrappers.worldGeneration;
|
||||||
|
|
||||||
import com.seibel.lod.core.api.ApiShared;
|
import com.seibel.lod.core.logging.ConfigBasedLogger;
|
||||||
|
import com.seibel.lod.core.logging.ConfigBasedSpamLogger;
|
||||||
import com.seibel.lod.core.builders.lodBuilding.LodBuilder;
|
import com.seibel.lod.core.builders.lodBuilding.LodBuilder;
|
||||||
import com.seibel.lod.core.builders.lodBuilding.LodBuilderConfig;
|
import com.seibel.lod.core.builders.lodBuilding.LodBuilderConfig;
|
||||||
import com.seibel.lod.core.enums.config.DistanceGenerationMode;
|
import com.seibel.lod.core.enums.config.DistanceGenerationMode;
|
||||||
@@ -70,6 +71,7 @@ import net.minecraft.world.level.levelgen.NoiseBasedChunkGenerator;
|
|||||||
import net.minecraft.core.Registry;
|
import net.minecraft.core.Registry;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.world.level.lighting.LevelLightEngine;
|
import net.minecraft.world.level.lighting.LevelLightEngine;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Total: 3.135214124s
|
Total: 3.135214124s
|
||||||
@@ -87,9 +89,17 @@ Lod Generation: 0.269023348s
|
|||||||
|
|
||||||
public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnvionmentWrapper
|
public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnvionmentWrapper
|
||||||
{
|
{
|
||||||
public static final boolean ENABLE_PERF_LOGGING = false;
|
private static final ILodConfigWrapperSingleton CONFIG = SingletonHandler.get(ILodConfigWrapperSingleton.class);
|
||||||
public static final boolean ENABLE_EVENT_LOGGING = false;
|
public static final ConfigBasedSpamLogger PREF_LOGGER =
|
||||||
public static final boolean ENABLE_LOAD_EVENT_LOGGING = false;
|
new ConfigBasedSpamLogger(LogManager.getLogger("LodWorldGen"),
|
||||||
|
() -> CONFIG.client().advanced().debugging().debugSwitch().getLogWorldGenPerformance(),1);
|
||||||
|
public static final ConfigBasedLogger EVENT_LOGGER =
|
||||||
|
new ConfigBasedLogger(LogManager.getLogger("LodWorldGen"),
|
||||||
|
() -> CONFIG.client().advanced().debugging().debugSwitch().getLogWorldGenEvent());
|
||||||
|
public static final ConfigBasedLogger LOAD_LOGGER =
|
||||||
|
new ConfigBasedLogger(LogManager.getLogger("LodWorldGen"),
|
||||||
|
() -> CONFIG.client().advanced().debugging().debugSwitch().getLogWorldGenLoadEvent());
|
||||||
|
|
||||||
//TODO: Make actual proper support for StarLight
|
//TODO: Make actual proper support for StarLight
|
||||||
|
|
||||||
public static class PrefEvent
|
public static class PrefEvent
|
||||||
@@ -224,7 +234,6 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
|||||||
public final StepLight stepLight = new StepLight(this);
|
public final StepLight stepLight = new StepLight(this);
|
||||||
public boolean unsafeThreadingRecorded = false;
|
public boolean unsafeThreadingRecorded = false;
|
||||||
//public boolean safeMode = false;
|
//public boolean safeMode = false;
|
||||||
private static final ILodConfigWrapperSingleton CONFIG = SingletonHandler.get(ILodConfigWrapperSingleton.class);
|
|
||||||
private static final IMinecraftClientWrapper MC = SingletonHandler.get(IMinecraftClientWrapper.class);
|
private static final IMinecraftClientWrapper MC = SingletonHandler.get(IMinecraftClientWrapper.class);
|
||||||
public static final long EXCEPTION_TIMER_RESET_TIME = TimeUnit.NANOSECONDS.convert(1, TimeUnit.SECONDS);
|
public static final long EXCEPTION_TIMER_RESET_TIME = TimeUnit.NANOSECONDS.convert(1, TimeUnit.SECONDS);
|
||||||
public static final int EXCEPTION_COUNTER_TRIGGER = 20;
|
public static final int EXCEPTION_COUNTER_TRIGGER = 20;
|
||||||
@@ -249,9 +258,8 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
|||||||
|
|
||||||
public <T> T joinSync(CompletableFuture<T> f) {
|
public <T> T joinSync(CompletableFuture<T> f) {
|
||||||
if (!unsafeThreadingRecorded && !f.isDone()) {
|
if (!unsafeThreadingRecorded && !f.isDone()) {
|
||||||
MC.sendChatMessage("\u00A74\u00A7l\u00A7uERROR: Distant Horizons: Unsafe Threading in Chunk Generator Detected!");
|
EVENT_LOGGER.error("Unsafe Threading in Chunk Generator: ", new RuntimeException("Concurrent future"));
|
||||||
MC.sendChatMessage("\u00A7eTo increase stability, it is recommended to set world generation threads count to 1.");
|
EVENT_LOGGER.error("To increase stability, it is recommended to set world generation threads count to 1.");
|
||||||
ApiShared.LOGGER.error("Unsafe Threading in Chunk Generator: ", new RuntimeException("Concurrent future"));
|
|
||||||
unsafeThreadingRecorded = true;
|
unsafeThreadingRecorded = true;
|
||||||
}
|
}
|
||||||
return f.join();
|
return f.join();
|
||||||
@@ -300,8 +308,8 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
|||||||
}
|
}
|
||||||
catch (Throwable e)
|
catch (Throwable e)
|
||||||
{
|
{
|
||||||
ApiShared.LOGGER.error("Batching World Generator: Event {} gotten an exception", event);
|
EVENT_LOGGER.error("Batching World Generator: Event {} gotten an exception", event);
|
||||||
ApiShared.LOGGER.error("Exception: ", e);
|
EVENT_LOGGER.error("Exception: ", e);
|
||||||
unknownExceptionCount++;
|
unknownExceptionCount++;
|
||||||
lastExceptionTriggerTime = System.nanoTime();
|
lastExceptionTriggerTime = System.nanoTime();
|
||||||
}
|
}
|
||||||
@@ -312,12 +320,12 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
|||||||
}
|
}
|
||||||
else if (event.hasTimeout(TIMEOUT_SECONDS, TimeUnit.SECONDS))
|
else if (event.hasTimeout(TIMEOUT_SECONDS, TimeUnit.SECONDS))
|
||||||
{
|
{
|
||||||
ApiShared.LOGGER.error("Batching World Generator: " + event + " timed out and terminated!");
|
EVENT_LOGGER.error("Batching World Generator: " + event + " timed out and terminated!");
|
||||||
ApiShared.LOGGER.info("Dump PrefEvent: " + event.pEvent);
|
EVENT_LOGGER.info("Dump PrefEvent: " + event.pEvent);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!event.terminate())
|
if (!event.terminate())
|
||||||
ApiShared.LOGGER.error("Failed to terminate the stuck generation event!");
|
EVENT_LOGGER.error("Failed to terminate the stuck generation event!");
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
@@ -326,10 +334,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (unknownExceptionCount > EXCEPTION_COUNTER_TRIGGER) {
|
if (unknownExceptionCount > EXCEPTION_COUNTER_TRIGGER) {
|
||||||
try {
|
EVENT_LOGGER.error("Too many exceptions in Batching World Generator! Disabling the generator.");
|
||||||
MC.sendChatMessage("\u00A74\u00A7l\u00A7uERROR: Distant Horizons: Too many exceptions in Batching World Generator! Disabling the generator.");
|
|
||||||
} catch (Exception e) {}
|
|
||||||
ApiShared.LOGGER.error("Too many exceptions in Batching World Generator! Now disabling.");
|
|
||||||
unknownExceptionCount = 0;
|
unknownExceptionCount = 0;
|
||||||
CONFIG.client().worldGenerator().setEnableDistantGeneration(false);
|
CONFIG.client().worldGenerator().setEnableDistantGeneration(false);
|
||||||
}
|
}
|
||||||
@@ -338,14 +343,13 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
|||||||
public BatchGenerationEnvironment(IWorldWrapper serverlevel, LodBuilder lodBuilder, LodDimension lodDim)
|
public BatchGenerationEnvironment(IWorldWrapper serverlevel, LodBuilder lodBuilder, LodDimension lodDim)
|
||||||
{
|
{
|
||||||
super(serverlevel, lodBuilder, lodDim);
|
super(serverlevel, lodBuilder, lodDim);
|
||||||
ApiShared.LOGGER.info("================WORLD_GEN_STEP_INITING=============");
|
EVENT_LOGGER.info("================WORLD_GEN_STEP_INITING=============");
|
||||||
ChunkGenerator generator = ((WorldWrapper) serverlevel).getServerWorld().getChunkSource().getGenerator();
|
ChunkGenerator generator = ((WorldWrapper) serverlevel).getServerWorld().getChunkSource().getGenerator();
|
||||||
if (!(generator instanceof NoiseBasedChunkGenerator ||
|
if (!(generator instanceof NoiseBasedChunkGenerator ||
|
||||||
generator instanceof DebugLevelSource ||
|
generator instanceof DebugLevelSource ||
|
||||||
generator instanceof FlatLevelSource)) {
|
generator instanceof FlatLevelSource)) {
|
||||||
MC.sendChatMessage("\u00A74\u00A7l\u00A7uWARNING: Distant Horizons: Unknown Chunk Generator Detected! Distant Generation May Fail!");
|
EVENT_LOGGER.warn("Unknown Chunk Generator detected: [{}], Distant Generation May Fail!", generator.getClass());
|
||||||
MC.sendChatMessage("\u00A7eIf it does crash, set Distant Generation to OFF or Generation Mode to None.");
|
EVENT_LOGGER.warn("If it does crash, set Distant Generation to OFF or Generation Mode to None.");
|
||||||
ApiShared.LOGGER.warn("Unknown Chunk Generator detected: {}", generator.getClass());
|
|
||||||
}
|
}
|
||||||
params = new GlobalParameters((ServerLevel) ((WorldWrapper) serverlevel).getWorld(), lodBuilder, lodDim);
|
params = new GlobalParameters((ServerLevel) ((WorldWrapper) serverlevel).getWorld(), lodBuilder, lodDim);
|
||||||
}
|
}
|
||||||
@@ -360,7 +364,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
ApiShared.LOGGER.error("DistantHorizons: Couldn't load chunk {}", chunkPos, e);
|
LOAD_LOGGER.error("DistantHorizons: Couldn't load chunk {}", chunkPos, e);
|
||||||
}
|
}
|
||||||
if (chunkData == null)
|
if (chunkData == null)
|
||||||
{
|
{
|
||||||
@@ -371,7 +375,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
|||||||
try {
|
try {
|
||||||
return ChunkLoader.read(level, lightEngine, chunkPos, chunkData);
|
return ChunkLoader.read(level, lightEngine, chunkPos, chunkData);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
ApiShared.LOGGER.error("DistantHorizons: Couldn't load chunk {}", chunkPos, e);
|
LOAD_LOGGER.error("DistantHorizons: Couldn't load chunk {}", chunkPos, e);
|
||||||
return new ProtoChunk(chunkPos, UpgradeData.EMPTY, level, level.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY), null);
|
return new ProtoChunk(chunkPos, UpgradeData.EMPTY, level, level.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY), null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -380,8 +384,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
|||||||
|
|
||||||
public void generateLodFromList(GenerationEvent e)
|
public void generateLodFromList(GenerationEvent e)
|
||||||
{
|
{
|
||||||
if (ENABLE_EVENT_LOGGING)
|
EVENT_LOGGER.debug("Lod Generate Event: " + e.pos);
|
||||||
ApiShared.LOGGER.info("Lod Generate Event: " + e.pos);
|
|
||||||
e.pEvent.beginNano = System.nanoTime();
|
e.pEvent.beginNano = System.nanoTime();
|
||||||
ArrayGridList<ChunkAccess> referencedChunks;
|
ArrayGridList<ChunkAccess> referencedChunks;
|
||||||
ArrayGridList<ChunkAccess> genChunks;
|
ArrayGridList<ChunkAccess> genChunks;
|
||||||
@@ -424,7 +427,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
|||||||
region = new LightedWorldGenRegion(params.level, lightEngine, referencedChunks,
|
region = new LightedWorldGenRegion(params.level, lightEngine, referencedChunks,
|
||||||
ChunkStatus.STRUCTURE_STARTS, refRange, e.lightMode, generator);
|
ChunkStatus.STRUCTURE_STARTS, refRange, e.lightMode, generator);
|
||||||
adaptor.setRegion(region);
|
adaptor.setRegion(region);
|
||||||
e.tParam.makeStructFeat(region);
|
e.tParam.makeStructFeat(region, params);
|
||||||
genChunks = new ArrayGridList<>(referencedChunks, RANGE_TO_RANGE_EMPTY_EXTENSION,
|
genChunks = new ArrayGridList<>(referencedChunks, RANGE_TO_RANGE_EMPTY_EXTENSION,
|
||||||
referencedChunks.gridSize - RANGE_TO_RANGE_EMPTY_EXTENSION);
|
referencedChunks.gridSize - RANGE_TO_RANGE_EMPTY_EXTENSION);
|
||||||
generateDirect(e, genChunks, e.target, region);
|
generateDirect(e, genChunks, e.target, region);
|
||||||
@@ -474,15 +477,13 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
|||||||
boolean isPartial = target.isOldNoiseGeneration();
|
boolean isPartial = target.isOldNoiseGeneration();
|
||||||
if (isFull)
|
if (isFull)
|
||||||
{
|
{
|
||||||
if (ENABLE_LOAD_EVENT_LOGGING)
|
LOAD_LOGGER.info("Detected full existing chunk at {}", target.getPos());
|
||||||
ApiShared.LOGGER.info("Detected full existing chunk at {}", target.getPos());
|
|
||||||
params.lodBuilder.generateLodNodeFromChunk(params.lodDim, wrappedChunk,
|
params.lodBuilder.generateLodNodeFromChunk(params.lodDim, wrappedChunk,
|
||||||
new LodBuilderConfig(DistanceGenerationMode.FULL), true, e.genAllDetails);
|
new LodBuilderConfig(DistanceGenerationMode.FULL), true, e.genAllDetails);
|
||||||
}
|
}
|
||||||
else if (isPartial)
|
else if (isPartial)
|
||||||
{
|
{
|
||||||
if (ENABLE_LOAD_EVENT_LOGGING)
|
LOAD_LOGGER.info("Detected old existing chunk at {}", target.getPos());
|
||||||
ApiShared.LOGGER.info("Detected old existing chunk at {}", target.getPos());
|
|
||||||
params.lodBuilder.generateLodNodeFromChunk(params.lodDim, wrappedChunk,
|
params.lodBuilder.generateLodNodeFromChunk(params.lodDim, wrappedChunk,
|
||||||
new LodBuilderConfig(generationMode), true, e.genAllDetails);
|
new LodBuilderConfig(generationMode), true, e.genAllDetails);
|
||||||
}
|
}
|
||||||
@@ -505,10 +506,10 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
|||||||
}
|
}
|
||||||
e.pEvent.endNano = System.nanoTime();
|
e.pEvent.endNano = System.nanoTime();
|
||||||
e.refreshTimeout();
|
e.refreshTimeout();
|
||||||
if (ENABLE_PERF_LOGGING)
|
if (PREF_LOGGER.canMaybeLog())
|
||||||
{
|
{
|
||||||
e.tParam.perf.recordEvent(e.pEvent);
|
e.tParam.perf.recordEvent(e.pEvent);
|
||||||
ApiShared.LOGGER.info(e.tParam.perf);
|
PREF_LOGGER.infoInc("{}", e.tParam.perf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -594,14 +595,14 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void stop(boolean blocking) {
|
public void stop(boolean blocking) {
|
||||||
ApiShared.LOGGER.info("Batch Chunk Generator shutting down...");
|
EVENT_LOGGER.info("Batch Chunk Generator shutting down...");
|
||||||
executors.shutdownNow();
|
executors.shutdownNow();
|
||||||
if (blocking) try {
|
if (blocking) try {
|
||||||
if (!executors.awaitTermination(10, TimeUnit.SECONDS)) {
|
if (!executors.awaitTermination(10, TimeUnit.SECONDS)) {
|
||||||
ApiShared.LOGGER.error("Batch Chunk Generator shutdown failed! Ignoring child threads...");
|
EVENT_LOGGER.error("Batch Chunk Generator shutdown failed! Ignoring child threads...");
|
||||||
}
|
}
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
ApiShared.LOGGER.error("Batch Chunk Generator shutdown failed! Ignoring child threads...", e);
|
EVENT_LOGGER.error("Batch Chunk Generator shutdown failed! Ignoring child threads...", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
-4
@@ -3,7 +3,6 @@ package com.seibel.lod.common.wrappers.worldGeneration;
|
|||||||
|
|
||||||
import com.mojang.datafixers.DataFixer;
|
import com.mojang.datafixers.DataFixer;
|
||||||
import com.seibel.lod.core.builders.lodBuilding.LodBuilder;
|
import com.seibel.lod.core.builders.lodBuilding.LodBuilder;
|
||||||
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
|
|
||||||
import com.seibel.lod.core.objects.lod.LodDimension;
|
import com.seibel.lod.core.objects.lod.LodDimension;
|
||||||
|
|
||||||
import net.minecraft.core.Registry;
|
import net.minecraft.core.Registry;
|
||||||
@@ -15,9 +14,6 @@ import net.minecraft.world.level.biome.Biome;
|
|||||||
import net.minecraft.world.level.biome.BiomeManager;
|
import net.minecraft.world.level.biome.BiomeManager;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.chunk.storage.ChunkScanAccess;
|
import net.minecraft.world.level.chunk.storage.ChunkScanAccess;
|
||||||
import net.minecraft.world.level.levelgen.DebugLevelSource;
|
|
||||||
import net.minecraft.world.level.levelgen.FlatLevelSource;
|
|
||||||
import net.minecraft.world.level.levelgen.NoiseBasedChunkGenerator;
|
|
||||||
import net.minecraft.world.level.levelgen.WorldGenSettings;
|
import net.minecraft.world.level.levelgen.WorldGenSettings;
|
||||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
|
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
|
||||||
import net.minecraft.world.level.storage.WorldData;
|
import net.minecraft.world.level.storage.WorldData;
|
||||||
|
|||||||
+4
-4
@@ -6,13 +6,14 @@ import com.seibel.lod.common.wrappers.worldGeneration.mimicObject.WorldGenStruct
|
|||||||
|
|
||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
import net.minecraft.world.level.WorldGenLevel;
|
import net.minecraft.world.level.WorldGenLevel;
|
||||||
|
import net.minecraft.world.level.levelgen.WorldGenSettings;
|
||||||
import net.minecraft.world.level.levelgen.structure.StructureCheck;
|
import net.minecraft.world.level.levelgen.structure.StructureCheck;
|
||||||
|
|
||||||
public final class ThreadedParameters
|
public final class ThreadedParameters
|
||||||
{
|
{
|
||||||
private static final ThreadLocal<ThreadedParameters> localParam = new ThreadLocal<ThreadedParameters>();
|
private static final ThreadLocal<ThreadedParameters> localParam = new ThreadLocal<ThreadedParameters>();
|
||||||
final ServerLevel level;
|
final ServerLevel level;
|
||||||
public final WorldGenStructFeatManager structFeat;
|
public WorldGenStructFeatManager structFeat = null;
|
||||||
public final StructureCheck structCheck;
|
public final StructureCheck structCheck;
|
||||||
boolean isValid = true;
|
boolean isValid = true;
|
||||||
public final PerfCalculator perf = new PerfCalculator();
|
public final PerfCalculator perf = new PerfCalculator();
|
||||||
@@ -38,11 +39,10 @@ public final class ThreadedParameters
|
|||||||
structCheck = new StructureCheck(param.chunkScanner, param.registry, param.structures,
|
structCheck = new StructureCheck(param.chunkScanner, param.registry, param.structures,
|
||||||
param.level.dimension(), param.generator, level, param.generator.getBiomeSource(), param.worldSeed,
|
param.level.dimension(), param.generator, level, param.generator.getBiomeSource(), param.worldSeed,
|
||||||
param.fixerUpper);
|
param.fixerUpper);
|
||||||
structFeat = new WorldGenStructFeatManager(level, param.worldGenSettings, null, structCheck);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void makeStructFeat(WorldGenLevel genLevel)
|
public void makeStructFeat(WorldGenLevel genLevel, GlobalParameters param)
|
||||||
{
|
{
|
||||||
structFeat.setGenLevel(genLevel);
|
structFeat = new WorldGenStructFeatManager(param.worldGenSettings, genLevel, structCheck);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+4
-3
@@ -4,9 +4,10 @@ package com.seibel.lod.common.wrappers.worldGeneration.mimicObject;
|
|||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.mojang.serialization.Codec;
|
import com.mojang.serialization.Codec;
|
||||||
import com.mojang.serialization.Dynamic;
|
import com.mojang.serialization.Dynamic;
|
||||||
|
import com.seibel.lod.common.wrappers.worldGeneration.BatchGenerationEnvironment;
|
||||||
import com.seibel.lod.core.api.ApiShared;
|
import com.seibel.lod.core.api.ApiShared;
|
||||||
import com.seibel.lod.core.api.ClientApi;
|
|
||||||
|
|
||||||
|
import com.seibel.lod.core.logging.ConfigBasedLogger;
|
||||||
import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
|
import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
|
||||||
import it.unimi.dsi.fastutil.longs.LongSet;
|
import it.unimi.dsi.fastutil.longs.LongSet;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -56,7 +57,7 @@ import org.apache.logging.log4j.Logger;
|
|||||||
public class ChunkLoader
|
public class ChunkLoader
|
||||||
{
|
{
|
||||||
private static final Codec<PalettedContainer<BlockState>> BLOCK_STATE_CODEC = PalettedContainer.codec(Block.BLOCK_STATE_REGISTRY, BlockState.CODEC, PalettedContainer.Strategy.SECTION_STATES, Blocks.AIR.defaultBlockState());
|
private static final Codec<PalettedContainer<BlockState>> BLOCK_STATE_CODEC = PalettedContainer.codec(Block.BLOCK_STATE_REGISTRY, BlockState.CODEC, PalettedContainer.Strategy.SECTION_STATES, Blocks.AIR.defaultBlockState());
|
||||||
private static final Logger LOGGER = ApiShared.LOGGER;
|
private static final ConfigBasedLogger LOGGER = BatchGenerationEnvironment.LOAD_LOGGER;
|
||||||
private static final String TAG_UPGRADE_DATA = "UpgradeData";
|
private static final String TAG_UPGRADE_DATA = "UpgradeData";
|
||||||
private static final String BLOCK_TICKS_TAG = "block_ticks";
|
private static final String BLOCK_TICKS_TAG = "block_ticks";
|
||||||
private static final String FLUID_TICKS_TAG = "fluid_ticks";
|
private static final String FLUID_TICKS_TAG = "fluid_ticks";
|
||||||
@@ -279,7 +280,7 @@ public class ChunkLoader
|
|||||||
ChunkPos actualPos = new ChunkPos(chunkData.getInt("xPos"), chunkData.getInt("zPos"));
|
ChunkPos actualPos = new ChunkPos(chunkData.getInt("xPos"), chunkData.getInt("zPos"));
|
||||||
if (!Objects.equals(chunkPos, actualPos))
|
if (!Objects.equals(chunkPos, actualPos))
|
||||||
{
|
{
|
||||||
LOGGER.error("Distant Horizons: Chunk file at {} is in the wrong location; Ignoring. (Expected {}, got {})", (Object) chunkPos, (Object) chunkPos, (Object) actualPos);
|
LOGGER.error("Chunk file at {} is in the wrong location; Ignoring. (Expected {}, got {})", (Object) chunkPos, (Object) chunkPos, (Object) actualPos);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-1
@@ -6,7 +6,6 @@ import com.seibel.lod.core.api.ApiShared;
|
|||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import com.seibel.lod.common.wrappers.worldGeneration.BatchGenerationEnvironment.EmptyChunkGenerator;
|
import com.seibel.lod.common.wrappers.worldGeneration.BatchGenerationEnvironment.EmptyChunkGenerator;
|
||||||
import com.seibel.lod.core.api.ClientApi;
|
|
||||||
import com.seibel.lod.core.enums.config.LightGenerationMode;
|
import com.seibel.lod.core.enums.config.LightGenerationMode;
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
|
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
|
||||||
|
|||||||
+74
-22
@@ -1,7 +1,11 @@
|
|||||||
package com.seibel.lod.common.wrappers.worldGeneration.mimicObject;
|
package com.seibel.lod.common.wrappers.worldGeneration.mimicObject;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Stream;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
|
||||||
@@ -17,60 +21,61 @@ import net.minecraft.world.level.WorldGenLevel;
|
|||||||
import net.minecraft.world.level.chunk.ChunkAccess;
|
import net.minecraft.world.level.chunk.ChunkAccess;
|
||||||
import net.minecraft.world.level.chunk.ChunkStatus;
|
import net.minecraft.world.level.chunk.ChunkStatus;
|
||||||
import net.minecraft.world.level.levelgen.WorldGenSettings;
|
import net.minecraft.world.level.levelgen.WorldGenSettings;
|
||||||
|
import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature;
|
||||||
import net.minecraft.world.level.levelgen.feature.StructureFeature;
|
import net.minecraft.world.level.levelgen.feature.StructureFeature;
|
||||||
import net.minecraft.world.level.levelgen.structure.StructureCheck;
|
import net.minecraft.world.level.levelgen.structure.StructureCheck;
|
||||||
import net.minecraft.world.level.levelgen.structure.StructureStart;
|
import net.minecraft.world.level.levelgen.structure.StructureStart;
|
||||||
|
|
||||||
public class WorldGenStructFeatManager extends StructureFeatureManager {
|
public class WorldGenStructFeatManager extends StructureFeatureManager {
|
||||||
WorldGenLevel genLevel;
|
final WorldGenLevel genLevel;
|
||||||
WorldGenSettings worldGenSettings;
|
WorldGenSettings worldGenSettings;
|
||||||
StructureCheck structureCheck;
|
StructureCheck structureCheck;
|
||||||
public WorldGenStructFeatManager(LevelAccessor levelAccessor, WorldGenSettings worldGenSettings,
|
public WorldGenStructFeatManager(WorldGenSettings worldGenSettings,
|
||||||
WorldGenLevel genLevel, StructureCheck structureCheck) {
|
WorldGenLevel genLevel, StructureCheck structureCheck) {
|
||||||
super(levelAccessor, worldGenSettings, structureCheck);
|
super(genLevel, worldGenSettings, structureCheck);
|
||||||
this.genLevel = genLevel;
|
this.genLevel = genLevel;
|
||||||
this.worldGenSettings = worldGenSettings;
|
this.worldGenSettings = worldGenSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGenLevel(WorldGenLevel genLevel) {
|
|
||||||
this.genLevel = genLevel;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WorldGenStructFeatManager forWorldGenRegion(WorldGenRegion worldGenRegion) {
|
public WorldGenStructFeatManager forWorldGenRegion(WorldGenRegion worldGenRegion) {
|
||||||
if (worldGenRegion == genLevel)
|
if (worldGenRegion == genLevel)
|
||||||
return this;
|
return this;
|
||||||
return new WorldGenStructFeatManager(worldGenRegion, worldGenSettings, worldGenRegion, structureCheck);
|
return new WorldGenStructFeatManager(worldGenSettings, worldGenRegion, structureCheck);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ChunkAccess _getChunk(int x, int z, ChunkStatus status) {
|
||||||
|
if (genLevel == null) return null;
|
||||||
|
return genLevel.getChunk(x, z, status, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasAnyStructureAt(BlockPos blockPos) {
|
public boolean hasAnyStructureAt(BlockPos blockPos) {
|
||||||
SectionPos sectionPos = SectionPos.of(blockPos);
|
SectionPos sectionPos = SectionPos.of(blockPos);
|
||||||
ChunkAccess chunk = genLevel.getChunk(sectionPos.x(), sectionPos.z(), ChunkStatus.STRUCTURE_REFERENCES,
|
ChunkAccess chunk = _getChunk(sectionPos.x(), sectionPos.z(), ChunkStatus.STRUCTURE_REFERENCES);
|
||||||
false);
|
|
||||||
if (chunk == null) return false;
|
if (chunk == null) return false;
|
||||||
return chunk.hasAnyStructureReferences();
|
return chunk.hasAnyStructureReferences();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Check this
|
|
||||||
/*
|
|
||||||
|
#if MC_VERSION_1_18_1
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
public List<? extends StructureStart<?>> startsForFeature(SectionPos sectionPos,
|
public List<? extends StructureStart<?>> startsForFeature(SectionPos sectionPos,
|
||||||
StructureFeature<?> structureFeature) {
|
StructureFeature<?> structureFeature) {
|
||||||
if (genLevel == null)
|
|
||||||
return List.of();
|
ChunkAccess chunk = _getChunk(sectionPos.x(), sectionPos.z(), ChunkStatus.STRUCTURE_REFERENCES);
|
||||||
ChunkAccess chunk = genLevel.getChunk(sectionPos.x(), sectionPos.z(), ChunkStatus.STRUCTURE_REFERENCES,
|
if (chunk == null) return List.of();
|
||||||
false);
|
|
||||||
if (chunk == null)
|
// Copied from StructureFeatureManager::startsForFeature(...) with slight tweaks
|
||||||
return List.of();
|
|
||||||
LongSet longSet = chunk.getReferencesForFeature(structureFeature);
|
LongSet longSet = chunk.getReferencesForFeature(structureFeature);
|
||||||
ImmutableList.Builder builder = ImmutableList.builder();
|
ImmutableList.Builder builder = ImmutableList.builder();
|
||||||
LongIterator longIterator = longSet.iterator();
|
LongIterator longIterator = longSet.iterator();
|
||||||
while (longIterator.hasNext()) {
|
while (longIterator.hasNext()) {
|
||||||
long l = (Long)longIterator.next();
|
long l = (Long)longIterator.next();
|
||||||
SectionPos sectPos = SectionPos.of(new ChunkPos(l), genLevel.getMinSection());
|
SectionPos sectPos = SectionPos.of(new ChunkPos(l), genLevel.getMinSection());
|
||||||
ChunkAccess startChunk = genLevel.getChunk(sectPos.x(), sectPos.z(), ChunkStatus.STRUCTURE_STARTS, false);
|
ChunkAccess startChunk = _getChunk(sectPos.x(), sectPos.z(), ChunkStatus.STRUCTURE_STARTS);
|
||||||
if (startChunk == null) continue;
|
if (startChunk == null) continue;
|
||||||
StructureStart<?> structureStart = this.getStartForFeature(sectPos, structureFeature, startChunk);
|
StructureStart<?> structureStart = this.getStartForFeature(sectPos, structureFeature, startChunk);
|
||||||
if (structureStart == null || !structureStart.isValid()) continue;
|
if (structureStart == null || !structureStart.isValid()) continue;
|
||||||
@@ -78,5 +83,52 @@ public class WorldGenStructFeatManager extends StructureFeatureManager {
|
|||||||
}
|
}
|
||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
*/
|
#elif MC_VERSION_1_18_2
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<StructureStart> startsForFeature(SectionPos sectionPos, Predicate<ConfiguredStructureFeature<?, ?>> predicate) {
|
||||||
|
ChunkAccess chunk = _getChunk(sectionPos.x(), sectionPos.z(), ChunkStatus.STRUCTURE_REFERENCES);
|
||||||
|
if (chunk == null) return List.of();
|
||||||
|
|
||||||
|
// Copied from StructureFeatureManager::startsForFeature(...)
|
||||||
|
Map<ConfiguredStructureFeature<?, ?>, LongSet> map = chunk.getAllReferences();
|
||||||
|
|
||||||
|
ImmutableList.Builder<StructureStart> builder = ImmutableList.builder();
|
||||||
|
Iterator<Map.Entry<ConfiguredStructureFeature<?, ?>, LongSet>> var5 = map.entrySet().iterator();
|
||||||
|
|
||||||
|
while(var5.hasNext()) {
|
||||||
|
Map.Entry<ConfiguredStructureFeature<?, ?>, LongSet> entry = var5.next();
|
||||||
|
ConfiguredStructureFeature<?, ?> configuredStructureFeature = entry.getKey();
|
||||||
|
if (predicate.test(configuredStructureFeature)) {
|
||||||
|
LongSet var10002 = (LongSet)entry.getValue();
|
||||||
|
Objects.requireNonNull(builder);
|
||||||
|
this.fillStartsForFeature(configuredStructureFeature, var10002, builder::add);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return builder.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<StructureStart> startsForFeature(SectionPos sectionPos, ConfiguredStructureFeature<?, ?> configuredStructureFeature) {
|
||||||
|
ChunkAccess chunk = _getChunk(sectionPos.x(), sectionPos.z(), ChunkStatus.STRUCTURE_REFERENCES);
|
||||||
|
if (chunk == null) return List.of();
|
||||||
|
|
||||||
|
// Copied from StructureFeatureManager::startsForFeature(...)
|
||||||
|
LongSet longSet = chunk.getReferencesForFeature(configuredStructureFeature);
|
||||||
|
ImmutableList.Builder<StructureStart> builder = ImmutableList.builder();
|
||||||
|
Objects.requireNonNull(builder);
|
||||||
|
this.fillStartsForFeature(configuredStructureFeature, longSet, builder::add);
|
||||||
|
return builder.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<ConfiguredStructureFeature<?, ?>, LongSet> getAllStructuresAt(BlockPos blockPos) {
|
||||||
|
SectionPos sectionPos = SectionPos.of(blockPos);
|
||||||
|
ChunkAccess chunk = _getChunk(sectionPos.x(), sectionPos.z(), ChunkStatus.STRUCTURE_REFERENCES);
|
||||||
|
if (chunk == null) return Map.of();
|
||||||
|
return chunk.getAllReferences();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,7 @@ accessible field net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo chu
|
|||||||
|
|
||||||
# lighting
|
# lighting
|
||||||
accessible field net/minecraft/client/renderer/LightTexture lightPixels Lcom/mojang/blaze3d/platform/NativeImage;
|
accessible field net/minecraft/client/renderer/LightTexture lightPixels Lcom/mojang/blaze3d/platform/NativeImage;
|
||||||
|
accessible field net/minecraft/client/renderer/LightTexture lightTexture Lnet/minecraft/client/renderer/texture/DynamicTexture;
|
||||||
accessible field net/minecraft/world/level/lighting/LevelLightEngine blockEngine Lnet/minecraft/world/level/lighting/LayerLightEngine;
|
accessible field net/minecraft/world/level/lighting/LevelLightEngine blockEngine Lnet/minecraft/world/level/lighting/LayerLightEngine;
|
||||||
accessible field net/minecraft/world/level/lighting/LevelLightEngine skyEngine Lnet/minecraft/world/level/lighting/LayerLightEngine;
|
accessible field net/minecraft/world/level/lighting/LevelLightEngine skyEngine Lnet/minecraft/world/level/lighting/LayerLightEngine;
|
||||||
|
|
||||||
|
|||||||
+1
-1
Submodule core updated: 6cd0281d0e...02b0637adc
+13
-4
@@ -17,6 +17,10 @@ configurations {
|
|||||||
compileClasspath.extendsFrom common
|
compileClasspath.extendsFrom common
|
||||||
runtimeClasspath.extendsFrom common
|
runtimeClasspath.extendsFrom common
|
||||||
developmentFabric.extendsFrom common
|
developmentFabric.extendsFrom common
|
||||||
|
|
||||||
|
addModJar
|
||||||
|
include.extendsFrom addModJar
|
||||||
|
modImplementation.extendsFrom addModJar
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@@ -36,19 +40,24 @@ dependencies {
|
|||||||
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
|
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
|
||||||
|
|
||||||
// Fabric API
|
// Fabric API
|
||||||
modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}"
|
addModJar(fabricApi.module("fabric-lifecycle-events-v1", rootProject.fabric_api_version))
|
||||||
|
addModJar(fabricApi.module("fabric-key-binding-api-v1", rootProject.fabric_api_version))
|
||||||
|
addModJar(fabricApi.module("fabric-networking-api-v1", rootProject.fabric_api_version))
|
||||||
|
|
||||||
// Mod Menu
|
// Mod Menu
|
||||||
modImplementation("com.terraformersmc:modmenu:${rootProject.modmenu_version}") {
|
modImplementation("com.terraformersmc:modmenu:${rootProject.modmenu_version}")
|
||||||
exclude(group: "net.fabricmc.fabric-api")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Starlight
|
// Starlight
|
||||||
addMod("curse.maven:starlight-521783:${rootProject.starlight_version_fabric}", rootProject.enable_starlight)
|
addMod("curse.maven:starlight-521783:${rootProject.starlight_version_fabric}", rootProject.enable_starlight)
|
||||||
|
|
||||||
|
// Phosphor
|
||||||
|
addMod("curse.maven:phosphor-372124:${rootProject.phosphor_version_fabric}", rootProject.enable_phosphor)
|
||||||
|
|
||||||
// Sodium
|
// Sodium
|
||||||
addMod("curse.maven:sodium-394468:${rootProject.sodium_version}", rootProject.enable_sodium)
|
addMod("curse.maven:sodium-394468:${rootProject.sodium_version}", rootProject.enable_sodium)
|
||||||
implementation "org.joml:joml:1.10.2"
|
implementation "org.joml:joml:1.10.2"
|
||||||
|
modImplementation(fabricApi.module("fabric-rendering-data-attachment-v1", rootProject.fabric_api_version))
|
||||||
|
modImplementation(fabricApi.module("fabric-rendering-fluids-v1", rootProject.fabric_api_version))
|
||||||
|
|
||||||
// Lithium
|
// Lithium
|
||||||
addMod("maven.modrinth:lithium:${rootProject.lithium_version}", rootProject.enable_lithium)
|
addMod("maven.modrinth:lithium:${rootProject.lithium_version}", rootProject.enable_lithium)
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ package com.seibel.lod.fabric.mixins;
|
|||||||
|
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.mojang.math.Matrix4f;
|
import com.mojang.math.Matrix4f;
|
||||||
|
import com.seibel.lod.common.Config;
|
||||||
import com.seibel.lod.common.wrappers.McObjectConverter;
|
import com.seibel.lod.common.wrappers.McObjectConverter;
|
||||||
import com.seibel.lod.core.api.ClientApi;
|
import com.seibel.lod.core.api.ClientApi;
|
||||||
import com.seibel.lod.core.objects.math.Mat4f;
|
import com.seibel.lod.core.objects.math.Mat4f;
|
||||||
@@ -61,6 +62,7 @@ public class MixinWorldRenderer
|
|||||||
previousPartialTicks = tickDelta;
|
previousPartialTicks = tickDelta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Inject rendering at renderSky
|
||||||
// HEAD or RETURN
|
// HEAD or RETURN
|
||||||
@Inject(at = @At("RETURN"),
|
@Inject(at = @At("RETURN"),
|
||||||
method = "renderSky",
|
method = "renderSky",
|
||||||
@@ -73,10 +75,9 @@ public class MixinWorldRenderer
|
|||||||
|
|
||||||
ClientApi.INSTANCE.renderLods(mcModelViewMatrix, mcProjectionMatrix, previousPartialTicks);
|
ClientApi.INSTANCE.renderLods(mcModelViewMatrix, mcProjectionMatrix, previousPartialTicks);
|
||||||
|
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
|
// Inject rendering at first call to renderChunkLayer
|
||||||
// HEAD or RETURN
|
// HEAD or RETURN
|
||||||
@Inject(at = @At("HEAD"),
|
@Inject(at = @At("HEAD"),
|
||||||
method = "renderChunkLayer(Lnet/minecraft/client/renderer/RenderType;Lcom/mojang/blaze3d/vertex/PoseStack;DDDLcom/mojang/math/Matrix4f;)V",
|
method = "renderChunkLayer(Lnet/minecraft/client/renderer/RenderType;Lcom/mojang/blaze3d/vertex/PoseStack;DDDLcom/mojang/math/Matrix4f;)V",
|
||||||
@@ -91,6 +92,8 @@ public class MixinWorldRenderer
|
|||||||
|
|
||||||
ClientApi.INSTANCE.renderLods(mcModelViewMatrix, mcProjectionMatrix, previousPartialTicks);
|
ClientApi.INSTANCE.renderLods(mcModelViewMatrix, mcProjectionMatrix, previousPartialTicks);
|
||||||
}
|
}
|
||||||
//callback.cancel();
|
if (Config.Client.Advanced.lodOnlyMode) {
|
||||||
}*/
|
callback.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,9 @@
|
|||||||
"accessWidener" : "lod.accesswidener",
|
"accessWidener" : "lod.accesswidener",
|
||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": "*",
|
"fabricloader": "*",
|
||||||
"fabric": "*",
|
"fabric-lifecycle-events-v1": "*",
|
||||||
|
"fabric-key-binding-api-v1": "*",
|
||||||
|
"fabric-networking-api-v1": "*",
|
||||||
"minecraft": "${minecraft_version}",
|
"minecraft": "${minecraft_version}",
|
||||||
"java": ">=${java_version}"
|
"java": ">=${java_version}"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ import com.seibel.lod.core.api.ClientApi;
|
|||||||
import com.seibel.lod.core.api.EventApi;
|
import com.seibel.lod.core.api.EventApi;
|
||||||
import com.seibel.lod.core.wrapperInterfaces.chunk.IChunkWrapper;
|
import com.seibel.lod.core.wrapperInterfaces.chunk.IChunkWrapper;
|
||||||
|
|
||||||
|
import net.minecraft.client.multiplayer.ClientLevel;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
|
|
||||||
import com.seibel.lod.common.wrappers.chunk.ChunkWrapper;
|
import com.seibel.lod.common.wrappers.chunk.ChunkWrapper;
|
||||||
|
|||||||
@@ -27,13 +27,10 @@ import com.seibel.lod.core.ModInfo;
|
|||||||
import com.seibel.lod.core.api.ApiShared;
|
import com.seibel.lod.core.api.ApiShared;
|
||||||
import com.seibel.lod.core.handlers.ReflectionHandler;
|
import com.seibel.lod.core.handlers.ReflectionHandler;
|
||||||
import com.seibel.lod.core.handlers.dependencyInjection.ModAccessorHandler;
|
import com.seibel.lod.core.handlers.dependencyInjection.ModAccessorHandler;
|
||||||
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
|
|
||||||
import com.seibel.lod.core.wrapperInterfaces.modAccessor.IModChecker;
|
|
||||||
import com.seibel.lod.core.wrapperInterfaces.modAccessor.IOptifineAccessor;
|
import com.seibel.lod.core.wrapperInterfaces.modAccessor.IOptifineAccessor;
|
||||||
import com.seibel.lod.forge.networking.NetworkHandler;
|
import com.seibel.lod.forge.networking.NetworkHandler;
|
||||||
import com.seibel.lod.forge.wrappers.ForgeDependencySetup;
|
import com.seibel.lod.forge.wrappers.ForgeDependencySetup;
|
||||||
|
|
||||||
import com.seibel.lod.forge.wrappers.modAccessor.ModChecker;
|
|
||||||
import com.seibel.lod.forge.wrappers.modAccessor.OptifineAccessor;
|
import com.seibel.lod.forge.wrappers.modAccessor.OptifineAccessor;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||||
@@ -88,6 +85,9 @@ public class ForgeMain implements LodForgeMethodCaller
|
|||||||
if (ReflectionHandler.instance.optifinePresent()) {
|
if (ReflectionHandler.instance.optifinePresent()) {
|
||||||
ModAccessorHandler.bind(IOptifineAccessor.class, new OptifineAccessor());
|
ModAccessorHandler.bind(IOptifineAccessor.class, new OptifineAccessor());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ModAccessorHandler.finishBinding();
|
||||||
|
|
||||||
|
|
||||||
ModAccessorHandler.finishBinding();
|
ModAccessorHandler.finishBinding();
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ package com.seibel.lod.forge.mixins;
|
|||||||
|
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.mojang.math.Matrix4f;
|
import com.mojang.math.Matrix4f;
|
||||||
|
import com.seibel.lod.common.Config;
|
||||||
import com.seibel.lod.common.wrappers.McObjectConverter;
|
import com.seibel.lod.common.wrappers.McObjectConverter;
|
||||||
import com.seibel.lod.core.api.ClientApi;
|
import com.seibel.lod.core.api.ClientApi;
|
||||||
import com.seibel.lod.core.objects.math.Mat4f;
|
import com.seibel.lod.core.objects.math.Mat4f;
|
||||||
@@ -61,7 +62,9 @@ public class MixinWorldRenderer
|
|||||||
}
|
}
|
||||||
|
|
||||||
// HEAD or RETURN
|
// HEAD or RETURN
|
||||||
@Inject(at = @At("HEAD"), method = "renderChunkLayer(Lnet/minecraft/client/renderer/RenderType;Lcom/mojang/blaze3d/vertex/PoseStack;DDDLcom/mojang/math/Matrix4f;)V")
|
@Inject(at = @At("HEAD"),
|
||||||
|
method = "renderChunkLayer(Lnet/minecraft/client/renderer/RenderType;Lcom/mojang/blaze3d/vertex/PoseStack;DDDLcom/mojang/math/Matrix4f;)V",
|
||||||
|
cancellable = true)
|
||||||
private void renderChunkLayer(RenderType renderType, PoseStack modelViewMatrixStack, double cameraXBlockPos, double cameraYBlockPos, double cameraZBlockPos, Matrix4f projectionMatrix, CallbackInfo callback)
|
private void renderChunkLayer(RenderType renderType, PoseStack modelViewMatrixStack, double cameraXBlockPos, double cameraYBlockPos, double cameraZBlockPos, Matrix4f projectionMatrix, CallbackInfo callback)
|
||||||
{
|
{
|
||||||
// only render before solid blocks
|
// only render before solid blocks
|
||||||
@@ -72,5 +75,8 @@ public class MixinWorldRenderer
|
|||||||
|
|
||||||
ClientApi.INSTANCE.renderLods(mcModelViewMatrix, mcProjectionMatrix, previousPartialTicks);
|
ClientApi.INSTANCE.renderLods(mcModelViewMatrix, mcProjectionMatrix, previousPartialTicks);
|
||||||
}
|
}
|
||||||
|
if (Config.Client.Advanced.lodOnlyMode) {
|
||||||
|
callback.cancel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user